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
|
@@ -5,29 +5,90 @@
|
|
|
5
5
|
* re-check, so the "Get" gate opens only after a re-check passes.
|
|
6
6
|
* @module dsh-plugin-local-infer/ui/viewmodels/depsHelpers
|
|
7
7
|
*/
|
|
8
|
+
import { SUDO_CLI_NOTE } from '../../../core/lib/index.js';
|
|
9
|
+
import { runLogKey } from '../../../service/lib/index.js';
|
|
8
10
|
import { readConfig } from "../config.js";
|
|
11
|
+
import { captureRunBaseline, finishRunSection, INSTALL_RUN_SEED } from "../ops/logs.js";
|
|
12
|
+
import { registerSudoObserver } from "../ops/engine.js";
|
|
9
13
|
import { RouteError } from "../route.js";
|
|
10
14
|
import { buildDeps } from "./deps.js";
|
|
11
15
|
/**
|
|
12
16
|
* runInstallFor is the Play/Run path: it refuses with a 409 while the
|
|
13
17
|
* trust gate is off (the copy/paste path is always the fallback), runs the
|
|
14
18
|
* install through the service, and refreshes the deps model from the
|
|
15
|
-
* re-check, so the "Get" gate opens only after a re-check passes.
|
|
19
|
+
* re-check, so the "Get" gate opens only after a re-check passes. A run that
|
|
20
|
+
* actually starts brackets one live hub run under the runLogKey rule (the
|
|
21
|
+
* stored entry matching the engine and model, else the engine id): the seed
|
|
22
|
+
* is the "Installing deps..." separator, the service writes each install
|
|
23
|
+
* command's `$ <command>` line into the run (through onLog) before its child
|
|
24
|
+
* spawns, each per-dep install result appends in the Get step's
|
|
25
|
+
* ` <id>: <status>` shape, and the run ends at settle, a throwing install
|
|
26
|
+
* included. The settle text also folds through the shared run-section persister
|
|
27
|
+
* (finishRunSection over the pre-run baseline), so the last install run
|
|
28
|
+
* survives a card reload in the stored last-run logs and the log file, like
|
|
29
|
+
* the other provider processes; the baseline close keeps the sudo note the
|
|
30
|
+
* observer persists mid-run from landing twice. The run registers the sudo
|
|
31
|
+
* hook the launch and Get paths register, so a guarded dependency install
|
|
32
|
+
* waiting for a password on the CLI lands the shared SUDO_CLI_NOTE line in
|
|
33
|
+
* the live run and the persisted run. A 409 refusal starts no run.
|
|
16
34
|
*/
|
|
17
35
|
export async function runInstallFor(localInfer, request) {
|
|
18
|
-
|
|
36
|
+
const stored = readConfig();
|
|
37
|
+
if (stored.allowRunDeps !== true) {
|
|
19
38
|
throw new RouteError(409, 'one-click install is not allowed; copy the install string instead');
|
|
20
39
|
}
|
|
21
40
|
const model = await buildDeps(localInfer, request);
|
|
22
41
|
const hardware = await localInfer.detectHardware();
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
42
|
+
const runKey = runLogKey(stored.providers, model.engineId, undefined, request.config ?? stored.config);
|
|
43
|
+
// The install run owns a sudo hook under its run key (the shared
|
|
44
|
+
// registerSudoObserver wiring): a guarded install waiting on the CLI writes
|
|
45
|
+
// the core CLI note into the live hub and, through persistProcessLog inside
|
|
46
|
+
// the helper, into the persisted run and log file, so a hung install reads
|
|
47
|
+
// where the prompt landed. The disposer clears only this run's slot.
|
|
48
|
+
// One append feeds both readers: the live hub run and the run's collected
|
|
49
|
+
// settle text (persisted at the finally), no second copy of the text.
|
|
50
|
+
let collected = '';
|
|
51
|
+
const append = (line) => {
|
|
52
|
+
collected += line;
|
|
53
|
+
localInfer.appendRunLog(runKey, line);
|
|
31
54
|
};
|
|
55
|
+
const clearSudoObserver = registerSudoObserver(localInfer, runKey, `${SUDO_CLI_NOTE}\n`, append);
|
|
56
|
+
// The stored last-run logs as they stand before the run persists anything:
|
|
57
|
+
// the sudo observer persists its note while the run hangs on the prompt,
|
|
58
|
+
// and finishRunSection closes the run over the baseline so that provisional
|
|
59
|
+
// line and the collected run text persist once (the Get route's pattern).
|
|
60
|
+
const baseline = captureRunBaseline();
|
|
61
|
+
localInfer.beginRun(runKey, INSTALL_RUN_SEED);
|
|
62
|
+
try {
|
|
63
|
+
const result = await localInfer.runInstall(model.engineId, model.buildMode, hardware, {
|
|
64
|
+
// Each install command's `$ <command>` line reaches the live hub and the
|
|
65
|
+
// collected run before the guarded runner spawns the child, so the run
|
|
66
|
+
// reads the command ahead of the per-dep results below.
|
|
67
|
+
onLog: append,
|
|
68
|
+
});
|
|
69
|
+
// The per-dep results stream as the re-check reported them, in the same
|
|
70
|
+
// indented shape the Get step's dep block logs, so both readers (the
|
|
71
|
+
// live buffer and, later, a re-rendered Logs pane) say the same thing.
|
|
72
|
+
for (const entry of result.results) {
|
|
73
|
+
append(` ${entry.id}: ${entry.status}${entry.detail !== undefined ? ` (${entry.detail})` : ''}\n`);
|
|
74
|
+
}
|
|
75
|
+
const deps = model.deps.map((dep) => {
|
|
76
|
+
const entry = result.results.find((entry) => entry.id === dep.id);
|
|
77
|
+
return entry === undefined ? dep : { ...dep, status: entry.status };
|
|
78
|
+
});
|
|
79
|
+
return {
|
|
80
|
+
result,
|
|
81
|
+
deps: { ...model, deps, allSatisfied: result.ok },
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
clearSudoObserver();
|
|
86
|
+
// The settle fold: the run's text (seed, command lines, per-dep results,
|
|
87
|
+
// any sudo note) persists as one section so a card reload still shows the
|
|
88
|
+
// last install run. A throwing install persists the partial section (the
|
|
89
|
+
// commands that ran) before the error reaches the route.
|
|
90
|
+
finishRunSection(baseline, `${INSTALL_RUN_SEED}${collected}`);
|
|
91
|
+
localInfer.endRun(runKey);
|
|
92
|
+
}
|
|
32
93
|
}
|
|
33
|
-
//# sourceMappingURL=depsHelpers.js.map
|
|
94
|
+
//# sourceMappingURL=depsHelpers.js.map
|
|
@@ -33,6 +33,7 @@ export interface LocalInferSummary {
|
|
|
33
33
|
};
|
|
34
34
|
defaultBuildCommand?: string;
|
|
35
35
|
defaultDockerTag?: string;
|
|
36
|
+
defaultEngineDirectory: string;
|
|
36
37
|
}[];
|
|
37
38
|
models: {
|
|
38
39
|
id: string;
|
|
@@ -66,7 +67,10 @@ export interface LocalInferSummary {
|
|
|
66
67
|
* ProviderSummaryEntry is the card-facing view of one saved provider config:
|
|
67
68
|
* the stable id the card edits and deletes against, the engine and model the
|
|
68
69
|
* title renders ("NInfer: <model>"), the running-state the status dot paints,
|
|
69
|
-
*
|
|
70
|
+
* the per-provider Auto Rebuild checkbox value the edit form and the entry
|
|
71
|
+
* launch read, and the full config and platform the expanded form draws from.
|
|
72
|
+
* An entry saved before the autoRebuild key existed carries no key, so the
|
|
73
|
+
* card draws the checkbox unchecked.
|
|
70
74
|
*/
|
|
71
75
|
export interface ProviderSummaryEntry {
|
|
72
76
|
id: string;
|
|
@@ -75,6 +79,7 @@ export interface ProviderSummaryEntry {
|
|
|
75
79
|
status: ProviderStatus;
|
|
76
80
|
config: Config;
|
|
77
81
|
platform: StoredPlatformConfig;
|
|
82
|
+
autoRebuild?: boolean;
|
|
78
83
|
}
|
|
79
84
|
/**
|
|
80
85
|
* ModelDefaultModel is the card-facing view of one default model entry: the
|
|
@@ -137,4 +142,4 @@ export declare function buildSummary(localInfer: LocalInferService, request?: {
|
|
|
137
142
|
engine?: string;
|
|
138
143
|
config?: Config;
|
|
139
144
|
}): Promise<LocalInferSummary>;
|
|
140
|
-
//# sourceMappingURL=summary.d.ts.map
|
|
145
|
+
//# sourceMappingURL=summary.d.ts.map
|
|
@@ -8,9 +8,7 @@
|
|
|
8
8
|
* are the single source the red banner and the inline warnings agree on.
|
|
9
9
|
* @module dsh-plugin-local-infer/ui/viewmodels/summary
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
12
|
-
import { join } from 'node:path';
|
|
13
|
-
import { buildModelEntry, CHAT_TEMPLATE_FILE, hfChatTemplateCommand, hfDownloadCommand, modelArtifactPath, modelEntriesForEngine, } from '../../../core/lib/index.js';
|
|
11
|
+
import { buildModelEntry, chatTemplatePresent, dshEngineCacheDirectory, hfChatTemplateCommand, hfDownloadCommand, modelArtifactPresent, modelCacheEntriesForEngine, modelEntriesForEngine, resolveModelDirectory, } from '../../../core/lib/index.js';
|
|
14
12
|
import { defaultModelFor, defaultModelsForEngine, ENGINES, enginePlatformDefaults, } from '../../../providers/lib/index.js';
|
|
15
13
|
import { readConfig } from "../config.js";
|
|
16
14
|
import { renderForm } from "../form.js";
|
|
@@ -33,16 +31,15 @@ export async function buildSummary(localInfer, request) {
|
|
|
33
31
|
const engineId = request?.engine ?? stored.engine;
|
|
34
32
|
// ENGINES is a known non-empty constant, so the fallback is always defined.
|
|
35
33
|
const engine = ENGINES.find((entry) => entry.id === engineId) ?? ENGINES[0];
|
|
36
|
-
// The
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const modelDir = typeof config.modelDirectory === 'string' ? config.modelDirectory : modelDirectory;
|
|
34
|
+
// The config the card edits is exactly what is stored or requested: the
|
|
35
|
+
// summary never backfills a default modelDirectory into it, so a Save of a
|
|
36
|
+
// default install writes no `modelDirectory` override and the card's field
|
|
37
|
+
// stays blank (blank means the derived default).
|
|
38
|
+
const config = request?.config ?? stored.config;
|
|
39
|
+
// The hub cache root: the plugin's model download home (created when
|
|
40
|
+
// absent), the base the cache-layout presence checks join onto and the
|
|
41
|
+
// fallback directory when nothing is cached yet.
|
|
42
|
+
const hubCacheRoot = localInfer.defaultModelDirectory();
|
|
46
43
|
const hardware = await localInfer.detectHardware();
|
|
47
44
|
// The model value the card carries maps onto the VramModel registry key the
|
|
48
45
|
// estimator prices: a default-model selection is already a registry key, a
|
|
@@ -64,17 +61,32 @@ export async function buildSummary(localInfer, request) {
|
|
|
64
61
|
const defaults = await localInfer.resolveDefaults(engine.id, modelId, hardware, pricedConfig);
|
|
65
62
|
const estimate = await localInfer.estimate(defaults.config, hardware, engine.id);
|
|
66
63
|
const guidelineResults = await localInfer.guidelines(defaults.config, hardware, engine.id);
|
|
67
|
-
// The
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
const
|
|
64
|
+
// The selected default entry: the resolved directory, the model status, and
|
|
65
|
+
// the download commands all read it; undefined when no default names the
|
|
66
|
+
// model.
|
|
67
|
+
const entry = defaultModelFor(engine.id, modelId);
|
|
68
|
+
// The shared model-directory resolution reads the raw config field (never
|
|
69
|
+
// a backfilled copy): the override keeps the flat layout, and the hub-cache
|
|
70
|
+
// layout names the hf download result (the snapshot holding the selected
|
|
71
|
+
// artifact) or the hub cache root as the display directory, with the base
|
|
72
|
+
// the presence checks join onto. The display directory is never persisted
|
|
73
|
+
// back into the stored config.
|
|
74
|
+
const resolution = resolveModelDirectory(config.modelDirectory, entry, hubCacheRoot);
|
|
75
|
+
const modelDirectory = resolution.directory;
|
|
76
|
+
// The model scan lists the models the selected engine can serve: the hub
|
|
77
|
+
// cache's `models--*` directories (the repo ids, filtered by the engine's
|
|
78
|
+
// artifact types) when the model directory is the plugin default, else the
|
|
79
|
+
// flat directory's top-level entries. A missing directory reads as an empty
|
|
80
|
+
// list.
|
|
81
|
+
const modelFiles = resolution.useHubCache
|
|
82
|
+
? modelCacheEntriesForEngine(localInfer.listModelCache(), engine.id)
|
|
83
|
+
: modelEntriesForEngine(localInfer.listModelDirectory(modelDirectory), engine.id);
|
|
71
84
|
// The model status checks the selected model against the model directory
|
|
72
85
|
// and probes the hf CLI, so the card shows its Download row (or the URL
|
|
73
86
|
// row) only while the model is absent.
|
|
74
|
-
const entry = defaultModelFor(engine.id, modelId);
|
|
75
87
|
let modelStatus = null;
|
|
76
88
|
if (entry !== undefined) {
|
|
77
|
-
const present =
|
|
89
|
+
const present = modelArtifactPresent(entry, resolution.baseDir, resolution.useHubCache);
|
|
78
90
|
const hfCli = (await localInfer.hfCliAvailable()) !== null;
|
|
79
91
|
modelStatus = {
|
|
80
92
|
modelId: entry.modelId,
|
|
@@ -82,7 +94,7 @@ export async function buildSummary(localInfer, request) {
|
|
|
82
94
|
url: entry.url,
|
|
83
95
|
present,
|
|
84
96
|
hfCli,
|
|
85
|
-
downloadCommand: hfDownloadCommand(entry,
|
|
97
|
+
downloadCommand: hfDownloadCommand(entry, modelDirectory, resolution.useHubCache),
|
|
86
98
|
};
|
|
87
99
|
}
|
|
88
100
|
// The chat-template status checks the selected template against the model
|
|
@@ -93,14 +105,14 @@ export async function buildSummary(localInfer, request) {
|
|
|
93
105
|
const chatTemplateValue = typeof config.chatTemplate === 'string' ? config.chatTemplate : '';
|
|
94
106
|
let chatTemplateStatus = null;
|
|
95
107
|
if (isHfRepoReference(chatTemplateValue)) {
|
|
96
|
-
const present =
|
|
108
|
+
const present = chatTemplatePresent(chatTemplateValue, resolution.baseDir, resolution.useHubCache);
|
|
97
109
|
const hfCli = (await localInfer.hfCliAvailable()) !== null;
|
|
98
110
|
chatTemplateStatus = {
|
|
99
111
|
repo: chatTemplateValue,
|
|
100
112
|
label: chatTemplateLabel(chatTemplateValue),
|
|
101
113
|
present,
|
|
102
114
|
hfCli,
|
|
103
|
-
downloadCommand: hfChatTemplateCommand(chatTemplateValue,
|
|
115
|
+
downloadCommand: hfChatTemplateCommand(chatTemplateValue, modelDirectory, resolution.useHubCache),
|
|
104
116
|
};
|
|
105
117
|
}
|
|
106
118
|
// The restart re-link: a provider entry whose launch record names a still-
|
|
@@ -134,12 +146,17 @@ export async function buildSummary(localInfer, request) {
|
|
|
134
146
|
status: providerStatuses[provider.id] ?? 'unsure',
|
|
135
147
|
config: provider.config,
|
|
136
148
|
platform: provider.platform,
|
|
149
|
+
// exactOptionalPropertyTypes: carry the Auto Rebuild flag only when the
|
|
150
|
+
// stored entry has it, so an entry saved before the key existed carries
|
|
151
|
+
// no key and the card draws the checkbox unchecked.
|
|
152
|
+
...(provider.autoRebuild !== undefined ? { autoRebuild: provider.autoRebuild } : {}),
|
|
137
153
|
}));
|
|
138
154
|
// The "unsure" banner: shown when no provider is confirmed running but at
|
|
139
155
|
// least one reads as unsure (a foreign engine the detector saw but could
|
|
140
|
-
// not tie to a model, or a busy card). The banner offers
|
|
141
|
-
//
|
|
142
|
-
//
|
|
156
|
+
// not tie to a model, or a busy card). The banner offers the host-OS stop
|
|
157
|
+
// commands (Stop-Process on Windows, kill on Linux and macOS) for the engine
|
|
158
|
+
// processes the detector saw holding VRAM, so the user can stop a provider
|
|
159
|
+
// launched in another session.
|
|
143
160
|
const anyRunning = providers.some((p) => p.status === 'running');
|
|
144
161
|
const anyUnsure = providers.some((p) => p.status === 'unsure');
|
|
145
162
|
const unsureBanner = !anyRunning && anyUnsure
|
|
@@ -148,6 +165,12 @@ export async function buildSummary(localInfer, request) {
|
|
|
148
165
|
killCommands: await localInfer.unsureBannerKillCommands(),
|
|
149
166
|
}
|
|
150
167
|
: null;
|
|
168
|
+
// The "Unknown Engine(s)" readout shows the VRAM the detector's foreign
|
|
169
|
+
// engine programs are holding: the OS-reserve segment is the GPU's used
|
|
170
|
+
// VRAM when a foreign engine is detected, so the readout names the
|
|
171
|
+
// footprint a provider launched in another session is eating off the
|
|
172
|
+
// card. Absent when no provider reads as unsure.
|
|
173
|
+
const unknownEngines = anyUnsure ? { bytes: estimate.breakdown.reserve } : null;
|
|
151
174
|
// The registered flag tells the card whether the current config's provider
|
|
152
175
|
// and model are already in the DSH settings, so the Remove button shows
|
|
153
176
|
// only when there is something to remove. A profile without the settings
|
|
@@ -172,8 +195,10 @@ export async function buildSummary(localInfer, request) {
|
|
|
172
195
|
engines: ENGINES.map((entry) => {
|
|
173
196
|
// The platform defaults ride the engine entry so the card's Engine
|
|
174
197
|
// platform section seeds the build-command and docker-tag placeholders
|
|
175
|
-
// from the same data the deploy step consumes.
|
|
176
|
-
|
|
198
|
+
// from the same data the deploy step consumes. The build command is the
|
|
199
|
+
// engine's first build step for the detected host OS, so a Windows host
|
|
200
|
+
// seeds the vcpkg route and a Linux host seeds the cmake route.
|
|
201
|
+
const defaults = enginePlatformDefaults(entry.id, hardware.os);
|
|
177
202
|
return {
|
|
178
203
|
id: entry.id,
|
|
179
204
|
label: entry.label,
|
|
@@ -184,6 +209,7 @@ export async function buildSummary(localInfer, request) {
|
|
|
184
209
|
...(defaults.defaultDockerTag !== undefined
|
|
185
210
|
? { defaultDockerTag: defaults.defaultDockerTag }
|
|
186
211
|
: {}),
|
|
212
|
+
defaultEngineDirectory: dshEngineCacheDirectory(entry.id),
|
|
187
213
|
};
|
|
188
214
|
}),
|
|
189
215
|
models: localInfer.registeredVramModels().map((model) => ({ id: model.id, source: model.source })),
|
|
@@ -193,13 +219,7 @@ export async function buildSummary(localInfer, request) {
|
|
|
193
219
|
// host-KV slider cap), so the render model and the meter agree on the
|
|
194
220
|
// machine they run on.
|
|
195
221
|
formModel: renderForm(engine.parameters, config, hardware),
|
|
196
|
-
meterModel: renderMeter(estimate.breakdown, estimate.verdict, hardware.gpu?.vramGiB ?? 0, estimate.source, estimate.reserveSource,
|
|
197
|
-
// The "Unknown Engine(s)" readout shows the VRAM the detector's foreign
|
|
198
|
-
// engine programs are holding: the OS-reserve segment is the GPU's used
|
|
199
|
-
// VRAM when a foreign engine is detected, so the readout names the
|
|
200
|
-
// footprint a provider launched in another session is eating off the
|
|
201
|
-
// card. Absent when no provider reads as unsure.
|
|
202
|
-
anyUnsure ? { bytes: estimate.breakdown.reserve } : null),
|
|
222
|
+
meterModel: renderMeter(estimate.breakdown, estimate.verdict, hardware.gpu?.vramGiB ?? 0, estimate.source, estimate.reserveSource, unknownEngines),
|
|
203
223
|
verdict: estimate.verdict,
|
|
204
224
|
warningsModel: renderWarnings(guidelineResults),
|
|
205
225
|
config,
|
|
@@ -222,4 +242,4 @@ export async function buildSummary(localInfer, request) {
|
|
|
222
242
|
registered,
|
|
223
243
|
};
|
|
224
244
|
}
|
|
225
|
-
//# sourceMappingURL=summary.js.map
|
|
245
|
+
//# sourceMappingURL=summary.js.map
|
|
@@ -27,4 +27,4 @@ export declare function chatTemplateLabel(repo: string): string;
|
|
|
27
27
|
* the engine's first default model.
|
|
28
28
|
*/
|
|
29
29
|
export declare function resolveModelRegistryId(engineId: string, model: unknown): string;
|
|
30
|
-
//# sourceMappingURL=summaryHelpers.d.ts.map
|
|
30
|
+
//# sourceMappingURL=summaryHelpers.d.ts.map
|
|
@@ -53,4 +53,4 @@ export declare function toneFor(level: GuidelineLevel): WarningTone;
|
|
|
53
53
|
* key so the form renders each warning next to the parameter it names.
|
|
54
54
|
*/
|
|
55
55
|
export declare function renderWarnings(results: readonly GuidelineResult[]): WarningsModel;
|
|
56
|
-
//# sourceMappingURL=warnings.d.ts.map
|
|
56
|
+
//# sourceMappingURL=warnings.d.ts.map
|
package/packages/ui/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-local-infer-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Web UI for the dsh local-inference plugin: the form-type-aware parameter form, the live VRAM Est. meter, the red hardware-warning banner, the engine lifecycle controls (build / deploy / stop), and the register-as-model confirmation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"dsh-plugin-local-infer-core": "workspace:^",
|
|
33
|
-
"dsh-plugin-local-infer-
|
|
34
|
-
"dsh-plugin-local-infer-
|
|
33
|
+
"dsh-plugin-local-infer-providers": "workspace:^",
|
|
34
|
+
"dsh-plugin-local-infer-service": "workspace:^"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@deepseek-ai/cordis": ">=4.0.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
40
|
+
"@deepseek-ai/cordis": "^4.0.6-alpha.2"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Strata parameter surface. The declarative `ParameterSpec` data for the
|
|
3
|
-
* Strata engine (https://github.com/Niko1221/Strata), sourced from the
|
|
4
|
-
* repository's `docs/AI_SETUP.md` (the `strata launch` flags) and
|
|
5
|
-
* `docs/DOCKER.md` (the container environment variables). Each spec carries
|
|
6
|
-
* both a `toArgv` spelling (the `strata launch` flag the binary and source
|
|
7
|
-
* build modes pass) and a `toEnv` spelling (the container variable the docker
|
|
8
|
-
* mode passes), so the one surface renders every build mode.
|
|
9
|
-
*
|
|
10
|
-
* The data is the surface; the `StrataAdapter` composes it into a `LaunchPlan`.
|
|
11
|
-
* Adding a flag here is a data edit, never an adapter rewire.
|
|
12
|
-
* @module dsh-plugin-local-infer/providers/strata
|
|
13
|
-
*/
|
|
14
|
-
import type { Config, EnumOption, ParameterSpec } from 'dsh-plugin-local-infer/core';
|
|
15
|
-
/**
|
|
16
|
-
* The model families Strata serves. `qwen` is the Qwen3.8-Flash-Next family
|
|
17
|
-
* (the default); the others are the size-specific variants the README's
|
|
18
|
-
* Models section names.
|
|
19
|
-
*/
|
|
20
|
-
export declare const STRATA_FAMILY_OPTIONS: readonly EnumOption[];
|
|
21
|
-
/**
|
|
22
|
-
* The picture-reader modes. `on` lets the engine pick the CPU reader under a
|
|
23
|
-
* 24 GB card and the GPU reader from 24 GB; `gpu` and `cpu` force a side.
|
|
24
|
-
*/
|
|
25
|
-
export declare const STRATA_VISION_OPTIONS: readonly EnumOption[];
|
|
26
|
-
/**
|
|
27
|
-
* The tuning modes. `skip` is the engine default (no tuning run); `quick` is
|
|
28
|
-
* a one-time run of up to about 20 minutes; `thorough` is a longer run.
|
|
29
|
-
*/
|
|
30
|
-
export declare const STRATA_TUNE_OPTIONS: readonly EnumOption[];
|
|
31
|
-
/**
|
|
32
|
-
* The access modes. `local` listens on 127.0.0.1 only and needs no key; every
|
|
33
|
-
* other mode makes a key for you, because the server is then reachable beyond
|
|
34
|
-
* this machine.
|
|
35
|
-
*/
|
|
36
|
-
export declare const STRATA_ACCESS_OPTIONS: readonly EnumOption[];
|
|
37
|
-
/**
|
|
38
|
-
* The Strata `ParameterSpec` surface, in form order. The `group` field is the
|
|
39
|
-
* form section; specs without a group render under `General`. The `toArgv`
|
|
40
|
-
* spelling is the `strata launch` flag the binary and source-build modes pass;
|
|
41
|
-
* the `toEnv` spelling is the container variable the docker mode passes. A
|
|
42
|
-
* spec with no `toEnv` (access, dataDir) has no docker counterpart, and a spec
|
|
43
|
-
* with no `toArgv` (port) is spelled by the adapter from the value.
|
|
44
|
-
*/
|
|
45
|
-
export declare const STRATA_PARAMETERS: readonly ParameterSpec[];
|
|
46
|
-
/**
|
|
47
|
-
* The Strata model key a config carries: the string model value, falling back
|
|
48
|
-
* to an empty string so a bare config renders a plan the engine sizes for the
|
|
49
|
-
* card (the engine picks the model when none is named). A value that names a
|
|
50
|
-
* local artifact file passes through unchanged.
|
|
51
|
-
*/
|
|
52
|
-
export declare function strataModelKey(config: Config): string;
|
|
53
|
-
//# sourceMappingURL=strata.d.ts.map
|