dsh-plugin-local-infer 0.1.3 → 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 +22 -4
- package/cordis.patch.yml +7 -0
- package/docs/zh/README.md +14 -2
- package/dsh/client.js +4195 -4522
- package/package.json +28 -11
- package/packages/core/lib/adapter.d.ts +133 -9
- 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 +44 -17
- 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 +20 -9
- package/packages/core/lib/registrar.js +27 -7
- 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 +92 -14
- package/packages/providers/lib/acquire.js +215 -37
- package/packages/providers/lib/adapters.d.ts +136 -12
- package/packages/providers/lib/adapters.js +597 -70
- package/packages/providers/lib/debug.d.ts +1 -1
- package/packages/providers/lib/debug.js +1 -1
- package/packages/providers/lib/deps.d.ts +27 -230
- package/packages/providers/lib/deps.js +61 -214
- 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/engines/{hyperqwen.d.ts → hyperqwen/hyperqwen.d.ts} +2 -2
- package/packages/providers/lib/engines/{hyperqwen.js → hyperqwen/hyperqwen.js} +14 -2
- package/packages/providers/lib/engines/{hyperqwenAdapter.d.ts → hyperqwen/hyperqwenAdapter.d.ts} +6 -6
- package/packages/providers/lib/engines/{hyperqwenAdapter.js → hyperqwen/hyperqwenAdapter.js} +24 -14
- 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/engines/{infernix.d.ts → infernix/infernix.d.ts} +7 -4
- package/packages/providers/lib/engines/{infernix.js → infernix/infernix.js} +52 -7
- package/packages/providers/lib/engines/{infernixAdapter.d.ts → infernix/infernixAdapter.d.ts} +5 -6
- package/packages/providers/lib/engines/{infernixAdapter.js → infernix/infernixAdapter.js} +75 -42
- 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/engines/{llamacpp.d.ts → llamacpp/llamacpp.d.ts} +2 -2
- package/packages/providers/lib/engines/{llamacpp.js → llamacpp/llamacpp.js} +12 -2
- package/packages/providers/lib/engines/{llamacppAdapter.d.ts → llamacpp/llamacppAdapter.d.ts} +5 -6
- package/packages/providers/lib/engines/{llamacppAdapter.js → llamacpp/llamacppAdapter.js} +87 -45
- 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/engines/{ninfer.d.ts → ninfer/ninfer.d.ts} +2 -2
- package/packages/providers/lib/engines/{ninfer.js → ninfer/ninfer.js} +24 -2
- package/packages/providers/lib/engines/{ninferAdapter.d.ts → ninfer/ninferAdapter.d.ts} +5 -6
- package/packages/providers/lib/engines/{ninferAdapter.js → ninfer/ninferAdapter.js} +123 -55
- 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.js → strata/strata.js} +70 -3
- package/packages/providers/lib/engines/{strataAdapter.d.ts → strata/strataAdapter.d.ts} +5 -6
- package/packages/providers/lib/engines/{strataAdapter.js → strata/strataAdapter.js} +147 -111
- 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 +7 -5
- package/packages/providers/lib/engines.js +21 -10
- 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 -29
- package/packages/providers/lib/index.js +45 -33
- package/packages/providers/lib/model-defaults.d.ts +5 -1
- package/packages/providers/lib/model-defaults.js +25 -1
- package/packages/providers/lib/platform.d.ts +8 -5
- package/packages/providers/lib/platform.js +23 -9
- 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 +176 -21
- package/packages/service/lib/index.js +589 -86
- 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 +163 -6
- 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 +12 -2
- package/packages/ui/lib/config.js +18 -2
- package/packages/ui/lib/deps.d.ts +1 -1
- 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 +142 -34
- package/packages/ui/lib/ops/engine.js +469 -265
- 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 +26 -11
- package/packages/ui/lib/ops/hf.js +115 -25
- package/packages/ui/lib/ops/logs.d.ts +70 -15
- package/packages/ui/lib/ops/logs.js +96 -35
- package/packages/ui/lib/ops/model.d.ts +2 -10
- package/packages/ui/lib/ops/model.js +9 -16
- package/packages/ui/lib/request.d.ts +1 -1
- package/packages/ui/lib/request.js +1 -1
- package/packages/ui/lib/route.d.ts +22 -6
- package/packages/ui/lib/route.js +32 -9
- package/packages/ui/lib/routes/chat-template.d.ts +1 -14
- package/packages/ui/lib/routes/chat-template.js +1 -37
- package/packages/ui/lib/routes/deps.d.ts +1 -16
- package/packages/ui/lib/routes/deps.js +1 -27
- package/packages/ui/lib/routes/download.d.ts +1 -16
- package/packages/ui/lib/routes/download.js +1 -48
- package/packages/ui/lib/routes/get.d.ts +1 -18
- package/packages/ui/lib/routes/get.js +66 -17
- package/packages/ui/lib/routes/install.d.ts +1 -1
- package/packages/ui/lib/routes/install.js +1 -1
- package/packages/ui/lib/routes/launch.d.ts +13 -7
- package/packages/ui/lib/routes/launch.js +33 -9
- 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 +1 -1
- package/packages/ui/lib/routes/provider-delete.js +1 -1
- package/packages/ui/lib/routes/register.d.ts +1 -1
- package/packages/ui/lib/routes/register.js +1 -1
- package/packages/ui/lib/routes/save.d.ts +1 -1
- package/packages/ui/lib/routes/save.js +22 -2
- package/packages/ui/lib/routes/stop.d.ts +7 -4
- package/packages/ui/lib/routes/stop.js +7 -4
- 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 +1 -1
- package/packages/ui/lib/routes/summary.js +1 -1
- package/packages/ui/lib/routes/unregister.d.ts +1 -1
- package/packages/ui/lib/routes/unregister.js +1 -1
- package/packages/ui/lib/viewmodels/deps.d.ts +1 -31
- package/packages/ui/lib/viewmodels/deps.js +1 -89
- package/packages/ui/lib/viewmodels/depsHelpers.d.ts +1 -28
- package/packages/ui/lib/viewmodels/depsHelpers.js +72 -11
- package/packages/ui/lib/viewmodels/summary.d.ts +7 -2
- package/packages/ui/lib/viewmodels/summary.js +55 -35
- package/packages/ui/lib/viewmodels/summaryHelpers.d.ts +1 -1
- package/packages/ui/lib/viewmodels/summaryHelpers.js +1 -1
- 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/engines/strata.d.ts +0 -53
|
@@ -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,6 +422,7 @@ 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',
|
|
@@ -410,6 +433,7 @@ export const INFERNIX_PARAMETERS = [
|
|
|
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
|
package/packages/providers/lib/engines/{infernixAdapter.d.ts → infernix/infernixAdapter.d.ts}
RENAMED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
* the model directory, and starts the engine; `healthCheck` polls the health
|
|
11
11
|
* URL; `stop` signals the tracked process. The engine ships no docker image,
|
|
12
12
|
* so the adapter supports the local build mode only.
|
|
13
|
-
* @module dsh-plugin-local-infer/providers/engines/infernixAdapter
|
|
13
|
+
* @module dsh-plugin-local-infer/providers/engines/infernix/infernixAdapter
|
|
14
14
|
*/
|
|
15
|
-
import { EngineAdapter } from '
|
|
16
|
-
import type { Config, DeployOptions, DeployResult, EngineLaunchSignature, EnginePlatformConfig, HealthCheckOptions, HealthResult, HardwareProfile, LaunchPlan, LaunchProgress, LifecycleHost, ParameterSpec } from '
|
|
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
17
|
/**
|
|
18
18
|
* InfernixAdapter is the local-only engine for Infernix, the C++/CUDA fork
|
|
19
19
|
* of NInfer (https://github.com/wallawalla47/infernix) tuned for Qwen models
|
|
@@ -45,9 +45,8 @@ export declare class InfernixAdapter extends EngineAdapter {
|
|
|
45
45
|
renderLaunch(config: Config, _hw: HardwareProfile): LaunchPlan;
|
|
46
46
|
deploy(plan: LaunchPlan, platform?: EnginePlatformConfig, onProgress?: LaunchProgress, options?: DeployOptions): Promise<DeployResult>;
|
|
47
47
|
healthCheck(plan: LaunchPlan, options?: HealthCheckOptions): Promise<HealthResult>;
|
|
48
|
-
stop(plan: LaunchPlan): Promise<void>;
|
|
48
|
+
stop(plan: LaunchPlan, log?: CommandLogger): Promise<void>;
|
|
49
49
|
private port;
|
|
50
|
-
private planKey;
|
|
51
50
|
private downloadModel;
|
|
52
51
|
}
|
|
53
|
-
//# sourceMappingURL=infernixAdapter.d.ts.map
|
|
52
|
+
//# sourceMappingURL=infernixAdapter.d.ts.map
|
|
@@ -10,13 +10,28 @@
|
|
|
10
10
|
* the model directory, and starts the engine; `healthCheck` polls the health
|
|
11
11
|
* URL; `stop` signals the tracked process. The engine ships no docker image,
|
|
12
12
|
* so the adapter supports the local build mode only.
|
|
13
|
-
* @module dsh-plugin-local-infer/providers/engines/infernixAdapter
|
|
13
|
+
* @module dsh-plugin-local-infer/providers/engines/infernix/infernixAdapter
|
|
14
14
|
*/
|
|
15
15
|
import { join } from 'node:path';
|
|
16
|
-
import { EngineAdapter } from '
|
|
17
|
-
import { customArgFlags, flagsFromSpecs, nodeLifecycleHost, pollHealth, } from "
|
|
18
|
-
import {
|
|
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
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
|
+
};
|
|
20
35
|
/**
|
|
21
36
|
* InfernixAdapter is the local-only engine for Infernix, the C++/CUDA fork
|
|
22
37
|
* of NInfer (https://github.com/wallawalla47/infernix) tuned for Qwen models
|
|
@@ -67,10 +82,18 @@ export class InfernixAdapter extends EngineAdapter {
|
|
|
67
82
|
? modelKey
|
|
68
83
|
: artifact.file;
|
|
69
84
|
const modelDirectory = typeof config.modelDirectory === 'string' ? config.modelDirectory : '';
|
|
70
|
-
|
|
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);
|
|
71
93
|
// The engine binary is the .exe on a Windows host, where the published
|
|
72
|
-
// release zip ships the server and its DLLs.
|
|
73
|
-
|
|
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]();
|
|
74
97
|
const flags = flagsFromSpecs(INFERNIX_PARAMETERS, config);
|
|
75
98
|
// The dflash2 backend always loads a drafter through --draft-model, so the
|
|
76
99
|
// flag is spelled here from the resolved path (the selected DFlash2 preset,
|
|
@@ -104,6 +127,7 @@ export class InfernixAdapter extends EngineAdapter {
|
|
|
104
127
|
...(modelDirectory === '' ? {} : { modelDirectory }),
|
|
105
128
|
port,
|
|
106
129
|
healthUrl: `http://127.0.0.1:${port}/health`,
|
|
130
|
+
os: _hw.os,
|
|
107
131
|
};
|
|
108
132
|
}
|
|
109
133
|
async deploy(plan, platform, onProgress, options) {
|
|
@@ -116,43 +140,32 @@ export class InfernixAdapter extends EngineAdapter {
|
|
|
116
140
|
let buildLogs = '';
|
|
117
141
|
// Auto Rebuild off (the card's checkbox): the git sync (fetch, rebase,
|
|
118
142
|
// rebuild) is skipped and the checkout launches as-is.
|
|
119
|
-
if (engineDir !== undefined && options?.autoRebuild
|
|
120
|
-
// The git sync is the checkout download: the card's button reads
|
|
121
|
-
// "Downloading..." for it, not "Building...".
|
|
122
|
-
onProgress?.('download');
|
|
143
|
+
if (engineDir !== undefined && autoRebuildEnabled(options?.autoRebuild)) {
|
|
123
144
|
// The conditional rebuild fetches the checkout, prices it against the
|
|
124
145
|
// remote branch, and rebuilds only when it is behind (or a fresh
|
|
125
146
|
// clone). The engine's own quick start (the cmake preset, then the
|
|
126
147
|
// preset's build) rides the acquisition-data build steps. The decision,
|
|
127
148
|
// the build command, and its output are captured into buildLogs and
|
|
128
149
|
// threaded to the card's Logs section.
|
|
129
|
-
const sync = await
|
|
150
|
+
const sync = await syncEngineForDeploy(this.host, {
|
|
130
151
|
engineId: this.id,
|
|
131
152
|
directory: engineDir,
|
|
132
|
-
...(platform
|
|
133
|
-
...(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}, () => { });
|
|
142
|
-
buildLogs = sync.logs;
|
|
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;
|
|
143
162
|
if (!sync.ok) {
|
|
144
163
|
return { ok: false, detail: sync.detail ?? 'unknown', logs: buildLogs };
|
|
145
164
|
}
|
|
146
|
-
// The build output reads as a fresh Logs section: a "Building..."
|
|
147
|
-
// separator leads the build decision and output, the same line the
|
|
148
|
-
// card writes when the build step event lands.
|
|
149
|
-
if (sync.rebuilt && buildLogs !== '') {
|
|
150
|
-
buildLogs = `--- Building...\n${buildLogs}`;
|
|
151
|
-
}
|
|
152
165
|
}
|
|
153
166
|
const withLogs = (result) => buildLogs !== '' ? { ...result, logs: buildLogs } : result;
|
|
154
167
|
onProgress?.('download');
|
|
155
|
-
const download = await this.downloadModel(plan);
|
|
168
|
+
const download = await this.downloadModel(plan, options?.onLog);
|
|
156
169
|
if (!download.ok)
|
|
157
170
|
return withLogs(download);
|
|
158
171
|
const handle = this.host.spawn(plan.argv ?? [], plan.env ?? {}, engineDir);
|
|
@@ -160,43 +173,63 @@ export class InfernixAdapter extends EngineAdapter {
|
|
|
160
173
|
return withLogs({ ok: true, handle });
|
|
161
174
|
}
|
|
162
175
|
async healthCheck(plan, options) {
|
|
163
|
-
|
|
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)));
|
|
164
179
|
}
|
|
165
|
-
async stop(plan) {
|
|
180
|
+
async stop(plan, log) {
|
|
166
181
|
const handle = this.children.get(this.planKey(plan));
|
|
167
182
|
if (handle !== undefined) {
|
|
168
183
|
handle.kill();
|
|
169
184
|
this.children.delete(this.planKey(plan));
|
|
185
|
+
return;
|
|
170
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);
|
|
171
191
|
}
|
|
172
192
|
port(config) {
|
|
173
193
|
// 8080 is the infernix-serve CLI default, so the form seeds it and the
|
|
174
194
|
// adapter falls back to it when a config names no port.
|
|
175
195
|
return typeof config.port === 'number' ? config.port : 8080;
|
|
176
196
|
}
|
|
177
|
-
|
|
178
|
-
return `${plan.engineId}:${plan.port}`;
|
|
179
|
-
}
|
|
180
|
-
async downloadModel(plan) {
|
|
197
|
+
async downloadModel(plan, log) {
|
|
181
198
|
const artifact = plan.modelId !== undefined ? INFERNIX_MODEL_ARTIFACTS[plan.modelId] : undefined;
|
|
182
199
|
// A model key that names a local artifact file carries no artifact entry,
|
|
183
200
|
// so the file the user has on disk launches as-is without a download.
|
|
184
201
|
if (artifact === undefined)
|
|
185
202
|
return { ok: true };
|
|
186
|
-
|
|
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);
|
|
187
206
|
// A multi-file artifact (the Flash-Next shards) downloads the whole repo,
|
|
188
207
|
// which carries the n-gram volume beside the shards, so the
|
|
189
208
|
// --ngram-volume flag points at a file the same download left on disk.
|
|
190
209
|
// A single-file artifact downloads the file alone.
|
|
191
210
|
const repo = artifact.repo;
|
|
192
|
-
const files = artifact.files ?? [];
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
:
|
|
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);
|
|
196
229
|
if (!download.ok) {
|
|
197
230
|
return { ok: false, detail: `model download failed: ${download.detail ?? 'unknown'}` };
|
|
198
231
|
}
|
|
199
232
|
return { ok: true };
|
|
200
233
|
}
|
|
201
234
|
}
|
|
202
|
-
//# sourceMappingURL=infernixAdapter.js.map
|
|
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
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Infernix Fedora build profile. Fedora 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/infernixFedora
|
|
6
|
+
*/
|
|
7
|
+
import type { EngineOsProfile } from '../engineOs.ts';
|
|
8
|
+
export declare const INFERNIX_FEDORA: EngineOsProfile;
|
|
9
|
+
//# sourceMappingURL=infernixFedora.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Infernix Fedora build profile. Fedora 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/infernixFedora
|
|
6
|
+
*/
|
|
7
|
+
import { INFERNIX_LINUX } from "./infernixLinux.js";
|
|
8
|
+
export const INFERNIX_FEDORA = INFERNIX_LINUX;
|
|
9
|
+
//# sourceMappingURL=infernixFedora.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Infernix shared Linux build profile. Every Linux distro (Arch, Debian,
|
|
3
|
+
* Fedora) builds Infernix through the engine's own cmake preset: configure the
|
|
4
|
+
* release preset, then build into the `build` directory, which is where the
|
|
5
|
+
* `infernix-serve` binary lands. The distro profiles reuse this profile, so a
|
|
6
|
+
* distro carries no build steps of its own.
|
|
7
|
+
* @module dsh-plugin-local-infer/providers/engines/infernix/infernixLinux
|
|
8
|
+
*/
|
|
9
|
+
import type { EngineOsProfile } from '../engineOs.ts';
|
|
10
|
+
export declare const INFERNIX_LINUX: EngineOsProfile;
|
|
11
|
+
/**
|
|
12
|
+
* infernixLinuxBinary returns the Infernix engine binary name on Linux: the
|
|
13
|
+
* plain `infernix-serve` (no .exe). The name comes from the shared Linux
|
|
14
|
+
* profile, so the spelling has one home.
|
|
15
|
+
*/
|
|
16
|
+
export declare function infernixLinuxBinary(): string;
|
|
17
|
+
//# sourceMappingURL=infernixLinux.d.ts.map
|