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.
- package/README.md +32 -6
- package/cordis.patch.yml +7 -0
- package/docs/zh/README.md +24 -4
- package/dsh/client.js +4200 -4049
- package/package.json +33 -11
- package/packages/core/lib/adapter.d.ts +177 -11
- package/packages/core/lib/adapter.js +74 -1
- package/packages/core/lib/config.d.ts +1 -1
- package/packages/core/lib/config.js +1 -1
- package/packages/core/lib/debug.d.ts +1 -1
- package/packages/core/lib/debug.js +1 -1
- package/packages/core/lib/defaults.d.ts +1 -1
- package/packages/core/lib/defaults.js +1 -1
- package/packages/core/lib/deps.d.ts +48 -20
- package/packages/core/lib/deps.js +24 -8
- package/packages/core/lib/estimator.d.ts +1 -1
- package/packages/core/lib/estimator.js +1 -1
- package/packages/core/lib/guideline.d.ts +1 -1
- package/packages/core/lib/guideline.js +1 -1
- package/packages/core/lib/hardware.d.ts +1 -1
- package/packages/core/lib/hardware.js +1 -1
- package/packages/core/lib/hf-cache.d.ts +70 -0
- package/packages/core/lib/hf-cache.js +83 -0
- package/packages/core/lib/index.d.ts +16 -9
- package/packages/core/lib/index.js +10 -6
- package/packages/core/lib/infer-cache.d.ts +39 -0
- package/packages/core/lib/infer-cache.js +53 -0
- package/packages/core/lib/launch-command.d.ts +8 -4
- package/packages/core/lib/launch-command.js +13 -6
- package/packages/core/lib/launch-record.d.ts +1 -1
- package/packages/core/lib/launch-record.js +1 -1
- package/packages/core/lib/logs.d.ts +8 -1
- package/packages/core/lib/logs.js +12 -4
- package/packages/core/lib/models.d.ts +120 -14
- package/packages/core/lib/models.js +209 -17
- package/packages/core/lib/parameter.d.ts +31 -3
- package/packages/core/lib/parameter.js +1 -1
- package/packages/core/lib/progress.d.ts +54 -0
- package/packages/core/lib/progress.js +120 -0
- package/packages/core/lib/registrar.d.ts +25 -14
- package/packages/core/lib/registrar.js +30 -10
- package/packages/core/lib/reserve.d.ts +11 -3
- package/packages/core/lib/reserve.js +6 -4
- package/packages/core/lib/status.d.ts +12 -6
- package/packages/core/lib/status.js +21 -10
- package/packages/core/lib/sudo.d.ts +80 -0
- package/packages/core/lib/sudo.js +78 -0
- package/packages/core/package.json +1 -1
- package/packages/orchestrator/lib/config.d.ts +63 -0
- package/packages/orchestrator/lib/config.js +111 -0
- package/packages/orchestrator/lib/index.d.ts +51 -0
- package/packages/orchestrator/lib/index.js +73 -0
- package/packages/orchestrator/lib/route.d.ts +60 -0
- package/packages/orchestrator/lib/route.js +159 -0
- package/packages/orchestrator/locale/en.json +6 -0
- package/packages/orchestrator/package.json +39 -0
- package/packages/orchestrator/prompt.md +87 -0
- package/packages/providers/lib/acquire.d.ts +95 -15
- package/packages/providers/lib/acquire.js +239 -40
- package/packages/providers/lib/adapters.d.ts +155 -221
- package/packages/providers/lib/adapters.js +589 -935
- package/packages/providers/lib/debug.d.ts +1 -1
- package/packages/providers/lib/debug.js +1 -1
- package/packages/providers/lib/deps.d.ts +31 -212
- package/packages/providers/lib/deps.js +71 -205
- package/packages/providers/lib/engines/basalt/basalt.d.ts +130 -0
- package/packages/providers/lib/engines/basalt/basalt.js +304 -0
- package/packages/providers/lib/engines/basalt/basaltAdapter.d.ts +85 -0
- package/packages/providers/lib/engines/basalt/basaltAdapter.js +439 -0
- package/packages/providers/lib/engines/basalt/basaltLinux.d.ts +23 -0
- package/packages/providers/lib/engines/basalt/basaltLinux.js +47 -0
- package/packages/providers/lib/engines/basalt/basaltMacOS.d.ts +17 -0
- package/packages/providers/lib/engines/basalt/basaltMacOS.js +19 -0
- package/packages/providers/lib/engines/basalt/basaltWindows.d.ts +24 -0
- package/packages/providers/lib/engines/basalt/basaltWindows.js +49 -0
- package/packages/providers/lib/engines/engineOs.d.ts +24 -0
- package/packages/providers/lib/engines/engineOs.js +17 -0
- package/packages/providers/lib/{hyperqwen.d.ts → engines/hyperqwen/hyperqwen.d.ts} +2 -2
- package/packages/providers/lib/{hyperqwen.js → engines/hyperqwen/hyperqwen.js} +14 -2
- package/packages/providers/lib/engines/hyperqwen/hyperqwenAdapter.d.ts +38 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenAdapter.js +115 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenArch.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenArch.js +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenDebian.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenDebian.js +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenFedora.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenFedora.js +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenLinux.d.ts +10 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenLinux.js +14 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenMacOS.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenMacOS.js +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenWindows.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenWindows.js +9 -0
- package/packages/providers/lib/{infernix.d.ts → engines/infernix/infernix.d.ts} +7 -4
- package/packages/providers/lib/{infernix.js → engines/infernix/infernix.js} +53 -8
- package/packages/providers/lib/engines/infernix/infernixAdapter.d.ts +52 -0
- package/packages/providers/lib/engines/infernix/infernixAdapter.js +235 -0
- package/packages/providers/lib/engines/infernix/infernixArch.d.ts +9 -0
- package/packages/providers/lib/engines/infernix/infernixArch.js +9 -0
- package/packages/providers/lib/engines/infernix/infernixDebian.d.ts +9 -0
- package/packages/providers/lib/engines/infernix/infernixDebian.js +9 -0
- package/packages/providers/lib/engines/infernix/infernixFedora.d.ts +9 -0
- package/packages/providers/lib/engines/infernix/infernixFedora.js +9 -0
- package/packages/providers/lib/engines/infernix/infernixLinux.d.ts +17 -0
- package/packages/providers/lib/engines/infernix/infernixLinux.js +35 -0
- package/packages/providers/lib/engines/infernix/infernixMacOS.d.ts +16 -0
- package/packages/providers/lib/engines/infernix/infernixMacOS.js +18 -0
- package/packages/providers/lib/engines/infernix/infernixWindows.d.ts +16 -0
- package/packages/providers/lib/engines/infernix/infernixWindows.js +34 -0
- package/packages/providers/lib/{llamacpp.d.ts → engines/llamacpp/llamacpp.d.ts} +2 -2
- package/packages/providers/lib/{llamacpp.js → engines/llamacpp/llamacpp.js} +12 -2
- package/packages/providers/lib/engines/llamacpp/llamacppAdapter.d.ts +50 -0
- package/packages/providers/lib/engines/llamacpp/llamacppAdapter.js +274 -0
- package/packages/providers/lib/engines/llamacpp/llamacppArch.d.ts +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppArch.js +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppDebian.d.ts +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppDebian.js +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppFedora.d.ts +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppFedora.js +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppLinux.d.ts +17 -0
- package/packages/providers/lib/engines/llamacpp/llamacppLinux.js +28 -0
- package/packages/providers/lib/engines/llamacpp/llamacppMacOS.d.ts +15 -0
- package/packages/providers/lib/engines/llamacpp/llamacppMacOS.js +17 -0
- package/packages/providers/lib/engines/llamacpp/llamacppWindows.d.ts +15 -0
- package/packages/providers/lib/engines/llamacpp/llamacppWindows.js +26 -0
- package/packages/providers/lib/{ninfer.d.ts → engines/ninfer/ninfer.d.ts} +2 -2
- package/packages/providers/lib/{ninfer.js → engines/ninfer/ninfer.js} +25 -3
- package/packages/providers/lib/engines/ninfer/ninferAdapter.d.ts +81 -0
- package/packages/providers/lib/engines/ninfer/ninferAdapter.js +392 -0
- package/packages/providers/lib/engines/ninfer/ninferArch.d.ts +9 -0
- package/packages/providers/lib/engines/ninfer/ninferArch.js +9 -0
- package/packages/providers/lib/engines/ninfer/ninferDebian.d.ts +9 -0
- package/packages/providers/lib/engines/ninfer/ninferDebian.js +9 -0
- package/packages/providers/lib/engines/ninfer/ninferFedora.d.ts +9 -0
- package/packages/providers/lib/engines/ninfer/ninferFedora.js +9 -0
- package/packages/providers/lib/engines/ninfer/ninferLinux.d.ts +17 -0
- package/packages/providers/lib/engines/ninfer/ninferLinux.js +37 -0
- package/packages/providers/lib/engines/ninfer/ninferMacOS.d.ts +15 -0
- package/packages/providers/lib/engines/ninfer/ninferMacOS.js +17 -0
- package/packages/providers/lib/engines/ninfer/ninferWindows.d.ts +29 -0
- package/packages/providers/lib/engines/ninfer/ninferWindows.js +59 -0
- package/packages/providers/lib/engines/strata/strata.d.ts +1 -0
- package/packages/providers/lib/engines/strata/strata.js +264 -0
- package/packages/providers/lib/engines/strata/strataAdapter.d.ts +97 -0
- package/packages/providers/lib/engines/strata/strataAdapter.js +463 -0
- package/packages/providers/lib/engines/strata/strataArch.d.ts +9 -0
- package/packages/providers/lib/engines/strata/strataArch.js +9 -0
- package/packages/providers/lib/engines/strata/strataDebian.d.ts +9 -0
- package/packages/providers/lib/engines/strata/strataDebian.js +9 -0
- package/packages/providers/lib/engines/strata/strataFedora.d.ts +9 -0
- package/packages/providers/lib/engines/strata/strataFedora.js +9 -0
- package/packages/providers/lib/engines/strata/strataLinux.d.ts +21 -0
- package/packages/providers/lib/engines/strata/strataLinux.js +30 -0
- package/packages/providers/lib/engines/strata/strataMacOS.d.ts +16 -0
- package/packages/providers/lib/engines/strata/strataMacOS.js +17 -0
- package/packages/providers/lib/engines/strata/strataWindows.d.ts +27 -0
- package/packages/providers/lib/engines/strata/strataWindows.js +37 -0
- package/packages/providers/lib/engines.d.ts +8 -5
- package/packages/providers/lib/engines.js +22 -11
- package/packages/providers/lib/guidelines.d.ts +5 -4
- package/packages/providers/lib/guidelines.js +18 -5
- package/packages/providers/lib/index.d.ts +33 -24
- package/packages/providers/lib/index.js +46 -24
- package/packages/providers/lib/model-defaults.d.ts +10 -5
- package/packages/providers/lib/model-defaults.js +47 -5
- package/packages/providers/lib/platform.d.ts +8 -5
- package/packages/providers/lib/platform.js +27 -7
- package/packages/providers/lib/presets.d.ts +6 -4
- package/packages/providers/lib/presets.js +53 -5
- package/packages/providers/lib/systemDeps.d.ts +313 -0
- package/packages/providers/lib/systemDeps.js +284 -0
- package/packages/providers/lib/vram.d.ts +34 -8
- package/packages/providers/lib/vram.js +81 -8
- package/packages/providers/package.json +2 -2
- package/packages/service/lib/index.d.ts +187 -23
- package/packages/service/lib/index.js +667 -90
- package/packages/service/lib/launch-target.d.ts +19 -0
- package/packages/service/lib/launch-target.js +28 -0
- package/packages/service/lib/run-logs.d.ts +72 -0
- package/packages/service/lib/run-logs.js +125 -0
- package/packages/service/lib/types.d.ts +166 -8
- package/packages/service/lib/types.js +1 -1
- package/packages/service/package.json +2 -2
- package/packages/tool/lib/index.d.ts +1 -1
- package/packages/tool/lib/index.js +1 -1
- package/packages/tool/package.json +2 -2
- package/packages/ui/lib/config.d.ts +89 -0
- package/packages/ui/lib/config.js +251 -0
- package/packages/ui/lib/deps.d.ts +4 -4
- package/packages/ui/lib/deps.js +1 -1
- package/packages/ui/lib/form.d.ts +1 -1
- package/packages/ui/lib/form.js +1 -1
- package/packages/ui/lib/index.d.ts +7 -1
- package/packages/ui/lib/index.js +12 -2
- package/packages/ui/lib/meter.d.ts +1 -1
- package/packages/ui/lib/meter.js +1 -1
- package/packages/ui/lib/ops/engine.d.ts +216 -0
- package/packages/ui/lib/ops/engine.js +697 -0
- package/packages/ui/lib/ops/get-steps.d.ts +98 -0
- package/packages/ui/lib/ops/get-steps.js +359 -0
- package/packages/ui/lib/ops/hf.d.ts +42 -0
- package/packages/ui/lib/ops/hf.js +150 -0
- package/packages/ui/lib/ops/logs.d.ts +78 -0
- package/packages/ui/lib/ops/logs.js +119 -0
- package/packages/ui/lib/ops/model.d.ts +71 -0
- package/packages/ui/lib/ops/model.js +123 -0
- package/packages/ui/lib/request.d.ts +106 -0
- package/packages/ui/lib/request.js +80 -0
- package/packages/ui/lib/route.d.ts +106 -422
- package/packages/ui/lib/route.js +136 -1845
- package/packages/ui/lib/routes/chat-template.d.ts +1 -0
- package/packages/ui/lib/routes/chat-template.js +1 -0
- package/packages/ui/lib/routes/deps.d.ts +1 -0
- package/packages/ui/lib/routes/deps.js +1 -0
- package/packages/ui/lib/routes/download.d.ts +1 -0
- package/packages/ui/lib/routes/download.js +1 -0
- package/packages/ui/lib/routes/get.d.ts +1 -0
- package/packages/ui/lib/routes/get.js +106 -0
- package/packages/ui/lib/routes/install.d.ts +16 -0
- package/packages/ui/lib/routes/install.js +36 -0
- package/packages/ui/lib/routes/launch.d.ts +24 -0
- package/packages/ui/lib/routes/launch.js +74 -0
- package/packages/ui/lib/routes/logs.d.ts +57 -0
- package/packages/ui/lib/routes/logs.js +117 -0
- package/packages/ui/lib/routes/provider-delete.d.ts +15 -0
- package/packages/ui/lib/routes/provider-delete.js +37 -0
- package/packages/ui/lib/routes/register.d.ts +16 -0
- package/packages/ui/lib/routes/register.js +28 -0
- package/packages/ui/lib/routes/save.d.ts +18 -0
- package/packages/ui/lib/routes/save.js +159 -0
- package/packages/ui/lib/routes/stop.d.ts +19 -0
- package/packages/ui/lib/routes/stop.js +32 -0
- package/packages/ui/lib/routes/stream.d.ts +40 -0
- package/packages/ui/lib/routes/stream.js +68 -0
- package/packages/ui/lib/routes/summary.d.ts +15 -0
- package/packages/ui/lib/routes/summary.js +26 -0
- package/packages/ui/lib/routes/unregister.d.ts +14 -0
- package/packages/ui/lib/routes/unregister.js +26 -0
- package/packages/ui/lib/viewmodels/deps.d.ts +1 -0
- package/packages/ui/lib/viewmodels/deps.js +1 -0
- package/packages/ui/lib/viewmodels/depsHelpers.d.ts +1 -0
- package/packages/ui/lib/viewmodels/depsHelpers.js +94 -0
- package/packages/ui/lib/viewmodels/summary.d.ts +145 -0
- package/packages/ui/lib/viewmodels/summary.js +245 -0
- package/packages/ui/lib/viewmodels/summaryHelpers.d.ts +30 -0
- package/packages/ui/lib/viewmodels/summaryHelpers.js +42 -0
- package/packages/ui/lib/warnings.d.ts +1 -1
- package/packages/ui/lib/warnings.js +1 -1
- package/packages/ui/package.json +4 -4
- package/packages/providers/lib/strata.d.ts +0 -15
- package/packages/providers/lib/strata.js +0 -14
|
@@ -14,10 +14,11 @@
|
|
|
14
14
|
* this surface, so the form renderer shows them only while the Infernix
|
|
15
15
|
* engine is selected, and the adapters of the other engines never spell
|
|
16
16
|
* them. Adding a flag here is a data edit, never a core rewire.
|
|
17
|
-
* @module dsh-plugin-local-infer/providers/infernix
|
|
17
|
+
* @module dsh-plugin-local-infer/providers/engines/infernix/infernix
|
|
18
18
|
*/
|
|
19
19
|
import { join } from 'node:path';
|
|
20
|
-
import {
|
|
20
|
+
import { hfDownloadFileCommand } from '../../../../core/lib/index.js';
|
|
21
|
+
import { CHAT_TEMPLATE_OPTIONS, LM_HEAD_DRAFT_GATE_MESSAGE } from "../ninfer/ninfer.js";
|
|
21
22
|
/**
|
|
22
23
|
* The KV cache quantization formats Infernix serves, in the order the form
|
|
23
24
|
* dropdown lists them. The set differs from NInfer's: the 2-bit and 4-bit-
|
|
@@ -201,20 +202,27 @@ export function infernixDraftModelPath(config) {
|
|
|
201
202
|
* layout the `--draft-model` path expects) when a preset is selected, and the
|
|
202
203
|
* model key's PLE n-gram volume (into the model directory) when the key names
|
|
203
204
|
* one. The commands are the single source the Get route streams, so a Get
|
|
204
|
-
* leaves the model directory ready to launch.
|
|
205
|
+
* leaves the model directory ready to launch. Every command renders through
|
|
206
|
+
* the core hfDownloadFileCommand builder, the single source of the
|
|
207
|
+
* `--format human` flag contract (the flag overrides the non-TTY default so
|
|
208
|
+
* the hf CLI prints tqdm progress lines to stderr).
|
|
205
209
|
*/
|
|
206
|
-
export function infernixGetDownloads(config, modelDir) {
|
|
210
|
+
export function infernixGetDownloads(config, modelDir, useHubCache = false) {
|
|
207
211
|
const commands = [];
|
|
208
212
|
const preset = typeof config.draftModelPreset === 'string' ? config.draftModelPreset : '';
|
|
209
213
|
if (preset !== '' && preset !== DFLASH2_CUSTOM_VALUE) {
|
|
210
214
|
const model = INFERNIX_DFLASH2_MODELS.find((entry) => entry.file === preset);
|
|
211
215
|
if (model !== undefined) {
|
|
212
|
-
|
|
216
|
+
// The hub-cache layout (the model directory is the plugin default)
|
|
217
|
+
// drops --local-dir so the drafter lands in the hub cache; an override
|
|
218
|
+
// keeps the flat --local-dir target under the drafter's own folder.
|
|
219
|
+
const target = useHubCache ? '' : join(modelDir, model.file);
|
|
220
|
+
commands.push(hfDownloadFileCommand(model.repo, model.file, target, useHubCache));
|
|
213
221
|
}
|
|
214
222
|
}
|
|
215
223
|
const volume = INFERNIX_NGRAM_VOLUMES[infernixModelKey(config)];
|
|
216
224
|
if (volume !== undefined) {
|
|
217
|
-
commands.push(
|
|
225
|
+
commands.push(hfDownloadFileCommand(volume.repo, volume.file, modelDir, useHubCache));
|
|
218
226
|
}
|
|
219
227
|
return commands;
|
|
220
228
|
}
|
|
@@ -240,6 +248,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
240
248
|
group: 'Engine',
|
|
241
249
|
// The port contributes no flag of its own: renderLaunch spells the local
|
|
242
250
|
// `--port` from this value, and the health URL derives from it too.
|
|
251
|
+
deploy: { target: 'cli' },
|
|
243
252
|
},
|
|
244
253
|
{
|
|
245
254
|
key: 'kvDtype',
|
|
@@ -261,6 +270,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
261
270
|
return { ok: true };
|
|
262
271
|
},
|
|
263
272
|
toArgv: (value) => ['--kv-dtype', String(value)],
|
|
273
|
+
deploy: { target: 'cli' },
|
|
264
274
|
},
|
|
265
275
|
{
|
|
266
276
|
key: 'maxContext',
|
|
@@ -270,6 +280,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
270
280
|
defaultValue: 32768,
|
|
271
281
|
group: 'Memory',
|
|
272
282
|
toArgv: (value) => ['--max-context', String(value)],
|
|
283
|
+
deploy: { target: 'cli' },
|
|
273
284
|
},
|
|
274
285
|
{
|
|
275
286
|
key: 'kvCapacity',
|
|
@@ -288,6 +299,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
288
299
|
},
|
|
289
300
|
group: 'Memory',
|
|
290
301
|
toArgv: (value) => ['--kv-capacity', String(value)],
|
|
302
|
+
deploy: { target: 'cli' },
|
|
291
303
|
},
|
|
292
304
|
{
|
|
293
305
|
key: 'hostContextMib',
|
|
@@ -308,6 +320,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
308
320
|
// cache on the device only, which the engine still accepts.
|
|
309
321
|
defaultValue: 16384,
|
|
310
322
|
toArgv: (value) => ['--host-context-mib', String(value)],
|
|
323
|
+
deploy: { target: 'cli' },
|
|
311
324
|
},
|
|
312
325
|
{
|
|
313
326
|
key: 'mediaLiveMib',
|
|
@@ -316,6 +329,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
316
329
|
form: { kind: 'number', min: 0, step: 1024, unit: 'MiB' },
|
|
317
330
|
group: 'Memory',
|
|
318
331
|
toArgv: (value) => ['--media-live-mib', String(value)],
|
|
332
|
+
deploy: { target: 'cli' },
|
|
319
333
|
},
|
|
320
334
|
{
|
|
321
335
|
key: 'ramHeadroomMib',
|
|
@@ -325,6 +339,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
325
339
|
defaultValue: 8192,
|
|
326
340
|
group: 'Memory',
|
|
327
341
|
toArgv: (value) => ['--ram-headroom-mib', String(value)],
|
|
342
|
+
deploy: { target: 'cli' },
|
|
328
343
|
},
|
|
329
344
|
{
|
|
330
345
|
key: 'vramHeadroomMib',
|
|
@@ -334,6 +349,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
334
349
|
group: 'Memory',
|
|
335
350
|
// The engine defaults to auto, so a bare value spells no flag.
|
|
336
351
|
toArgv: (value) => ['--vram-headroom-mib', String(value)],
|
|
352
|
+
deploy: { target: 'cli' },
|
|
337
353
|
},
|
|
338
354
|
{
|
|
339
355
|
key: 'expertRamMib',
|
|
@@ -344,6 +360,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
344
360
|
// The engine defaults to auto (what the RAM ledger leaves), so a bare
|
|
345
361
|
// value spells no flag.
|
|
346
362
|
toArgv: (value) => ['--expert-ram-mib', String(value)],
|
|
363
|
+
deploy: { target: 'cli' },
|
|
347
364
|
},
|
|
348
365
|
{
|
|
349
366
|
key: 'expertPinMib',
|
|
@@ -354,6 +371,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
354
371
|
// The engine defaults to auto (what the OS lets the GPU page-lock), so a
|
|
355
372
|
// bare value spells no flag.
|
|
356
373
|
toArgv: (value) => ['--expert-pin-mib', String(value)],
|
|
374
|
+
deploy: { target: 'cli' },
|
|
357
375
|
},
|
|
358
376
|
{
|
|
359
377
|
key: 'ngramResidency',
|
|
@@ -364,6 +382,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
364
382
|
group: 'Memory',
|
|
365
383
|
// auto is the engine default, so the bare value spells no flag.
|
|
366
384
|
toArgv: (value) => (value === 'auto' ? [] : ['--ngram-residency', String(value)]),
|
|
385
|
+
deploy: { target: 'cli' },
|
|
367
386
|
},
|
|
368
387
|
{
|
|
369
388
|
key: 'maxConcurrency',
|
|
@@ -373,6 +392,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
373
392
|
defaultValue: 1,
|
|
374
393
|
group: 'Concurrency',
|
|
375
394
|
toArgv: (value) => ['--max-concurrency', String(value)],
|
|
395
|
+
deploy: { target: 'cli' },
|
|
376
396
|
},
|
|
377
397
|
{
|
|
378
398
|
key: 'maxPendingRequests',
|
|
@@ -381,6 +401,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
381
401
|
form: { kind: 'number', min: 0, step: 1, unit: 'requests' },
|
|
382
402
|
group: 'Concurrency',
|
|
383
403
|
toArgv: (value) => ['--max-pending-requests', String(value)],
|
|
404
|
+
deploy: { target: 'cli' },
|
|
384
405
|
},
|
|
385
406
|
{
|
|
386
407
|
key: 'spec',
|
|
@@ -390,6 +411,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
390
411
|
defaultValue: 'none',
|
|
391
412
|
group: 'Speculation',
|
|
392
413
|
toArgv: (value) => (value === 'none' ? [] : ['--spec', String(value)]),
|
|
414
|
+
deploy: { target: 'cli' },
|
|
393
415
|
},
|
|
394
416
|
{
|
|
395
417
|
key: 'draftTokens',
|
|
@@ -400,16 +422,18 @@ export const INFERNIX_PARAMETERS = [
|
|
|
400
422
|
group: 'Speculation',
|
|
401
423
|
requires: (config) => config.spec && config.spec !== 'none' ? null : SPEC_GATE_MESSAGE,
|
|
402
424
|
toArgv: (value) => ['--draft-tokens', String(value)],
|
|
425
|
+
deploy: { target: 'cli' },
|
|
403
426
|
},
|
|
404
427
|
{
|
|
405
428
|
key: 'lmHeadDraft',
|
|
406
429
|
label: 'LM-head draft',
|
|
407
|
-
description: 'Drafts from the small proposal head instead of the full output head, cutting the per-draft projection cost.
|
|
430
|
+
description: 'Drafts from the small proposal head instead of the full output head, cutting the per-draft projection cost.',
|
|
408
431
|
form: { kind: 'boolean' },
|
|
409
432
|
defaultValue: false,
|
|
410
433
|
group: 'Speculation',
|
|
411
434
|
requires: (config) => config.spec === 'mtp' ? null : LM_HEAD_DRAFT_GATE_MESSAGE,
|
|
412
435
|
toArgv: (value) => (value === true ? ['--lm-head-draft'] : []),
|
|
436
|
+
deploy: { target: 'cli' },
|
|
413
437
|
},
|
|
414
438
|
{
|
|
415
439
|
key: 'draftModelPreset',
|
|
@@ -425,6 +449,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
425
449
|
requires: (config) => config.spec === 'dflash2' ? null : DFLASH2_GATE_MESSAGE,
|
|
426
450
|
// No toArgv: the adapter resolves the effective --draft-model path from
|
|
427
451
|
// this selection (or the Custom Draft model field) and spells the flag.
|
|
452
|
+
deploy: { target: 'cli' },
|
|
428
453
|
},
|
|
429
454
|
{
|
|
430
455
|
key: 'draftModel',
|
|
@@ -446,6 +471,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
446
471
|
},
|
|
447
472
|
// No toArgv: the adapter resolves the effective --draft-model path and
|
|
448
473
|
// spells the flag, so the preset and the custom path share one source.
|
|
474
|
+
deploy: { target: 'cli' },
|
|
449
475
|
},
|
|
450
476
|
{
|
|
451
477
|
key: 'ngramDraftTokens',
|
|
@@ -454,6 +480,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
454
480
|
form: { kind: 'number', min: 0, max: 63, step: 1, unit: 'proposals' },
|
|
455
481
|
group: 'Speculation',
|
|
456
482
|
toArgv: (value) => (value === 0 ? [] : ['--ngram-draft-tokens', String(value)]),
|
|
483
|
+
deploy: { target: 'cli' },
|
|
457
484
|
},
|
|
458
485
|
{
|
|
459
486
|
key: 'ngramMinMatch',
|
|
@@ -468,6 +495,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
468
495
|
? null
|
|
469
496
|
: 'Enable n-gram copy proposals first (n-gram draft tokens above 0)',
|
|
470
497
|
toArgv: (value) => ['--ngram-min-match', String(value)],
|
|
498
|
+
deploy: { target: 'cli' },
|
|
471
499
|
},
|
|
472
500
|
{
|
|
473
501
|
key: 'ngramVolume',
|
|
@@ -476,6 +504,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
476
504
|
form: { kind: 'path' },
|
|
477
505
|
group: 'Artifacts',
|
|
478
506
|
toArgv: (value) => (value ? ['--ngram-volume', String(value)] : []),
|
|
507
|
+
deploy: { target: 'cli' },
|
|
479
508
|
},
|
|
480
509
|
{
|
|
481
510
|
key: 'expertState',
|
|
@@ -486,6 +515,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
486
515
|
// The engine defaults to the artifact-named state file, so a bare value
|
|
487
516
|
// spells no flag.
|
|
488
517
|
toArgv: (value) => (value ? ['--expert-state', String(value)] : []),
|
|
518
|
+
deploy: { target: 'cli' },
|
|
489
519
|
},
|
|
490
520
|
{
|
|
491
521
|
key: 'prefixCacheFile',
|
|
@@ -494,6 +524,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
494
524
|
form: { kind: 'path' },
|
|
495
525
|
group: 'Artifacts',
|
|
496
526
|
toArgv: (value) => (value ? ['--prefix-cache-file', String(value)] : []),
|
|
527
|
+
deploy: { target: 'cli' },
|
|
497
528
|
},
|
|
498
529
|
{
|
|
499
530
|
key: 'prefillChunk',
|
|
@@ -513,6 +544,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
513
544
|
defaultValue: 2048,
|
|
514
545
|
group: 'Engine',
|
|
515
546
|
toArgv: (value) => ['--prefill-chunk', String(value)],
|
|
547
|
+
deploy: { target: 'cli' },
|
|
516
548
|
},
|
|
517
549
|
{
|
|
518
550
|
key: 'vision',
|
|
@@ -522,6 +554,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
522
554
|
defaultValue: false,
|
|
523
555
|
group: 'Engine',
|
|
524
556
|
toArgv: (value) => (value === true ? ['--vision'] : []),
|
|
557
|
+
deploy: { target: 'cli' },
|
|
525
558
|
},
|
|
526
559
|
{
|
|
527
560
|
key: 'noCudaGraph',
|
|
@@ -531,6 +564,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
531
564
|
defaultValue: false,
|
|
532
565
|
group: 'Engine',
|
|
533
566
|
toArgv: (value) => (value === true ? ['--no-cuda-graph'] : []),
|
|
567
|
+
deploy: { target: 'cli' },
|
|
534
568
|
},
|
|
535
569
|
{
|
|
536
570
|
key: 'reproducible',
|
|
@@ -540,6 +574,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
540
574
|
defaultValue: false,
|
|
541
575
|
group: 'Engine',
|
|
542
576
|
toArgv: (value) => (value === true ? ['--reproducible'] : []),
|
|
577
|
+
deploy: { target: 'cli' },
|
|
543
578
|
},
|
|
544
579
|
{
|
|
545
580
|
key: 'lossless',
|
|
@@ -549,6 +584,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
549
584
|
defaultValue: false,
|
|
550
585
|
group: 'Engine',
|
|
551
586
|
toArgv: (value) => (value === true ? ['--lossless'] : []),
|
|
587
|
+
deploy: { target: 'cli' },
|
|
552
588
|
},
|
|
553
589
|
{
|
|
554
590
|
key: 'ropeYarnFactor',
|
|
@@ -559,6 +595,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
559
595
|
group: 'Engine',
|
|
560
596
|
// 1 leaves the native RoPE unchanged, so the bare value spells no flag.
|
|
561
597
|
toArgv: (value) => (value === 1 ? [] : ['--rope-yarn-factor', String(value)]),
|
|
598
|
+
deploy: { target: 'cli' },
|
|
562
599
|
},
|
|
563
600
|
{
|
|
564
601
|
key: 'chatTemplate',
|
|
@@ -567,6 +604,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
567
604
|
form: { kind: 'combo', options: [...CHAT_TEMPLATE_OPTIONS] },
|
|
568
605
|
group: 'Engine',
|
|
569
606
|
toArgv: (value) => (value ? ['--chat-template', String(value)] : []),
|
|
607
|
+
deploy: { target: 'cli' },
|
|
570
608
|
},
|
|
571
609
|
{
|
|
572
610
|
key: 'temperature',
|
|
@@ -576,6 +614,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
576
614
|
defaultValue: 0.9,
|
|
577
615
|
group: 'Sampling',
|
|
578
616
|
toArgv: (value) => ['--temperature', String(value)],
|
|
617
|
+
deploy: { target: 'cli' },
|
|
579
618
|
},
|
|
580
619
|
{
|
|
581
620
|
key: 'minP',
|
|
@@ -585,6 +624,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
585
624
|
defaultValue: 0.05,
|
|
586
625
|
group: 'Sampling',
|
|
587
626
|
toArgv: (value) => ['--min-p', String(value)],
|
|
627
|
+
deploy: { target: 'cli' },
|
|
588
628
|
},
|
|
589
629
|
{
|
|
590
630
|
key: 'defaultMaxTokens',
|
|
@@ -608,6 +648,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
608
648
|
},
|
|
609
649
|
group: 'Sampling',
|
|
610
650
|
toArgv: (value) => ['--default-max-tokens', String(value)],
|
|
651
|
+
deploy: { target: 'cli' },
|
|
611
652
|
},
|
|
612
653
|
{
|
|
613
654
|
key: 'defaultThinkingBudget',
|
|
@@ -616,6 +657,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
616
657
|
form: { kind: 'number', min: 0, step: 1, unit: 'tokens' },
|
|
617
658
|
group: 'Sampling',
|
|
618
659
|
toArgv: (value) => ['--default-thinking-budget', String(value)],
|
|
660
|
+
deploy: { target: 'cli' },
|
|
619
661
|
},
|
|
620
662
|
{
|
|
621
663
|
key: 'preserveThinking',
|
|
@@ -625,6 +667,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
625
667
|
defaultValue: false,
|
|
626
668
|
group: 'Sampling',
|
|
627
669
|
toArgv: (value) => (value === true ? ['--preserve-thinking'] : []),
|
|
670
|
+
deploy: { target: 'cli' },
|
|
628
671
|
},
|
|
629
672
|
{
|
|
630
673
|
key: 'tolerantToolCalls',
|
|
@@ -634,6 +677,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
634
677
|
defaultValue: false,
|
|
635
678
|
group: 'Sampling',
|
|
636
679
|
toArgv: (value) => (value === true ? ['--tolerant-tool-calls'] : []),
|
|
680
|
+
deploy: { target: 'cli' },
|
|
637
681
|
},
|
|
638
682
|
{
|
|
639
683
|
key: 'reasoningLoop',
|
|
@@ -644,6 +688,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
644
688
|
group: 'Sampling',
|
|
645
689
|
// off is the engine default, so the bare value spells no flag.
|
|
646
690
|
toArgv: (value) => (value === 'off' ? [] : ['--reasoning-loop', String(value)]),
|
|
691
|
+
deploy: { target: 'cli' },
|
|
647
692
|
},
|
|
648
693
|
];
|
|
649
694
|
/**
|
|
@@ -668,4 +713,4 @@ export function infernixArtifactFor(modelKey) {
|
|
|
668
713
|
const artifact = INFERNIX_MODEL_ARTIFACTS[modelKey];
|
|
669
714
|
return artifact ?? INFERNIX_MODEL_ARTIFACTS['qwen3-27b'];
|
|
670
715
|
}
|
|
671
|
-
//# sourceMappingURL=infernix.js.map
|
|
716
|
+
//# sourceMappingURL=infernix.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Infernix engine adapter. InfernixAdapter is the local-only engine for
|
|
3
|
+
* Infernix, the C++/CUDA fork of NInfer (https://github.com/wallawalla47/infernix)
|
|
4
|
+
* tuned for Qwen models on a single RTX 50-series GPU. `renderLaunch` renders a
|
|
5
|
+
* local `infernix-serve` process from the `INFERNIX_PARAMETERS` surface (the
|
|
6
|
+
* Infernix-only fields, from `--ngram-volume` to the quality routes, spell
|
|
7
|
+
* onto the argv only for this engine); `deploy` builds the engine in the
|
|
8
|
+
* engine directory (the engine's own cmake preset), downloads the model
|
|
9
|
+
* artifact (and the n-gram volume, for the multi-file Flash-Next repo) into
|
|
10
|
+
* the model directory, and starts the engine; `healthCheck` polls the health
|
|
11
|
+
* URL; `stop` signals the tracked process. The engine ships no docker image,
|
|
12
|
+
* so the adapter supports the local build mode only.
|
|
13
|
+
* @module dsh-plugin-local-infer/providers/engines/infernix/infernixAdapter
|
|
14
|
+
*/
|
|
15
|
+
import { EngineAdapter } from '../../../../core/lib/index.js';
|
|
16
|
+
import type { CommandLogger, Config, DeployOptions, DeployResult, EngineLaunchSignature, EnginePlatformConfig, HealthCheckOptions, HealthResult, HardwareProfile, LaunchPlan, LaunchProgress, LifecycleHost, ParameterSpec } from '../../../../core/lib/index.js';
|
|
17
|
+
/**
|
|
18
|
+
* InfernixAdapter is the local-only engine for Infernix, the C++/CUDA fork
|
|
19
|
+
* of NInfer (https://github.com/wallawalla47/infernix) tuned for Qwen models
|
|
20
|
+
* on a single RTX 50-series GPU. `renderLaunch` renders a local
|
|
21
|
+
* `infernix-serve` process from the `INFERNIX_PARAMETERS` surface (the
|
|
22
|
+
* Infernix-only fields, from `--ngram-volume` to the quality routes, spell
|
|
23
|
+
* onto the argv only for this engine); `deploy` builds the engine in the
|
|
24
|
+
* engine directory (the engine's own cmake preset), downloads the model
|
|
25
|
+
* artifact (and the n-gram volume, for the multi-file Flash-Next repo) into
|
|
26
|
+
* the model directory, and starts the engine; `healthCheck` polls the health
|
|
27
|
+
* URL; `stop` signals the tracked process. The engine ships no docker image,
|
|
28
|
+
* so the adapter supports the local build mode only.
|
|
29
|
+
*/
|
|
30
|
+
export declare class InfernixAdapter extends EngineAdapter {
|
|
31
|
+
readonly id = "infernix";
|
|
32
|
+
readonly supports: {
|
|
33
|
+
docker: boolean;
|
|
34
|
+
local: boolean;
|
|
35
|
+
};
|
|
36
|
+
private readonly host;
|
|
37
|
+
private readonly children;
|
|
38
|
+
constructor(host?: LifecycleHost);
|
|
39
|
+
parameters(): readonly ParameterSpec[];
|
|
40
|
+
modelRef(config: Config): {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
};
|
|
44
|
+
launchSignature(config?: Config): EngineLaunchSignature;
|
|
45
|
+
renderLaunch(config: Config, _hw: HardwareProfile): LaunchPlan;
|
|
46
|
+
deploy(plan: LaunchPlan, platform?: EnginePlatformConfig, onProgress?: LaunchProgress, options?: DeployOptions): Promise<DeployResult>;
|
|
47
|
+
healthCheck(plan: LaunchPlan, options?: HealthCheckOptions): Promise<HealthResult>;
|
|
48
|
+
stop(plan: LaunchPlan, log?: CommandLogger): Promise<void>;
|
|
49
|
+
private port;
|
|
50
|
+
private downloadModel;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=infernixAdapter.d.ts.map
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Infernix engine adapter. InfernixAdapter is the local-only engine for
|
|
3
|
+
* Infernix, the C++/CUDA fork of NInfer (https://github.com/wallawalla47/infernix)
|
|
4
|
+
* tuned for Qwen models on a single RTX 50-series GPU. `renderLaunch` renders a
|
|
5
|
+
* local `infernix-serve` process from the `INFERNIX_PARAMETERS` surface (the
|
|
6
|
+
* Infernix-only fields, from `--ngram-volume` to the quality routes, spell
|
|
7
|
+
* onto the argv only for this engine); `deploy` builds the engine in the
|
|
8
|
+
* engine directory (the engine's own cmake preset), downloads the model
|
|
9
|
+
* artifact (and the n-gram volume, for the multi-file Flash-Next repo) into
|
|
10
|
+
* the model directory, and starts the engine; `healthCheck` polls the health
|
|
11
|
+
* URL; `stop` signals the tracked process. The engine ships no docker image,
|
|
12
|
+
* so the adapter supports the local build mode only.
|
|
13
|
+
* @module dsh-plugin-local-infer/providers/engines/infernix/infernixAdapter
|
|
14
|
+
*/
|
|
15
|
+
import { join } from 'node:path';
|
|
16
|
+
import { EngineAdapter, autoRebuildEnabled, hfDownloadCommand, hfHubCacheDirectory, hubCacheSnapshotFilePath, modelArtifactPresent, modelDownloadTarget, } from '../../../../core/lib/index.js';
|
|
17
|
+
import { auditRun, customArgFlags, flagsFromSpecs, nodeLifecycleHost, pollHealth, stopProcessPlan, } from "../../adapters.js";
|
|
18
|
+
import { syncEngineForDeploy } from "../../acquire.js";
|
|
19
|
+
import { INFERNIX_MODEL_ARTIFACTS, INFERNIX_PARAMETERS, infernixArtifactFor, infernixDraftModelPath, infernixModelKey, } from "./infernix.js";
|
|
20
|
+
import { infernixLinuxBinary } from "./infernixLinux.js";
|
|
21
|
+
import { infernixMacOSBinary } from "./infernixMacOS.js";
|
|
22
|
+
import { infernixWindowsBinary } from "./infernixWindows.js";
|
|
23
|
+
/**
|
|
24
|
+
* The Infernix engine binary is OS-specific (the .exe on Windows, where the
|
|
25
|
+
* published release zip ships the server and its DLLs), so the launch binary
|
|
26
|
+
* comes from the host OS's binary function. The adapter's renderLaunch reads
|
|
27
|
+
* this map by the hardware profile's os, keeping the per-OS name in its own OS
|
|
28
|
+
* file.
|
|
29
|
+
*/
|
|
30
|
+
const INFERNIX_BINARY = {
|
|
31
|
+
linux: infernixLinuxBinary,
|
|
32
|
+
macos: infernixMacOSBinary,
|
|
33
|
+
windows: infernixWindowsBinary,
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* InfernixAdapter is the local-only engine for Infernix, the C++/CUDA fork
|
|
37
|
+
* of NInfer (https://github.com/wallawalla47/infernix) tuned for Qwen models
|
|
38
|
+
* on a single RTX 50-series GPU. `renderLaunch` renders a local
|
|
39
|
+
* `infernix-serve` process from the `INFERNIX_PARAMETERS` surface (the
|
|
40
|
+
* Infernix-only fields, from `--ngram-volume` to the quality routes, spell
|
|
41
|
+
* onto the argv only for this engine); `deploy` builds the engine in the
|
|
42
|
+
* engine directory (the engine's own cmake preset), downloads the model
|
|
43
|
+
* artifact (and the n-gram volume, for the multi-file Flash-Next repo) into
|
|
44
|
+
* the model directory, and starts the engine; `healthCheck` polls the health
|
|
45
|
+
* URL; `stop` signals the tracked process. The engine ships no docker image,
|
|
46
|
+
* so the adapter supports the local build mode only.
|
|
47
|
+
*/
|
|
48
|
+
export class InfernixAdapter extends EngineAdapter {
|
|
49
|
+
id = 'infernix';
|
|
50
|
+
supports = { docker: false, local: true };
|
|
51
|
+
host;
|
|
52
|
+
children = new Map();
|
|
53
|
+
constructor(host = nodeLifecycleHost) {
|
|
54
|
+
super();
|
|
55
|
+
this.host = host;
|
|
56
|
+
}
|
|
57
|
+
parameters() {
|
|
58
|
+
return INFERNIX_PARAMETERS;
|
|
59
|
+
}
|
|
60
|
+
modelRef(config) {
|
|
61
|
+
// The engine serves the model under the artifact's advertised id, so the
|
|
62
|
+
// registrar publishes that alias and a chat turn routes to it. A model
|
|
63
|
+
// key that names a local artifact file (a directory-scanned model)
|
|
64
|
+
// reuses the 27B alias, the same fallback the NInfer adapter applies.
|
|
65
|
+
const artifact = infernixArtifactFor(infernixModelKey(config));
|
|
66
|
+
return { id: artifact.modelId, name: artifact.modelId };
|
|
67
|
+
}
|
|
68
|
+
launchSignature(config = {}) {
|
|
69
|
+
// The local plan runs the infernix-serve binary (the .exe on Windows),
|
|
70
|
+
// so the binary name is the command-line marker the reserve probe
|
|
71
|
+
// matches on, and the port the plan binds rides along.
|
|
72
|
+
return { binary: 'infernix-serve', port: this.port(config) };
|
|
73
|
+
}
|
|
74
|
+
renderLaunch(config, _hw) {
|
|
75
|
+
const port = this.port(config);
|
|
76
|
+
const modelKey = infernixModelKey(config);
|
|
77
|
+
const artifact = infernixArtifactFor(modelKey);
|
|
78
|
+
// A model key that names a local artifact file (a directory-scanned
|
|
79
|
+
// model, a .ninfer or .infernix name) overrides the artifact map's file,
|
|
80
|
+
// so a file the user has on disk launches as-is.
|
|
81
|
+
const file = modelKey.endsWith('.ninfer') || modelKey.endsWith('.infernix')
|
|
82
|
+
? modelKey
|
|
83
|
+
: artifact.file;
|
|
84
|
+
const modelDirectory = typeof config.modelDirectory === 'string' ? config.modelDirectory : '';
|
|
85
|
+
// The hub-cache layout (the model directory is the plugin default)
|
|
86
|
+
// resolves the concrete snapshot file the engine reads; a user override
|
|
87
|
+
// keeps the flat model-directory path. A not-yet-downloaded model falls
|
|
88
|
+
// back to the bare file name, the same as the flat layout's missing-file
|
|
89
|
+
// case.
|
|
90
|
+
const modelPath = modelDirectory === ''
|
|
91
|
+
? (hubCacheSnapshotFilePath(hfHubCacheDirectory(), artifact.repo, file) ?? file)
|
|
92
|
+
: join(modelDirectory, file);
|
|
93
|
+
// The engine binary is the .exe on a Windows host, where the published
|
|
94
|
+
// release zip ships the server and its DLLs. The name comes from the host
|
|
95
|
+
// OS's binary function, so the .exe spelling has one home in the OS file.
|
|
96
|
+
const binary = INFERNIX_BINARY[_hw.os]();
|
|
97
|
+
const flags = flagsFromSpecs(INFERNIX_PARAMETERS, config);
|
|
98
|
+
// The dflash2 backend always loads a drafter through --draft-model, so the
|
|
99
|
+
// flag is spelled here from the resolved path (the selected DFlash2 preset,
|
|
100
|
+
// or the Custom Draft model field) rather than by a spec toArgv. A config
|
|
101
|
+
// that names no drafter path is the misconfiguration the dflash2
|
|
102
|
+
// guideline names, so the flag is spelled only when a path resolves.
|
|
103
|
+
if (config.spec === 'dflash2') {
|
|
104
|
+
const draftPath = infernixDraftModelPath(config);
|
|
105
|
+
if (draftPath !== null) {
|
|
106
|
+
flags.push('--draft-model', draftPath);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const customArgs = customArgFlags(config);
|
|
110
|
+
return {
|
|
111
|
+
engineId: this.id,
|
|
112
|
+
kind: 'process',
|
|
113
|
+
argv: [
|
|
114
|
+
binary,
|
|
115
|
+
modelPath,
|
|
116
|
+
'--host',
|
|
117
|
+
'127.0.0.1',
|
|
118
|
+
'--port',
|
|
119
|
+
String(port),
|
|
120
|
+
'--model-id',
|
|
121
|
+
artifact.modelId,
|
|
122
|
+
...flags,
|
|
123
|
+
...customArgs,
|
|
124
|
+
],
|
|
125
|
+
env: {},
|
|
126
|
+
modelId: modelKey,
|
|
127
|
+
...(modelDirectory === '' ? {} : { modelDirectory }),
|
|
128
|
+
port,
|
|
129
|
+
healthUrl: `http://127.0.0.1:${port}/health`,
|
|
130
|
+
os: _hw.os,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
async deploy(plan, platform, onProgress, options) {
|
|
134
|
+
if (plan.kind !== 'process') {
|
|
135
|
+
// Infernix renders process plans only; a docker or compose plan is a
|
|
136
|
+
// no-op.
|
|
137
|
+
return { ok: true };
|
|
138
|
+
}
|
|
139
|
+
const engineDir = platform?.engineDirectory;
|
|
140
|
+
let buildLogs = '';
|
|
141
|
+
// Auto Rebuild off (the card's checkbox): the git sync (fetch, rebase,
|
|
142
|
+
// rebuild) is skipped and the checkout launches as-is.
|
|
143
|
+
if (engineDir !== undefined && autoRebuildEnabled(options?.autoRebuild)) {
|
|
144
|
+
// The conditional rebuild fetches the checkout, prices it against the
|
|
145
|
+
// remote branch, and rebuilds only when it is behind (or a fresh
|
|
146
|
+
// clone). The engine's own quick start (the cmake preset, then the
|
|
147
|
+
// preset's build) rides the acquisition-data build steps. The decision,
|
|
148
|
+
// the build command, and its output are captured into buildLogs and
|
|
149
|
+
// threaded to the card's Logs section.
|
|
150
|
+
const sync = await syncEngineForDeploy(this.host, {
|
|
151
|
+
engineId: this.id,
|
|
152
|
+
directory: engineDir,
|
|
153
|
+
...(platform !== undefined ? { platform } : {}),
|
|
154
|
+
...(options !== undefined ? { options } : {}),
|
|
155
|
+
// The host OS the build steps pick for: a Windows host reads the
|
|
156
|
+
// engine's Windows build steps when the user carries no build-
|
|
157
|
+
// command override.
|
|
158
|
+
...(plan.os !== undefined ? { os: plan.os } : {}),
|
|
159
|
+
...(onProgress !== undefined ? { onProgress } : {}),
|
|
160
|
+
});
|
|
161
|
+
buildLogs = sync.buildLogs;
|
|
162
|
+
if (!sync.ok) {
|
|
163
|
+
return { ok: false, detail: sync.detail ?? 'unknown', logs: buildLogs };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
const withLogs = (result) => buildLogs !== '' ? { ...result, logs: buildLogs } : result;
|
|
167
|
+
onProgress?.('download');
|
|
168
|
+
const download = await this.downloadModel(plan, options?.onLog);
|
|
169
|
+
if (!download.ok)
|
|
170
|
+
return withLogs(download);
|
|
171
|
+
const handle = this.host.spawn(plan.argv ?? [], plan.env ?? {}, engineDir);
|
|
172
|
+
this.children.set(this.planKey(plan), handle);
|
|
173
|
+
return withLogs({ ok: true, handle });
|
|
174
|
+
}
|
|
175
|
+
async healthCheck(plan, options) {
|
|
176
|
+
// The tracked handle rides into the poll, so a child that exits (a
|
|
177
|
+
// crash) ends the poll early with a failed result.
|
|
178
|
+
return pollHealth(this.host, plan, options, this.children.get(this.planKey(plan)));
|
|
179
|
+
}
|
|
180
|
+
async stop(plan, log) {
|
|
181
|
+
const handle = this.children.get(this.planKey(plan));
|
|
182
|
+
if (handle !== undefined) {
|
|
183
|
+
handle.kill();
|
|
184
|
+
this.children.delete(this.planKey(plan));
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
// No tracked child (an engine a DSH restart re-adopted): signal the pid
|
|
188
|
+
// the stored launch record stamped on the plan, so the stop reaches a
|
|
189
|
+
// process this adapter instance did not spawn.
|
|
190
|
+
await stopProcessPlan(this.host, plan, log);
|
|
191
|
+
}
|
|
192
|
+
port(config) {
|
|
193
|
+
// 8080 is the infernix-serve CLI default, so the form seeds it and the
|
|
194
|
+
// adapter falls back to it when a config names no port.
|
|
195
|
+
return typeof config.port === 'number' ? config.port : 8080;
|
|
196
|
+
}
|
|
197
|
+
async downloadModel(plan, log) {
|
|
198
|
+
const artifact = plan.modelId !== undefined ? INFERNIX_MODEL_ARTIFACTS[plan.modelId] : undefined;
|
|
199
|
+
// A model key that names a local artifact file carries no artifact entry,
|
|
200
|
+
// so the file the user has on disk launches as-is without a download.
|
|
201
|
+
if (artifact === undefined)
|
|
202
|
+
return { ok: true };
|
|
203
|
+
// The hub-cache layout (no --local-dir) applies when the model directory is
|
|
204
|
+
// the plugin default; a user override keeps the flat --local-dir target.
|
|
205
|
+
const { baseDir, useHubCache } = modelDownloadTarget(plan.modelDirectory);
|
|
206
|
+
// A multi-file artifact (the Flash-Next shards) downloads the whole repo,
|
|
207
|
+
// which carries the n-gram volume beside the shards, so the
|
|
208
|
+
// --ngram-volume flag points at a file the same download left on disk.
|
|
209
|
+
// A single-file artifact downloads the file alone.
|
|
210
|
+
const repo = artifact.repo;
|
|
211
|
+
const files = artifact.files ?? [artifact.file];
|
|
212
|
+
const entry = {
|
|
213
|
+
engineId: this.id,
|
|
214
|
+
modelId: plan.modelId ?? '',
|
|
215
|
+
label: artifact.modelId,
|
|
216
|
+
url: `https://huggingface.co/${repo}`,
|
|
217
|
+
...(files.length > 1 ? {} : { file: artifact.file }),
|
|
218
|
+
};
|
|
219
|
+
// A model the shared Get-steps routine already downloaded is on disk, so
|
|
220
|
+
// the deploy step skips the re-fetch and a launch after a Get does no
|
|
221
|
+
// duplicate download. Presence is the snapshot the hub-cache layout
|
|
222
|
+
// resolves or the flat artifact path (modelArtifactPresent), never a
|
|
223
|
+
// bare blobs folder: a cache whose snapshot links are missing (the
|
|
224
|
+
// interrupted first download) re-runs the cheap hf download, which
|
|
225
|
+
// reuses the blobs and writes the links.
|
|
226
|
+
if (modelArtifactPresent(entry, baseDir, useHubCache))
|
|
227
|
+
return { ok: true };
|
|
228
|
+
const download = await auditRun(this.host, hfDownloadCommand(entry, baseDir, useHubCache), log);
|
|
229
|
+
if (!download.ok) {
|
|
230
|
+
return { ok: false, detail: `model download failed: ${download.detail ?? 'unknown'}` };
|
|
231
|
+
}
|
|
232
|
+
return { ok: true };
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=infernixAdapter.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Infernix Arch Linux build profile. Arch builds Infernix through the
|
|
3
|
+
* shared Linux route (the engine's own cmake preset), so this profile reuses
|
|
4
|
+
* the shared Linux profile and carries no build steps of its own.
|
|
5
|
+
* @module dsh-plugin-local-infer/providers/engines/infernix/infernixArch
|
|
6
|
+
*/
|
|
7
|
+
import type { EngineOsProfile } from '../engineOs.ts';
|
|
8
|
+
export declare const INFERNIX_ARCH: EngineOsProfile;
|
|
9
|
+
//# sourceMappingURL=infernixArch.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Infernix Arch Linux build profile. Arch builds Infernix through the
|
|
3
|
+
* shared Linux route (the engine's own cmake preset), so this profile reuses
|
|
4
|
+
* the shared Linux profile and carries no build steps of its own.
|
|
5
|
+
* @module dsh-plugin-local-infer/providers/engines/infernix/infernixArch
|
|
6
|
+
*/
|
|
7
|
+
import { INFERNIX_LINUX } from "./infernixLinux.js";
|
|
8
|
+
export const INFERNIX_ARCH = INFERNIX_LINUX;
|
|
9
|
+
//# sourceMappingURL=infernixArch.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Infernix Debian build profile. Debian builds Infernix through the shared
|
|
3
|
+
* Linux route (the engine's own cmake preset), so this profile reuses the
|
|
4
|
+
* shared Linux profile and carries no build steps of its own.
|
|
5
|
+
* @module dsh-plugin-local-infer/providers/engines/infernix/infernixDebian
|
|
6
|
+
*/
|
|
7
|
+
import type { EngineOsProfile } from '../engineOs.ts';
|
|
8
|
+
export declare const INFERNIX_DEBIAN: EngineOsProfile;
|
|
9
|
+
//# sourceMappingURL=infernixDebian.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Infernix Debian build profile. Debian builds Infernix through the shared
|
|
3
|
+
* Linux route (the engine's own cmake preset), so this profile reuses the
|
|
4
|
+
* shared Linux profile and carries no build steps of its own.
|
|
5
|
+
* @module dsh-plugin-local-infer/providers/engines/infernix/infernixDebian
|
|
6
|
+
*/
|
|
7
|
+
import { INFERNIX_LINUX } from "./infernixLinux.js";
|
|
8
|
+
export const INFERNIX_DEBIAN = INFERNIX_LINUX;
|
|
9
|
+
//# sourceMappingURL=infernixDebian.js.map
|