dsh-plugin-local-infer 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -6
- package/cordis.patch.yml +7 -0
- package/docs/zh/README.md +24 -4
- package/dsh/client.js +4200 -4049
- package/package.json +33 -11
- package/packages/core/lib/adapter.d.ts +177 -11
- package/packages/core/lib/adapter.js +74 -1
- package/packages/core/lib/config.d.ts +1 -1
- package/packages/core/lib/config.js +1 -1
- package/packages/core/lib/debug.d.ts +1 -1
- package/packages/core/lib/debug.js +1 -1
- package/packages/core/lib/defaults.d.ts +1 -1
- package/packages/core/lib/defaults.js +1 -1
- package/packages/core/lib/deps.d.ts +48 -20
- package/packages/core/lib/deps.js +24 -8
- package/packages/core/lib/estimator.d.ts +1 -1
- package/packages/core/lib/estimator.js +1 -1
- package/packages/core/lib/guideline.d.ts +1 -1
- package/packages/core/lib/guideline.js +1 -1
- package/packages/core/lib/hardware.d.ts +1 -1
- package/packages/core/lib/hardware.js +1 -1
- package/packages/core/lib/hf-cache.d.ts +70 -0
- package/packages/core/lib/hf-cache.js +83 -0
- package/packages/core/lib/index.d.ts +16 -9
- package/packages/core/lib/index.js +10 -6
- package/packages/core/lib/infer-cache.d.ts +39 -0
- package/packages/core/lib/infer-cache.js +53 -0
- package/packages/core/lib/launch-command.d.ts +8 -4
- package/packages/core/lib/launch-command.js +13 -6
- package/packages/core/lib/launch-record.d.ts +1 -1
- package/packages/core/lib/launch-record.js +1 -1
- package/packages/core/lib/logs.d.ts +8 -1
- package/packages/core/lib/logs.js +12 -4
- package/packages/core/lib/models.d.ts +120 -14
- package/packages/core/lib/models.js +209 -17
- package/packages/core/lib/parameter.d.ts +31 -3
- package/packages/core/lib/parameter.js +1 -1
- package/packages/core/lib/progress.d.ts +54 -0
- package/packages/core/lib/progress.js +120 -0
- package/packages/core/lib/registrar.d.ts +25 -14
- package/packages/core/lib/registrar.js +30 -10
- package/packages/core/lib/reserve.d.ts +11 -3
- package/packages/core/lib/reserve.js +6 -4
- package/packages/core/lib/status.d.ts +12 -6
- package/packages/core/lib/status.js +21 -10
- package/packages/core/lib/sudo.d.ts +80 -0
- package/packages/core/lib/sudo.js +78 -0
- package/packages/core/package.json +1 -1
- package/packages/orchestrator/lib/config.d.ts +63 -0
- package/packages/orchestrator/lib/config.js +111 -0
- package/packages/orchestrator/lib/index.d.ts +51 -0
- package/packages/orchestrator/lib/index.js +73 -0
- package/packages/orchestrator/lib/route.d.ts +60 -0
- package/packages/orchestrator/lib/route.js +159 -0
- package/packages/orchestrator/locale/en.json +6 -0
- package/packages/orchestrator/package.json +39 -0
- package/packages/orchestrator/prompt.md +87 -0
- package/packages/providers/lib/acquire.d.ts +95 -15
- package/packages/providers/lib/acquire.js +239 -40
- package/packages/providers/lib/adapters.d.ts +155 -221
- package/packages/providers/lib/adapters.js +589 -935
- package/packages/providers/lib/debug.d.ts +1 -1
- package/packages/providers/lib/debug.js +1 -1
- package/packages/providers/lib/deps.d.ts +31 -212
- package/packages/providers/lib/deps.js +71 -205
- package/packages/providers/lib/engines/basalt/basalt.d.ts +130 -0
- package/packages/providers/lib/engines/basalt/basalt.js +304 -0
- package/packages/providers/lib/engines/basalt/basaltAdapter.d.ts +85 -0
- package/packages/providers/lib/engines/basalt/basaltAdapter.js +439 -0
- package/packages/providers/lib/engines/basalt/basaltLinux.d.ts +23 -0
- package/packages/providers/lib/engines/basalt/basaltLinux.js +47 -0
- package/packages/providers/lib/engines/basalt/basaltMacOS.d.ts +17 -0
- package/packages/providers/lib/engines/basalt/basaltMacOS.js +19 -0
- package/packages/providers/lib/engines/basalt/basaltWindows.d.ts +24 -0
- package/packages/providers/lib/engines/basalt/basaltWindows.js +49 -0
- package/packages/providers/lib/engines/engineOs.d.ts +24 -0
- package/packages/providers/lib/engines/engineOs.js +17 -0
- package/packages/providers/lib/{hyperqwen.d.ts → engines/hyperqwen/hyperqwen.d.ts} +2 -2
- package/packages/providers/lib/{hyperqwen.js → engines/hyperqwen/hyperqwen.js} +14 -2
- package/packages/providers/lib/engines/hyperqwen/hyperqwenAdapter.d.ts +38 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenAdapter.js +115 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenArch.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenArch.js +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenDebian.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenDebian.js +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenFedora.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenFedora.js +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenLinux.d.ts +10 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenLinux.js +14 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenMacOS.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenMacOS.js +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenWindows.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenWindows.js +9 -0
- package/packages/providers/lib/{infernix.d.ts → engines/infernix/infernix.d.ts} +7 -4
- package/packages/providers/lib/{infernix.js → engines/infernix/infernix.js} +53 -8
- package/packages/providers/lib/engines/infernix/infernixAdapter.d.ts +52 -0
- package/packages/providers/lib/engines/infernix/infernixAdapter.js +235 -0
- package/packages/providers/lib/engines/infernix/infernixArch.d.ts +9 -0
- package/packages/providers/lib/engines/infernix/infernixArch.js +9 -0
- package/packages/providers/lib/engines/infernix/infernixDebian.d.ts +9 -0
- package/packages/providers/lib/engines/infernix/infernixDebian.js +9 -0
- package/packages/providers/lib/engines/infernix/infernixFedora.d.ts +9 -0
- package/packages/providers/lib/engines/infernix/infernixFedora.js +9 -0
- package/packages/providers/lib/engines/infernix/infernixLinux.d.ts +17 -0
- package/packages/providers/lib/engines/infernix/infernixLinux.js +35 -0
- package/packages/providers/lib/engines/infernix/infernixMacOS.d.ts +16 -0
- package/packages/providers/lib/engines/infernix/infernixMacOS.js +18 -0
- package/packages/providers/lib/engines/infernix/infernixWindows.d.ts +16 -0
- package/packages/providers/lib/engines/infernix/infernixWindows.js +34 -0
- package/packages/providers/lib/{llamacpp.d.ts → engines/llamacpp/llamacpp.d.ts} +2 -2
- package/packages/providers/lib/{llamacpp.js → engines/llamacpp/llamacpp.js} +12 -2
- package/packages/providers/lib/engines/llamacpp/llamacppAdapter.d.ts +50 -0
- package/packages/providers/lib/engines/llamacpp/llamacppAdapter.js +274 -0
- package/packages/providers/lib/engines/llamacpp/llamacppArch.d.ts +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppArch.js +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppDebian.d.ts +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppDebian.js +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppFedora.d.ts +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppFedora.js +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppLinux.d.ts +17 -0
- package/packages/providers/lib/engines/llamacpp/llamacppLinux.js +28 -0
- package/packages/providers/lib/engines/llamacpp/llamacppMacOS.d.ts +15 -0
- package/packages/providers/lib/engines/llamacpp/llamacppMacOS.js +17 -0
- package/packages/providers/lib/engines/llamacpp/llamacppWindows.d.ts +15 -0
- package/packages/providers/lib/engines/llamacpp/llamacppWindows.js +26 -0
- package/packages/providers/lib/{ninfer.d.ts → engines/ninfer/ninfer.d.ts} +2 -2
- package/packages/providers/lib/{ninfer.js → engines/ninfer/ninfer.js} +25 -3
- package/packages/providers/lib/engines/ninfer/ninferAdapter.d.ts +81 -0
- package/packages/providers/lib/engines/ninfer/ninferAdapter.js +392 -0
- package/packages/providers/lib/engines/ninfer/ninferArch.d.ts +9 -0
- package/packages/providers/lib/engines/ninfer/ninferArch.js +9 -0
- package/packages/providers/lib/engines/ninfer/ninferDebian.d.ts +9 -0
- package/packages/providers/lib/engines/ninfer/ninferDebian.js +9 -0
- package/packages/providers/lib/engines/ninfer/ninferFedora.d.ts +9 -0
- package/packages/providers/lib/engines/ninfer/ninferFedora.js +9 -0
- package/packages/providers/lib/engines/ninfer/ninferLinux.d.ts +17 -0
- package/packages/providers/lib/engines/ninfer/ninferLinux.js +37 -0
- package/packages/providers/lib/engines/ninfer/ninferMacOS.d.ts +15 -0
- package/packages/providers/lib/engines/ninfer/ninferMacOS.js +17 -0
- package/packages/providers/lib/engines/ninfer/ninferWindows.d.ts +29 -0
- package/packages/providers/lib/engines/ninfer/ninferWindows.js +59 -0
- package/packages/providers/lib/engines/strata/strata.d.ts +1 -0
- package/packages/providers/lib/engines/strata/strata.js +264 -0
- package/packages/providers/lib/engines/strata/strataAdapter.d.ts +97 -0
- package/packages/providers/lib/engines/strata/strataAdapter.js +463 -0
- package/packages/providers/lib/engines/strata/strataArch.d.ts +9 -0
- package/packages/providers/lib/engines/strata/strataArch.js +9 -0
- package/packages/providers/lib/engines/strata/strataDebian.d.ts +9 -0
- package/packages/providers/lib/engines/strata/strataDebian.js +9 -0
- package/packages/providers/lib/engines/strata/strataFedora.d.ts +9 -0
- package/packages/providers/lib/engines/strata/strataFedora.js +9 -0
- package/packages/providers/lib/engines/strata/strataLinux.d.ts +21 -0
- package/packages/providers/lib/engines/strata/strataLinux.js +30 -0
- package/packages/providers/lib/engines/strata/strataMacOS.d.ts +16 -0
- package/packages/providers/lib/engines/strata/strataMacOS.js +17 -0
- package/packages/providers/lib/engines/strata/strataWindows.d.ts +27 -0
- package/packages/providers/lib/engines/strata/strataWindows.js +37 -0
- package/packages/providers/lib/engines.d.ts +8 -5
- package/packages/providers/lib/engines.js +22 -11
- package/packages/providers/lib/guidelines.d.ts +5 -4
- package/packages/providers/lib/guidelines.js +18 -5
- package/packages/providers/lib/index.d.ts +33 -24
- package/packages/providers/lib/index.js +46 -24
- package/packages/providers/lib/model-defaults.d.ts +10 -5
- package/packages/providers/lib/model-defaults.js +47 -5
- package/packages/providers/lib/platform.d.ts +8 -5
- package/packages/providers/lib/platform.js +27 -7
- package/packages/providers/lib/presets.d.ts +6 -4
- package/packages/providers/lib/presets.js +53 -5
- package/packages/providers/lib/systemDeps.d.ts +313 -0
- package/packages/providers/lib/systemDeps.js +284 -0
- package/packages/providers/lib/vram.d.ts +34 -8
- package/packages/providers/lib/vram.js +81 -8
- package/packages/providers/package.json +2 -2
- package/packages/service/lib/index.d.ts +187 -23
- package/packages/service/lib/index.js +667 -90
- package/packages/service/lib/launch-target.d.ts +19 -0
- package/packages/service/lib/launch-target.js +28 -0
- package/packages/service/lib/run-logs.d.ts +72 -0
- package/packages/service/lib/run-logs.js +125 -0
- package/packages/service/lib/types.d.ts +166 -8
- package/packages/service/lib/types.js +1 -1
- package/packages/service/package.json +2 -2
- package/packages/tool/lib/index.d.ts +1 -1
- package/packages/tool/lib/index.js +1 -1
- package/packages/tool/package.json +2 -2
- package/packages/ui/lib/config.d.ts +89 -0
- package/packages/ui/lib/config.js +251 -0
- package/packages/ui/lib/deps.d.ts +4 -4
- package/packages/ui/lib/deps.js +1 -1
- package/packages/ui/lib/form.d.ts +1 -1
- package/packages/ui/lib/form.js +1 -1
- package/packages/ui/lib/index.d.ts +7 -1
- package/packages/ui/lib/index.js +12 -2
- package/packages/ui/lib/meter.d.ts +1 -1
- package/packages/ui/lib/meter.js +1 -1
- package/packages/ui/lib/ops/engine.d.ts +216 -0
- package/packages/ui/lib/ops/engine.js +697 -0
- package/packages/ui/lib/ops/get-steps.d.ts +98 -0
- package/packages/ui/lib/ops/get-steps.js +359 -0
- package/packages/ui/lib/ops/hf.d.ts +42 -0
- package/packages/ui/lib/ops/hf.js +150 -0
- package/packages/ui/lib/ops/logs.d.ts +78 -0
- package/packages/ui/lib/ops/logs.js +119 -0
- package/packages/ui/lib/ops/model.d.ts +71 -0
- package/packages/ui/lib/ops/model.js +123 -0
- package/packages/ui/lib/request.d.ts +106 -0
- package/packages/ui/lib/request.js +80 -0
- package/packages/ui/lib/route.d.ts +106 -422
- package/packages/ui/lib/route.js +136 -1845
- package/packages/ui/lib/routes/chat-template.d.ts +1 -0
- package/packages/ui/lib/routes/chat-template.js +1 -0
- package/packages/ui/lib/routes/deps.d.ts +1 -0
- package/packages/ui/lib/routes/deps.js +1 -0
- package/packages/ui/lib/routes/download.d.ts +1 -0
- package/packages/ui/lib/routes/download.js +1 -0
- package/packages/ui/lib/routes/get.d.ts +1 -0
- package/packages/ui/lib/routes/get.js +106 -0
- package/packages/ui/lib/routes/install.d.ts +16 -0
- package/packages/ui/lib/routes/install.js +36 -0
- package/packages/ui/lib/routes/launch.d.ts +24 -0
- package/packages/ui/lib/routes/launch.js +74 -0
- package/packages/ui/lib/routes/logs.d.ts +57 -0
- package/packages/ui/lib/routes/logs.js +117 -0
- package/packages/ui/lib/routes/provider-delete.d.ts +15 -0
- package/packages/ui/lib/routes/provider-delete.js +37 -0
- package/packages/ui/lib/routes/register.d.ts +16 -0
- package/packages/ui/lib/routes/register.js +28 -0
- package/packages/ui/lib/routes/save.d.ts +18 -0
- package/packages/ui/lib/routes/save.js +159 -0
- package/packages/ui/lib/routes/stop.d.ts +19 -0
- package/packages/ui/lib/routes/stop.js +32 -0
- package/packages/ui/lib/routes/stream.d.ts +40 -0
- package/packages/ui/lib/routes/stream.js +68 -0
- package/packages/ui/lib/routes/summary.d.ts +15 -0
- package/packages/ui/lib/routes/summary.js +26 -0
- package/packages/ui/lib/routes/unregister.d.ts +14 -0
- package/packages/ui/lib/routes/unregister.js +26 -0
- package/packages/ui/lib/viewmodels/deps.d.ts +1 -0
- package/packages/ui/lib/viewmodels/deps.js +1 -0
- package/packages/ui/lib/viewmodels/depsHelpers.d.ts +1 -0
- package/packages/ui/lib/viewmodels/depsHelpers.js +94 -0
- package/packages/ui/lib/viewmodels/summary.d.ts +145 -0
- package/packages/ui/lib/viewmodels/summary.js +245 -0
- package/packages/ui/lib/viewmodels/summaryHelpers.d.ts +30 -0
- package/packages/ui/lib/viewmodels/summaryHelpers.js +42 -0
- package/packages/ui/lib/warnings.d.ts +1 -1
- package/packages/ui/lib/warnings.js +1 -1
- package/packages/ui/package.json +4 -4
- package/packages/providers/lib/strata.d.ts +0 -15
- package/packages/providers/lib/strata.js +0 -14
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Basalt parameter surface. The declarative `ParameterSpec` data for the
|
|
3
|
+
* Basalt engine (https://github.com/jesdga95/basalt), sourced from the
|
|
4
|
+
* repository's `docs/configuration/index.md`. Basalt is a C++/CUDA engine
|
|
5
|
+
* for the Qwen3.8-Flash-Next and DeepSeek-V4.1-Flash MoE models,
|
|
6
|
+
* Blackwell-only (sm_120). Every setting lands in a v2
|
|
7
|
+
* `basalt_config.json` file the deploy step writes, so each spec carries a
|
|
8
|
+
* `config` deploy target naming where the value nests: the shared `server`
|
|
9
|
+
* options, the per-model settings of the single `models[]` entry, or the
|
|
10
|
+
* shared `engine` flags; the `BasaltAdapter` renders the file with
|
|
11
|
+
* `configFileFromSpecs` and passes it to `basalt serve --config`.
|
|
12
|
+
*
|
|
13
|
+
* The data is the surface; the adapter composes it into a `LaunchPlan`.
|
|
14
|
+
* Adding a setting here is a data edit, never an adapter rewire.
|
|
15
|
+
* @module dsh-plugin-local-infer/providers/engines/basalt/basalt
|
|
16
|
+
*/
|
|
17
|
+
import type { ComboOption, Config, EnumOption, ParameterSpec } from 'dsh-plugin-local-infer/core';
|
|
18
|
+
/**
|
|
19
|
+
* The Hugging Face repo and file of the bundled Qwen `.basalt` artifact
|
|
20
|
+
* (the weights, tokenizer, chat template, drafter, vision projector, and
|
|
21
|
+
* default sampling all come from it), the one a bare config serves. The
|
|
22
|
+
* constants live in this leaf module so both the adapter and the default
|
|
23
|
+
* model list import them without a circular edge.
|
|
24
|
+
*/
|
|
25
|
+
export declare const BASALT_MODEL_REPO = "jesdga/Qwen3.8-Flash-Next-Basalt";
|
|
26
|
+
export declare const BASALT_MODEL_FILE = "Qwen3.8-FN-NVFP4-DQ6_K.basalt";
|
|
27
|
+
/**
|
|
28
|
+
* The Hugging Face repo and file of the second `.basalt` artifact the
|
|
29
|
+
* engine serves: the DeepSeek-V4.1-Flash UD-IQ1_M pack the v0.3.0 release
|
|
30
|
+
* notes name. The registry key and the served API id ride beside them, so
|
|
31
|
+
* the default model list, the VRAM and preset rows, the adapter's per-
|
|
32
|
+
* artifact download resolution, and the entry's alias stamp all name the
|
|
33
|
+
* same pack from one place.
|
|
34
|
+
*/
|
|
35
|
+
export declare const BASALT_DEEPSEEK_MODEL_REPO = "jesdga/DeepSeek-V4.1-Flash-1017-Basalt";
|
|
36
|
+
export declare const BASALT_DEEPSEEK_MODEL_FILE = "DeepSeek-V4.1-Flash-1017-UD-IQ1_M.basalt";
|
|
37
|
+
/**
|
|
38
|
+
* The `basalt_config.json` format version the adapter's render envelope
|
|
39
|
+
* stamps under the top-level `version` key. v0.3.0 refuses a file without
|
|
40
|
+
* the stamp as a v1 config; the adapter's envelope reads this constant, so
|
|
41
|
+
* the version lives beside the surface that re-blocked for it.
|
|
42
|
+
*/
|
|
43
|
+
export declare const BASALT_CONFIG_VERSION = 2;
|
|
44
|
+
/**
|
|
45
|
+
* The loopback port the basalt serve CLI binds by default, so a config that
|
|
46
|
+
* names no port launches on it. The port spec's defaultValue and the adapter's
|
|
47
|
+
* port fallback share this one constant.
|
|
48
|
+
*/
|
|
49
|
+
export declare const BASALT_DEFAULT_PORT = 8080;
|
|
50
|
+
/**
|
|
51
|
+
* The model id of the default registry entry a bare config names: the
|
|
52
|
+
* Qwen3.8-Flash-Next `.basalt` artifact the engine serves. The default
|
|
53
|
+
* model list, the built-in preset key, the Basalt VramModel id, and the
|
|
54
|
+
* adapter's plan modelId stamp all share this one constant, so every
|
|
55
|
+
* model-id keyed read of the engine names the same model the card's Model
|
|
56
|
+
* dropdown offers first.
|
|
57
|
+
*/
|
|
58
|
+
export declare const BASALT_DEFAULT_MODEL_ID = "qwen38-flash-next";
|
|
59
|
+
/**
|
|
60
|
+
* The registry key and served API id of the second default entry, the
|
|
61
|
+
* DeepSeek-V4.1-Flash UD-IQ1_M pack: `BASALT_DEEPSEEK_MODEL_ID` keys the
|
|
62
|
+
* default model list, the VRAM row, and the preset row, while
|
|
63
|
+
* `BASALT_DEEPSEEK_SERVED_MODEL_ID` is the name the adapter stamps as the
|
|
64
|
+
* config entry's `alias` and the registrar publishes (basaltServedName).
|
|
65
|
+
* The alias pins the name on `/v1/models` because the pack's stored
|
|
66
|
+
* `meta.name` is not known to the plugin.
|
|
67
|
+
*/
|
|
68
|
+
export declare const BASALT_DEEPSEEK_MODEL_ID = "deepseek-v41-flash";
|
|
69
|
+
export declare const BASALT_DEEPSEEK_SERVED_MODEL_ID = "DeepSeek-V4.1-Flash";
|
|
70
|
+
/**
|
|
71
|
+
* The model id the serve server reports the bundled Qwen artifact under:
|
|
72
|
+
* the `meta.name` stored inside the `.basalt` artifact file. The adapter
|
|
73
|
+
* stamps it as the config entry's `alias` and the registrar publishes it
|
|
74
|
+
* (basaltServedName), so `/v1/models` always lists this name and the
|
|
75
|
+
* registry key and the file path are never advertised.
|
|
76
|
+
*/
|
|
77
|
+
export declare const BASALT_SERVED_MODEL_ID = "Qwen3.8-Flash-Next NVIDIA-NVFP4";
|
|
78
|
+
/**
|
|
79
|
+
* The KV cache storage formats Basalt serves, in the order the form
|
|
80
|
+
* dropdown lists them. `note` carries the tradeoff text the dropdown shows
|
|
81
|
+
* beside each choice.
|
|
82
|
+
*/
|
|
83
|
+
export declare const BASALT_KV_OPTIONS: readonly EnumOption[];
|
|
84
|
+
/**
|
|
85
|
+
* The image-input modes. `off` reads no pictures; `dynamic` borrows
|
|
86
|
+
* expert-cache slots inside the engine only while it reads an image; `cpu`
|
|
87
|
+
* runs the encoder on the CPU (no VRAM, slow). A GPU number pins the
|
|
88
|
+
* encoder sidecar to that card; the combo control offers the three named
|
|
89
|
+
* modes and accepts a free-text GPU number.
|
|
90
|
+
*/
|
|
91
|
+
export declare const BASALT_VISION_OPTIONS: readonly ComboOption[];
|
|
92
|
+
/**
|
|
93
|
+
* The expert-cache sizes. `auto` takes as many expert blobs as fit in the
|
|
94
|
+
* VRAM left after the weights, the session and the reserve; a free-text
|
|
95
|
+
* count pins the number of blobs. The combo control offers `auto` and
|
|
96
|
+
* accepts a free-text count.
|
|
97
|
+
*/
|
|
98
|
+
export declare const BASALT_EXPERT_CACHE_OPTIONS: readonly ComboOption[];
|
|
99
|
+
/**
|
|
100
|
+
* The Basalt `ParameterSpec` surface, in form order. Every spec carries a
|
|
101
|
+
* `config` deploy target naming its v2 `basalt_config.json` placement:
|
|
102
|
+
* shared server options under `server`, per-model settings merged into the
|
|
103
|
+
* single `models[]` entry, and shared engine flags under `engine`. The
|
|
104
|
+
* multi-word keys name their flag spelling in `deploy.key`; the config
|
|
105
|
+
* parser lowercases the key and turns `_` into `-`, so the dash form is the
|
|
106
|
+
* one it matches.
|
|
107
|
+
*/
|
|
108
|
+
export declare const BASALT_PARAMETERS: readonly ParameterSpec[];
|
|
109
|
+
/**
|
|
110
|
+
* The Basalt model key a config carries: the string `.basalt` model path,
|
|
111
|
+
* falling back to an empty string so a bare config renders a plan the
|
|
112
|
+
* adapter fills in with the downloaded model file. A value that names a
|
|
113
|
+
* local artifact path passes through unchanged.
|
|
114
|
+
*/
|
|
115
|
+
export declare function basaltModelKey(config: Config): string;
|
|
116
|
+
/**
|
|
117
|
+
* basaltServedName returns the model name a `.basalt` artifact answers to
|
|
118
|
+
* at the API: the name the serve server reports and `/v1/models` lists
|
|
119
|
+
* (the config entry's `alias`, stamped from here), and a request may
|
|
120
|
+
* equally name the artifact's own file name. The two artifacts the default
|
|
121
|
+
* list carries map to their published served ids, because each pack's
|
|
122
|
+
* stored `meta.name` is not knowable to the plugin for arbitrary files;
|
|
123
|
+
* any other artifact file answers to its basename, the engine's own
|
|
124
|
+
* file-name rule. Takes the resolved artifact file (the name or path
|
|
125
|
+
* `basaltModelFileName` produces); the adapter's `modelRef` and
|
|
126
|
+
* `renderLaunch` alias stamp both call it, so the published id and the
|
|
127
|
+
* served alias cannot drift apart.
|
|
128
|
+
*/
|
|
129
|
+
export declare function basaltServedName(modelValue: string): string;
|
|
130
|
+
//# sourceMappingURL=basalt.d.ts.map
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Basalt parameter surface. The declarative `ParameterSpec` data for the
|
|
3
|
+
* Basalt engine (https://github.com/jesdga95/basalt), sourced from the
|
|
4
|
+
* repository's `docs/configuration/index.md`. Basalt is a C++/CUDA engine
|
|
5
|
+
* for the Qwen3.8-Flash-Next and DeepSeek-V4.1-Flash MoE models,
|
|
6
|
+
* Blackwell-only (sm_120). Every setting lands in a v2
|
|
7
|
+
* `basalt_config.json` file the deploy step writes, so each spec carries a
|
|
8
|
+
* `config` deploy target naming where the value nests: the shared `server`
|
|
9
|
+
* options, the per-model settings of the single `models[]` entry, or the
|
|
10
|
+
* shared `engine` flags; the `BasaltAdapter` renders the file with
|
|
11
|
+
* `configFileFromSpecs` and passes it to `basalt serve --config`.
|
|
12
|
+
*
|
|
13
|
+
* The data is the surface; the adapter composes it into a `LaunchPlan`.
|
|
14
|
+
* Adding a setting here is a data edit, never an adapter rewire.
|
|
15
|
+
* @module dsh-plugin-local-infer/providers/engines/basalt/basalt
|
|
16
|
+
*/
|
|
17
|
+
import { basename } from 'node:path';
|
|
18
|
+
/**
|
|
19
|
+
* The Hugging Face repo and file of the bundled Qwen `.basalt` artifact
|
|
20
|
+
* (the weights, tokenizer, chat template, drafter, vision projector, and
|
|
21
|
+
* default sampling all come from it), the one a bare config serves. The
|
|
22
|
+
* constants live in this leaf module so both the adapter and the default
|
|
23
|
+
* model list import them without a circular edge.
|
|
24
|
+
*/
|
|
25
|
+
export const BASALT_MODEL_REPO = 'jesdga/Qwen3.8-Flash-Next-Basalt';
|
|
26
|
+
export const BASALT_MODEL_FILE = 'Qwen3.8-FN-NVFP4-DQ6_K.basalt';
|
|
27
|
+
/**
|
|
28
|
+
* The Hugging Face repo and file of the second `.basalt` artifact the
|
|
29
|
+
* engine serves: the DeepSeek-V4.1-Flash UD-IQ1_M pack the v0.3.0 release
|
|
30
|
+
* notes name. The registry key and the served API id ride beside them, so
|
|
31
|
+
* the default model list, the VRAM and preset rows, the adapter's per-
|
|
32
|
+
* artifact download resolution, and the entry's alias stamp all name the
|
|
33
|
+
* same pack from one place.
|
|
34
|
+
*/
|
|
35
|
+
export const BASALT_DEEPSEEK_MODEL_REPO = 'jesdga/DeepSeek-V4.1-Flash-1017-Basalt';
|
|
36
|
+
export const BASALT_DEEPSEEK_MODEL_FILE = 'DeepSeek-V4.1-Flash-1017-UD-IQ1_M.basalt';
|
|
37
|
+
/**
|
|
38
|
+
* The `basalt_config.json` format version the adapter's render envelope
|
|
39
|
+
* stamps under the top-level `version` key. v0.3.0 refuses a file without
|
|
40
|
+
* the stamp as a v1 config; the adapter's envelope reads this constant, so
|
|
41
|
+
* the version lives beside the surface that re-blocked for it.
|
|
42
|
+
*/
|
|
43
|
+
export const BASALT_CONFIG_VERSION = 2;
|
|
44
|
+
/**
|
|
45
|
+
* The loopback port the basalt serve CLI binds by default, so a config that
|
|
46
|
+
* names no port launches on it. The port spec's defaultValue and the adapter's
|
|
47
|
+
* port fallback share this one constant.
|
|
48
|
+
*/
|
|
49
|
+
export const BASALT_DEFAULT_PORT = 8080;
|
|
50
|
+
/**
|
|
51
|
+
* The model id of the default registry entry a bare config names: the
|
|
52
|
+
* Qwen3.8-Flash-Next `.basalt` artifact the engine serves. The default
|
|
53
|
+
* model list, the built-in preset key, the Basalt VramModel id, and the
|
|
54
|
+
* adapter's plan modelId stamp all share this one constant, so every
|
|
55
|
+
* model-id keyed read of the engine names the same model the card's Model
|
|
56
|
+
* dropdown offers first.
|
|
57
|
+
*/
|
|
58
|
+
export const BASALT_DEFAULT_MODEL_ID = 'qwen38-flash-next';
|
|
59
|
+
/**
|
|
60
|
+
* The registry key and served API id of the second default entry, the
|
|
61
|
+
* DeepSeek-V4.1-Flash UD-IQ1_M pack: `BASALT_DEEPSEEK_MODEL_ID` keys the
|
|
62
|
+
* default model list, the VRAM row, and the preset row, while
|
|
63
|
+
* `BASALT_DEEPSEEK_SERVED_MODEL_ID` is the name the adapter stamps as the
|
|
64
|
+
* config entry's `alias` and the registrar publishes (basaltServedName).
|
|
65
|
+
* The alias pins the name on `/v1/models` because the pack's stored
|
|
66
|
+
* `meta.name` is not known to the plugin.
|
|
67
|
+
*/
|
|
68
|
+
export const BASALT_DEEPSEEK_MODEL_ID = 'deepseek-v41-flash';
|
|
69
|
+
export const BASALT_DEEPSEEK_SERVED_MODEL_ID = 'DeepSeek-V4.1-Flash';
|
|
70
|
+
/**
|
|
71
|
+
* The model id the serve server reports the bundled Qwen artifact under:
|
|
72
|
+
* the `meta.name` stored inside the `.basalt` artifact file. The adapter
|
|
73
|
+
* stamps it as the config entry's `alias` and the registrar publishes it
|
|
74
|
+
* (basaltServedName), so `/v1/models` always lists this name and the
|
|
75
|
+
* registry key and the file path are never advertised.
|
|
76
|
+
*/
|
|
77
|
+
export const BASALT_SERVED_MODEL_ID = 'Qwen3.8-Flash-Next NVIDIA-NVFP4';
|
|
78
|
+
/**
|
|
79
|
+
* The KV cache storage formats Basalt serves, in the order the form
|
|
80
|
+
* dropdown lists them. `note` carries the tradeoff text the dropdown shows
|
|
81
|
+
* beside each choice.
|
|
82
|
+
*/
|
|
83
|
+
export const BASALT_KV_OPTIONS = [
|
|
84
|
+
{ value: 'fp16', label: 'fp16', note: 'full precision; the widest KV pool, the default' },
|
|
85
|
+
{ value: 'int8', label: 'int8', note: 'half the bytes of fp16; the everyday long-context choice' },
|
|
86
|
+
{
|
|
87
|
+
value: 'q4_0',
|
|
88
|
+
label: 'q4_0',
|
|
89
|
+
note: '4-bit after a Hadamard rotation, half of int8 again, slightly lower precision',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
value: 'k8v4',
|
|
93
|
+
label: 'k8v4',
|
|
94
|
+
note: 'K in int8, V in rotated 4-bit; 816 B per cell against int8 at 1056',
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
/**
|
|
98
|
+
* The image-input modes. `off` reads no pictures; `dynamic` borrows
|
|
99
|
+
* expert-cache slots inside the engine only while it reads an image; `cpu`
|
|
100
|
+
* runs the encoder on the CPU (no VRAM, slow). A GPU number pins the
|
|
101
|
+
* encoder sidecar to that card; the combo control offers the three named
|
|
102
|
+
* modes and accepts a free-text GPU number.
|
|
103
|
+
*/
|
|
104
|
+
export const BASALT_VISION_OPTIONS = [
|
|
105
|
+
{ value: 'off', label: 'off', note: 'no image input; the default', source: 'engine' },
|
|
106
|
+
{
|
|
107
|
+
value: 'dynamic',
|
|
108
|
+
label: 'dynamic',
|
|
109
|
+
note: 'inside the engine; borrows expert-cache slots only while it reads an image',
|
|
110
|
+
source: 'engine',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
value: 'cpu',
|
|
114
|
+
label: 'cpu',
|
|
115
|
+
note: 'the encoder runs on the CPU; no VRAM, slow',
|
|
116
|
+
source: 'engine',
|
|
117
|
+
},
|
|
118
|
+
];
|
|
119
|
+
/**
|
|
120
|
+
* The expert-cache sizes. `auto` takes as many expert blobs as fit in the
|
|
121
|
+
* VRAM left after the weights, the session and the reserve; a free-text
|
|
122
|
+
* count pins the number of blobs. The combo control offers `auto` and
|
|
123
|
+
* accepts a free-text count.
|
|
124
|
+
*/
|
|
125
|
+
export const BASALT_EXPERT_CACHE_OPTIONS = [
|
|
126
|
+
{
|
|
127
|
+
value: 'auto',
|
|
128
|
+
label: 'auto',
|
|
129
|
+
note: 'as many expert blobs as fit after the weights and the reserve; the default',
|
|
130
|
+
source: 'engine',
|
|
131
|
+
},
|
|
132
|
+
];
|
|
133
|
+
/**
|
|
134
|
+
* The Basalt `ParameterSpec` surface, in form order. Every spec carries a
|
|
135
|
+
* `config` deploy target naming its v2 `basalt_config.json` placement:
|
|
136
|
+
* shared server options under `server`, per-model settings merged into the
|
|
137
|
+
* single `models[]` entry, and shared engine flags under `engine`. The
|
|
138
|
+
* multi-word keys name their flag spelling in `deploy.key`; the config
|
|
139
|
+
* parser lowercases the key and turns `_` into `-`, so the dash form is the
|
|
140
|
+
* one it matches.
|
|
141
|
+
*/
|
|
142
|
+
export const BASALT_PARAMETERS = [
|
|
143
|
+
{
|
|
144
|
+
key: 'port',
|
|
145
|
+
label: 'Port',
|
|
146
|
+
description: 'The loopback port the engine serves its OpenAI endpoint and health check on. The registrar publishes it as the model base URL.',
|
|
147
|
+
// The port is a typed number, not a range strip: a 1..65535 drag slider is
|
|
148
|
+
// noise, so `slider: false` renders the plain number entry only.
|
|
149
|
+
form: { kind: 'number', min: 1, max: 65535, step: 1, slider: false },
|
|
150
|
+
// The port the basalt serve CLI binds by default, so the form seeds the
|
|
151
|
+
// value the adapter's own fallback uses when a config names no port.
|
|
152
|
+
defaultValue: BASALT_DEFAULT_PORT,
|
|
153
|
+
group: 'Engine',
|
|
154
|
+
deploy: { target: 'config', format: 'json', block: 'server' },
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
key: 'host',
|
|
158
|
+
label: 'Host',
|
|
159
|
+
description: 'The address to listen on. 127.0.0.1 serves this machine only; 0.0.0.0 also serves the network, which needs an API key.',
|
|
160
|
+
form: { kind: 'text', placeholder: '127.0.0.1' },
|
|
161
|
+
defaultValue: '127.0.0.1',
|
|
162
|
+
group: 'Engine',
|
|
163
|
+
deploy: { target: 'config', format: 'json', block: 'server' },
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
key: 'gpu',
|
|
167
|
+
label: 'GPU',
|
|
168
|
+
description: 'Card numbers the model shares, e.g. 0 or 0,1, or auto to take every Blackwell card. The first is the main card.',
|
|
169
|
+
form: { kind: 'text', placeholder: '0' },
|
|
170
|
+
group: 'Engine',
|
|
171
|
+
// Basalt is Blackwell-only: the engine is compiled for sm_120 and its
|
|
172
|
+
// NVFP4 expert kernels need it. A card that reports a lower SM number,
|
|
173
|
+
// or no card at all, cannot run it, so the error names the fix before
|
|
174
|
+
// the engine starts.
|
|
175
|
+
hardwareConstraint: (_value, hw) => {
|
|
176
|
+
const sm = hw.gpu?.sm ?? 0;
|
|
177
|
+
if (sm < 120) {
|
|
178
|
+
return {
|
|
179
|
+
ok: false,
|
|
180
|
+
severity: 'error',
|
|
181
|
+
message: `Basalt needs an NVIDIA Blackwell GPU (SM 120); this machine reports SM ${sm}.`,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
return { ok: true };
|
|
185
|
+
},
|
|
186
|
+
deploy: { target: 'config', format: 'json', block: 'models[]' },
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
key: 'parallel',
|
|
190
|
+
label: 'Parallel requests',
|
|
191
|
+
description: 'How many requests decode at once, 1 to 8. More lanes share the model and cut per-request throughput; the max context is split across the lanes.',
|
|
192
|
+
form: { kind: 'number', min: 1, max: 8, step: 1, unit: 'lanes' },
|
|
193
|
+
defaultValue: 1,
|
|
194
|
+
group: 'Concurrency',
|
|
195
|
+
deploy: { target: 'config', format: 'json', block: 'models[]' },
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
key: 'vision',
|
|
199
|
+
label: 'Vision input',
|
|
200
|
+
description: 'Whether the model reads pictures. off reads none; dynamic borrows expert-cache slots only while it reads an image; cpu runs the encoder on the CPU; a GPU number pins the encoder to that card.',
|
|
201
|
+
form: { kind: 'combo', options: [...BASALT_VISION_OPTIONS] },
|
|
202
|
+
defaultValue: 'off',
|
|
203
|
+
group: 'Engine',
|
|
204
|
+
deploy: { target: 'config', format: 'json', block: 'models[]' },
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
key: 'model',
|
|
208
|
+
label: 'Model path',
|
|
209
|
+
description: 'The .basalt model file: the weights, tokenizer, chat template, drafter, vision projector and default sampling all come from it.',
|
|
210
|
+
form: { kind: 'path' },
|
|
211
|
+
group: 'Artifacts',
|
|
212
|
+
deploy: { target: 'config', format: 'json', block: 'models[]' },
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
key: 'kv',
|
|
216
|
+
label: 'KV cache format',
|
|
217
|
+
description: 'Quantizes the KV cache. Smaller formats fit a longer context in the same VRAM at a small quality cost.',
|
|
218
|
+
form: { kind: 'enum', options: [...BASALT_KV_OPTIONS] },
|
|
219
|
+
defaultValue: 'fp16',
|
|
220
|
+
group: 'Memory',
|
|
221
|
+
// kv stays in the top-level engine block, unlike the upstream v1-to-v2
|
|
222
|
+
// migration's default. A flag the model lacks stops the start in a
|
|
223
|
+
// model entry but is left out for that model in the engine block
|
|
224
|
+
// (upstream docs/configuration/models.md), so one surface serves both
|
|
225
|
+
// Flash-Next (takes kv) and DeepSeek-V4.1-Flash (no KV format choice).
|
|
226
|
+
deploy: { target: 'config', format: 'json', block: 'engine' },
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
key: 'maxContext',
|
|
230
|
+
label: 'Max context',
|
|
231
|
+
description: 'The longest conversation the engine accepts. Raising it reserves more VRAM for the KV cache; with parallel it is shared across the lanes.',
|
|
232
|
+
form: { kind: 'number', min: 256, max: 262144, step: 256, unit: 'tokens' },
|
|
233
|
+
defaultValue: 4096,
|
|
234
|
+
group: 'Memory',
|
|
235
|
+
deploy: { target: 'config', format: 'json', block: 'models[]', key: 'max-context' },
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
key: 'expertCache',
|
|
239
|
+
label: 'Expert cache',
|
|
240
|
+
description: 'How many expert blobs stay in VRAM. auto takes as many as fit after the weights and the reserve; a count pins the number.',
|
|
241
|
+
form: { kind: 'combo', options: [...BASALT_EXPERT_CACHE_OPTIONS] },
|
|
242
|
+
defaultValue: 'auto',
|
|
243
|
+
group: 'Memory',
|
|
244
|
+
deploy: { target: 'config', format: 'json', block: 'engine', key: 'expert-cache' },
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
key: 'prefill',
|
|
248
|
+
label: 'Prefill chunk',
|
|
249
|
+
description: 'The prompt is read in batched chunks of this many tokens. auto takes the largest chunk the expert cache can lend; a number pins the chunk size.',
|
|
250
|
+
form: { kind: 'text', placeholder: 'auto' },
|
|
251
|
+
defaultValue: 'auto',
|
|
252
|
+
group: 'Engine',
|
|
253
|
+
deploy: { target: 'config', format: 'json', block: 'engine' },
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
key: 'residentExperts',
|
|
257
|
+
label: 'Resident experts',
|
|
258
|
+
description: 'Keeps the experts the GPU does not hold in page-locked RAM, so none is read from the file again. Off falls back to a plain file mapping.',
|
|
259
|
+
form: { kind: 'boolean' },
|
|
260
|
+
defaultValue: true,
|
|
261
|
+
group: 'Memory',
|
|
262
|
+
deploy: { target: 'config', format: 'json', block: 'engine', key: 'resident-experts' },
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
key: 'spec',
|
|
266
|
+
label: 'Speculation',
|
|
267
|
+
description: 'The drafter proposes tokens and the model verifies windows of at most this many. 0 or 1 turns speculation off; the default is 8 with a drafter.',
|
|
268
|
+
form: { kind: 'number', min: 0, max: 16, step: 1, unit: 'tokens' },
|
|
269
|
+
defaultValue: 8,
|
|
270
|
+
group: 'Engine',
|
|
271
|
+
deploy: { target: 'config', format: 'json', block: 'engine' },
|
|
272
|
+
},
|
|
273
|
+
];
|
|
274
|
+
/**
|
|
275
|
+
* The Basalt model key a config carries: the string `.basalt` model path,
|
|
276
|
+
* falling back to an empty string so a bare config renders a plan the
|
|
277
|
+
* adapter fills in with the downloaded model file. A value that names a
|
|
278
|
+
* local artifact path passes through unchanged.
|
|
279
|
+
*/
|
|
280
|
+
export function basaltModelKey(config) {
|
|
281
|
+
return typeof config.model === 'string' ? config.model : '';
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* basaltServedName returns the model name a `.basalt` artifact answers to
|
|
285
|
+
* at the API: the name the serve server reports and `/v1/models` lists
|
|
286
|
+
* (the config entry's `alias`, stamped from here), and a request may
|
|
287
|
+
* equally name the artifact's own file name. The two artifacts the default
|
|
288
|
+
* list carries map to their published served ids, because each pack's
|
|
289
|
+
* stored `meta.name` is not knowable to the plugin for arbitrary files;
|
|
290
|
+
* any other artifact file answers to its basename, the engine's own
|
|
291
|
+
* file-name rule. Takes the resolved artifact file (the name or path
|
|
292
|
+
* `basaltModelFileName` produces); the adapter's `modelRef` and
|
|
293
|
+
* `renderLaunch` alias stamp both call it, so the published id and the
|
|
294
|
+
* served alias cannot drift apart.
|
|
295
|
+
*/
|
|
296
|
+
export function basaltServedName(modelValue) {
|
|
297
|
+
const file = basename(modelValue);
|
|
298
|
+
if (file === BASALT_MODEL_FILE)
|
|
299
|
+
return BASALT_SERVED_MODEL_ID;
|
|
300
|
+
if (file === BASALT_DEEPSEEK_MODEL_FILE)
|
|
301
|
+
return BASALT_DEEPSEEK_SERVED_MODEL_ID;
|
|
302
|
+
return file;
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=basalt.js.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Basalt engine adapter. BasaltAdapter is the Basalt engine (the
|
|
3
|
+
* C++/CUDA serve/ server for the Qwen3.8-Flash-Next and DeepSeek-V4.1-Flash
|
|
4
|
+
* MoE models, Blackwell-only).
|
|
5
|
+
* `renderLaunch` renders a `basalt serve --config --engine-bin` process
|
|
6
|
+
* plan: the binary name comes from the host OS profile, every setting and
|
|
7
|
+
* the served model land in the `basalt_config.json` the plan's `configFile`
|
|
8
|
+
* carries (the spec surface rendered with `configFileFromSpecs` into the
|
|
9
|
+
* versioned v2 envelope the 0.3.0 serve CLI accepts), and the argv carries
|
|
10
|
+
* the CLI-only `--engine-bin` flag, so it stays fixed no matter how many
|
|
11
|
+
* settings the form offers. `deploy` builds the engine in the checkout (the
|
|
12
|
+
* acquisition build steps), downloads the `.basalt` model into the model
|
|
13
|
+
* directory, stamps the artifact path into the config entry, writes the
|
|
14
|
+
* config file, and spawns the serve command.
|
|
15
|
+
* `healthCheck` polls the health URL and reports the start phase from the
|
|
16
|
+
* tracked process output. `stop` signals the tracked process.
|
|
17
|
+
* @module dsh-plugin-local-infer/providers/engines/basalt/basaltAdapter
|
|
18
|
+
*/
|
|
19
|
+
import { EngineAdapter } from '../../../../core/lib/index.js';
|
|
20
|
+
import type { CommandLogger, Config, DeployOptions, DeployResult, EngineLaunchSignature, EnginePlatformConfig, HealthCheckOptions, HealthResult, HardwareProfile, LaunchPlan, LaunchProgress, LifecycleHost, ParameterSpec } from '../../../../core/lib/index.js';
|
|
21
|
+
export { BASALT_MODEL_FILE, BASALT_MODEL_REPO } from './basalt.ts';
|
|
22
|
+
/**
|
|
23
|
+
* The config file name the deploy step writes. It lands in the plugin's
|
|
24
|
+
* config cache home in the per-engine subdirectory (Basalt takes the path
|
|
25
|
+
* via `--config`, so it carries no placement requirement of its own), never
|
|
26
|
+
* the model directory, the hub cache, or the engine checkout.
|
|
27
|
+
*/
|
|
28
|
+
export declare const BASALT_CONFIG_FILE = "basalt_config.json";
|
|
29
|
+
/**
|
|
30
|
+
* BasaltAdapter is the Basalt engine. `renderLaunch` renders a
|
|
31
|
+
* `basalt serve --config --engine-bin` process plan (the settings and the
|
|
32
|
+
* served model ride the versioned config file; the argv carries the CLI-only
|
|
33
|
+
* `--engine-bin` flag); `deploy` builds the engine, downloads the model,
|
|
34
|
+
* stamps the artifact path into the config entry, writes the config file,
|
|
35
|
+
* and spawns the serve command; `healthCheck` polls the health URL and
|
|
36
|
+
* reports the start phase from the tracked process output; `stop` signals
|
|
37
|
+
* the tracked process.
|
|
38
|
+
*/
|
|
39
|
+
export declare class BasaltAdapter extends EngineAdapter {
|
|
40
|
+
readonly id = "basalt";
|
|
41
|
+
readonly supports: {
|
|
42
|
+
docker: boolean;
|
|
43
|
+
local: boolean;
|
|
44
|
+
};
|
|
45
|
+
private readonly host;
|
|
46
|
+
private readonly children;
|
|
47
|
+
constructor(host?: LifecycleHost);
|
|
48
|
+
parameters(): readonly ParameterSpec[];
|
|
49
|
+
modelRef(config: Config): {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
};
|
|
53
|
+
modelInput(config: Config): string[];
|
|
54
|
+
launchSignature(config?: Config): EngineLaunchSignature;
|
|
55
|
+
renderLaunch(config: Config, _hw: HardwareProfile): LaunchPlan;
|
|
56
|
+
deploy(plan: LaunchPlan, platform?: EnginePlatformConfig, onProgress?: LaunchProgress, options?: DeployOptions): Promise<DeployResult>;
|
|
57
|
+
/**
|
|
58
|
+
* ensureModelArtifact downloads the `.basalt` model file named by the
|
|
59
|
+
* resolved download source (its repo URL plus artifact file) into the
|
|
60
|
+
* model directory and resolves the concrete path the engine serves. A
|
|
61
|
+
* model the Get-steps routine already downloaded is on disk, so the
|
|
62
|
+
* re-fetch is skipped; presence is the deterministic snapshot check
|
|
63
|
+
* (modelArtifactPresent), so a blob-only cache left by an interrupted
|
|
64
|
+
* download re-runs the cheap hf download (the CLI reuses the blobs and
|
|
65
|
+
* writes the snapshot links) instead of dead-ending on the later lookup.
|
|
66
|
+
* With the hub-cache layout the concrete path is the content-addressed
|
|
67
|
+
* snapshot path (only known after the download); with the flat layout it
|
|
68
|
+
* is the flat join. Returns the path, or a detail when the download fails
|
|
69
|
+
* or leaves no snapshot.
|
|
70
|
+
*/
|
|
71
|
+
private ensureModelArtifact;
|
|
72
|
+
/**
|
|
73
|
+
* writeConfigFile writes the config file the plan names, so the engine's
|
|
74
|
+
* --config flag points at a path that exists. renderLaunch renders the
|
|
75
|
+
* path absolute under the plugin's config cache home, and the host's
|
|
76
|
+
* writeFile mkdirs the parent before writing. Returns a failure detail (a
|
|
77
|
+
* host that cannot write files, a test stub) or null when the write
|
|
78
|
+
* succeeded or the plan names no config file.
|
|
79
|
+
*/
|
|
80
|
+
private writeConfigFile;
|
|
81
|
+
healthCheck(plan: LaunchPlan, options?: HealthCheckOptions): Promise<HealthResult>;
|
|
82
|
+
stop(plan: LaunchPlan, log?: CommandLogger): Promise<void>;
|
|
83
|
+
private port;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=basaltAdapter.d.ts.map
|