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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NInfer shared Linux build profile. Every Linux distro (Arch, Debian,
|
|
3
|
+
* Fedora) builds NInfer through this one route: cmake with the Ninja generator
|
|
4
|
+
* into the `build` directory, which is where the `ninfer-serve` binary lands.
|
|
5
|
+
* The distro profiles reuse this profile, so a distro carries no build steps of
|
|
6
|
+
* its own.
|
|
7
|
+
* @module dsh-plugin-local-infer/providers/engines/ninfer/ninferLinux
|
|
8
|
+
*/
|
|
9
|
+
import { SYSTEM_DEPS } from "../../systemDeps.js";
|
|
10
|
+
export const NINFER_LINUX = {
|
|
11
|
+
buildSteps: [
|
|
12
|
+
'cmake -S {dir} -B {dir}/build -G Ninja -DCMAKE_BUILD_TYPE=Release && cmake --build {dir}/build -j',
|
|
13
|
+
],
|
|
14
|
+
buildDir: 'build',
|
|
15
|
+
binary: 'ninfer-serve',
|
|
16
|
+
// The Linux local build needs the compile toolchain (cmake, ninja), the
|
|
17
|
+
// ffmpeg and curl dev libraries (pkg-config, ffmpeg, curl), the CUDA
|
|
18
|
+
// toolkit, and the hf CLI to download the model.
|
|
19
|
+
deps: [
|
|
20
|
+
SYSTEM_DEPS.cmake,
|
|
21
|
+
SYSTEM_DEPS.ninja,
|
|
22
|
+
SYSTEM_DEPS.pkgConfig,
|
|
23
|
+
SYSTEM_DEPS.ffmpeg,
|
|
24
|
+
SYSTEM_DEPS.curl,
|
|
25
|
+
SYSTEM_DEPS.cudaToolkit,
|
|
26
|
+
SYSTEM_DEPS.hfCli,
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* ninferLinuxBinary returns the NInfer engine binary name on Linux: the plain
|
|
31
|
+
* `ninfer-serve` (no .exe). The name comes from the shared Linux profile, so
|
|
32
|
+
* the spelling has one home.
|
|
33
|
+
*/
|
|
34
|
+
export function ninferLinuxBinary() {
|
|
35
|
+
return NINFER_LINUX.binary ?? 'ninfer-serve';
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=ninferLinux.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NInfer macOS build profile. macOS builds NInfer through the same cmake
|
|
3
|
+
* route as Linux, so this profile reuses the shared Linux build steps and
|
|
4
|
+
* build directory; the binary keeps its plain name (no .exe on macOS).
|
|
5
|
+
* @module dsh-plugin-local-infer/providers/engines/ninfer/ninferMacOS
|
|
6
|
+
*/
|
|
7
|
+
import type { EngineOsProfile } from '../engineOs.ts';
|
|
8
|
+
export declare const NINFER_MACOS: EngineOsProfile;
|
|
9
|
+
/**
|
|
10
|
+
* ninferMacOSBinary returns the NInfer engine binary name on macOS: the plain
|
|
11
|
+
* `ninfer-serve` (no .exe on macOS). The name comes from the shared Linux
|
|
12
|
+
* profile the macOS profile reuses, so the spelling has one home.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ninferMacOSBinary(): string;
|
|
15
|
+
//# sourceMappingURL=ninferMacOS.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NInfer macOS build profile. macOS builds NInfer through the same cmake
|
|
3
|
+
* route as Linux, so this profile reuses the shared Linux build steps and
|
|
4
|
+
* build directory; the binary keeps its plain name (no .exe on macOS).
|
|
5
|
+
* @module dsh-plugin-local-infer/providers/engines/ninfer/ninferMacOS
|
|
6
|
+
*/
|
|
7
|
+
import { NINFER_LINUX } from "./ninferLinux.js";
|
|
8
|
+
export const NINFER_MACOS = NINFER_LINUX;
|
|
9
|
+
/**
|
|
10
|
+
* ninferMacOSBinary returns the NInfer engine binary name on macOS: the plain
|
|
11
|
+
* `ninfer-serve` (no .exe on macOS). The name comes from the shared Linux
|
|
12
|
+
* profile the macOS profile reuses, so the spelling has one home.
|
|
13
|
+
*/
|
|
14
|
+
export function ninferMacOSBinary() {
|
|
15
|
+
return NINFER_MACOS.binary ?? 'ninfer-serve';
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ninferMacOS.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NInfer Windows build profile. The Windows route is the ninfer-all fork's
|
|
3
|
+
* vcpkg build: the manifest pulls the dev libraries, then the engine's own
|
|
4
|
+
* build-native.bat configures and builds. The step cds into the checkout first
|
|
5
|
+
* (the {dir} placeholder), because vcpkg install and the relative script path
|
|
6
|
+
* both resolve against the checkout root.
|
|
7
|
+
*
|
|
8
|
+
* The build leaves the engine binary in the Windows build tree, not the Linux
|
|
9
|
+
* build directory: the vcpkg route writes ninfer-serve.exe into
|
|
10
|
+
* build-windows\apps\Release, so the launch step reads the binary from that
|
|
11
|
+
* directory, not from the shared Linux build directory. The launch binary is
|
|
12
|
+
* the path relative to the checkout root (the engine directory the spawn runs
|
|
13
|
+
* in), so the spawn resolves it against the default or override engine dir.
|
|
14
|
+
* @module dsh-plugin-local-infer/providers/engines/ninfer/ninferWindows
|
|
15
|
+
*/
|
|
16
|
+
import type { EngineOsProfile } from '../engineOs.ts';
|
|
17
|
+
export declare const NINFER_WINDOWS: EngineOsProfile;
|
|
18
|
+
/**
|
|
19
|
+
* ninferWindowsBinary returns the NInfer launch binary on Windows: the path
|
|
20
|
+
* relative to the checkout root (the engine directory the spawn runs in) where
|
|
21
|
+
* the vcpkg build-native route writes the Release binary,
|
|
22
|
+
* `build-windows/apps/Release/ninfer-serve.exe`. The directory and the .exe
|
|
23
|
+
* name both come from the Windows profile, so the build tree and the spelling
|
|
24
|
+
* have one home. `join` keeps the result cross-platform: the host's path module
|
|
25
|
+
* normalizes the separators, so the spawn resolves it on Windows, Linux, and
|
|
26
|
+
* macOS alike.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ninferWindowsBinary(): string;
|
|
29
|
+
//# sourceMappingURL=ninferWindows.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NInfer Windows build profile. The Windows route is the ninfer-all fork's
|
|
3
|
+
* vcpkg build: the manifest pulls the dev libraries, then the engine's own
|
|
4
|
+
* build-native.bat configures and builds. The step cds into the checkout first
|
|
5
|
+
* (the {dir} placeholder), because vcpkg install and the relative script path
|
|
6
|
+
* both resolve against the checkout root.
|
|
7
|
+
*
|
|
8
|
+
* The build leaves the engine binary in the Windows build tree, not the Linux
|
|
9
|
+
* build directory: the vcpkg route writes ninfer-serve.exe into
|
|
10
|
+
* build-windows\apps\Release, so the launch step reads the binary from that
|
|
11
|
+
* directory, not from the shared Linux build directory. The launch binary is
|
|
12
|
+
* the path relative to the checkout root (the engine directory the spawn runs
|
|
13
|
+
* in), so the spawn resolves it against the default or override engine dir.
|
|
14
|
+
* @module dsh-plugin-local-infer/providers/engines/ninfer/ninferWindows
|
|
15
|
+
*/
|
|
16
|
+
import { join } from 'node:path';
|
|
17
|
+
import { SYSTEM_DEPS } from "../../systemDeps.js";
|
|
18
|
+
export const NINFER_WINDOWS = {
|
|
19
|
+
buildSteps: [
|
|
20
|
+
'$env:PATH="C:\\Program Files\\Microsoft Visual Studio\\18\\Community\\VC\\vcpkg;$env:PATH"; $env:NINFER_VCPKG_ROOT="C:\\Program Files\\Microsoft Visual Studio\\18\\Community\\VC\\vcpkg"; cd {dir} && vcpkg install && .\\scripts\\build-native.bat configure && .\\scripts\\build-native.bat build && .\\scripts\\build-native.bat build',
|
|
21
|
+
],
|
|
22
|
+
// The vcpkg build-native route writes the Release binary into the Windows
|
|
23
|
+
// build tree, not the Linux build directory the shared route uses. The
|
|
24
|
+
// separators are forward slashes (valid on every platform) so the directory
|
|
25
|
+
// joins cross-platform; the host's path module normalizes them on use.
|
|
26
|
+
buildDir: 'build-windows/apps/Release',
|
|
27
|
+
binary: 'ninfer-serve.exe',
|
|
28
|
+
// pwsh.exe (PowerShell 7+) is the modern shell the vcpkg build tooling
|
|
29
|
+
// expects; the legacy powershell.exe (Windows PowerShell 5.1) lacks it.
|
|
30
|
+
shell: 'pwsh.exe',
|
|
31
|
+
// The Windows local build is the vcpkg route: the winget toolchain (CMake,
|
|
32
|
+
// Ninja, the MSVC compiler, the CUDA toolkit) plus the hf CLI and git. The
|
|
33
|
+
// vcpkg manifest pulls the ffmpeg and curl dev libraries, so the Linux
|
|
34
|
+
// pkg-config/ffmpeg/curl deps do not ride the Windows list.
|
|
35
|
+
deps: [
|
|
36
|
+
SYSTEM_DEPS.cmake,
|
|
37
|
+
SYSTEM_DEPS.ninja,
|
|
38
|
+
SYSTEM_DEPS.visualStudio,
|
|
39
|
+
SYSTEM_DEPS.cudaToolkit,
|
|
40
|
+
SYSTEM_DEPS.hfCli,
|
|
41
|
+
SYSTEM_DEPS.git,
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* ninferWindowsBinary returns the NInfer launch binary on Windows: the path
|
|
46
|
+
* relative to the checkout root (the engine directory the spawn runs in) where
|
|
47
|
+
* the vcpkg build-native route writes the Release binary,
|
|
48
|
+
* `build-windows/apps/Release/ninfer-serve.exe`. The directory and the .exe
|
|
49
|
+
* name both come from the Windows profile, so the build tree and the spelling
|
|
50
|
+
* have one home. `join` keeps the result cross-platform: the host's path module
|
|
51
|
+
* normalizes the separators, so the spawn resolves it on Windows, Linux, and
|
|
52
|
+
* macOS alike.
|
|
53
|
+
*/
|
|
54
|
+
export function ninferWindowsBinary() {
|
|
55
|
+
const binary = NINFER_WINDOWS.binary ?? 'ninfer-serve.exe';
|
|
56
|
+
const buildDir = NINFER_WINDOWS.buildDir;
|
|
57
|
+
return buildDir !== undefined ? join(buildDir, binary) : binary;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=ninferWindows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* The data is the surface; the `StrataAdapter` composes it into a `LaunchPlan`.
|
|
11
11
|
* Adding a flag here is a data edit, never an adapter rewire.
|
|
12
|
-
* @module dsh-plugin-local-infer/providers/strata
|
|
12
|
+
* @module dsh-plugin-local-infer/providers/engines/strata/strata
|
|
13
13
|
*/
|
|
14
14
|
/**
|
|
15
15
|
* The model families Strata serves. `qwen` is the Qwen3.8-Flash-Next family
|
|
@@ -70,7 +70,10 @@ export const STRATA_ACCESS_OPTIONS = [
|
|
|
70
70
|
* spelling is the `strata launch` flag the binary and source-build modes pass;
|
|
71
71
|
* the `toEnv` spelling is the container variable the docker mode passes. A
|
|
72
72
|
* spec with no `toEnv` (access, dataDir) has no docker counterpart, and a spec
|
|
73
|
-
* with no `toArgv` (port) is spelled by the adapter from the value.
|
|
73
|
+
* with no `toArgv` (port) is spelled by the adapter from the value. The shared
|
|
74
|
+
* specs declare both deploy targets (`cli` and `env`), so the binary and
|
|
75
|
+
* source-build plans spell the flags and the docker plan carries the env vars;
|
|
76
|
+
* `access`, `dataDir`, and `port` stay `cli`-only.
|
|
74
77
|
*/
|
|
75
78
|
export const STRATA_PARAMETERS = [
|
|
76
79
|
{
|
|
@@ -88,6 +91,7 @@ export const STRATA_PARAMETERS = [
|
|
|
88
91
|
// The port contributes no flag of its own: renderLaunch spells the local
|
|
89
92
|
// --port and the docker host-port mapping from this value, and the health
|
|
90
93
|
// URL and container name derive from it too.
|
|
94
|
+
deploy: { target: 'cli' },
|
|
91
95
|
},
|
|
92
96
|
{
|
|
93
97
|
key: 'family',
|
|
@@ -98,6 +102,7 @@ export const STRATA_PARAMETERS = [
|
|
|
98
102
|
group: 'Model',
|
|
99
103
|
toArgv: (value) => ['--family', String(value)],
|
|
100
104
|
toEnv: (value) => ['FAMILY', String(value)],
|
|
105
|
+
deploy: [{ target: 'cli' }, { target: 'env' }],
|
|
101
106
|
},
|
|
102
107
|
{
|
|
103
108
|
key: 'context',
|
|
@@ -109,6 +114,7 @@ export const STRATA_PARAMETERS = [
|
|
|
109
114
|
// envFromSpecs only calls toEnv when the value is set, so the pair is
|
|
110
115
|
// always well-formed here.
|
|
111
116
|
toEnv: (value) => ['CONTEXT', String(value)],
|
|
117
|
+
deploy: [{ target: 'cli' }, { target: 'env' }],
|
|
112
118
|
},
|
|
113
119
|
{
|
|
114
120
|
key: 'vision',
|
|
@@ -119,6 +125,7 @@ export const STRATA_PARAMETERS = [
|
|
|
119
125
|
group: 'Engine',
|
|
120
126
|
toArgv: (value) => ['--vision', String(value)],
|
|
121
127
|
toEnv: (value) => ['VISION', String(value)],
|
|
128
|
+
deploy: [{ target: 'cli' }, { target: 'env' }],
|
|
122
129
|
},
|
|
123
130
|
{
|
|
124
131
|
key: 'parallel',
|
|
@@ -128,6 +135,7 @@ export const STRATA_PARAMETERS = [
|
|
|
128
135
|
group: 'Concurrency',
|
|
129
136
|
toArgv: (value) => (value === undefined ? [] : ['--parallel', String(value)]),
|
|
130
137
|
toEnv: (value) => ['PARALLEL', String(value)],
|
|
138
|
+
deploy: [{ target: 'cli' }, { target: 'env' }],
|
|
131
139
|
},
|
|
132
140
|
{
|
|
133
141
|
key: 'gpu',
|
|
@@ -137,6 +145,7 @@ export const STRATA_PARAMETERS = [
|
|
|
137
145
|
group: 'Engine',
|
|
138
146
|
toArgv: (value) => (value ? ['--gpu', String(value)] : []),
|
|
139
147
|
toEnv: (value) => ['GPU', String(value)],
|
|
148
|
+
deploy: [{ target: 'cli' }, { target: 'env' }],
|
|
140
149
|
},
|
|
141
150
|
{
|
|
142
151
|
key: 'tune',
|
|
@@ -147,6 +156,7 @@ export const STRATA_PARAMETERS = [
|
|
|
147
156
|
group: 'Engine',
|
|
148
157
|
toArgv: (value) => ['--tune', String(value)],
|
|
149
158
|
toEnv: (value) => ['TUNE', String(value)],
|
|
159
|
+
deploy: [{ target: 'cli' }, { target: 'env' }],
|
|
150
160
|
},
|
|
151
161
|
{
|
|
152
162
|
key: 'access',
|
|
@@ -157,6 +167,7 @@ export const STRATA_PARAMETERS = [
|
|
|
157
167
|
group: 'Engine',
|
|
158
168
|
// local is the engine default, so the bare value spells no flag.
|
|
159
169
|
toArgv: (value) => (value === 'local' ? [] : ['--access', String(value)]),
|
|
170
|
+
deploy: { target: 'cli' },
|
|
160
171
|
},
|
|
161
172
|
{
|
|
162
173
|
key: 'apiKey',
|
|
@@ -166,6 +177,7 @@ export const STRATA_PARAMETERS = [
|
|
|
166
177
|
group: 'Engine',
|
|
167
178
|
toArgv: (value) => (value ? ['--api-key', String(value)] : []),
|
|
168
179
|
toEnv: (value) => ['API_KEY', String(value)],
|
|
180
|
+
deploy: [{ target: 'cli' }, { target: 'env' }],
|
|
169
181
|
},
|
|
170
182
|
{
|
|
171
183
|
key: 'modelPath',
|
|
@@ -175,6 +187,7 @@ export const STRATA_PARAMETERS = [
|
|
|
175
187
|
group: 'Artifacts',
|
|
176
188
|
toArgv: (value) => (value ? ['--model-path', String(value)] : []),
|
|
177
189
|
toEnv: (value) => ['MODEL_PATH', String(value)],
|
|
190
|
+
deploy: [{ target: 'cli' }, { target: 'env' }],
|
|
178
191
|
},
|
|
179
192
|
{
|
|
180
193
|
key: 'dataDir',
|
|
@@ -183,6 +196,7 @@ export const STRATA_PARAMETERS = [
|
|
|
183
196
|
form: { kind: 'path' },
|
|
184
197
|
group: 'Artifacts',
|
|
185
198
|
toArgv: (value) => (value ? ['--data-dir', String(value)] : []),
|
|
199
|
+
deploy: { target: 'cli' },
|
|
186
200
|
},
|
|
187
201
|
];
|
|
188
202
|
/**
|
|
@@ -194,4 +208,57 @@ export const STRATA_PARAMETERS = [
|
|
|
194
208
|
export function strataModelKey(config) {
|
|
195
209
|
return typeof config.model === 'string' ? config.model : '';
|
|
196
210
|
}
|
|
197
|
-
|
|
211
|
+
/**
|
|
212
|
+
* strataDefaults resolves the source-build launch values (family, vision,
|
|
213
|
+
* context) from the config, falling back to the parameter surface's
|
|
214
|
+
* defaultValue when the config names no value. The surface is the single home
|
|
215
|
+
* for the defaults, so the adapter's renderLaunch never hard-codes one.
|
|
216
|
+
* `context` carries no surface default (the engine picks the largest that
|
|
217
|
+
* fits), so it resolves to undefined when the config names no value.
|
|
218
|
+
*/
|
|
219
|
+
export function strataDefaults(config) {
|
|
220
|
+
const resolve = (key) => {
|
|
221
|
+
const value = config[key];
|
|
222
|
+
if (typeof value === 'string' && value !== '') {
|
|
223
|
+
return value;
|
|
224
|
+
}
|
|
225
|
+
const spec = STRATA_PARAMETERS.find((candidate) => candidate.key === key);
|
|
226
|
+
return typeof spec?.defaultValue === 'string' ? spec.defaultValue : undefined;
|
|
227
|
+
};
|
|
228
|
+
const family = resolve('family');
|
|
229
|
+
const vision = resolve('vision');
|
|
230
|
+
// The surface declares string defaults for family and vision, so the
|
|
231
|
+
// resolver returns a string for both. Reaching the guard means a spec lost
|
|
232
|
+
// its defaultValue, so the launch cannot be spelled; fail fast at render
|
|
233
|
+
// time rather than emit a broken argv.
|
|
234
|
+
if (family === undefined || vision === undefined) {
|
|
235
|
+
const missing = family === undefined ? 'family' : 'vision';
|
|
236
|
+
throw new Error(`the strata surface lost its ${missing} default`);
|
|
237
|
+
}
|
|
238
|
+
return { family, vision, context: resolve('context') };
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* strataSourceLaunchArgs renders the source-build wrapper argv shared by every
|
|
242
|
+
* OS. The wrapper's `--vision` takes yes|no|gpu|cpu, so the surface's on|off
|
|
243
|
+
* maps onto it (gpu and cpu pass through). The command name is the one
|
|
244
|
+
* OS-specific piece, supplied by the caller (setup.sh on Linux/Mac,
|
|
245
|
+
* START-HERE.bat on Windows).
|
|
246
|
+
*/
|
|
247
|
+
export function strataSourceLaunchArgs(command, args) {
|
|
248
|
+
// The wrapper's --vision takes yes|no|gpu|cpu; the surface's on|off maps onto
|
|
249
|
+
// it (gpu and cpu pass through).
|
|
250
|
+
const visionFlag = args.vision === 'on' ? 'yes' : args.vision === 'off' ? 'no' : args.vision;
|
|
251
|
+
return [
|
|
252
|
+
command,
|
|
253
|
+
'--yes',
|
|
254
|
+
...(args.model !== '' ? ['--model', args.model] : []),
|
|
255
|
+
...(args.family !== 'qwen' ? ['--family', args.family] : []),
|
|
256
|
+
'--vision',
|
|
257
|
+
visionFlag,
|
|
258
|
+
...(args.context !== undefined ? ['--context', args.context] : []),
|
|
259
|
+
'--port',
|
|
260
|
+
String(args.port),
|
|
261
|
+
...args.customArgs,
|
|
262
|
+
];
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=strata.js.map
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
* queries the running engine's model endpoint through the terminal for the id
|
|
14
14
|
* it actually loaded (family and size sized to the host), so the registrar
|
|
15
15
|
* publishes the served model, not a placeholder.
|
|
16
|
-
* @module dsh-plugin-local-infer/providers/engines/strataAdapter
|
|
16
|
+
* @module dsh-plugin-local-infer/providers/engines/strata/strataAdapter
|
|
17
17
|
*/
|
|
18
|
-
import { EngineAdapter } from '
|
|
19
|
-
import type { Config, DeployOptions, DeployResult, EngineLaunchSignature, EngineLaunchState, EnginePlatformConfig, HealthCheckOptions, HealthResult, HardwareProfile, LaunchPlan, LaunchProgress, LifecycleHost, ParameterSpec } from '
|
|
18
|
+
import { EngineAdapter } from '../../../../core/lib/index.js';
|
|
19
|
+
import type { CommandLogger, Config, DeployOptions, DeployResult, EngineLaunchSignature, EngineLaunchState, EnginePlatformConfig, HealthCheckOptions, HealthResult, HardwareProfile, LaunchPlan, LaunchProgress, LifecycleHost, ParameterSpec } from '../../../../core/lib/index.js';
|
|
20
20
|
/**
|
|
21
21
|
* The Strata docker image the adapter pulls and runs. The image is the
|
|
22
22
|
* upstream GitHub Container Registry artifact for the newest release's CUDA 13
|
|
@@ -90,9 +90,8 @@ export declare class StrataAdapter extends EngineAdapter {
|
|
|
90
90
|
renderLaunch(config: Config, _hw: HardwareProfile): LaunchPlan;
|
|
91
91
|
deploy(plan: LaunchPlan, platform?: EnginePlatformConfig, onProgress?: LaunchProgress, options?: DeployOptions): Promise<DeployResult>;
|
|
92
92
|
healthCheck(plan: LaunchPlan, options?: HealthCheckOptions): Promise<HealthResult>;
|
|
93
|
-
stop(plan: LaunchPlan): Promise<void>;
|
|
93
|
+
stop(plan: LaunchPlan, log?: CommandLogger): Promise<void>;
|
|
94
94
|
private buildMode;
|
|
95
95
|
private port;
|
|
96
|
-
private planKey;
|
|
97
96
|
}
|
|
98
|
-
//# sourceMappingURL=strataAdapter.d.ts.map
|
|
97
|
+
//# sourceMappingURL=strataAdapter.d.ts.map
|