dsh-plugin-local-infer 0.1.2 → 0.1.4

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 (251) hide show
  1. package/README.md +32 -6
  2. package/cordis.patch.yml +7 -0
  3. package/docs/zh/README.md +24 -4
  4. package/dsh/client.js +4200 -4049
  5. package/package.json +33 -11
  6. package/packages/core/lib/adapter.d.ts +177 -11
  7. package/packages/core/lib/adapter.js +74 -1
  8. package/packages/core/lib/config.d.ts +1 -1
  9. package/packages/core/lib/config.js +1 -1
  10. package/packages/core/lib/debug.d.ts +1 -1
  11. package/packages/core/lib/debug.js +1 -1
  12. package/packages/core/lib/defaults.d.ts +1 -1
  13. package/packages/core/lib/defaults.js +1 -1
  14. package/packages/core/lib/deps.d.ts +48 -20
  15. package/packages/core/lib/deps.js +24 -8
  16. package/packages/core/lib/estimator.d.ts +1 -1
  17. package/packages/core/lib/estimator.js +1 -1
  18. package/packages/core/lib/guideline.d.ts +1 -1
  19. package/packages/core/lib/guideline.js +1 -1
  20. package/packages/core/lib/hardware.d.ts +1 -1
  21. package/packages/core/lib/hardware.js +1 -1
  22. package/packages/core/lib/hf-cache.d.ts +70 -0
  23. package/packages/core/lib/hf-cache.js +83 -0
  24. package/packages/core/lib/index.d.ts +16 -9
  25. package/packages/core/lib/index.js +10 -6
  26. package/packages/core/lib/infer-cache.d.ts +39 -0
  27. package/packages/core/lib/infer-cache.js +53 -0
  28. package/packages/core/lib/launch-command.d.ts +8 -4
  29. package/packages/core/lib/launch-command.js +13 -6
  30. package/packages/core/lib/launch-record.d.ts +1 -1
  31. package/packages/core/lib/launch-record.js +1 -1
  32. package/packages/core/lib/logs.d.ts +8 -1
  33. package/packages/core/lib/logs.js +12 -4
  34. package/packages/core/lib/models.d.ts +120 -14
  35. package/packages/core/lib/models.js +209 -17
  36. package/packages/core/lib/parameter.d.ts +31 -3
  37. package/packages/core/lib/parameter.js +1 -1
  38. package/packages/core/lib/progress.d.ts +54 -0
  39. package/packages/core/lib/progress.js +120 -0
  40. package/packages/core/lib/registrar.d.ts +25 -14
  41. package/packages/core/lib/registrar.js +30 -10
  42. package/packages/core/lib/reserve.d.ts +11 -3
  43. package/packages/core/lib/reserve.js +6 -4
  44. package/packages/core/lib/status.d.ts +12 -6
  45. package/packages/core/lib/status.js +21 -10
  46. package/packages/core/lib/sudo.d.ts +80 -0
  47. package/packages/core/lib/sudo.js +78 -0
  48. package/packages/core/package.json +1 -1
  49. package/packages/orchestrator/lib/config.d.ts +63 -0
  50. package/packages/orchestrator/lib/config.js +111 -0
  51. package/packages/orchestrator/lib/index.d.ts +51 -0
  52. package/packages/orchestrator/lib/index.js +73 -0
  53. package/packages/orchestrator/lib/route.d.ts +60 -0
  54. package/packages/orchestrator/lib/route.js +159 -0
  55. package/packages/orchestrator/locale/en.json +6 -0
  56. package/packages/orchestrator/package.json +39 -0
  57. package/packages/orchestrator/prompt.md +87 -0
  58. package/packages/providers/lib/acquire.d.ts +95 -15
  59. package/packages/providers/lib/acquire.js +239 -40
  60. package/packages/providers/lib/adapters.d.ts +155 -221
  61. package/packages/providers/lib/adapters.js +589 -935
  62. package/packages/providers/lib/debug.d.ts +1 -1
  63. package/packages/providers/lib/debug.js +1 -1
  64. package/packages/providers/lib/deps.d.ts +31 -212
  65. package/packages/providers/lib/deps.js +71 -205
  66. package/packages/providers/lib/engines/basalt/basalt.d.ts +130 -0
  67. package/packages/providers/lib/engines/basalt/basalt.js +304 -0
  68. package/packages/providers/lib/engines/basalt/basaltAdapter.d.ts +85 -0
  69. package/packages/providers/lib/engines/basalt/basaltAdapter.js +439 -0
  70. package/packages/providers/lib/engines/basalt/basaltLinux.d.ts +23 -0
  71. package/packages/providers/lib/engines/basalt/basaltLinux.js +47 -0
  72. package/packages/providers/lib/engines/basalt/basaltMacOS.d.ts +17 -0
  73. package/packages/providers/lib/engines/basalt/basaltMacOS.js +19 -0
  74. package/packages/providers/lib/engines/basalt/basaltWindows.d.ts +24 -0
  75. package/packages/providers/lib/engines/basalt/basaltWindows.js +49 -0
  76. package/packages/providers/lib/engines/engineOs.d.ts +24 -0
  77. package/packages/providers/lib/engines/engineOs.js +17 -0
  78. package/packages/providers/lib/{hyperqwen.d.ts → engines/hyperqwen/hyperqwen.d.ts} +2 -2
  79. package/packages/providers/lib/{hyperqwen.js → engines/hyperqwen/hyperqwen.js} +14 -2
  80. package/packages/providers/lib/engines/hyperqwen/hyperqwenAdapter.d.ts +38 -0
  81. package/packages/providers/lib/engines/hyperqwen/hyperqwenAdapter.js +115 -0
  82. package/packages/providers/lib/engines/hyperqwen/hyperqwenArch.d.ts +9 -0
  83. package/packages/providers/lib/engines/hyperqwen/hyperqwenArch.js +9 -0
  84. package/packages/providers/lib/engines/hyperqwen/hyperqwenDebian.d.ts +9 -0
  85. package/packages/providers/lib/engines/hyperqwen/hyperqwenDebian.js +9 -0
  86. package/packages/providers/lib/engines/hyperqwen/hyperqwenFedora.d.ts +9 -0
  87. package/packages/providers/lib/engines/hyperqwen/hyperqwenFedora.js +9 -0
  88. package/packages/providers/lib/engines/hyperqwen/hyperqwenLinux.d.ts +10 -0
  89. package/packages/providers/lib/engines/hyperqwen/hyperqwenLinux.js +14 -0
  90. package/packages/providers/lib/engines/hyperqwen/hyperqwenMacOS.d.ts +9 -0
  91. package/packages/providers/lib/engines/hyperqwen/hyperqwenMacOS.js +9 -0
  92. package/packages/providers/lib/engines/hyperqwen/hyperqwenWindows.d.ts +9 -0
  93. package/packages/providers/lib/engines/hyperqwen/hyperqwenWindows.js +9 -0
  94. package/packages/providers/lib/{infernix.d.ts → engines/infernix/infernix.d.ts} +7 -4
  95. package/packages/providers/lib/{infernix.js → engines/infernix/infernix.js} +53 -8
  96. package/packages/providers/lib/engines/infernix/infernixAdapter.d.ts +52 -0
  97. package/packages/providers/lib/engines/infernix/infernixAdapter.js +235 -0
  98. package/packages/providers/lib/engines/infernix/infernixArch.d.ts +9 -0
  99. package/packages/providers/lib/engines/infernix/infernixArch.js +9 -0
  100. package/packages/providers/lib/engines/infernix/infernixDebian.d.ts +9 -0
  101. package/packages/providers/lib/engines/infernix/infernixDebian.js +9 -0
  102. package/packages/providers/lib/engines/infernix/infernixFedora.d.ts +9 -0
  103. package/packages/providers/lib/engines/infernix/infernixFedora.js +9 -0
  104. package/packages/providers/lib/engines/infernix/infernixLinux.d.ts +17 -0
  105. package/packages/providers/lib/engines/infernix/infernixLinux.js +35 -0
  106. package/packages/providers/lib/engines/infernix/infernixMacOS.d.ts +16 -0
  107. package/packages/providers/lib/engines/infernix/infernixMacOS.js +18 -0
  108. package/packages/providers/lib/engines/infernix/infernixWindows.d.ts +16 -0
  109. package/packages/providers/lib/engines/infernix/infernixWindows.js +34 -0
  110. package/packages/providers/lib/{llamacpp.d.ts → engines/llamacpp/llamacpp.d.ts} +2 -2
  111. package/packages/providers/lib/{llamacpp.js → engines/llamacpp/llamacpp.js} +12 -2
  112. package/packages/providers/lib/engines/llamacpp/llamacppAdapter.d.ts +50 -0
  113. package/packages/providers/lib/engines/llamacpp/llamacppAdapter.js +274 -0
  114. package/packages/providers/lib/engines/llamacpp/llamacppArch.d.ts +9 -0
  115. package/packages/providers/lib/engines/llamacpp/llamacppArch.js +9 -0
  116. package/packages/providers/lib/engines/llamacpp/llamacppDebian.d.ts +9 -0
  117. package/packages/providers/lib/engines/llamacpp/llamacppDebian.js +9 -0
  118. package/packages/providers/lib/engines/llamacpp/llamacppFedora.d.ts +9 -0
  119. package/packages/providers/lib/engines/llamacpp/llamacppFedora.js +9 -0
  120. package/packages/providers/lib/engines/llamacpp/llamacppLinux.d.ts +17 -0
  121. package/packages/providers/lib/engines/llamacpp/llamacppLinux.js +28 -0
  122. package/packages/providers/lib/engines/llamacpp/llamacppMacOS.d.ts +15 -0
  123. package/packages/providers/lib/engines/llamacpp/llamacppMacOS.js +17 -0
  124. package/packages/providers/lib/engines/llamacpp/llamacppWindows.d.ts +15 -0
  125. package/packages/providers/lib/engines/llamacpp/llamacppWindows.js +26 -0
  126. package/packages/providers/lib/{ninfer.d.ts → engines/ninfer/ninfer.d.ts} +2 -2
  127. package/packages/providers/lib/{ninfer.js → engines/ninfer/ninfer.js} +25 -3
  128. package/packages/providers/lib/engines/ninfer/ninferAdapter.d.ts +81 -0
  129. package/packages/providers/lib/engines/ninfer/ninferAdapter.js +392 -0
  130. package/packages/providers/lib/engines/ninfer/ninferArch.d.ts +9 -0
  131. package/packages/providers/lib/engines/ninfer/ninferArch.js +9 -0
  132. package/packages/providers/lib/engines/ninfer/ninferDebian.d.ts +9 -0
  133. package/packages/providers/lib/engines/ninfer/ninferDebian.js +9 -0
  134. package/packages/providers/lib/engines/ninfer/ninferFedora.d.ts +9 -0
  135. package/packages/providers/lib/engines/ninfer/ninferFedora.js +9 -0
  136. package/packages/providers/lib/engines/ninfer/ninferLinux.d.ts +17 -0
  137. package/packages/providers/lib/engines/ninfer/ninferLinux.js +37 -0
  138. package/packages/providers/lib/engines/ninfer/ninferMacOS.d.ts +15 -0
  139. package/packages/providers/lib/engines/ninfer/ninferMacOS.js +17 -0
  140. package/packages/providers/lib/engines/ninfer/ninferWindows.d.ts +29 -0
  141. package/packages/providers/lib/engines/ninfer/ninferWindows.js +59 -0
  142. package/packages/providers/lib/engines/strata/strata.d.ts +1 -0
  143. package/packages/providers/lib/engines/strata/strata.js +264 -0
  144. package/packages/providers/lib/engines/strata/strataAdapter.d.ts +97 -0
  145. package/packages/providers/lib/engines/strata/strataAdapter.js +463 -0
  146. package/packages/providers/lib/engines/strata/strataArch.d.ts +9 -0
  147. package/packages/providers/lib/engines/strata/strataArch.js +9 -0
  148. package/packages/providers/lib/engines/strata/strataDebian.d.ts +9 -0
  149. package/packages/providers/lib/engines/strata/strataDebian.js +9 -0
  150. package/packages/providers/lib/engines/strata/strataFedora.d.ts +9 -0
  151. package/packages/providers/lib/engines/strata/strataFedora.js +9 -0
  152. package/packages/providers/lib/engines/strata/strataLinux.d.ts +21 -0
  153. package/packages/providers/lib/engines/strata/strataLinux.js +30 -0
  154. package/packages/providers/lib/engines/strata/strataMacOS.d.ts +16 -0
  155. package/packages/providers/lib/engines/strata/strataMacOS.js +17 -0
  156. package/packages/providers/lib/engines/strata/strataWindows.d.ts +27 -0
  157. package/packages/providers/lib/engines/strata/strataWindows.js +37 -0
  158. package/packages/providers/lib/engines.d.ts +8 -5
  159. package/packages/providers/lib/engines.js +22 -11
  160. package/packages/providers/lib/guidelines.d.ts +5 -4
  161. package/packages/providers/lib/guidelines.js +18 -5
  162. package/packages/providers/lib/index.d.ts +33 -24
  163. package/packages/providers/lib/index.js +46 -24
  164. package/packages/providers/lib/model-defaults.d.ts +10 -5
  165. package/packages/providers/lib/model-defaults.js +47 -5
  166. package/packages/providers/lib/platform.d.ts +8 -5
  167. package/packages/providers/lib/platform.js +27 -7
  168. package/packages/providers/lib/presets.d.ts +6 -4
  169. package/packages/providers/lib/presets.js +53 -5
  170. package/packages/providers/lib/systemDeps.d.ts +313 -0
  171. package/packages/providers/lib/systemDeps.js +284 -0
  172. package/packages/providers/lib/vram.d.ts +34 -8
  173. package/packages/providers/lib/vram.js +81 -8
  174. package/packages/providers/package.json +2 -2
  175. package/packages/service/lib/index.d.ts +187 -23
  176. package/packages/service/lib/index.js +667 -90
  177. package/packages/service/lib/launch-target.d.ts +19 -0
  178. package/packages/service/lib/launch-target.js +28 -0
  179. package/packages/service/lib/run-logs.d.ts +72 -0
  180. package/packages/service/lib/run-logs.js +125 -0
  181. package/packages/service/lib/types.d.ts +166 -8
  182. package/packages/service/lib/types.js +1 -1
  183. package/packages/service/package.json +2 -2
  184. package/packages/tool/lib/index.d.ts +1 -1
  185. package/packages/tool/lib/index.js +1 -1
  186. package/packages/tool/package.json +2 -2
  187. package/packages/ui/lib/config.d.ts +89 -0
  188. package/packages/ui/lib/config.js +251 -0
  189. package/packages/ui/lib/deps.d.ts +4 -4
  190. package/packages/ui/lib/deps.js +1 -1
  191. package/packages/ui/lib/form.d.ts +1 -1
  192. package/packages/ui/lib/form.js +1 -1
  193. package/packages/ui/lib/index.d.ts +7 -1
  194. package/packages/ui/lib/index.js +12 -2
  195. package/packages/ui/lib/meter.d.ts +1 -1
  196. package/packages/ui/lib/meter.js +1 -1
  197. package/packages/ui/lib/ops/engine.d.ts +216 -0
  198. package/packages/ui/lib/ops/engine.js +697 -0
  199. package/packages/ui/lib/ops/get-steps.d.ts +98 -0
  200. package/packages/ui/lib/ops/get-steps.js +359 -0
  201. package/packages/ui/lib/ops/hf.d.ts +42 -0
  202. package/packages/ui/lib/ops/hf.js +150 -0
  203. package/packages/ui/lib/ops/logs.d.ts +78 -0
  204. package/packages/ui/lib/ops/logs.js +119 -0
  205. package/packages/ui/lib/ops/model.d.ts +71 -0
  206. package/packages/ui/lib/ops/model.js +123 -0
  207. package/packages/ui/lib/request.d.ts +106 -0
  208. package/packages/ui/lib/request.js +80 -0
  209. package/packages/ui/lib/route.d.ts +106 -422
  210. package/packages/ui/lib/route.js +136 -1845
  211. package/packages/ui/lib/routes/chat-template.d.ts +1 -0
  212. package/packages/ui/lib/routes/chat-template.js +1 -0
  213. package/packages/ui/lib/routes/deps.d.ts +1 -0
  214. package/packages/ui/lib/routes/deps.js +1 -0
  215. package/packages/ui/lib/routes/download.d.ts +1 -0
  216. package/packages/ui/lib/routes/download.js +1 -0
  217. package/packages/ui/lib/routes/get.d.ts +1 -0
  218. package/packages/ui/lib/routes/get.js +106 -0
  219. package/packages/ui/lib/routes/install.d.ts +16 -0
  220. package/packages/ui/lib/routes/install.js +36 -0
  221. package/packages/ui/lib/routes/launch.d.ts +24 -0
  222. package/packages/ui/lib/routes/launch.js +74 -0
  223. package/packages/ui/lib/routes/logs.d.ts +57 -0
  224. package/packages/ui/lib/routes/logs.js +117 -0
  225. package/packages/ui/lib/routes/provider-delete.d.ts +15 -0
  226. package/packages/ui/lib/routes/provider-delete.js +37 -0
  227. package/packages/ui/lib/routes/register.d.ts +16 -0
  228. package/packages/ui/lib/routes/register.js +28 -0
  229. package/packages/ui/lib/routes/save.d.ts +18 -0
  230. package/packages/ui/lib/routes/save.js +159 -0
  231. package/packages/ui/lib/routes/stop.d.ts +19 -0
  232. package/packages/ui/lib/routes/stop.js +32 -0
  233. package/packages/ui/lib/routes/stream.d.ts +40 -0
  234. package/packages/ui/lib/routes/stream.js +68 -0
  235. package/packages/ui/lib/routes/summary.d.ts +15 -0
  236. package/packages/ui/lib/routes/summary.js +26 -0
  237. package/packages/ui/lib/routes/unregister.d.ts +14 -0
  238. package/packages/ui/lib/routes/unregister.js +26 -0
  239. package/packages/ui/lib/viewmodels/deps.d.ts +1 -0
  240. package/packages/ui/lib/viewmodels/deps.js +1 -0
  241. package/packages/ui/lib/viewmodels/depsHelpers.d.ts +1 -0
  242. package/packages/ui/lib/viewmodels/depsHelpers.js +94 -0
  243. package/packages/ui/lib/viewmodels/summary.d.ts +145 -0
  244. package/packages/ui/lib/viewmodels/summary.js +245 -0
  245. package/packages/ui/lib/viewmodels/summaryHelpers.d.ts +30 -0
  246. package/packages/ui/lib/viewmodels/summaryHelpers.js +42 -0
  247. package/packages/ui/lib/warnings.d.ts +1 -1
  248. package/packages/ui/lib/warnings.js +1 -1
  249. package/packages/ui/package.json +4 -4
  250. package/packages/providers/lib/strata.d.ts +0 -15
  251. package/packages/providers/lib/strata.js +0 -14
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Basalt parameter surface. The declarative `ParameterSpec` data for the
3
+ * Basalt engine (https://github.com/jesdga95/basalt), sourced from the
4
+ * repository's `docs/configuration/index.md`. Basalt is a C++/CUDA engine
5
+ * for the Qwen3.8-Flash-Next and DeepSeek-V4.1-Flash MoE models,
6
+ * Blackwell-only (sm_120). Every setting lands in a v2
7
+ * `basalt_config.json` file the deploy step writes, so each spec carries a
8
+ * `config` deploy target naming where the value nests: the shared `server`
9
+ * options, the per-model settings of the single `models[]` entry, or the
10
+ * shared `engine` flags; the `BasaltAdapter` renders the file with
11
+ * `configFileFromSpecs` and passes it to `basalt serve --config`.
12
+ *
13
+ * The data is the surface; the adapter composes it into a `LaunchPlan`.
14
+ * Adding a setting here is a data edit, never an adapter rewire.
15
+ * @module dsh-plugin-local-infer/providers/engines/basalt/basalt
16
+ */
17
+ import type { ComboOption, Config, EnumOption, ParameterSpec } from 'dsh-plugin-local-infer/core';
18
+ /**
19
+ * The Hugging Face repo and file of the bundled Qwen `.basalt` artifact
20
+ * (the weights, tokenizer, chat template, drafter, vision projector, and
21
+ * default sampling all come from it), the one a bare config serves. The
22
+ * constants live in this leaf module so both the adapter and the default
23
+ * model list import them without a circular edge.
24
+ */
25
+ export declare const BASALT_MODEL_REPO = "jesdga/Qwen3.8-Flash-Next-Basalt";
26
+ export declare const BASALT_MODEL_FILE = "Qwen3.8-FN-NVFP4-DQ6_K.basalt";
27
+ /**
28
+ * The Hugging Face repo and file of the second `.basalt` artifact the
29
+ * engine serves: the DeepSeek-V4.1-Flash UD-IQ1_M pack the v0.3.0 release
30
+ * notes name. The registry key and the served API id ride beside them, so
31
+ * the default model list, the VRAM and preset rows, the adapter's per-
32
+ * artifact download resolution, and the entry's alias stamp all name the
33
+ * same pack from one place.
34
+ */
35
+ export declare const BASALT_DEEPSEEK_MODEL_REPO = "jesdga/DeepSeek-V4.1-Flash-1017-Basalt";
36
+ export declare const BASALT_DEEPSEEK_MODEL_FILE = "DeepSeek-V4.1-Flash-1017-UD-IQ1_M.basalt";
37
+ /**
38
+ * The `basalt_config.json` format version the adapter's render envelope
39
+ * stamps under the top-level `version` key. v0.3.0 refuses a file without
40
+ * the stamp as a v1 config; the adapter's envelope reads this constant, so
41
+ * the version lives beside the surface that re-blocked for it.
42
+ */
43
+ export declare const BASALT_CONFIG_VERSION = 2;
44
+ /**
45
+ * The loopback port the basalt serve CLI binds by default, so a config that
46
+ * names no port launches on it. The port spec's defaultValue and the adapter's
47
+ * port fallback share this one constant.
48
+ */
49
+ export declare const BASALT_DEFAULT_PORT = 8080;
50
+ /**
51
+ * The model id of the default registry entry a bare config names: the
52
+ * Qwen3.8-Flash-Next `.basalt` artifact the engine serves. The default
53
+ * model list, the built-in preset key, the Basalt VramModel id, and the
54
+ * adapter's plan modelId stamp all share this one constant, so every
55
+ * model-id keyed read of the engine names the same model the card's Model
56
+ * dropdown offers first.
57
+ */
58
+ export declare const BASALT_DEFAULT_MODEL_ID = "qwen38-flash-next";
59
+ /**
60
+ * The registry key and served API id of the second default entry, the
61
+ * DeepSeek-V4.1-Flash UD-IQ1_M pack: `BASALT_DEEPSEEK_MODEL_ID` keys the
62
+ * default model list, the VRAM row, and the preset row, while
63
+ * `BASALT_DEEPSEEK_SERVED_MODEL_ID` is the name the adapter stamps as the
64
+ * config entry's `alias` and the registrar publishes (basaltServedName).
65
+ * The alias pins the name on `/v1/models` because the pack's stored
66
+ * `meta.name` is not known to the plugin.
67
+ */
68
+ export declare const BASALT_DEEPSEEK_MODEL_ID = "deepseek-v41-flash";
69
+ export declare const BASALT_DEEPSEEK_SERVED_MODEL_ID = "DeepSeek-V4.1-Flash";
70
+ /**
71
+ * The model id the serve server reports the bundled Qwen artifact under:
72
+ * the `meta.name` stored inside the `.basalt` artifact file. The adapter
73
+ * stamps it as the config entry's `alias` and the registrar publishes it
74
+ * (basaltServedName), so `/v1/models` always lists this name and the
75
+ * registry key and the file path are never advertised.
76
+ */
77
+ export declare const BASALT_SERVED_MODEL_ID = "Qwen3.8-Flash-Next NVIDIA-NVFP4";
78
+ /**
79
+ * The KV cache storage formats Basalt serves, in the order the form
80
+ * dropdown lists them. `note` carries the tradeoff text the dropdown shows
81
+ * beside each choice.
82
+ */
83
+ export declare const BASALT_KV_OPTIONS: readonly EnumOption[];
84
+ /**
85
+ * The image-input modes. `off` reads no pictures; `dynamic` borrows
86
+ * expert-cache slots inside the engine only while it reads an image; `cpu`
87
+ * runs the encoder on the CPU (no VRAM, slow). A GPU number pins the
88
+ * encoder sidecar to that card; the combo control offers the three named
89
+ * modes and accepts a free-text GPU number.
90
+ */
91
+ export declare const BASALT_VISION_OPTIONS: readonly ComboOption[];
92
+ /**
93
+ * The expert-cache sizes. `auto` takes as many expert blobs as fit in the
94
+ * VRAM left after the weights, the session and the reserve; a free-text
95
+ * count pins the number of blobs. The combo control offers `auto` and
96
+ * accepts a free-text count.
97
+ */
98
+ export declare const BASALT_EXPERT_CACHE_OPTIONS: readonly ComboOption[];
99
+ /**
100
+ * The Basalt `ParameterSpec` surface, in form order. Every spec carries a
101
+ * `config` deploy target naming its v2 `basalt_config.json` placement:
102
+ * shared server options under `server`, per-model settings merged into the
103
+ * single `models[]` entry, and shared engine flags under `engine`. The
104
+ * multi-word keys name their flag spelling in `deploy.key`; the config
105
+ * parser lowercases the key and turns `_` into `-`, so the dash form is the
106
+ * one it matches.
107
+ */
108
+ export declare const BASALT_PARAMETERS: readonly ParameterSpec[];
109
+ /**
110
+ * The Basalt model key a config carries: the string `.basalt` model path,
111
+ * falling back to an empty string so a bare config renders a plan the
112
+ * adapter fills in with the downloaded model file. A value that names a
113
+ * local artifact path passes through unchanged.
114
+ */
115
+ export declare function basaltModelKey(config: Config): string;
116
+ /**
117
+ * basaltServedName returns the model name a `.basalt` artifact answers to
118
+ * at the API: the name the serve server reports and `/v1/models` lists
119
+ * (the config entry's `alias`, stamped from here), and a request may
120
+ * equally name the artifact's own file name. The two artifacts the default
121
+ * list carries map to their published served ids, because each pack's
122
+ * stored `meta.name` is not knowable to the plugin for arbitrary files;
123
+ * any other artifact file answers to its basename, the engine's own
124
+ * file-name rule. Takes the resolved artifact file (the name or path
125
+ * `basaltModelFileName` produces); the adapter's `modelRef` and
126
+ * `renderLaunch` alias stamp both call it, so the published id and the
127
+ * served alias cannot drift apart.
128
+ */
129
+ export declare function basaltServedName(modelValue: string): string;
130
+ //# sourceMappingURL=basalt.d.ts.map
@@ -0,0 +1,304 @@
1
+ /**
2
+ * Basalt parameter surface. The declarative `ParameterSpec` data for the
3
+ * Basalt engine (https://github.com/jesdga95/basalt), sourced from the
4
+ * repository's `docs/configuration/index.md`. Basalt is a C++/CUDA engine
5
+ * for the Qwen3.8-Flash-Next and DeepSeek-V4.1-Flash MoE models,
6
+ * Blackwell-only (sm_120). Every setting lands in a v2
7
+ * `basalt_config.json` file the deploy step writes, so each spec carries a
8
+ * `config` deploy target naming where the value nests: the shared `server`
9
+ * options, the per-model settings of the single `models[]` entry, or the
10
+ * shared `engine` flags; the `BasaltAdapter` renders the file with
11
+ * `configFileFromSpecs` and passes it to `basalt serve --config`.
12
+ *
13
+ * The data is the surface; the adapter composes it into a `LaunchPlan`.
14
+ * Adding a setting here is a data edit, never an adapter rewire.
15
+ * @module dsh-plugin-local-infer/providers/engines/basalt/basalt
16
+ */
17
+ import { basename } from 'node:path';
18
+ /**
19
+ * The Hugging Face repo and file of the bundled Qwen `.basalt` artifact
20
+ * (the weights, tokenizer, chat template, drafter, vision projector, and
21
+ * default sampling all come from it), the one a bare config serves. The
22
+ * constants live in this leaf module so both the adapter and the default
23
+ * model list import them without a circular edge.
24
+ */
25
+ export const BASALT_MODEL_REPO = 'jesdga/Qwen3.8-Flash-Next-Basalt';
26
+ export const BASALT_MODEL_FILE = 'Qwen3.8-FN-NVFP4-DQ6_K.basalt';
27
+ /**
28
+ * The Hugging Face repo and file of the second `.basalt` artifact the
29
+ * engine serves: the DeepSeek-V4.1-Flash UD-IQ1_M pack the v0.3.0 release
30
+ * notes name. The registry key and the served API id ride beside them, so
31
+ * the default model list, the VRAM and preset rows, the adapter's per-
32
+ * artifact download resolution, and the entry's alias stamp all name the
33
+ * same pack from one place.
34
+ */
35
+ export const BASALT_DEEPSEEK_MODEL_REPO = 'jesdga/DeepSeek-V4.1-Flash-1017-Basalt';
36
+ export const BASALT_DEEPSEEK_MODEL_FILE = 'DeepSeek-V4.1-Flash-1017-UD-IQ1_M.basalt';
37
+ /**
38
+ * The `basalt_config.json` format version the adapter's render envelope
39
+ * stamps under the top-level `version` key. v0.3.0 refuses a file without
40
+ * the stamp as a v1 config; the adapter's envelope reads this constant, so
41
+ * the version lives beside the surface that re-blocked for it.
42
+ */
43
+ export const BASALT_CONFIG_VERSION = 2;
44
+ /**
45
+ * The loopback port the basalt serve CLI binds by default, so a config that
46
+ * names no port launches on it. The port spec's defaultValue and the adapter's
47
+ * port fallback share this one constant.
48
+ */
49
+ export const BASALT_DEFAULT_PORT = 8080;
50
+ /**
51
+ * The model id of the default registry entry a bare config names: the
52
+ * Qwen3.8-Flash-Next `.basalt` artifact the engine serves. The default
53
+ * model list, the built-in preset key, the Basalt VramModel id, and the
54
+ * adapter's plan modelId stamp all share this one constant, so every
55
+ * model-id keyed read of the engine names the same model the card's Model
56
+ * dropdown offers first.
57
+ */
58
+ export const BASALT_DEFAULT_MODEL_ID = 'qwen38-flash-next';
59
+ /**
60
+ * The registry key and served API id of the second default entry, the
61
+ * DeepSeek-V4.1-Flash UD-IQ1_M pack: `BASALT_DEEPSEEK_MODEL_ID` keys the
62
+ * default model list, the VRAM row, and the preset row, while
63
+ * `BASALT_DEEPSEEK_SERVED_MODEL_ID` is the name the adapter stamps as the
64
+ * config entry's `alias` and the registrar publishes (basaltServedName).
65
+ * The alias pins the name on `/v1/models` because the pack's stored
66
+ * `meta.name` is not known to the plugin.
67
+ */
68
+ export const BASALT_DEEPSEEK_MODEL_ID = 'deepseek-v41-flash';
69
+ export const BASALT_DEEPSEEK_SERVED_MODEL_ID = 'DeepSeek-V4.1-Flash';
70
+ /**
71
+ * The model id the serve server reports the bundled Qwen artifact under:
72
+ * the `meta.name` stored inside the `.basalt` artifact file. The adapter
73
+ * stamps it as the config entry's `alias` and the registrar publishes it
74
+ * (basaltServedName), so `/v1/models` always lists this name and the
75
+ * registry key and the file path are never advertised.
76
+ */
77
+ export const BASALT_SERVED_MODEL_ID = 'Qwen3.8-Flash-Next NVIDIA-NVFP4';
78
+ /**
79
+ * The KV cache storage formats Basalt serves, in the order the form
80
+ * dropdown lists them. `note` carries the tradeoff text the dropdown shows
81
+ * beside each choice.
82
+ */
83
+ export const BASALT_KV_OPTIONS = [
84
+ { value: 'fp16', label: 'fp16', note: 'full precision; the widest KV pool, the default' },
85
+ { value: 'int8', label: 'int8', note: 'half the bytes of fp16; the everyday long-context choice' },
86
+ {
87
+ value: 'q4_0',
88
+ label: 'q4_0',
89
+ note: '4-bit after a Hadamard rotation, half of int8 again, slightly lower precision',
90
+ },
91
+ {
92
+ value: 'k8v4',
93
+ label: 'k8v4',
94
+ note: 'K in int8, V in rotated 4-bit; 816 B per cell against int8 at 1056',
95
+ },
96
+ ];
97
+ /**
98
+ * The image-input modes. `off` reads no pictures; `dynamic` borrows
99
+ * expert-cache slots inside the engine only while it reads an image; `cpu`
100
+ * runs the encoder on the CPU (no VRAM, slow). A GPU number pins the
101
+ * encoder sidecar to that card; the combo control offers the three named
102
+ * modes and accepts a free-text GPU number.
103
+ */
104
+ export const BASALT_VISION_OPTIONS = [
105
+ { value: 'off', label: 'off', note: 'no image input; the default', source: 'engine' },
106
+ {
107
+ value: 'dynamic',
108
+ label: 'dynamic',
109
+ note: 'inside the engine; borrows expert-cache slots only while it reads an image',
110
+ source: 'engine',
111
+ },
112
+ {
113
+ value: 'cpu',
114
+ label: 'cpu',
115
+ note: 'the encoder runs on the CPU; no VRAM, slow',
116
+ source: 'engine',
117
+ },
118
+ ];
119
+ /**
120
+ * The expert-cache sizes. `auto` takes as many expert blobs as fit in the
121
+ * VRAM left after the weights, the session and the reserve; a free-text
122
+ * count pins the number of blobs. The combo control offers `auto` and
123
+ * accepts a free-text count.
124
+ */
125
+ export const BASALT_EXPERT_CACHE_OPTIONS = [
126
+ {
127
+ value: 'auto',
128
+ label: 'auto',
129
+ note: 'as many expert blobs as fit after the weights and the reserve; the default',
130
+ source: 'engine',
131
+ },
132
+ ];
133
+ /**
134
+ * The Basalt `ParameterSpec` surface, in form order. Every spec carries a
135
+ * `config` deploy target naming its v2 `basalt_config.json` placement:
136
+ * shared server options under `server`, per-model settings merged into the
137
+ * single `models[]` entry, and shared engine flags under `engine`. The
138
+ * multi-word keys name their flag spelling in `deploy.key`; the config
139
+ * parser lowercases the key and turns `_` into `-`, so the dash form is the
140
+ * one it matches.
141
+ */
142
+ export const BASALT_PARAMETERS = [
143
+ {
144
+ key: 'port',
145
+ label: 'Port',
146
+ description: 'The loopback port the engine serves its OpenAI endpoint and health check on. The registrar publishes it as the model base URL.',
147
+ // The port is a typed number, not a range strip: a 1..65535 drag slider is
148
+ // noise, so `slider: false` renders the plain number entry only.
149
+ form: { kind: 'number', min: 1, max: 65535, step: 1, slider: false },
150
+ // The port the basalt serve CLI binds by default, so the form seeds the
151
+ // value the adapter's own fallback uses when a config names no port.
152
+ defaultValue: BASALT_DEFAULT_PORT,
153
+ group: 'Engine',
154
+ deploy: { target: 'config', format: 'json', block: 'server' },
155
+ },
156
+ {
157
+ key: 'host',
158
+ label: 'Host',
159
+ description: 'The address to listen on. 127.0.0.1 serves this machine only; 0.0.0.0 also serves the network, which needs an API key.',
160
+ form: { kind: 'text', placeholder: '127.0.0.1' },
161
+ defaultValue: '127.0.0.1',
162
+ group: 'Engine',
163
+ deploy: { target: 'config', format: 'json', block: 'server' },
164
+ },
165
+ {
166
+ key: 'gpu',
167
+ label: 'GPU',
168
+ description: 'Card numbers the model shares, e.g. 0 or 0,1, or auto to take every Blackwell card. The first is the main card.',
169
+ form: { kind: 'text', placeholder: '0' },
170
+ group: 'Engine',
171
+ // Basalt is Blackwell-only: the engine is compiled for sm_120 and its
172
+ // NVFP4 expert kernels need it. A card that reports a lower SM number,
173
+ // or no card at all, cannot run it, so the error names the fix before
174
+ // the engine starts.
175
+ hardwareConstraint: (_value, hw) => {
176
+ const sm = hw.gpu?.sm ?? 0;
177
+ if (sm < 120) {
178
+ return {
179
+ ok: false,
180
+ severity: 'error',
181
+ message: `Basalt needs an NVIDIA Blackwell GPU (SM 120); this machine reports SM ${sm}.`,
182
+ };
183
+ }
184
+ return { ok: true };
185
+ },
186
+ deploy: { target: 'config', format: 'json', block: 'models[]' },
187
+ },
188
+ {
189
+ key: 'parallel',
190
+ label: 'Parallel requests',
191
+ description: 'How many requests decode at once, 1 to 8. More lanes share the model and cut per-request throughput; the max context is split across the lanes.',
192
+ form: { kind: 'number', min: 1, max: 8, step: 1, unit: 'lanes' },
193
+ defaultValue: 1,
194
+ group: 'Concurrency',
195
+ deploy: { target: 'config', format: 'json', block: 'models[]' },
196
+ },
197
+ {
198
+ key: 'vision',
199
+ label: 'Vision input',
200
+ description: 'Whether the model reads pictures. off reads none; dynamic borrows expert-cache slots only while it reads an image; cpu runs the encoder on the CPU; a GPU number pins the encoder to that card.',
201
+ form: { kind: 'combo', options: [...BASALT_VISION_OPTIONS] },
202
+ defaultValue: 'off',
203
+ group: 'Engine',
204
+ deploy: { target: 'config', format: 'json', block: 'models[]' },
205
+ },
206
+ {
207
+ key: 'model',
208
+ label: 'Model path',
209
+ description: 'The .basalt model file: the weights, tokenizer, chat template, drafter, vision projector and default sampling all come from it.',
210
+ form: { kind: 'path' },
211
+ group: 'Artifacts',
212
+ deploy: { target: 'config', format: 'json', block: 'models[]' },
213
+ },
214
+ {
215
+ key: 'kv',
216
+ label: 'KV cache format',
217
+ description: 'Quantizes the KV cache. Smaller formats fit a longer context in the same VRAM at a small quality cost.',
218
+ form: { kind: 'enum', options: [...BASALT_KV_OPTIONS] },
219
+ defaultValue: 'fp16',
220
+ group: 'Memory',
221
+ // kv stays in the top-level engine block, unlike the upstream v1-to-v2
222
+ // migration's default. A flag the model lacks stops the start in a
223
+ // model entry but is left out for that model in the engine block
224
+ // (upstream docs/configuration/models.md), so one surface serves both
225
+ // Flash-Next (takes kv) and DeepSeek-V4.1-Flash (no KV format choice).
226
+ deploy: { target: 'config', format: 'json', block: 'engine' },
227
+ },
228
+ {
229
+ key: 'maxContext',
230
+ label: 'Max context',
231
+ description: 'The longest conversation the engine accepts. Raising it reserves more VRAM for the KV cache; with parallel it is shared across the lanes.',
232
+ form: { kind: 'number', min: 256, max: 262144, step: 256, unit: 'tokens' },
233
+ defaultValue: 4096,
234
+ group: 'Memory',
235
+ deploy: { target: 'config', format: 'json', block: 'models[]', key: 'max-context' },
236
+ },
237
+ {
238
+ key: 'expertCache',
239
+ label: 'Expert cache',
240
+ description: 'How many expert blobs stay in VRAM. auto takes as many as fit after the weights and the reserve; a count pins the number.',
241
+ form: { kind: 'combo', options: [...BASALT_EXPERT_CACHE_OPTIONS] },
242
+ defaultValue: 'auto',
243
+ group: 'Memory',
244
+ deploy: { target: 'config', format: 'json', block: 'engine', key: 'expert-cache' },
245
+ },
246
+ {
247
+ key: 'prefill',
248
+ label: 'Prefill chunk',
249
+ description: 'The prompt is read in batched chunks of this many tokens. auto takes the largest chunk the expert cache can lend; a number pins the chunk size.',
250
+ form: { kind: 'text', placeholder: 'auto' },
251
+ defaultValue: 'auto',
252
+ group: 'Engine',
253
+ deploy: { target: 'config', format: 'json', block: 'engine' },
254
+ },
255
+ {
256
+ key: 'residentExperts',
257
+ label: 'Resident experts',
258
+ description: 'Keeps the experts the GPU does not hold in page-locked RAM, so none is read from the file again. Off falls back to a plain file mapping.',
259
+ form: { kind: 'boolean' },
260
+ defaultValue: true,
261
+ group: 'Memory',
262
+ deploy: { target: 'config', format: 'json', block: 'engine', key: 'resident-experts' },
263
+ },
264
+ {
265
+ key: 'spec',
266
+ label: 'Speculation',
267
+ description: 'The drafter proposes tokens and the model verifies windows of at most this many. 0 or 1 turns speculation off; the default is 8 with a drafter.',
268
+ form: { kind: 'number', min: 0, max: 16, step: 1, unit: 'tokens' },
269
+ defaultValue: 8,
270
+ group: 'Engine',
271
+ deploy: { target: 'config', format: 'json', block: 'engine' },
272
+ },
273
+ ];
274
+ /**
275
+ * The Basalt model key a config carries: the string `.basalt` model path,
276
+ * falling back to an empty string so a bare config renders a plan the
277
+ * adapter fills in with the downloaded model file. A value that names a
278
+ * local artifact path passes through unchanged.
279
+ */
280
+ export function basaltModelKey(config) {
281
+ return typeof config.model === 'string' ? config.model : '';
282
+ }
283
+ /**
284
+ * basaltServedName returns the model name a `.basalt` artifact answers to
285
+ * at the API: the name the serve server reports and `/v1/models` lists
286
+ * (the config entry's `alias`, stamped from here), and a request may
287
+ * equally name the artifact's own file name. The two artifacts the default
288
+ * list carries map to their published served ids, because each pack's
289
+ * stored `meta.name` is not knowable to the plugin for arbitrary files;
290
+ * any other artifact file answers to its basename, the engine's own
291
+ * file-name rule. Takes the resolved artifact file (the name or path
292
+ * `basaltModelFileName` produces); the adapter's `modelRef` and
293
+ * `renderLaunch` alias stamp both call it, so the published id and the
294
+ * served alias cannot drift apart.
295
+ */
296
+ export function basaltServedName(modelValue) {
297
+ const file = basename(modelValue);
298
+ if (file === BASALT_MODEL_FILE)
299
+ return BASALT_SERVED_MODEL_ID;
300
+ if (file === BASALT_DEEPSEEK_MODEL_FILE)
301
+ return BASALT_DEEPSEEK_SERVED_MODEL_ID;
302
+ return file;
303
+ }
304
+ //# sourceMappingURL=basalt.js.map
@@ -0,0 +1,85 @@
1
+ /**
2
+ * The Basalt engine adapter. BasaltAdapter is the Basalt engine (the
3
+ * C++/CUDA serve/ server for the Qwen3.8-Flash-Next and DeepSeek-V4.1-Flash
4
+ * MoE models, Blackwell-only).
5
+ * `renderLaunch` renders a `basalt serve --config --engine-bin` process
6
+ * plan: the binary name comes from the host OS profile, every setting and
7
+ * the served model land in the `basalt_config.json` the plan's `configFile`
8
+ * carries (the spec surface rendered with `configFileFromSpecs` into the
9
+ * versioned v2 envelope the 0.3.0 serve CLI accepts), and the argv carries
10
+ * the CLI-only `--engine-bin` flag, so it stays fixed no matter how many
11
+ * settings the form offers. `deploy` builds the engine in the checkout (the
12
+ * acquisition build steps), downloads the `.basalt` model into the model
13
+ * directory, stamps the artifact path into the config entry, writes the
14
+ * config file, and spawns the serve command.
15
+ * `healthCheck` polls the health URL and reports the start phase from the
16
+ * tracked process output. `stop` signals the tracked process.
17
+ * @module dsh-plugin-local-infer/providers/engines/basalt/basaltAdapter
18
+ */
19
+ import { EngineAdapter } from '../../../../core/lib/index.js';
20
+ import type { CommandLogger, Config, DeployOptions, DeployResult, EngineLaunchSignature, EnginePlatformConfig, HealthCheckOptions, HealthResult, HardwareProfile, LaunchPlan, LaunchProgress, LifecycleHost, ParameterSpec } from '../../../../core/lib/index.js';
21
+ export { BASALT_MODEL_FILE, BASALT_MODEL_REPO } from './basalt.ts';
22
+ /**
23
+ * The config file name the deploy step writes. It lands in the plugin's
24
+ * config cache home in the per-engine subdirectory (Basalt takes the path
25
+ * via `--config`, so it carries no placement requirement of its own), never
26
+ * the model directory, the hub cache, or the engine checkout.
27
+ */
28
+ export declare const BASALT_CONFIG_FILE = "basalt_config.json";
29
+ /**
30
+ * BasaltAdapter is the Basalt engine. `renderLaunch` renders a
31
+ * `basalt serve --config --engine-bin` process plan (the settings and the
32
+ * served model ride the versioned config file; the argv carries the CLI-only
33
+ * `--engine-bin` flag); `deploy` builds the engine, downloads the model,
34
+ * stamps the artifact path into the config entry, writes the config file,
35
+ * and spawns the serve command; `healthCheck` polls the health URL and
36
+ * reports the start phase from the tracked process output; `stop` signals
37
+ * the tracked process.
38
+ */
39
+ export declare class BasaltAdapter extends EngineAdapter {
40
+ readonly id = "basalt";
41
+ readonly supports: {
42
+ docker: boolean;
43
+ local: boolean;
44
+ };
45
+ private readonly host;
46
+ private readonly children;
47
+ constructor(host?: LifecycleHost);
48
+ parameters(): readonly ParameterSpec[];
49
+ modelRef(config: Config): {
50
+ id: string;
51
+ name: string;
52
+ };
53
+ modelInput(config: Config): string[];
54
+ launchSignature(config?: Config): EngineLaunchSignature;
55
+ renderLaunch(config: Config, _hw: HardwareProfile): LaunchPlan;
56
+ deploy(plan: LaunchPlan, platform?: EnginePlatformConfig, onProgress?: LaunchProgress, options?: DeployOptions): Promise<DeployResult>;
57
+ /**
58
+ * ensureModelArtifact downloads the `.basalt` model file named by the
59
+ * resolved download source (its repo URL plus artifact file) into the
60
+ * model directory and resolves the concrete path the engine serves. A
61
+ * model the Get-steps routine already downloaded is on disk, so the
62
+ * re-fetch is skipped; presence is the deterministic snapshot check
63
+ * (modelArtifactPresent), so a blob-only cache left by an interrupted
64
+ * download re-runs the cheap hf download (the CLI reuses the blobs and
65
+ * writes the snapshot links) instead of dead-ending on the later lookup.
66
+ * With the hub-cache layout the concrete path is the content-addressed
67
+ * snapshot path (only known after the download); with the flat layout it
68
+ * is the flat join. Returns the path, or a detail when the download fails
69
+ * or leaves no snapshot.
70
+ */
71
+ private ensureModelArtifact;
72
+ /**
73
+ * writeConfigFile writes the config file the plan names, so the engine's
74
+ * --config flag points at a path that exists. renderLaunch renders the
75
+ * path absolute under the plugin's config cache home, and the host's
76
+ * writeFile mkdirs the parent before writing. Returns a failure detail (a
77
+ * host that cannot write files, a test stub) or null when the write
78
+ * succeeded or the plan names no config file.
79
+ */
80
+ private writeConfigFile;
81
+ healthCheck(plan: LaunchPlan, options?: HealthCheckOptions): Promise<HealthResult>;
82
+ stop(plan: LaunchPlan, log?: CommandLogger): Promise<void>;
83
+ private port;
84
+ }
85
+ //# sourceMappingURL=basaltAdapter.d.ts.map