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,17 @@
1
+ /**
2
+ * The llama.cpp shared Linux build profile. Every Linux distro (Arch, Debian,
3
+ * Fedora) builds llama.cpp through this one route: cmake with the Ninja
4
+ * generator into the `build` directory, which is where the `llama-server`
5
+ * binary lands. The distro profiles reuse this profile, so a distro carries no
6
+ * build steps of its own.
7
+ * @module dsh-plugin-local-infer/providers/engines/llamacpp/llamacppLinux
8
+ */
9
+ import type { EngineOsProfile } from '../engineOs.ts';
10
+ export declare const LLAMACPP_LINUX: EngineOsProfile;
11
+ /**
12
+ * llamacppLinuxBinary returns the llama.cpp engine binary name on Linux: the
13
+ * plain `llama-server` (no .exe). The name comes from the shared Linux
14
+ * profile, so the spelling has one home.
15
+ */
16
+ export declare function llamacppLinuxBinary(): string;
17
+ //# sourceMappingURL=llamacppLinux.d.ts.map
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The llama.cpp shared Linux build profile. Every Linux distro (Arch, Debian,
3
+ * Fedora) builds llama.cpp through this one route: cmake with the Ninja
4
+ * generator into the `build` directory, which is where the `llama-server`
5
+ * binary lands. The distro profiles reuse this profile, so a distro carries no
6
+ * build steps of its own.
7
+ * @module dsh-plugin-local-infer/providers/engines/llamacpp/llamacppLinux
8
+ */
9
+ import { SYSTEM_DEPS } from "../../systemDeps.js";
10
+ export const LLAMACPP_LINUX = {
11
+ buildSteps: [
12
+ 'cmake -S {dir} -B {dir}/build -G Ninja -DCMAKE_BUILD_TYPE=Release && cmake --build {dir}/build -j',
13
+ ],
14
+ buildDir: 'build',
15
+ binary: 'llama-server',
16
+ // The llama.cpp local build is a thin cmake route: the compiler and the hf
17
+ // CLI to download the model.
18
+ deps: [SYSTEM_DEPS.cmake, SYSTEM_DEPS.hfCli],
19
+ };
20
+ /**
21
+ * llamacppLinuxBinary returns the llama.cpp engine binary name on Linux: the
22
+ * plain `llama-server` (no .exe). The name comes from the shared Linux
23
+ * profile, so the spelling has one home.
24
+ */
25
+ export function llamacppLinuxBinary() {
26
+ return LLAMACPP_LINUX.binary ?? 'llama-server';
27
+ }
28
+ //# sourceMappingURL=llamacppLinux.js.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The llama.cpp macOS build profile. macOS builds llama.cpp through the same
3
+ * cmake route as Linux, so this profile reuses the shared Linux build steps
4
+ * and build directory; the binary keeps its plain name (no .exe on macOS).
5
+ * @module dsh-plugin-local-infer/providers/engines/llamacpp/llamacppMacOS
6
+ */
7
+ import type { EngineOsProfile } from '../engineOs.ts';
8
+ export declare const LLAMACPP_MACOS: EngineOsProfile;
9
+ /**
10
+ * llamacppMacOSBinary returns the llama.cpp engine binary name on macOS: the
11
+ * plain `llama-server` (no .exe on macOS). The name comes from the shared
12
+ * Linux profile the macOS profile reuses, so the spelling has one home.
13
+ */
14
+ export declare function llamacppMacOSBinary(): string;
15
+ //# sourceMappingURL=llamacppMacOS.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The llama.cpp macOS build profile. macOS builds llama.cpp through the same
3
+ * cmake route as Linux, so this profile reuses the shared Linux build steps
4
+ * and build directory; the binary keeps its plain name (no .exe on macOS).
5
+ * @module dsh-plugin-local-infer/providers/engines/llamacpp/llamacppMacOS
6
+ */
7
+ import { LLAMACPP_LINUX } from "./llamacppLinux.js";
8
+ export const LLAMACPP_MACOS = LLAMACPP_LINUX;
9
+ /**
10
+ * llamacppMacOSBinary returns the llama.cpp engine binary name on macOS: the
11
+ * plain `llama-server` (no .exe on macOS). The name comes from the shared
12
+ * Linux profile the macOS profile reuses, so the spelling has one home.
13
+ */
14
+ export function llamacppMacOSBinary() {
15
+ return LLAMACPP_MACOS.binary ?? 'llama-server';
16
+ }
17
+ //# sourceMappingURL=llamacppMacOS.js.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The llama.cpp Windows build profile. llama.cpp carries no dedicated Windows
3
+ * build route, so a Windows host reads the shared Linux cmake steps and build
4
+ * directory; the binary is the .exe.
5
+ * @module dsh-plugin-local-infer/providers/engines/llamacpp/llamacppWindows
6
+ */
7
+ import type { EngineOsProfile } from '../engineOs.ts';
8
+ export declare const LLAMACPP_WINDOWS: EngineOsProfile;
9
+ /**
10
+ * llamacppWindowsBinary returns the llama.cpp engine binary name on Windows:
11
+ * the `llama-server.exe` the Windows build leaves in the build tree. The name
12
+ * comes from the Windows profile, so the .exe spelling has one home.
13
+ */
14
+ export declare function llamacppWindowsBinary(): string;
15
+ //# sourceMappingURL=llamacppWindows.d.ts.map
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The llama.cpp Windows build profile. llama.cpp carries no dedicated Windows
3
+ * build route, so a Windows host reads the shared Linux cmake steps and build
4
+ * directory; the binary is the .exe.
5
+ * @module dsh-plugin-local-infer/providers/engines/llamacpp/llamacppWindows
6
+ */
7
+ import { LLAMACPP_LINUX } from "./llamacppLinux.js";
8
+ import { SYSTEM_DEPS } from "../../systemDeps.js";
9
+ export const LLAMACPP_WINDOWS = {
10
+ buildSteps: LLAMACPP_LINUX.buildSteps,
11
+ buildDir: 'build',
12
+ binary: 'llama-server.exe',
13
+ // llama.cpp carries no dedicated Windows build route, so a Windows host
14
+ // reads the shared Linux cmake steps; the local build deps are the same thin
15
+ // cmake-plus-hf list.
16
+ deps: [SYSTEM_DEPS.cmake, SYSTEM_DEPS.hfCli],
17
+ };
18
+ /**
19
+ * llamacppWindowsBinary returns the llama.cpp engine binary name on Windows:
20
+ * the `llama-server.exe` the Windows build leaves in the build tree. The name
21
+ * comes from the Windows profile, so the .exe spelling has one home.
22
+ */
23
+ export function llamacppWindowsBinary() {
24
+ return LLAMACPP_WINDOWS.binary ?? 'llama-server.exe';
25
+ }
26
+ //# sourceMappingURL=llamacppWindows.js.map
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * The data is the surface; the `NInferAdapter` (Phase 5) composes it into a
9
9
  * `LaunchPlan`. Adding a flag here is a data edit, never a core rewire.
10
- * @module dsh-plugin-local-infer/providers/ninfer
10
+ * @module dsh-plugin-local-infer/providers/engines/ninfer/ninfer
11
11
  */
12
12
  import type { ComboOption, EnumOption, ParameterSpec } from 'dsh-plugin-local-infer/core';
13
13
  /**
@@ -53,4 +53,4 @@ export declare const LM_HEAD_DRAFT_GATE_MESSAGE = "LM-head draft is only availab
53
53
  * the field is disabled.
54
54
  */
55
55
  export declare const NINFER_PARAMETERS: readonly ParameterSpec[];
56
- //# sourceMappingURL=ninfer.d.ts.map
56
+ //# sourceMappingURL=ninfer.d.ts.map
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * The data is the surface; the `NInferAdapter` (Phase 5) composes it into a
9
9
  * `LaunchPlan`. Adding a flag here is a data edit, never a core rewire.
10
- * @module dsh-plugin-local-infer/providers/ninfer
10
+ * @module dsh-plugin-local-infer/providers/engines/ninfer/ninfer
11
11
  */
12
12
  /**
13
13
  * The KV cache quantization formats NInfer serves, in the order the form
@@ -94,6 +94,7 @@ export const NINFER_PARAMETERS = [
94
94
  // The port contributes no flag of its own: renderLaunch spells the local
95
95
  // `--port` and the docker host-port mapping from this value, and the
96
96
  // health URL and container name derive from it too.
97
+ deploy: { target: 'cli' },
97
98
  },
98
99
  {
99
100
  key: 'kvDtype',
@@ -115,6 +116,7 @@ export const NINFER_PARAMETERS = [
115
116
  return { ok: true };
116
117
  },
117
118
  toArgv: (value) => ['--kv-dtype', String(value)],
119
+ deploy: { target: 'cli' },
118
120
  },
119
121
  {
120
122
  key: 'maxContext',
@@ -124,6 +126,7 @@ export const NINFER_PARAMETERS = [
124
126
  defaultValue: 32768,
125
127
  group: 'Memory',
126
128
  toArgv: (value) => ['--max-context', String(value)],
129
+ deploy: { target: 'cli' },
127
130
  },
128
131
  {
129
132
  key: 'kvCapacity',
@@ -142,6 +145,7 @@ export const NINFER_PARAMETERS = [
142
145
  },
143
146
  group: 'Memory',
144
147
  toArgv: (value) => ['--kv-capacity', String(value)],
148
+ deploy: { target: 'cli' },
145
149
  },
146
150
  {
147
151
  key: 'hostKvMib',
@@ -159,6 +163,7 @@ export const NINFER_PARAMETERS = [
159
163
  },
160
164
  group: 'Memory',
161
165
  toArgv: (value) => ['--host-kv-mib', String(value)],
166
+ deploy: { target: 'cli' },
162
167
  },
163
168
  {
164
169
  key: 'hostStateSlots',
@@ -167,6 +172,7 @@ export const NINFER_PARAMETERS = [
167
172
  form: { kind: 'number', min: 0, step: 1, unit: 'slots' },
168
173
  group: 'Memory',
169
174
  toArgv: (value) => ['--host-state-slots', String(value)],
175
+ deploy: { target: 'cli' },
170
176
  },
171
177
  {
172
178
  key: 'mediaLiveMib',
@@ -175,6 +181,7 @@ export const NINFER_PARAMETERS = [
175
181
  form: { kind: 'number', min: 0, step: 1024, unit: 'MiB' },
176
182
  group: 'Memory',
177
183
  toArgv: (value) => ['--media-live-mib', String(value)],
184
+ deploy: { target: 'cli' },
178
185
  },
179
186
  {
180
187
  key: 'gdnStateFp16',
@@ -184,6 +191,7 @@ export const NINFER_PARAMETERS = [
184
191
  defaultValue: false,
185
192
  group: 'Memory',
186
193
  toArgv: (value) => (value === true ? ['--gdn-state-fp16'] : []),
194
+ deploy: { target: 'cli' },
187
195
  },
188
196
  {
189
197
  key: 'maxConcurrency',
@@ -193,6 +201,7 @@ export const NINFER_PARAMETERS = [
193
201
  defaultValue: 1,
194
202
  group: 'Concurrency',
195
203
  toArgv: (value) => ['--max-concurrency', String(value)],
204
+ deploy: { target: 'cli' },
196
205
  },
197
206
  {
198
207
  key: 'spec',
@@ -202,6 +211,7 @@ export const NINFER_PARAMETERS = [
202
211
  defaultValue: 'none',
203
212
  group: 'Speculation',
204
213
  toArgv: (value) => (value === 'none' ? [] : ['--spec', String(value)]),
214
+ deploy: { target: 'cli' },
205
215
  },
206
216
  {
207
217
  key: 'draftTokens',
@@ -212,16 +222,18 @@ export const NINFER_PARAMETERS = [
212
222
  group: 'Speculation',
213
223
  requires: (config) => config.spec && config.spec !== 'none' ? null : SPEC_GATE_MESSAGE,
214
224
  toArgv: (value) => ['--draft-tokens', String(value)],
225
+ deploy: { target: 'cli' },
215
226
  },
216
227
  {
217
228
  key: 'lmHeadDraft',
218
229
  label: 'LM-head draft',
219
- description: 'Drafts from the small proposal head instead of the full output head, cutting the per-draft projection cost. An MTP-backend feature, so the field unlocks only while MTP is selected.',
230
+ description: 'Drafts from the small proposal head instead of the full output head, cutting the per-draft projection cost.',
220
231
  form: { kind: 'boolean' },
221
232
  defaultValue: false,
222
233
  group: 'Speculation',
223
234
  requires: (config) => config.spec === 'mtp' ? null : LM_HEAD_DRAFT_GATE_MESSAGE,
224
235
  toArgv: (value) => (value === true ? ['--lm-head-draft'] : []),
236
+ deploy: { target: 'cli' },
225
237
  },
226
238
  {
227
239
  key: 'temperature',
@@ -231,6 +243,7 @@ export const NINFER_PARAMETERS = [
231
243
  defaultValue: 0.9,
232
244
  group: 'Sampling',
233
245
  toArgv: (value) => ['--temperature', String(value)],
246
+ deploy: { target: 'cli' },
234
247
  },
235
248
  {
236
249
  key: 'minP',
@@ -240,6 +253,7 @@ export const NINFER_PARAMETERS = [
240
253
  defaultValue: 0.05,
241
254
  group: 'Sampling',
242
255
  toArgv: (value) => ['--min-p', String(value)],
256
+ deploy: { target: 'cli' },
243
257
  },
244
258
  {
245
259
  key: 'defaultMaxTokens',
@@ -264,6 +278,7 @@ export const NINFER_PARAMETERS = [
264
278
  },
265
279
  group: 'Sampling',
266
280
  toArgv: (value) => ['--default-max-tokens', String(value)],
281
+ deploy: { target: 'cli' },
267
282
  },
268
283
  {
269
284
  key: 'defaultThinkingBudget',
@@ -272,6 +287,7 @@ export const NINFER_PARAMETERS = [
272
287
  form: { kind: 'number', min: 0, step: 1, unit: 'tokens' },
273
288
  group: 'Sampling',
274
289
  toArgv: (value) => ['--default-thinking-budget', String(value)],
290
+ deploy: { target: 'cli' },
275
291
  },
276
292
  {
277
293
  key: 'preserveThinking',
@@ -281,6 +297,7 @@ export const NINFER_PARAMETERS = [
281
297
  defaultValue: false,
282
298
  group: 'Sampling',
283
299
  toArgv: (value) => (value === true ? ['--preserve-thinking'] : []),
300
+ deploy: { target: 'cli' },
284
301
  },
285
302
  {
286
303
  key: 'prefillChunk',
@@ -310,6 +327,7 @@ export const NINFER_PARAMETERS = [
310
327
  },
311
328
  group: 'Engine',
312
329
  toArgv: (value) => ['--prefill-chunk', String(value)],
330
+ deploy: { target: 'cli' },
313
331
  },
314
332
  {
315
333
  key: 'vision',
@@ -319,6 +337,7 @@ export const NINFER_PARAMETERS = [
319
337
  defaultValue: false,
320
338
  group: 'Engine',
321
339
  toArgv: (value) => (value === true ? ['--vision'] : []),
340
+ deploy: { target: 'cli' },
322
341
  },
323
342
  {
324
343
  key: 'structuredOutput',
@@ -328,6 +347,7 @@ export const NINFER_PARAMETERS = [
328
347
  defaultValue: false,
329
348
  group: 'Engine',
330
349
  toArgv: (value) => (value === true ? ['--structured-output'] : []),
350
+ deploy: { target: 'cli' },
331
351
  },
332
352
  {
333
353
  key: 'deviceProfile',
@@ -337,6 +357,7 @@ export const NINFER_PARAMETERS = [
337
357
  defaultValue: 'auto',
338
358
  group: 'Engine',
339
359
  toArgv: (value) => (value === 'auto' ? [] : ['--device-profile', String(value)]),
360
+ deploy: { target: 'cli' },
340
361
  },
341
362
  {
342
363
  key: 'chatTemplate',
@@ -345,6 +366,7 @@ export const NINFER_PARAMETERS = [
345
366
  form: { kind: 'combo', options: [...CHAT_TEMPLATE_OPTIONS] },
346
367
  group: 'Engine',
347
368
  toArgv: (value) => (value ? ['--chat-template', String(value)] : []),
369
+ deploy: { target: 'cli' },
348
370
  },
349
371
  ];
350
- //# sourceMappingURL=ninfer.js.map
372
+ //# sourceMappingURL=ninfer.js.map
@@ -0,0 +1,81 @@
1
+ /**
2
+ * The NInfer engine adapter. NInferModelArtifact is the per-model deploy data:
3
+ * the `.ninfer` artifact file, the Hugging Face repo the model download pulls
4
+ * it from, and the `--model-id` alias the server advertises. The data is the
5
+ * surface; adding a model is a data edit here, never an adapter rewire.
6
+ * NInferAdapter is the canonical both-capable engine. `renderLaunch` renders a
7
+ * local `ninfer-serve` process or a `docker run` of the ghcr image from the
8
+ * same spec surface; `deploy` builds the engine in the engine directory (or
9
+ * pulls the image), downloads the model into the model directory, and starts
10
+ * the engine; `healthCheck` polls the health URL; `stop` signals the tracked
11
+ * process and stops the named container.
12
+ * @module dsh-plugin-local-infer/providers/engines/ninfer/ninferAdapter
13
+ */
14
+ import { EngineAdapter } from '../../../../core/lib/index.js';
15
+ import type { CommandLogger, Config, DeployOptions, DeployResult, EngineLaunchSignature, EnginePlatformConfig, HealthCheckOptions, HealthResult, HardwareProfile, LaunchPlan, LaunchProgress, LifecycleHost, ParameterSpec } from '../../../../core/lib/index.js';
16
+ /**
17
+ * NInferModelArtifact is the per-model deploy data: the `.ninfer` artifact
18
+ * file, the Hugging Face repo the model download pulls it from, and the
19
+ * `--model-id` alias the server advertises. The data is the surface; adding a
20
+ * model is a data edit here, never an adapter rewire.
21
+ */
22
+ export interface NInferModelArtifact {
23
+ file: string;
24
+ repo: string;
25
+ modelId: string;
26
+ }
27
+ /**
28
+ * The NInfer model artifacts, keyed by the model registry id. The 27B entry
29
+ * is the default the DEFAULT_MODELS list names; the 35B-A3B entries are the
30
+ * Qwen3.8 measured artifact (`qwen3-35b`) and the Qwen3.6 default
31
+ * (`qwen36-35b`).
32
+ */
33
+ export declare const NINFER_MODEL_ARTIFACTS: Record<string, NInferModelArtifact>;
34
+ /**
35
+ * The NInfer docker image the adapter pulls and runs. The engineFork platform
36
+ * config overrides the git source for a local build; the image stays the
37
+ * upstream ghcr artifact.
38
+ */
39
+ export declare const NINFER_DOCKER_IMAGE = "ghcr.io/iamwavecut/ninfer-all";
40
+ /**
41
+ * NInferAdapter is the canonical both-capable engine. `renderLaunch` renders a
42
+ * local `ninfer-serve` process or a `docker run` of the ghcr image from the
43
+ * same spec surface; `deploy` builds the engine in the engine directory (or
44
+ * pulls the image), downloads the model into the model directory, and starts
45
+ * the engine; `healthCheck` polls the health URL; `stop` signals the tracked
46
+ * process and stops the named container.
47
+ */
48
+ export declare class NInferAdapter extends EngineAdapter {
49
+ readonly id = "ninfer";
50
+ readonly supports: {
51
+ docker: boolean;
52
+ local: boolean;
53
+ };
54
+ private readonly host;
55
+ private readonly children;
56
+ constructor(host?: LifecycleHost);
57
+ parameters(): readonly ParameterSpec[];
58
+ modelRef(config: Config): {
59
+ id: string;
60
+ name: string;
61
+ };
62
+ launchSignature(config?: Config): EngineLaunchSignature;
63
+ renderLaunch(config: Config, _hw: HardwareProfile): LaunchPlan;
64
+ deploy(plan: LaunchPlan, platform?: EnginePlatformConfig, onProgress?: LaunchProgress, options?: DeployOptions): Promise<DeployResult>;
65
+ healthCheck(plan: LaunchPlan, options?: HealthCheckOptions): Promise<HealthResult>;
66
+ stop(plan: LaunchPlan, log?: CommandLogger): Promise<void>;
67
+ private buildMode;
68
+ private port;
69
+ private downloadModel;
70
+ /**
71
+ * resolveChatTemplate rewrites a --chat-template flag that carries an HF repo
72
+ * reference into the local file the engine reads. A value with a slash that
73
+ * is not an absolute path (the combo control's known choices) is a repo the
74
+ * deploy step downloads into the model directory; an already-local path is
75
+ * left as-is. The download is best-effort: a template that is already on
76
+ * disk is used without a re-fetch, and a missing hf CLI leaves the flag
77
+ * untouched so the engine reports the missing template itself.
78
+ */
79
+ private resolveChatTemplate;
80
+ }
81
+ //# sourceMappingURL=ninferAdapter.d.ts.map