@bastani/atomic 0.10.14 → 0.10.15-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/README.md +1 -1
- package/dist/_shared/dist-KOELCESV.js +2 -2
- package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
- package/dist/_shared/lib-4PES5P4V.js +2 -2
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +3 -3
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +3 -3
- package/dist/_shared/mode-shared-2QJSCUM6.js +3 -3
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
- package/dist/_shared/runtime-O4KCSG4C.js +2 -2
- package/dist/_shared/{sdk-B5LEWGGI.js → sdk-OHKMDJ74.js} +27 -5
- package/dist/_shared/{sdk-B5LEWGGI.js.map → sdk-OHKMDJ74.js.map} +1 -1
- package/dist/_shared/session-data-AHTU7IS6.js +2 -2
- package/dist/_shared/startup-0-0-Q3MWKUK4.js +2 -2
- package/dist/_shared/startup-0-1-M6OWAYHH.js +2 -2
- package/dist/_shared/{startup-0-2-5QHPCEON.js → startup-0-2-2HUMCPKX.js} +14 -16
- package/dist/_shared/startup-0-2-2HUMCPKX.js.map +1 -0
- package/dist/_shared/startup-0-3-4ZYBYQNM.js +3 -3
- package/dist/_shared/startup-0-4-ZMJV547D.js +3 -3
- package/dist/_shared/startup-0-5-YDW47QX6.js +3 -3
- package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
- package/dist/_shared/startup-14-0-MLX36RBG.js +1 -1
- package/dist/_shared/startup-15-0-YUKGAC63.js +1 -1
- package/dist/_shared/startup-15-1-4S7FLMNG.js +6 -30
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +3 -3
- package/dist/_shared/startup-8-1-LZFXSD3Z.js +3 -3
- package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
- package/dist/_shared/storage-status-K7PX2RXA.js +3 -3
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/builtin/intercom/index.bundle.mjs +1 -1
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/auth-cli.code.js +1 -1
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +3 -3
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.code.js +1 -1
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +1 -1
- package/dist/cli/startup-ui.impl.js +3 -3
- package/dist/cli/startup-ui.js +3 -3
- package/dist/cli/storage-command.impl.js +3 -3
- package/dist/cli/storage-command.js +3 -3
- package/dist/cli/storage-search-session.code.js +1 -1
- package/dist/cli/storage-search-session.impl.js +3 -3
- package/dist/cli/storage-search-session.js +3 -3
- package/dist/cli/team-command.code.js +1 -1
- package/dist/cli/team-command.impl.js +3 -3
- package/dist/cli/team-command.js +3 -3
- package/dist/cli.js +2 -2
- package/dist/core/compaction/compactor.d.ts +0 -8
- package/dist/core/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- package/dist/core/export-html/card-projection.impl.js +3 -3
- package/dist/core/export-html/card-projection.js +3 -3
- package/dist/core/export-html/index.code.js +2 -2
- package/dist/core/export-html/index.impl.js +3 -3
- package/dist/core/export-html/index.js +3 -3
- package/dist/core/export-html/json-spans.impl.js +3 -3
- package/dist/core/export-html/json-spans.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.js +3 -3
- package/dist/core/export-html/tool-renderer.impl.js +3 -3
- package/dist/core/export-html/tool-renderer.js +3 -3
- package/dist/core/extensions/jiti-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-loader.js +3 -3
- package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-static-loader.js +3 -3
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- package/dist/core/intercom-broker-control-host.code.js +1 -1
- package/dist/core/intercom-broker-control-host.impl.js +3 -3
- package/dist/core/intercom-broker-control-host.js +3 -3
- package/dist/core/intercom-broker-control.code.js +2 -2
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/sdk.code.js +1 -1
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.js +3 -3
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-storage.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/storage/index.js +2 -2
- package/dist/core/storage/node-sqlite-thread.js +2 -2
- package/dist/core/storage/node-sqlite.js +2 -2
- package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
- package/dist/core/storage/offline-snapshot-file.js +3 -3
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/selection.js +2 -2
- package/dist/core/storage/session/branch-fork-source.code.js +2 -2
- package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
- package/dist/core/storage/session/branch-fork-source.js +3 -3
- package/dist/core/storage/session/card-view.impl.js +3 -3
- package/dist/core/storage/session/card-view.js +3 -3
- package/dist/core/storage/session/child-reader.code.js +2 -2
- package/dist/core/storage/session/child-reader.impl.js +3 -3
- package/dist/core/storage/session/child-reader.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.js +3 -3
- package/dist/core/storage/session/expanded-child-details.code.js +2 -2
- package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
- package/dist/core/storage/session/expanded-child-details.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.js +3 -3
- package/dist/core/storage/session/fork-row-index.impl.js +3 -3
- package/dist/core/storage/session/fork-row-index.js +3 -3
- package/dist/core/storage/session/fork-staging.code.js +1 -1
- package/dist/core/storage/session/fork-staging.impl.js +3 -3
- package/dist/core/storage/session/fork-staging.js +3 -3
- package/dist/core/storage/session/fork-window.code.js +2 -2
- package/dist/core/storage/session/fork-window.impl.js +3 -3
- package/dist/core/storage/session/fork-window.js +3 -3
- package/dist/core/storage/session/history-pages.impl.js +3 -3
- package/dist/core/storage/session/history-pages.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.js +3 -3
- package/dist/core/storage/session/memory-session-store.impl.js +3 -3
- package/dist/core/storage/session/memory-session-store.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
- package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.js +3 -3
- package/dist/core/storage/session/released-history-files.code.js +1 -1
- package/dist/core/storage/session/released-history-files.impl.js +3 -3
- package/dist/core/storage/session/released-history-files.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.js +3 -3
- package/dist/core/storage/session/session-resume.impl.js +3 -3
- package/dist/core/storage/session/session-resume.js +3 -3
- package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
- package/dist/core/storage/session/snapshot-cut.js +3 -3
- package/dist/core/storage/session/snapshot-history.code.js +2 -2
- package/dist/core/storage/session/snapshot-history.impl.js +3 -3
- package/dist/core/storage/session/snapshot-history.js +3 -3
- package/dist/core/storage/session/sql-session-store.code.js +1 -1
- package/dist/core/storage/session/sql-session-store.impl.js +3 -3
- package/dist/core/storage/session/sql-session-store.js +3 -3
- package/dist/core/storage/session/tree-outline.impl.js +3 -3
- package/dist/core/storage/session/tree-outline.js +3 -3
- package/dist/core/storage/session/tree-presentation.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/storage-status.impl.js +3 -3
- package/dist/core/storage/storage-status.js +3 -3
- package/dist/core/storage/team.impl.js +3 -3
- package/dist/core/storage/team.js +3 -3
- package/dist/core/structured-output/index.code.js +1 -1
- package/dist/core/structured-output/index.impl.js +3 -3
- package/dist/core/structured-output/index.js +3 -3
- package/dist/core/tasks/task-completion-entry.impl.js +3 -3
- package/dist/core/tasks/task-completion-entry.js +3 -3
- package/dist/core/tasks/task-file-history.code.js +2 -2
- package/dist/core/tasks/task-file-history.impl.js +3 -3
- package/dist/core/tasks/task-file-history.js +3 -3
- package/dist/core/tasks/task-reference-archive.code.js +2 -2
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.js +3 -3
- package/dist/core/tasks/task-reference-stream.impl.js +3 -3
- package/dist/core/tasks/task-reference-stream.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.js +3 -3
- package/dist/core/tasks/task-view-source.impl.js +3 -3
- package/dist/core/tasks/task-view-source.js +3 -3
- package/dist/core/tools/read-url.impl.js +3 -3
- package/dist/core/tools/read-url.js +3 -3
- package/dist/core/worktree-snapshot/blob-store.js +2 -2
- package/dist/core/worktree-snapshot/errors.code.js +1 -1
- package/dist/core/worktree-snapshot/errors.impl.js +3 -3
- package/dist/core/worktree-snapshot/errors.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
- package/dist/extensions/codemode/execute.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.js +1 -1
- package/dist/extensions/mcp/cli.impl.js +3 -3
- package/dist/extensions/mcp/cli.js +3 -3
- package/dist/extensions/mcp/cli.lazy.code.js +2 -2
- package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
- package/dist/extensions/mcp/cli.lazy.js +3 -3
- package/dist/extensions/mcp/runtime.code.js +1 -1
- package/dist/extensions/mcp/runtime.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/index.d.ts +21 -1
- package/dist/index.js +2 -2
- package/dist/main-first-time-setup.code.js +1 -1
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
- package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
- package/dist/modes/print-mode.js +1 -1
- package/dist/package-manager-cli.code.js +2 -2
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/6.js +1 -1
- package/dist/utils/startup-database-spare.code.js +1 -1
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/background-tasks/reference.md +182 -0
- package/docs/background-tasks.md +98 -405
- package/docs/build.md +67 -27
- package/docs/changelog.mdx +11 -1
- package/docs/codemode.md +108 -39
- package/docs/compaction/branch-summaries.md +54 -0
- package/docs/compaction/custom-compactors.md +161 -0
- package/docs/compaction/memory-compaction.md +77 -0
- package/docs/compaction/reference.md +86 -38
- package/docs/compaction.md +51 -252
- package/docs/computer-use.md +169 -321
- package/docs/containerization.md +71 -57
- package/docs/custom-provider/api-reference.md +119 -25
- package/docs/custom-provider/oauth.md +114 -132
- package/docs/custom-provider/override.md +37 -27
- package/docs/custom-provider/registration.md +107 -83
- package/docs/custom-provider/streaming.md +85 -71
- package/docs/custom-provider.md +85 -52
- package/docs/development.md +39 -29
- package/docs/docs.json +80 -67
- package/docs/environment-variables.md +94 -44
- package/docs/extensions/api-reference.md +86 -43
- package/docs/extensions/authoring.md +162 -154
- package/docs/extensions/events.md +80 -25
- package/docs/extensions/examples.md +90 -85
- package/docs/extensions/ui.md +206 -82
- package/docs/extensions.md +79 -108
- package/docs/getting-started/authentication.md +67 -36
- package/docs/getting-started/first-session.md +53 -43
- package/docs/getting-started/installation.md +117 -90
- package/docs/getting-started/project-instructions.md +48 -34
- package/docs/guides/configuration.md +82 -20
- package/docs/guides/non-interactive.md +66 -24
- package/docs/guides/resume-on-any-machine.md +135 -82
- package/docs/guides/team-setup.md +114 -105
- package/docs/guides.md +76 -32
- package/docs/herdr.md +16 -17
- package/docs/how-atomic-works.md +140 -0
- package/docs/index.md +58 -44
- package/docs/intercom/operations.md +141 -151
- package/docs/intercom/reference.md +85 -108
- package/docs/intercom.md +84 -145
- package/docs/json.md +120 -67
- package/docs/keybindings.md +85 -49
- package/docs/libraries/agent-core.md +137 -275
- package/docs/libraries/ai.md +100 -84
- package/docs/libraries/codemode.md +210 -300
- package/docs/libraries/schema.md +59 -53
- package/docs/libraries/storage-postgres.md +49 -35
- package/docs/libraries/telemetry.md +153 -354
- package/docs/libraries/tui.md +265 -393
- package/docs/libraries.md +42 -26
- package/docs/llama-cpp.md +171 -161
- package/docs/mcp-servers.md +90 -51
- package/docs/models/choose-a-model.md +188 -0
- package/docs/models/reference.md +74 -30
- package/docs/models.md +153 -88
- package/docs/orchestration/migrating-workflows.md +23 -16
- package/docs/orchestration/patterns.md +39 -44
- package/docs/orchestration.md +65 -26
- package/docs/packages/authoring.md +51 -29
- package/docs/packages/reference.md +42 -21
- package/docs/packages.md +69 -58
- package/docs/programmatic.md +118 -24
- package/docs/prompt-templates.md +84 -83
- package/docs/providers/reference.md +43 -48
- package/docs/providers.md +219 -451
- package/docs/quickstart.md +140 -120
- package/docs/reference/cli.md +135 -97
- package/docs/reference.md +20 -19
- package/docs/rpc/examples.md +76 -20
- package/docs/rpc/extension-ui.md +64 -38
- package/docs/rpc/protocol.md +361 -110
- package/docs/rpc.md +57 -17
- package/docs/sdk/reference.md +409 -534
- package/docs/sdk/storage.md +53 -13
- package/docs/sdk/structured-decisions.md +82 -56
- package/docs/sdk/web-server.md +57 -43
- package/docs/sdk.md +106 -84
- package/docs/security.md +42 -64
- package/docs/session-format.md +62 -38
- package/docs/sessions.md +99 -214
- package/docs/settings.md +165 -195
- package/docs/shell-aliases.md +9 -6
- package/docs/skills/authoring.md +69 -48
- package/docs/skills/reference.md +51 -20
- package/docs/skills.md +99 -148
- package/docs/slash-commands.md +129 -0
- package/docs/storage/custom-adapters.md +160 -85
- package/docs/storage/jsonl.md +81 -66
- package/docs/storage/postgres/pgbouncer.md +120 -126
- package/docs/storage/postgres/tuning.md +120 -143
- package/docs/storage/postgres.md +314 -330
- package/docs/storage/sqlite.md +71 -42
- package/docs/storage.md +298 -302
- package/docs/subagents/authoring.md +55 -38
- package/docs/subagents/reference.md +73 -33
- package/docs/subagents.md +119 -187
- package/docs/terminal-setup.md +51 -39
- package/docs/themes/reference.md +23 -19
- package/docs/themes.md +142 -127
- package/docs/tmux.md +47 -55
- package/docs/tools.md +147 -109
- package/docs/tui/reference.md +166 -214
- package/docs/tui.md +196 -341
- package/docs/usage.md +118 -138
- package/docs/verification.md +79 -51
- package/docs/web-access.md +121 -101
- package/docs/windows.md +26 -27
- package/docs/worktree-snapshots/reference.md +245 -0
- package/docs/worktree-snapshots.md +71 -259
- package/package.json +8 -8
- package/dist/_shared/startup-0-2-5QHPCEON.js.map +0 -1
- package/docs/guides/intercom.md +0 -32
- package/docs/guides/orchestration.md +0 -28
- package/docs/guides/subagents.md +0 -37
- package/docs/termux.md +0 -118
package/docs/libraries.md
CHANGED
|
@@ -1,50 +1,66 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Standalone libraries"
|
|
3
3
|
sidebarTitle: "All libraries"
|
|
4
|
-
description: "Explore Atomic's six core @bastani/atomic-* TypeScript libraries and
|
|
4
|
+
description: "Explore Atomic's six core @bastani/atomic-* TypeScript libraries and the optional PostgreSQL storage adapter package for extensions, SDK apps, and standalone Node.js 24.20+ projects."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Atomic publishes six core TypeScript libraries and
|
|
7
|
+
Atomic publishes six core TypeScript libraries and one optional storage adapter package (`@bastani/atomic-storage-postgres`), all requiring Node.js 24.20 or newer. Each package publishes on npm at Atomic's version with every release and works independently outside Atomic.
|
|
8
8
|
|
|
9
9
|
## Core libraries
|
|
10
10
|
|
|
11
11
|
The six core libraries are bundled inside `@bastani/atomic` and provided to extensions automatically:
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
>
|
|
13
|
+
<Columns cols={2}>
|
|
14
|
+
<Card title="@bastani/atomic-ai" href="/libraries/ai">
|
|
15
|
+
One API for every LLM provider: models, auth, streaming, tools, images, classification, and thinking.
|
|
16
|
+
</Card>
|
|
17
|
+
<Card title="@bastani/atomic-agent-core" href="/libraries/agent-core">
|
|
18
|
+
A stateful agent loop with tool execution, event streaming, steering, and follow-up messages.
|
|
19
|
+
</Card>
|
|
20
|
+
<Card title="@bastani/atomic-tui" href="/libraries/tui">
|
|
21
|
+
A terminal UI framework with differential rendering, alternate-screen viewports, overlays, and key handling.
|
|
22
|
+
</Card>
|
|
23
|
+
<Card title="@bastani/atomic-codemode" href="/libraries/codemode">
|
|
24
|
+
A QuickJS WebAssembly sandbox that runs model-written JavaScript whose only capability is calling injected tools.
|
|
25
|
+
</Card>
|
|
26
|
+
<Card title="@bastani/atomic-schema" href="/libraries/schema">
|
|
27
|
+
JSON Schema drafts 2020-12 and 7 builders and validation without `eval`, with zero runtime dependencies.
|
|
28
|
+
</Card>
|
|
29
|
+
<Card title="@bastani/atomic-telemetry" href="/libraries/telemetry">
|
|
30
|
+
Vendor-neutral telemetry contracts, metrics, trace rendering, and typed schemas that send nothing on their own.
|
|
31
|
+
</Card>
|
|
32
|
+
</Columns>
|
|
33
|
+
|
|
34
|
+
## Storage adapter package
|
|
35
|
+
|
|
36
|
+
Remote SQL storage is **not** bundled into `@bastani/atomic`. Install the optional PostgreSQL adapter only when you store sessions or Intercom multi-node routing in PostgreSQL:
|
|
37
|
+
|
|
38
|
+
<Columns cols={2}>
|
|
39
|
+
<Card title="@bastani/atomic-storage-postgres" href="/libraries/storage-postgres">
|
|
40
|
+
PostgreSQL 16+ storage adapter (`openPostgresDatabase()`, cloud IAM, HTTP proxies, and pooler auto-detection) for shared sessions and Intercom.
|
|
41
|
+
</Card>
|
|
42
|
+
</Columns>
|
|
43
|
+
|
|
44
|
+
For CLI usage, install the adapter in user scope with `atomic install npm:@bastani/atomic-storage-postgres`. For TypeScript SDK applications, install it with `npm install` alongside `@bastani/atomic` (see [SDK storage backends](/sdk/storage)).
|
|
45
|
+
|
|
46
|
+
<Note>
|
|
47
|
+
**Native bindings:** `@bastani/atomic-natives` is an internal N-API native module installed automatically as a runtime dependency of `@bastani/atomic` (with per-platform binaries in its `optionalDependencies`) and is not intended as a standalone user library.
|
|
48
|
+
</Note>
|
|
33
49
|
|
|
34
50
|
## Install
|
|
35
51
|
|
|
36
|
-
Install
|
|
52
|
+
Install any core library on its own with npm:
|
|
37
53
|
|
|
38
54
|
```bash
|
|
39
55
|
npm install @bastani/atomic-ai
|
|
40
56
|
```
|
|
41
57
|
|
|
42
|
-
Inside an Atomic [extension](/extensions), import the six core libraries without installing them
|
|
58
|
+
Inside an Atomic [extension](/extensions), import the six core libraries without installing them—the running Atomic process provides them so your extension shares its instances. If you publish an [Atomic package](/packages/authoring) that imports them, list them in `peerDependencies` with a `"*"` range.
|
|
43
59
|
|
|
44
|
-
To build on Atomic's sessions, tools, and extensions rather than
|
|
60
|
+
To build on Atomic's sessions, tools, and extensions rather than bare libraries, use the [TypeScript SDK](/sdk) and [SDK storage backends](/sdk/storage). For custom extension UI, start with [Build TUI components](/tui).
|
|
45
61
|
|
|
46
62
|
## Older package names
|
|
47
63
|
|
|
48
64
|
These libraries began as forks of pi's packages. Extensions written for pi still work inside Atomic: imports of `@earendil-works/pi-coding-agent` and `@mariozechner/pi-coding-agent` map to `@bastani/atomic`, while `@earendil-works/pi-ai`, `@earendil-works/pi-tui`, `@earendil-works/pi-agent-core`, `@earendil-works/pi-codemode`, `@earendil-works/pi-schema`, `@earendil-works/pi-telemetry`, their `@mariozechner/pi-*` equivalents, and `@bastani/pi-ai` (plus subpaths) map to the matching `@bastani/atomic-*` package.
|
|
49
65
|
|
|
50
|
-
Use the `@bastani/atomic-*` names in new code. The older names resolve only inside Atomic
|
|
66
|
+
Use the `@bastani/atomic-*` names in new code. The older names resolve only inside Atomic; outside Atomic, install the `@bastani/atomic-*` packages directly.
|
package/docs/llama-cpp.md
CHANGED
|
@@ -1,51 +1,50 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
3
|
-
sidebarTitle: "Local
|
|
2
|
+
title: "Run local models with llama.cpp"
|
|
3
|
+
sidebarTitle: "Run Local Models"
|
|
4
4
|
description: "Connect Atomic to a local llama.cpp router server to discover, load, download, and run GGUF models and local classifiers."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
Atomic integrates with the [llama.cpp](https://llama.app) router server to discover local GGUF models, load or unload them on demand, download models from Hugging Face, and run local classification.
|
|
8
8
|
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
llama
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- `--models-dir ~/models` discovers local GGUF files in that directory.
|
|
41
|
-
|
|
42
|
-
Place single-file models directly in the model directory, and put multimodal or multi-shard models in separate subdirectories with their projection or shard files. Restart the router after adding files manually. The router also reads cached models and `--models-preset` files; see the [server guide](https://llama.app/docs/serve#serving-multiple-models-router-mode).
|
|
9
|
+
## Install and start the router
|
|
10
|
+
|
|
11
|
+
<Steps>
|
|
12
|
+
<Step title="Install llama.cpp">
|
|
13
|
+
Install llama.cpp with the [official installer](https://llama.app/docs/installation) (see [llama.app](https://llama.app) for package managers and building from source):
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
curl -LsSf https://llama.app/install.sh | sh
|
|
17
|
+
llama --version
|
|
18
|
+
```
|
|
19
|
+
</Step>
|
|
20
|
+
<Step title="Start llama serve in router mode">
|
|
21
|
+
Start `llama serve` **without** `--model`, `-m`, or `-hf` (those flags launch single-model mode instead of router mode). See the [llama.cpp server guide](https://llama.app/docs/serve#serving-multiple-models-router-mode) for full router options.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
llama serve \
|
|
25
|
+
--no-models-autoload \
|
|
26
|
+
--host 127.0.0.1 \
|
|
27
|
+
-ngl all \
|
|
28
|
+
-c 32768
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- `--no-models-autoload` keeps model loading under explicit `/llama` control.
|
|
32
|
+
- `-ngl all` offloads all layers to the GPU (omit it for automatic offloading).
|
|
33
|
+
- `-c 32768` sets the context size in tokens (use `-c 0` for a model's full context window, which uses more memory; parallel slots share context).
|
|
34
|
+
- `--models-dir ~/models` discovers local GGUF files in that directory. Place single-file models directly in the directory, place multimodal or multi-shard models in separate subdirectories with their projection or shard files, and restart the router after adding files manually.
|
|
35
|
+
</Step>
|
|
36
|
+
<Step title="Connect Atomic and load a model">
|
|
37
|
+
Run `/login llama.cpp` inside Atomic (see [Configure Atomic](#configure-atomic)), load a model with `/llama`, then select it with `/model`.
|
|
38
|
+
</Step>
|
|
39
|
+
</Steps>
|
|
43
40
|
|
|
44
41
|
For settings tuned to a specific NVIDIA GPU and model, see [NVIDIA RTX recipes](#nvidia-rtx-recipes).
|
|
45
42
|
|
|
46
|
-
## Configure Atomic
|
|
43
|
+
## Configure Atomic {#configure-atomic}
|
|
44
|
+
|
|
45
|
+
Run `/login llama.cpp` inside an interactive session and enter your router URL and optional API key. The default URL is `http://127.0.0.1:9931` (trailing slashes and `/v1` are normalized automatically).
|
|
47
46
|
|
|
48
|
-
|
|
47
|
+
`/login llama.cpp` immediately verifies connectivity against the router before saving credentials, so unreachable URLs or invalid API keys fail right away. Shell `atomic auth login` does not load extension providers, so use `/login llama.cpp` or environment variables instead (see [CLI credential commands](/reference/cli#credential-commands)). When the router runs with `--no-models-autoload`, login saves only the connection; load a model with `/llama` before selecting it in `/model`.
|
|
49
48
|
|
|
50
49
|
You can configure the same values with environment variables instead of `/login`:
|
|
51
50
|
|
|
@@ -55,157 +54,168 @@ export LLAMA_API_KEY=optional-secret
|
|
|
55
54
|
atomic
|
|
56
55
|
```
|
|
57
56
|
|
|
58
|
-
A server URL saved
|
|
57
|
+
A server URL saved via `/login llama.cpp` (stored in `auth.json` under `env.LLAMA_BASE_URL`) takes precedence over `LLAMA_BASE_URL`. When no API key is configured, Atomic sends `"local"` as a placeholder key. If the server requires authentication, start `llama serve` with the matching `--api-key` and keep `--host 127.0.0.1` for local-only access.
|
|
59
58
|
|
|
60
59
|
## Manage models
|
|
61
60
|
|
|
62
|
-
Run `/llama` in interactive mode to manage router models
|
|
61
|
+
Run `/llama` in interactive mode to manage router models. Because `/llama` talks directly to your configured local router, it continues to work even when `ATOMIC_OFFLINE` (or `--offline`) is enabled.
|
|
63
62
|
|
|
64
63
|
- Select an unloaded model to load it, or a loaded model to unload it.
|
|
65
|
-
- Select **Download model...** to search Hugging Face and
|
|
66
|
-
- Press
|
|
64
|
+
- Select **Download model...** to search Hugging Face and choose a repository and quantization. Search returns up to 20 GGUF repositories sorted by downloads (15-second timeout). The quantization picker excludes `mmproj` projection files, lists `Q4_K_M` first, and sorts remaining quantizations from smallest to largest. Type an exact `owner/repository` or `owner/repository:QUANT` and press Enter to download directly.
|
|
65
|
+
- Press `Esc` during a load or download to confirm cancellation.
|
|
67
66
|
|
|
68
|
-
Hugging Face search checks `HF_TOKEN`, then `$HF_TOKEN_PATH`, `$HF_HOME/token`, `$XDG_CACHE_HOME/huggingface/token`, and `~/.cache/huggingface/token
|
|
67
|
+
Hugging Face search checks `HF_TOKEN`, then `$HF_TOKEN_PATH`, `$HF_HOME/token`, `$XDG_CACHE_HOME/huggingface/token`, and `~/.cache/huggingface/token` (unauthenticated search has lower rate limits). Atomic warns before gated downloads and links to the access page; because `llama.cpp` performs the download itself, its process also needs `HF_TOKEN` for gated repositories.
|
|
69
68
|
|
|
70
|
-
Atomic asks before unloading other models, never silently unloads models, and never deletes model files. `/llama` reads
|
|
69
|
+
Atomic asks before unloading other models, never silently unloads models, and never deletes model files. `/llama` always reads live router state because other clients may share the server. Loaded and sleeping models appear in `/model` (sleeping models wake automatically when selected). With router autoload enabled, unloaded preset models also appear in `/model` and load on selection; with `--no-models-autoload`, load them in `/llama` first.
|
|
71
70
|
|
|
72
|
-
Atomic caches the last loaded-model catalog in `~/.atomic/agent/models-store.json`
|
|
71
|
+
Atomic caches the last loaded-model catalog in `~/.atomic/agent/models-store.json` so entries stay selectable across restarts. If a refresh fails, Atomic reports the router error and keeps the cached catalog; a later successful refresh replaces stale entries without duplicates. If the router disconnects mid-action, select **Retry** to reconnect and refresh state without replaying the interrupted action.
|
|
73
72
|
|
|
74
|
-
|
|
73
|
+
### Context window, thinking, and vision detection
|
|
75
74
|
|
|
76
|
-
|
|
75
|
+
Atomic derives each model's context size, thinking support, and vision support automatically from the router:
|
|
77
76
|
|
|
78
|
-
|
|
77
|
+
- **Context window:** Atomic sets both `contextWindow` and `maxTokens` from the context window reported by the router (falling back to 128,000 tokens if unreported). The server remains authoritative and may enforce a smaller generation limit.
|
|
78
|
+
- **Thinking controls:** Thinking controls appear only for **currently loaded** models whose chat template supports thinking. Sleeping or unloaded preset models are not probed during discovery so they are not woken unexpectedly—load a model in `/llama` and refresh `/model` to enable thinking controls. When detected, Atomic exposes **`off`** and **`medium`** thinking levels (`minimal`, `low`, `high`, `xhigh`, and `max` are unavailable).
|
|
79
|
+
- **Vision support:** Image input turns on automatically when the server reports image capability for the model.
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
<Note>
|
|
82
|
+
**How the router reports metadata:** Context size is read in order from `meta.n_ctx`, the model's `--ctx-size`/`-c`/`-ctx` flag, cached context, and training context `meta.n_ctx_train`. Thinking detection checks for `"enable_thinking"` in the loaded model's `/props` `chat_template`, and vision detection checks for `"image"` in `architecture.input_modalities`.
|
|
83
|
+
</Note>
|
|
82
84
|
|
|
83
|
-
## Classification
|
|
85
|
+
## Classification {#classification}
|
|
84
86
|
|
|
85
|
-
Classifier models answer typed `choice`, `bool`, and `score` questions about JSON state, letting a local model serve `decide()` and `structured_output`
|
|
87
|
+
Classifier models answer typed `choice`, `bool`, and `score` questions about JSON state, letting a local model serve structured decisions (`decide()` and `structured_output`) as your [`decisionModel`](/settings#decisionmodel) (see [Structured decisions](/sdk/structured-decisions)). Extensions can call `ctx.modelRegistry.classify()` and codemode scripts can call `models.classify()`; see [Use classifier models](/models#use-classifier-models).
|
|
86
88
|
|
|
87
|
-
Atomic exposes llama.cpp models as classifiers in two ways:
|
|
89
|
+
Atomic exposes `llama.cpp` models as classifiers in two ways:
|
|
88
90
|
|
|
89
|
-
- **
|
|
90
|
-
- **Chat models** are also exposed as classifiers under the same ID using next-token probability classification (
|
|
91
|
+
- **Native decision models** (such as Julia-1, Laya, Kev, lev, and OpenJev) answer through `llama.cpp`'s native decision endpoint (`/v1/systemone`). Decision-only models never appear in `/model`.
|
|
92
|
+
- **Chat models** are also exposed as classifiers under the same ID using next-token probability classification (`llama-cpp-classify`).
|
|
91
93
|
|
|
92
|
-
|
|
94
|
+
<Note>
|
|
95
|
+
`llama.cpp` 0.6.0 and newer identify native decision models by advertising `"decisions"` in `architecture.output_modalities`. Atomic detects them even while sleeping or unloaded without waking them (unloaded presets remain selectable only when router autoload is enabled). Older servers omit this metadata and fall back to next-token classification.
|
|
96
|
+
</Note>
|
|
93
97
|
|
|
94
98
|
### Chat models as classifiers
|
|
95
99
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
Key behavior for chat-model classifiers:
|
|
99
|
-
|
|
100
|
-
- An explicit [`decisionModel`](/settings#decisionmodel) resolves classifiers before chat models, so `decisionModel: "llama.cpp/<id>"` uses the classifier. A choice with more than 62 options fails on `llama-cpp-classify` and falls back to the active chat model. The **Decision model** picker lists each chat model twice (classifier and chat), saving the same ID; decision-only models have only a classifier row.
|
|
101
|
-
- `structured_output` and `generateStructuredOutput()` resolve chat models before classifiers when both share an ID, so naming `llama.cpp/<id>` there uses the chat model.
|
|
102
|
-
- SDK `classify()` accepts a `temperature` option that divides label logits before normalizing. Values above `1` soften overconfident probabilities without changing the winning answer.
|
|
103
|
-
- Questions run sequentially and share the prompt prefix so the server's prompt cache evaluates it once. Because the state appears twice in the prompt, reserve twice the state size in context.
|
|
104
|
-
- Small models may follow prompt-injection instructions inside the state despite the system prompt instructing them to judge the state as data.
|
|
105
|
-
- Hybrid models such as Qwen3.5 need context checkpoints to reuse a cached prefix across questions. If every question reprocesses the full state, start the router with `--ctx-checkpoints 32 --checkpoint-min-step 0`.
|
|
100
|
+
Instead of generating prose, Atomic formats each question as a single prompt (presenting the JSON state, all questions, the state again, and the target question with single-token labels) and reads the server's next-token probabilities for those labels:
|
|
106
101
|
|
|
107
|
-
|
|
102
|
+
- **Supported question types:** `choice` accepts 2 to 62 options (single alphanumeric labels; 1 option throws an error, and more than 62 options fail over to the active chat model), `bool` uses `Yes`/`No`, and `score` accepts 2 to 10 digit levels.
|
|
103
|
+
- **Probability lookup and confidence:** If a label token does not appear in the server's initial top-token probabilities, Atomic retries with a wider candidate token window (up to 32,768 tokens). Choices return normalized option probabilities and a confidence score from `0` (uniform guess) to `1` (certainty), computed as `(n * peak - 1) / (n - 1)` where `n` is the option count and `peak` is the highest normalized probability; scores return the expected level.
|
|
104
|
+
- **Prefix caching and context sizing:** Questions run sequentially with a shared prefix so the server's prompt cache evaluates it once. Because the JSON state appears twice in the prompt, reserve at least twice the state size in context. For hybrid models such as Qwen3.5, start the router with `--ctx-checkpoints 32 --checkpoint-min-step 0` if every question reprocesses the full state.
|
|
105
|
+
- **Temperature and prompt injection:** SDK `classify()` accepts a `temperature` option that scales label scores before normalizing (values above `1` soften overconfident probabilities without changing the winning answer). Small local models may follow prompt-injection instructions embedded inside untrusted JSON state.
|
|
108
106
|
|
|
109
|
-
|
|
107
|
+
When a chat model is exposed as both a chat model and a classifier under the same `llama.cpp/<id>`:
|
|
110
108
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
1. Open the [recipe catalog](https://nvidia.github.io/local-ai-inference-recipes/index.html), choose your hardware, OS, and model, then select **llama.cpp**. Check prerequisites and memory requirements, and keep the launch command.
|
|
114
|
-
2. Install llama.cpp using the recipe's setup instructions so your build includes any required CUDA or speculative-decoding features.
|
|
115
|
-
3. Run `llama serve --help` and verify that `--models-preset` is listed. If `llama` or `--models-preset` is missing, update to a newer compatible build.
|
|
116
|
-
4. Install Atomic via the [Quickstart](/quickstart). On native Windows, see [Run Atomic on Windows](/windows).
|
|
117
|
-
|
|
118
|
-
### Convert the recipe to a preset
|
|
119
|
-
|
|
120
|
-
A preset file defines settings for one or more models, and each section header becomes the model ID in Atomic. Save the file in the llama.cpp directory or pass its full path to `llama serve`.
|
|
121
|
-
|
|
122
|
-
Convert each command-line option into a preset line:
|
|
123
|
-
|
|
124
|
-
- Drop leading dashes: `--ctx-size 65536` becomes `ctx-size = 65536`.
|
|
125
|
-
- Set boolean flags to `true`: `--jinja` becomes `jinja = true`.
|
|
126
|
-
- Strip quotes and PowerShell line-continuation backticks around values.
|
|
127
|
-
- Omit `--host` and `--port` (pass them to `llama serve` instead).
|
|
128
|
-
- Add `load-on-startup = true` to load the model when the router starts.
|
|
129
|
-
- Map short model-file flags to their preset keys:
|
|
130
|
-
|
|
131
|
-
| Recipe option | Preset key |
|
|
109
|
+
| Setting or API | Which model wins when IDs match |
|
|
132
110
|
| --- | --- |
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
111
|
+
| `decisionModel: "llama.cpp/<id>"` and `decide()` | Classifier first (`llama-cpp-classify` or native decision model); falls back to the active chat model if a `choice` exceeds 62 options |
|
|
112
|
+
| `structured_output` and `generateStructuredOutput()` | Chat model first |
|
|
113
|
+
|
|
114
|
+
<Note>
|
|
115
|
+
In `/settings` → **Decision model**, each loaded chat model appears twice (once as a classifier and once as a chat model), and both rows save the same `llama.cpp/<id>`. Decision-only models show only a classifier row.
|
|
116
|
+
</Note>
|
|
117
|
+
|
|
118
|
+
## NVIDIA RTX recipes {#nvidia-rtx-recipes}
|
|
119
|
+
|
|
120
|
+
[NVIDIA Local AI Inference Recipes](https://nvidia.github.io/local-ai-inference-recipes/index.html) publishes `llama.cpp` flags tuned for specific NVIDIA GPUs and models. Each recipe provides a single-model `llama-server` command; convert it into a router preset file so `llama serve` can run it alongside other models. The commands below use Windows PowerShell.
|
|
121
|
+
|
|
122
|
+
<Steps>
|
|
123
|
+
<Step title="Pick a recipe and verify your llama.cpp build">
|
|
124
|
+
1. Open the [recipe catalog](https://nvidia.github.io/local-ai-inference-recipes/index.html), choose your hardware, OS, and model, select **llama.cpp**, and note the launch command and memory requirements.
|
|
125
|
+
2. Install `llama.cpp` using the recipe's instructions so your build includes any required CUDA or speculative-decoding features.
|
|
126
|
+
3. Run `llama serve --help` and confirm `--models-preset` is listed.
|
|
127
|
+
4. Install Atomic via the [Quickstart](/quickstart) (on native Windows, see [Run Atomic on Windows](/windows)).
|
|
128
|
+
</Step>
|
|
129
|
+
<Step title="Convert the recipe command into a preset file">
|
|
130
|
+
Save a `.ini` preset file where each section header becomes the model ID in Atomic:
|
|
131
|
+
|
|
132
|
+
- Drop leading dashes (`--ctx-size 65536` → `ctx-size = 65536`).
|
|
133
|
+
- Set boolean flags to `true` (`--jinja` → `jinja = true`).
|
|
134
|
+
- Strip surrounding quotes and PowerShell line-continuation backticks.
|
|
135
|
+
- Omit `--host` and `--port` (pass those to `llama serve` instead), and add `load-on-startup = true`.
|
|
136
|
+
- Map short model-file flags using this table:
|
|
137
|
+
|
|
138
|
+
| Recipe option | Preset key |
|
|
139
|
+
| --- | --- |
|
|
140
|
+
| `-hf` | `hf-repo` |
|
|
141
|
+
| `-hff` | `hf-file` |
|
|
142
|
+
| `-hfrd` | `hf-repo-draft` |
|
|
143
|
+
| `--spec-draft-model` | `spec-draft-model` |
|
|
144
|
+
|
|
145
|
+
For example, this recipe command:
|
|
146
|
+
|
|
147
|
+
```powershell
|
|
148
|
+
llama-server.exe -hf "unsloth/Qwen3.8-27B-GGUF" `
|
|
149
|
+
-hff "Qwen3.8-27B-UD-Q4_K_M.gguf" `
|
|
150
|
+
-hfrd "z-lab/Qwen3.8-27B-DFlash2-GGUF" `
|
|
151
|
+
--spec-draft-model "Qwen3.8-27B-DFlash2-Q4_K_M.gguf" `
|
|
152
|
+
--no-mmproj `
|
|
153
|
+
--host 127.0.0.1 `
|
|
154
|
+
--port 9931 `
|
|
155
|
+
--batch-size 4096 `
|
|
156
|
+
--ubatch-size 1024 `
|
|
157
|
+
--ctx-size 65536 `
|
|
158
|
+
--parallel 1 `
|
|
159
|
+
-ngl 999 `
|
|
160
|
+
--jinja `
|
|
161
|
+
--chat-template-kwargs '{"preserve_thinking":true}' `
|
|
162
|
+
--spec-type draft-dflash `
|
|
163
|
+
--spec-draft-n-max 7 `
|
|
164
|
+
--spec-draft-backend-sampling
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
becomes `qwen3.8-27b.ini`:
|
|
168
|
+
|
|
169
|
+
```ini
|
|
170
|
+
version = 1
|
|
171
|
+
|
|
172
|
+
[qwen3.8-27b]
|
|
173
|
+
load-on-startup = true
|
|
174
|
+
hf-repo = unsloth/Qwen3.8-27B-GGUF
|
|
175
|
+
hf-file = Qwen3.8-27B-UD-Q4_K_M.gguf
|
|
176
|
+
hf-repo-draft = z-lab/Qwen3.8-27B-DFlash2-GGUF
|
|
177
|
+
spec-draft-model = Qwen3.8-27B-DFlash2-Q4_K_M.gguf
|
|
178
|
+
no-mmproj = true
|
|
179
|
+
batch-size = 4096
|
|
180
|
+
ubatch-size = 1024
|
|
181
|
+
ctx-size = 65536
|
|
182
|
+
parallel = 1
|
|
183
|
+
ngl = 999
|
|
184
|
+
jinja = true
|
|
185
|
+
chat-template-kwargs = {"preserve_thinking":true}
|
|
186
|
+
spec-type = draft-dflash
|
|
187
|
+
spec-draft-n-max = 7
|
|
188
|
+
spec-draft-backend-sampling = true
|
|
189
|
+
```
|
|
190
|
+
</Step>
|
|
191
|
+
<Step title="Start the router with the preset and connect Atomic">
|
|
192
|
+
In PowerShell inside the `llama.cpp` directory, set `$env:HF_TOKEN` if the recipe uses a gated model, then run:
|
|
193
|
+
|
|
194
|
+
```powershell
|
|
195
|
+
.\llama.exe serve --models-preset qwen3.8-27b.ini --host 127.0.0.1
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Verify readiness with `curl.exe http://127.0.0.1:9931/models` until `qwen3.8-27b` reports status `loaded`. Then follow [Configure Atomic](#configure-atomic) to connect to `http://127.0.0.1:9931` and select `qwen3.8-27b` in `/model`.
|
|
199
|
+
</Step>
|
|
200
|
+
</Steps>
|
|
201
|
+
|
|
202
|
+
<Note>
|
|
203
|
+
NVIDIA recipe memory budgets assume only that model occupies the GPU. Unload other loaded models in `/llama` before running a recipe model.
|
|
204
|
+
</Note>
|
|
205
|
+
|
|
206
|
+
## Troubleshooting {#troubleshooting}
|
|
207
|
+
|
|
208
|
+
Check router health and loaded models directly:
|
|
201
209
|
|
|
202
210
|
```bash
|
|
203
211
|
curl http://127.0.0.1:9931/health
|
|
204
212
|
curl http://127.0.0.1:9931/models
|
|
205
213
|
```
|
|
206
214
|
|
|
207
|
-
- **
|
|
208
|
-
- **
|
|
209
|
-
- **
|
|
210
|
-
- **
|
|
215
|
+
- **Server unreachable (`server-unreachable` / `LlamaServerUnreachableError`, retryable):** `llama serve` is not running, the port or host is wrong, DNS failed, or you used `https://` against a plain-HTTP server. Verify the server is listening and recheck `/login llama.cpp` or `LLAMA_BASE_URL`.
|
|
216
|
+
- **Request rejected (`request-rejected` / `LlamaServerRequestError`, non-retryable):** The runtime refused the configured URL before contacting the server—for example, embedded `user:pass@` credentials in the URL or a fetch-blocked port such as `6000`. Use a plain `http://` or `https://` address on a standard port (such as default `9931`) and pass any API key separately.
|
|
217
|
+
- **No models in `/llama`:** Verify cached models or your `--models-dir` folder layout, then restart the router.
|
|
218
|
+
- **Model missing from `/model` with `--no-models-autoload`:** Load the model in `/llama` first.
|
|
219
|
+
- **Thinking controls missing:** Load the model in `/llama`, then refresh `/model`; thinking controls appear only for currently loaded models whose chat template supports thinking.
|
|
220
|
+
- **Load fails or runs out of memory:** Lower `-c` or unload another model in `/llama`.
|
|
211
221
|
- **Server is not in router mode:** Start `llama serve` without `--model`, `-m`, or `-hf`.
|