@bastani/atomic 0.10.14 → 0.10.15-alpha.1

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.
Files changed (341) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/_shared/dist-KOELCESV.js +2 -2
  3. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  4. package/dist/_shared/lib-4PES5P4V.js +2 -2
  5. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +3 -3
  6. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +3 -3
  7. package/dist/_shared/mode-shared-2QJSCUM6.js +3 -3
  8. package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
  9. package/dist/_shared/runtime-O4KCSG4C.js +2 -2
  10. package/dist/_shared/{sdk-B5LEWGGI.js → sdk-OHKMDJ74.js} +27 -5
  11. package/dist/_shared/{sdk-B5LEWGGI.js.map → sdk-OHKMDJ74.js.map} +1 -1
  12. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  13. package/dist/_shared/startup-0-0-Q3MWKUK4.js +2 -2
  14. package/dist/_shared/startup-0-1-M6OWAYHH.js +2 -2
  15. package/dist/_shared/{startup-0-2-5QHPCEON.js → startup-0-2-2HUMCPKX.js} +14 -16
  16. package/dist/_shared/startup-0-2-2HUMCPKX.js.map +1 -0
  17. package/dist/_shared/startup-0-3-4ZYBYQNM.js +3 -3
  18. package/dist/_shared/startup-0-4-ZMJV547D.js +3 -3
  19. package/dist/_shared/startup-0-5-YDW47QX6.js +3 -3
  20. package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
  21. package/dist/_shared/startup-14-0-MLX36RBG.js +1 -1
  22. package/dist/_shared/startup-15-0-YUKGAC63.js +1 -1
  23. package/dist/_shared/startup-15-1-4S7FLMNG.js +6 -30
  24. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  25. package/dist/_shared/startup-8-0-34CBHPZH.js +3 -3
  26. package/dist/_shared/startup-8-1-LZFXSD3Z.js +3 -3
  27. package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
  28. package/dist/_shared/storage-status-K7PX2RXA.js +3 -3
  29. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  30. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  31. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  32. package/dist/builtin/intercom/package.json +1 -1
  33. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  34. package/dist/builtin/mcp/package.json +1 -1
  35. package/dist/builtin/subagents/package.json +1 -1
  36. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
  37. package/dist/builtin/web-access/index.bundle.mjs +1 -1
  38. package/dist/builtin/web-access/package.json +1 -1
  39. package/dist/cli/auth-cli.code.js +1 -1
  40. package/dist/cli/auth-cli.impl.js +3 -3
  41. package/dist/cli/auth-cli.js +3 -3
  42. package/dist/cli/blueprint-command.impl.js +3 -3
  43. package/dist/cli/blueprint-command.js +3 -3
  44. package/dist/cli/intercom-command.code.js +3 -3
  45. package/dist/cli/intercom-command.impl.js +3 -3
  46. package/dist/cli/intercom-command.js +3 -3
  47. package/dist/cli/list-models.impl.js +3 -3
  48. package/dist/cli/list-models.js +3 -3
  49. package/dist/cli/session-picker.code.js +1 -1
  50. package/dist/cli/session-picker.impl.js +3 -3
  51. package/dist/cli/session-picker.js +3 -3
  52. package/dist/cli/startup-ui.code.js +1 -1
  53. package/dist/cli/startup-ui.impl.js +3 -3
  54. package/dist/cli/startup-ui.js +3 -3
  55. package/dist/cli/storage-command.impl.js +3 -3
  56. package/dist/cli/storage-command.js +3 -3
  57. package/dist/cli/storage-search-session.code.js +1 -1
  58. package/dist/cli/storage-search-session.impl.js +3 -3
  59. package/dist/cli/storage-search-session.js +3 -3
  60. package/dist/cli/team-command.code.js +1 -1
  61. package/dist/cli/team-command.impl.js +3 -3
  62. package/dist/cli/team-command.js +3 -3
  63. package/dist/cli.js +2 -2
  64. package/dist/core/compaction/compactor.d.ts +0 -8
  65. package/dist/core/debug.impl.js +3 -3
  66. package/dist/core/debug.js +3 -3
  67. package/dist/core/export-html/card-projection.impl.js +3 -3
  68. package/dist/core/export-html/card-projection.js +3 -3
  69. package/dist/core/export-html/index.code.js +2 -2
  70. package/dist/core/export-html/index.impl.js +3 -3
  71. package/dist/core/export-html/index.js +3 -3
  72. package/dist/core/export-html/json-spans.impl.js +3 -3
  73. package/dist/core/export-html/json-spans.js +3 -3
  74. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  75. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  76. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  77. package/dist/core/export-html/tool-renderer.js +3 -3
  78. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  79. package/dist/core/extensions/jiti-loader.js +3 -3
  80. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  81. package/dist/core/extensions/jiti-static-loader.js +3 -3
  82. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  83. package/dist/core/extensions/loader-host-modules.js +3 -3
  84. package/dist/core/intercom-broker-control-host.code.js +1 -1
  85. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  86. package/dist/core/intercom-broker-control-host.js +3 -3
  87. package/dist/core/intercom-broker-control.code.js +2 -2
  88. package/dist/core/intercom-broker-control.impl.js +3 -3
  89. package/dist/core/intercom-broker-control.js +3 -3
  90. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  91. package/dist/core/package-manager-storage-adapters.js +3 -3
  92. package/dist/core/sdk.code.js +1 -1
  93. package/dist/core/sdk.impl.js +3 -3
  94. package/dist/core/sdk.js +3 -3
  95. package/dist/core/session-manager-core.js +3 -3
  96. package/dist/core/session-manager-list.impl.js +3 -3
  97. package/dist/core/session-manager-list.js +3 -3
  98. package/dist/core/session-manager.impl.js +3 -3
  99. package/dist/core/session-manager.js +3 -3
  100. package/dist/core/session-storage.impl.js +3 -3
  101. package/dist/core/session-storage.js +3 -3
  102. package/dist/core/storage/index.js +2 -2
  103. package/dist/core/storage/node-sqlite-thread.js +2 -2
  104. package/dist/core/storage/node-sqlite.js +2 -2
  105. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  106. package/dist/core/storage/offline-snapshot-file.js +3 -3
  107. package/dist/core/storage/provider.js +2 -2
  108. package/dist/core/storage/selection.js +2 -2
  109. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  110. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  111. package/dist/core/storage/session/branch-fork-source.js +3 -3
  112. package/dist/core/storage/session/card-view.impl.js +3 -3
  113. package/dist/core/storage/session/card-view.js +3 -3
  114. package/dist/core/storage/session/child-reader.code.js +2 -2
  115. package/dist/core/storage/session/child-reader.impl.js +3 -3
  116. package/dist/core/storage/session/child-reader.js +3 -3
  117. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  118. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  119. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  120. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  121. package/dist/core/storage/session/expanded-child-details.js +3 -3
  122. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  123. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  124. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  125. package/dist/core/storage/session/fork-row-index.js +3 -3
  126. package/dist/core/storage/session/fork-staging.code.js +1 -1
  127. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  128. package/dist/core/storage/session/fork-staging.js +3 -3
  129. package/dist/core/storage/session/fork-window.code.js +2 -2
  130. package/dist/core/storage/session/fork-window.impl.js +3 -3
  131. package/dist/core/storage/session/fork-window.js +3 -3
  132. package/dist/core/storage/session/history-pages.impl.js +3 -3
  133. package/dist/core/storage/session/history-pages.js +3 -3
  134. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  135. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  136. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  137. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  138. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  139. package/dist/core/storage/session/memory-session-store.js +3 -3
  140. package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
  141. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  142. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  143. package/dist/core/storage/session/released-history-files.code.js +1 -1
  144. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  145. package/dist/core/storage/session/released-history-files.js +3 -3
  146. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  147. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  148. package/dist/core/storage/session/session-resume.impl.js +3 -3
  149. package/dist/core/storage/session/session-resume.js +3 -3
  150. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  151. package/dist/core/storage/session/snapshot-cut.js +3 -3
  152. package/dist/core/storage/session/snapshot-history.code.js +2 -2
  153. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  154. package/dist/core/storage/session/snapshot-history.js +3 -3
  155. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  156. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  157. package/dist/core/storage/session/sql-session-store.js +3 -3
  158. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  159. package/dist/core/storage/session/tree-outline.js +3 -3
  160. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  161. package/dist/core/storage/session/tree-presentation.js +3 -3
  162. package/dist/core/storage/storage-status.impl.js +3 -3
  163. package/dist/core/storage/storage-status.js +3 -3
  164. package/dist/core/storage/team.impl.js +3 -3
  165. package/dist/core/storage/team.js +3 -3
  166. package/dist/core/structured-output/index.code.js +1 -1
  167. package/dist/core/structured-output/index.impl.js +3 -3
  168. package/dist/core/structured-output/index.js +3 -3
  169. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  170. package/dist/core/tasks/task-completion-entry.js +3 -3
  171. package/dist/core/tasks/task-file-history.code.js +2 -2
  172. package/dist/core/tasks/task-file-history.impl.js +3 -3
  173. package/dist/core/tasks/task-file-history.js +3 -3
  174. package/dist/core/tasks/task-reference-archive.code.js +2 -2
  175. package/dist/core/tasks/task-reference-archive.js +3 -3
  176. package/dist/core/tasks/task-reference-identity.js +3 -3
  177. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  178. package/dist/core/tasks/task-reference-stream.js +3 -3
  179. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  180. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  181. package/dist/core/tasks/task-view-source.impl.js +3 -3
  182. package/dist/core/tasks/task-view-source.js +3 -3
  183. package/dist/core/tools/read-url.impl.js +3 -3
  184. package/dist/core/tools/read-url.js +3 -3
  185. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  186. package/dist/core/worktree-snapshot/errors.code.js +1 -1
  187. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  188. package/dist/core/worktree-snapshot/errors.js +3 -3
  189. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  190. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  191. package/dist/extensions/codemode/execute.impl.js +3 -3
  192. package/dist/extensions/codemode/execute.js +3 -3
  193. package/dist/extensions/codemode/renderer.impl.js +3 -3
  194. package/dist/extensions/codemode/renderer.js +3 -3
  195. package/dist/extensions/mcp/cli.code.js +1 -1
  196. package/dist/extensions/mcp/cli.impl.js +3 -3
  197. package/dist/extensions/mcp/cli.js +3 -3
  198. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  199. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  200. package/dist/extensions/mcp/cli.lazy.js +3 -3
  201. package/dist/extensions/mcp/runtime.code.js +1 -1
  202. package/dist/extensions/mcp/runtime.impl.js +3 -3
  203. package/dist/extensions/mcp/runtime.js +3 -3
  204. package/dist/index.d.ts +21 -1
  205. package/dist/index.js +2 -2
  206. package/dist/main-first-time-setup.code.js +1 -1
  207. package/dist/main-first-time-setup.impl.js +3 -3
  208. package/dist/main-first-time-setup.js +3 -3
  209. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  210. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  211. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  212. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  213. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  214. package/dist/modes/print-mode.js +1 -1
  215. package/dist/package-manager-cli.code.js +2 -2
  216. package/dist/package-manager-cli.impl.js +3 -3
  217. package/dist/package-manager-cli.js +3 -3
  218. package/dist/startup-files.json +1 -1
  219. package/dist/startup-stages/6.js +1 -1
  220. package/dist/utils/startup-database-spare.code.js +1 -1
  221. package/dist/utils/startup-database-spare.impl.js +3 -3
  222. package/dist/utils/startup-database-spare.js +3 -3
  223. package/dist/utils/tools-manager.impl.js +3 -3
  224. package/dist/utils/tools-manager.js +3 -3
  225. package/docs/background-tasks/reference.md +182 -0
  226. package/docs/background-tasks.md +98 -405
  227. package/docs/build.md +67 -27
  228. package/docs/changelog.mdx +1 -1
  229. package/docs/codemode.md +108 -39
  230. package/docs/compaction/branch-summaries.md +54 -0
  231. package/docs/compaction/custom-compactors.md +161 -0
  232. package/docs/compaction/memory-compaction.md +77 -0
  233. package/docs/compaction/reference.md +86 -38
  234. package/docs/compaction.md +51 -252
  235. package/docs/computer-use.md +169 -321
  236. package/docs/containerization.md +71 -57
  237. package/docs/custom-provider/api-reference.md +119 -25
  238. package/docs/custom-provider/oauth.md +114 -132
  239. package/docs/custom-provider/override.md +37 -27
  240. package/docs/custom-provider/registration.md +107 -83
  241. package/docs/custom-provider/streaming.md +85 -71
  242. package/docs/custom-provider.md +85 -52
  243. package/docs/development.md +39 -29
  244. package/docs/docs.json +76 -63
  245. package/docs/environment-variables.md +94 -44
  246. package/docs/extensions/api-reference.md +86 -43
  247. package/docs/extensions/authoring.md +162 -154
  248. package/docs/extensions/events.md +80 -25
  249. package/docs/extensions/examples.md +90 -85
  250. package/docs/extensions/ui.md +206 -82
  251. package/docs/extensions.md +79 -108
  252. package/docs/getting-started/authentication.md +67 -36
  253. package/docs/getting-started/first-session.md +53 -43
  254. package/docs/getting-started/installation.md +116 -89
  255. package/docs/getting-started/project-instructions.md +48 -34
  256. package/docs/guides/configuration.md +82 -20
  257. package/docs/guides/non-interactive.md +66 -24
  258. package/docs/guides/resume-on-any-machine.md +135 -82
  259. package/docs/guides/team-setup.md +114 -105
  260. package/docs/guides.md +76 -32
  261. package/docs/herdr.md +15 -16
  262. package/docs/how-atomic-works.md +140 -0
  263. package/docs/index.md +58 -44
  264. package/docs/intercom/operations.md +141 -151
  265. package/docs/intercom/reference.md +85 -108
  266. package/docs/intercom.md +84 -145
  267. package/docs/json.md +120 -67
  268. package/docs/keybindings.md +85 -49
  269. package/docs/libraries/agent-core.md +137 -275
  270. package/docs/libraries/ai.md +100 -84
  271. package/docs/libraries/codemode.md +210 -300
  272. package/docs/libraries/schema.md +59 -53
  273. package/docs/libraries/storage-postgres.md +49 -35
  274. package/docs/libraries/telemetry.md +153 -354
  275. package/docs/libraries/tui.md +265 -393
  276. package/docs/libraries.md +42 -26
  277. package/docs/llama-cpp.md +171 -161
  278. package/docs/mcp-servers.md +90 -51
  279. package/docs/models/choose-a-model.md +188 -0
  280. package/docs/models/reference.md +74 -30
  281. package/docs/models.md +153 -88
  282. package/docs/orchestration/migrating-workflows.md +23 -16
  283. package/docs/orchestration/patterns.md +39 -44
  284. package/docs/orchestration.md +65 -26
  285. package/docs/packages/authoring.md +51 -29
  286. package/docs/packages/reference.md +42 -21
  287. package/docs/packages.md +69 -58
  288. package/docs/programmatic.md +118 -24
  289. package/docs/prompt-templates.md +84 -83
  290. package/docs/providers/reference.md +43 -48
  291. package/docs/providers.md +219 -451
  292. package/docs/quickstart.md +140 -120
  293. package/docs/reference/cli.md +135 -97
  294. package/docs/reference.md +20 -18
  295. package/docs/rpc/examples.md +76 -20
  296. package/docs/rpc/extension-ui.md +64 -38
  297. package/docs/rpc/protocol.md +361 -110
  298. package/docs/rpc.md +57 -17
  299. package/docs/sdk/reference.md +409 -534
  300. package/docs/sdk/storage.md +53 -13
  301. package/docs/sdk/structured-decisions.md +82 -56
  302. package/docs/sdk/web-server.md +57 -43
  303. package/docs/sdk.md +106 -84
  304. package/docs/security.md +42 -64
  305. package/docs/session-format.md +62 -38
  306. package/docs/sessions.md +99 -214
  307. package/docs/settings.md +165 -195
  308. package/docs/shell-aliases.md +9 -6
  309. package/docs/skills/authoring.md +69 -48
  310. package/docs/skills/reference.md +51 -20
  311. package/docs/skills.md +99 -148
  312. package/docs/slash-commands.md +129 -0
  313. package/docs/storage/custom-adapters.md +160 -85
  314. package/docs/storage/jsonl.md +81 -66
  315. package/docs/storage/postgres/pgbouncer.md +120 -126
  316. package/docs/storage/postgres/tuning.md +120 -143
  317. package/docs/storage/postgres.md +314 -330
  318. package/docs/storage/sqlite.md +71 -42
  319. package/docs/storage.md +298 -302
  320. package/docs/subagents/authoring.md +55 -38
  321. package/docs/subagents/reference.md +73 -33
  322. package/docs/subagents.md +119 -187
  323. package/docs/terminal-setup.md +50 -38
  324. package/docs/termux.md +67 -41
  325. package/docs/themes/reference.md +23 -19
  326. package/docs/themes.md +142 -127
  327. package/docs/tmux.md +47 -55
  328. package/docs/tools.md +147 -109
  329. package/docs/tui/reference.md +166 -214
  330. package/docs/tui.md +196 -341
  331. package/docs/usage.md +118 -138
  332. package/docs/verification.md +79 -51
  333. package/docs/web-access.md +121 -101
  334. package/docs/windows.md +26 -27
  335. package/docs/worktree-snapshots/reference.md +245 -0
  336. package/docs/worktree-snapshots.md +71 -259
  337. package/package.json +8 -8
  338. package/dist/_shared/startup-0-2-5QHPCEON.js.map +0 -1
  339. package/docs/guides/intercom.md +0 -32
  340. package/docs/guides/orchestration.md +0 -28
  341. package/docs/guides/subagents.md +0 -37
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 two optional storage adapter packages for extensions, SDK apps, and standalone Node.js 24.20+ projects."
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 two optional storage adapter packages (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.
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
- | Package | What it does |
14
- | --- | --- |
15
- | [`@bastani/atomic-ai`](/libraries/ai) | One API for every LLM provider: models, auth, streaming, tools, images, classification, and thinking |
16
- | [`@bastani/atomic-agent-core`](/libraries/agent-core) | A stateful agent loop with tool execution, event streaming, steering, and follow-up messages |
17
- | [`@bastani/atomic-tui`](/libraries/tui) | A terminal UI framework with differential rendering, components, overlays, and key handling |
18
- | [`@bastani/atomic-codemode`](/libraries/codemode) | A sandbox that runs model-written JavaScript whose only capability is calling the tools you give it |
19
- | [`@bastani/atomic-schema`](/libraries/schema) | JSON Schema builders and validation without `eval` |
20
- | [`@bastani/atomic-telemetry`](/libraries/telemetry) | Vendor-neutral telemetry contracts and reference contexts that send nothing on their own |
21
-
22
- ## Storage adapter packages
23
-
24
- Remote SQL storage adapters are **not** bundled into `@bastani/atomic` and must be installed separately when you use PostgreSQL:
25
-
26
- | Package | What it does |
27
- | --- | --- |
28
- | [`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) | PostgreSQL 16+ storage adapter (`openPostgresDatabase()`, cloud IAM, proxies, poolers) for shared sessions and Intercom |
29
-
30
- For CLI usage, install storage adapters in user scope with `atomic install npm:@bastani/atomic-storage-postgres`. For TypeScript SDK applications, install them with `npm install` alongside `@bastani/atomic` (see [SDK storage backends](/sdk/storage)).
31
-
32
- > **Native bindings:** `@bastani/atomic-natives` is an internal N-API native module installed automatically as a runtime dependency of `@bastani/atomic` (with per-platform binary packages in its `optionalDependencies`) and is not intended as a standalone user library.
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 a core library on its own with npm:
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. 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.
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 the bare libraries, use the [SDK](/sdk) and [SDK storage backends](/sdk/storage). For custom extension UI, start with [TUI components](/tui).
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. Outside Atomic, install the `@bastani/atomic-*` packages.
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: "Local models with llama.cpp"
3
- sidebarTitle: "Local models"
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 llama.cpp
10
-
11
- Install llama.cpp with the [official installer](https://llama.app/docs/installation):
12
-
13
- ```bash
14
- curl -LsSf https://llama.app/install.sh | sh
15
- ```
16
-
17
- Verify the installation:
18
-
19
- ```bash
20
- llama --version
21
- ```
22
-
23
- See [llama.app](https://llama.app) for package managers and building from source.
24
-
25
- ## Start the router
26
-
27
- Start `llama serve` without `--model`, `-m`, or `-hf`, which start 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.
28
-
29
- ```bash
30
- llama serve \
31
- --no-models-autoload \
32
- --host 127.0.0.1 \
33
- -ngl all \
34
- -c 32768
35
- ```
36
-
37
- - `--no-models-autoload` keeps model loading under explicit `/llama` control.
38
- - `-ngl all` offloads all layers to the GPU. Omit it for automatic GPU offloading.
39
- - `-c 32768` sets the context size in tokens. Use `-c 0` for a model's full context window, which uses more memory. Parallel server slots share context.
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
- Run `/login llama.cpp` inside an interactive session and enter the router URL and optional API key. The default URL is `http://127.0.0.1:9931` (trailing slashes and `/v1` are normalized automatically). Shell `atomic auth login` does not load extension providers, so use `/login llama.cpp` or environment variables below instead (see [CLI reference](/reference/cli#credential-commands) and [Model providers](/providers)). When the router runs with `--no-models-autoload`, login saves only the connection; load a model with `/llama`, then select it with `/model`.
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 with `/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.
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 pick 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. Typing an exact `owner/repository` or `owner/repository:QUANT` value and pressing Enter downloads it directly.
66
- - Press Escape during a load or download to confirm cancellation.
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`. Unauthenticated search has lower rate limits. Atomic warns before gated downloads and links to the access page; because llama.cpp performs the download, its process also needs `HF_TOKEN` for gated repositories.
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 the router's live state because other clients may share the server. Loaded and sleeping models appear in `/model`, and 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 through `/llama` first.
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` (or the active agent directory). Cached entries stay selectable across restarts until the next successful refresh. If an online refresh fails, Atomic reports the router error and keeps the cached catalog; a later successful refresh replaces stale entries without duplicates.
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
- If the router disconnects, select **Retry** to reconnect and refresh state without replaying the interrupted action.
73
+ ### Context window, thinking, and vision detection
75
74
 
76
- Each llama.cpp model sets both `contextWindow` and `maxTokens` from the router-reported context window (`meta.n_ctx`, then the model's configured `--ctx-size`, `-c`, or `-ctx` argument, cached context, training context `meta.n_ctx_train`, or the 128,000-token fallback). The server remains authoritative and may enforce a smaller generation limit.
75
+ Atomic derives each model's context size, thinking support, and vision support automatically from the router:
77
76
 
78
- ### Thinking and vision detection
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
- - **Thinking controls:** Atomic enables thinking controls only when a **currently loaded** model's server `/props` `chat_template` contains `"enable_thinking"`. Sleeping or unloaded autoload-preset models are not queried during discovery so they are not woken unexpectedly; load a model in `/llama` and refresh to detect its thinking template. When thinking is detected, Atomic exposes only **`off`** and **`medium`** thinking levels (`minimal`, `low`, `high`, `xhigh`, and `max` are unavailable).
81
- - **Vision support:** Image input is enabled automatically when the server reports `"image"` in `architecture.input_modalities`.
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` decisions 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 [Classifier models](/models#use-classifier-models).
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
- - **Decision models** (such as Julia-1, Laya, Kev, lev, and OpenJev) answer natively through llama.cpp's decision endpoint (`/v1/systemone`, API `typesafe-system-one`). Decision-only models do not appear in `/model`.
90
- - **Chat models** are also exposed as classifiers under the same ID using next-token probability classification (API `llama-cpp-classify`).
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
- llama.cpp 0.6.0 and newer identify decision models by including `decisions` in `architecture.output_modalities`. Atomic detects them even when sleeping or unloaded without waking them during discovery. Unloaded presets are selectable only when router autoload is enabled. Older servers omit this metadata and fall back to `llama-cpp-classify`.
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
- Rather than generating text, Atomic formats each question as a single chat prompt (state, all request questions, state again, then the target question and single-token labels) and reads next-token probabilities for the labels. Labels are alphanumeric characters for `choice` (2 to 62 options; 1 option throws an error), `Yes`/`No` for `bool`, and digits for `score` (2 to 10 levels). If a label token is absent from the server's top probabilities, Atomic retries with larger `n_probs` up to 32,768. Choices return normalized option probabilities and a confidence of `(n * peak - 1) / (n - 1)`; scores return the expected level.
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
- ## NVIDIA RTX recipes
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
- [NVIDIA Local AI Inference Recipes](https://nvidia.github.io/local-ai-inference-recipes/index.html) publishes llama.cpp settings 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` (which accepts the same options) can serve it alongside other models. The examples below use Windows PowerShell.
107
+ When a chat model is exposed as both a chat model and a classifier under the same `llama.cpp/<id>`:
110
108
 
111
- ### Before you begin
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
- | `-hf` | `hf-repo` |
134
- | `-hff` | `hf-file` |
135
- | `-hfrd` | `hf-repo-draft` |
136
- | `--spec-draft-model` | `spec-draft-model` |
137
-
138
- For example, this recipe command:
139
-
140
- ```powershell
141
- llama-server.exe -hf "unsloth/Qwen3.8-27B-GGUF" `
142
- -hff "Qwen3.8-27B-UD-Q4_K_M.gguf" `
143
- -hfrd "z-lab/Qwen3.8-27B-DFlash2-GGUF" `
144
- --spec-draft-model "Qwen3.8-27B-DFlash2-Q4_K_M.gguf" `
145
- --no-mmproj `
146
- --host 127.0.0.1 `
147
- --port 9931 `
148
- --batch-size 4096 `
149
- --ubatch-size 1024 `
150
- --ctx-size 65536 `
151
- --parallel 1 `
152
- -ngl 999 `
153
- --jinja `
154
- --chat-template-kwargs '{"preserve_thinking":true}' `
155
- --spec-type draft-dflash `
156
- --spec-draft-n-max 7 `
157
- --spec-draft-backend-sampling
158
- ```
159
-
160
- becomes `qwen3.8-27b.ini`:
161
-
162
- ```ini
163
- version = 1
164
-
165
- [qwen3.8-27b]
166
- load-on-startup = true
167
- hf-repo = unsloth/Qwen3.8-27B-GGUF
168
- hf-file = Qwen3.8-27B-UD-Q4_K_M.gguf
169
- hf-repo-draft = z-lab/Qwen3.8-27B-DFlash2-GGUF
170
- spec-draft-model = Qwen3.8-27B-DFlash2-Q4_K_M.gguf
171
- no-mmproj = true
172
- batch-size = 4096
173
- ubatch-size = 1024
174
- ctx-size = 65536
175
- parallel = 1
176
- ngl = 999
177
- jinja = true
178
- chat-template-kwargs = {"preserve_thinking":true}
179
- spec-type = draft-dflash
180
- spec-draft-n-max = 7
181
- spec-draft-backend-sampling = true
182
- ```
183
-
184
- ### Start the recipe router
185
-
186
- Open PowerShell in the llama.cpp directory and run:
187
-
188
- ```powershell
189
- .\llama.exe serve --models-preset qwen3.8-27b.ini --host 127.0.0.1
190
- ```
191
-
192
- If the recipe needs a Hugging Face token, set `$env:HF_TOKEN` in the same PowerShell session before starting the router. The first launch downloads the model files.
193
-
194
- Check readiness with the [troubleshooting commands](#troubleshooting). In PowerShell, use `curl.exe` instead of `curl`. The model is ready when `/models` lists `qwen3.8-27b` with status `loaded`.
195
-
196
- Follow [Configure Atomic](#configure-atomic) to connect to `http://127.0.0.1:9931`, then select `qwen3.8-27b` in `/model`.
197
-
198
- NVIDIA recipe memory budgets assume only that model occupies the GPU. Unload any other loaded models in `/llama` before running the recipe model.
199
-
200
- ## Troubleshooting
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
- - **No models in `/llama`:** Verify cached models or `--models-dir` layout, then restart the router.
208
- - **Model missing from `/model` with `--no-models-autoload`:** Load it in `/llama` first.
209
- - **Thinking controls missing:** Load the model in `/llama`, then refresh `/model`; thinking controls appear only for loaded models whose chat template includes `"enable_thinking"`.
210
- - **Load fails or runs out of memory:** Lower `-c` or unload another model.
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`.