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,463 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Strata engine adapter. StrataAdapter is the Strata engine, three build
|
|
3
|
+
* modes. `renderLaunch` renders a `docker run` of the ghcr image (docker
|
|
4
|
+
* mode), a `strata launch` process (binary mode), or a `setup.sh` run with the
|
|
5
|
+
* model (local mode); `deploy` pulls the image, installs the Terminal, or
|
|
6
|
+
* git-syncs the checkout and resolves `setup.sh` to an absolute path in it
|
|
7
|
+
* before spawning (spawn resolves a bare name against PATH, not the cwd);
|
|
8
|
+
* `healthCheck` polls the health URL; `stop` stops the named container, runs
|
|
9
|
+
* `strata launch --stop`, or signals the tracked process. The model the
|
|
10
|
+
* engine serves is the config model (or the engine's own pick when none is
|
|
11
|
+
* named), and the engine downloads it itself, so the deploy step runs no model
|
|
12
|
+
* download of its own. When the config names no model, `discoverModel`
|
|
13
|
+
* queries the running engine's model endpoint through the terminal for the id
|
|
14
|
+
* it actually loaded (family and size sized to the host), so the registrar
|
|
15
|
+
* publishes the served model, not a placeholder.
|
|
16
|
+
* @module dsh-plugin-local-infer/providers/engines/strata/strataAdapter
|
|
17
|
+
*/
|
|
18
|
+
import { join } from 'node:path';
|
|
19
|
+
import { EngineAdapter, autoRebuildEnabled } from '../../../../core/lib/index.js';
|
|
20
|
+
import { HEALTH_POLL_DEFAULT_MS, HEALTH_POLL_MAX_ATTEMPTS, auditRun, customArgEnv, customArgFlags, delay, envFromSpecs, flagsFromSpecs, logHealthPoll, nodeLifecycleHost, stopProcessPlan, trackChild, } from "../../adapters.js";
|
|
21
|
+
import { syncEngineForDeploy } from "../../acquire.js";
|
|
22
|
+
import { STRATA_PARAMETERS, strataDefaults, strataModelKey, } from "./strata.js";
|
|
23
|
+
import { strataLinuxSourceLaunch } from "./strataLinux.js";
|
|
24
|
+
import { strataMacOSSourceLaunch } from "./strataMacOS.js";
|
|
25
|
+
import { strataWindowsSourceLaunch } from "./strataWindows.js";
|
|
26
|
+
/**
|
|
27
|
+
* The Strata docker image the adapter pulls and runs. The image is the
|
|
28
|
+
* upstream GitHub Container Registry artifact for the newest release's CUDA 13
|
|
29
|
+
* flavor (NVIDIA RTX 20/30/40/50 series, driver 580 or newer); the README pins
|
|
30
|
+
* a version tag when updates should only land on purpose.
|
|
31
|
+
*/
|
|
32
|
+
export const STRATA_DOCKER_IMAGE = 'ghcr.io/niko1221/strata:latest-cuda13';
|
|
33
|
+
/**
|
|
34
|
+
* The one-line install the Strata binary build mode runs: it downloads the
|
|
35
|
+
* `strata` Terminal from the latest release, checks its SHA-256, unpacks it into
|
|
36
|
+
* the user's home folder, and puts `strata` on the PATH. Sourced from
|
|
37
|
+
* docs/AI_SETUP.md step 2 (Linux and Mac; Windows uses the PowerShell twin).
|
|
38
|
+
*/
|
|
39
|
+
export const STRATA_BINARY_INSTALL = 'curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh';
|
|
40
|
+
/**
|
|
41
|
+
* The source-build wrapper is OS-specific (setup.sh on Linux/Mac,
|
|
42
|
+
* START-HERE.bat on Windows), so the launch argv comes from the host OS's
|
|
43
|
+
* launch function. The adapter's renderLaunch reads this map by the hardware
|
|
44
|
+
* profile's os, keeping the per-OS command in its own OS file.
|
|
45
|
+
*/
|
|
46
|
+
const STRATA_SOURCE_LAUNCH = {
|
|
47
|
+
linux: strataLinuxSourceLaunch,
|
|
48
|
+
macos: strataMacOSSourceLaunch,
|
|
49
|
+
windows: strataWindowsSourceLaunch,
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* strataPreReadyState reads the phase the strata process is in from the tail of
|
|
53
|
+
* its accumulated output. The Terminal downloads the engine and the model files
|
|
54
|
+
* before it can serve, and prints a progress line for each (Downloading,
|
|
55
|
+
* Unpacking, Checking the package signature, Getting the model files, ...), so
|
|
56
|
+
* a tail that carries one of those reads as downloading. A tail past the
|
|
57
|
+
* download (the engine starting, the API binding) reads as starting. The tail
|
|
58
|
+
* is the most recent output, so a finished download no longer reads as
|
|
59
|
+
* downloading even though its progress lines are still in the buffer.
|
|
60
|
+
*/
|
|
61
|
+
export function strataPreReadyState(logs) {
|
|
62
|
+
const tail = logs.slice(-2000);
|
|
63
|
+
const downloading = /Downloading|Unpacking|Checking the package signature|Test-starting|Getting the model files|Getting your model ready|Getting the helper packages/i.test(tail);
|
|
64
|
+
return downloading ? 'downloading' : 'starting';
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* strataServedModelId reads the served model id out of a /v1/models answer:
|
|
68
|
+
* the id of the first entry in the JSON `data` list. The engine names the
|
|
69
|
+
* model it auto-selected with family and size (qwen3.8-flash-next-iq3_s), so
|
|
70
|
+
* the registrar can publish the id the engine actually serves. A body that is
|
|
71
|
+
* not JSON, or carries no usable id (an error page, a truncated answer), reads
|
|
72
|
+
* as no discovery.
|
|
73
|
+
*/
|
|
74
|
+
export function strataServedModelId(body) {
|
|
75
|
+
const start = body.indexOf('{');
|
|
76
|
+
const end = body.lastIndexOf('}');
|
|
77
|
+
if (start < 0 || end <= start) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
const parsed = JSON.parse(body.slice(start, end + 1));
|
|
82
|
+
const list = Array.isArray(parsed.data) ? parsed.data : [];
|
|
83
|
+
for (const item of list) {
|
|
84
|
+
const id = typeof item === 'object' && item !== null ? item.id : undefined;
|
|
85
|
+
if (typeof id === 'string' && id !== '') {
|
|
86
|
+
return id;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
// A partial or non-JSON answer (an error page, a truncated body) carries
|
|
92
|
+
// no served id.
|
|
93
|
+
}
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* StrataAdapter is the Strata engine, three build modes. `renderLaunch` renders
|
|
98
|
+
* a `docker run` of the ghcr image (docker mode), a `strata launch` process
|
|
99
|
+
* (binary mode), or a `setup.sh` run with the model (local mode); `deploy` pulls
|
|
100
|
+
* the image, installs the Terminal, or git-syncs the checkout and resolves
|
|
101
|
+
* `setup.sh` to an absolute path in it before spawning (spawn resolves a bare
|
|
102
|
+
* name against PATH, not the cwd); `healthCheck` polls the health URL; `stop`
|
|
103
|
+
* stops the named container, runs `strata launch --stop`, or signals the
|
|
104
|
+
* tracked process. The model the engine serves is the config model (or the
|
|
105
|
+
* engine's own pick when none is named), and the engine downloads it itself, so
|
|
106
|
+
* the deploy step runs no model download of its own. When the config names no
|
|
107
|
+
* model, `discoverModel` queries the running engine's model endpoint through
|
|
108
|
+
* the terminal for the id it actually loaded (family and size sized to the
|
|
109
|
+
* host), so the registrar publishes the served model, not a placeholder.
|
|
110
|
+
*/
|
|
111
|
+
export class StrataAdapter extends EngineAdapter {
|
|
112
|
+
id = 'strata';
|
|
113
|
+
supports = { docker: true, local: true, binary: true };
|
|
114
|
+
host;
|
|
115
|
+
children = new Map();
|
|
116
|
+
constructor(host = nodeLifecycleHost) {
|
|
117
|
+
super();
|
|
118
|
+
this.host = host;
|
|
119
|
+
}
|
|
120
|
+
parameters() {
|
|
121
|
+
return STRATA_PARAMETERS;
|
|
122
|
+
}
|
|
123
|
+
modelRef(config) {
|
|
124
|
+
// Strata serves the model under the name the config names (or the engine
|
|
125
|
+
// default when none), so the registrar publishes that name and a chat turn
|
|
126
|
+
// routes to it.
|
|
127
|
+
const model = strataModelKey(config);
|
|
128
|
+
return model !== '' ? { id: model, name: model } : { id: 'strata', name: 'Strata' };
|
|
129
|
+
}
|
|
130
|
+
async discoverModel(config) {
|
|
131
|
+
// A config that names a model already routes through modelRef; discovery
|
|
132
|
+
// answers only for the model the engine auto-selected for the host.
|
|
133
|
+
if (strataModelKey(config) !== '') {
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
// The terminal query: curl the running engine's model list, capped at a
|
|
137
|
+
// few seconds so a down engine fails fast rather than parking the
|
|
138
|
+
// register route. A host without output capture cannot read the answer,
|
|
139
|
+
// so it discovers nothing and the route falls back to modelRef.
|
|
140
|
+
const runStream = this.host.runStream;
|
|
141
|
+
if (runStream === undefined) {
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
const port = this.port(config);
|
|
145
|
+
const chunks = [];
|
|
146
|
+
const outcome = await runStream.call(this.host, `curl -fsS --max-time 3 http://127.0.0.1:${port}/v1/models`, (chunk) => {
|
|
147
|
+
chunks.push(chunk);
|
|
148
|
+
});
|
|
149
|
+
if (!outcome.ok) {
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
const id = strataServedModelId(chunks.join(''));
|
|
153
|
+
return id === undefined ? undefined : { id, name: id };
|
|
154
|
+
}
|
|
155
|
+
modelInput(config) {
|
|
156
|
+
// Strata's models read pictures and the vision control is on by default
|
|
157
|
+
// (on, gpu, and cpu all enable a vision runner), so only 'off' withholds
|
|
158
|
+
// the Image input on the DSH model row.
|
|
159
|
+
return config.vision === 'off' ? ['text'] : ['text', 'image'];
|
|
160
|
+
}
|
|
161
|
+
launchSignature(config = {}) {
|
|
162
|
+
// The docker plan's host process is docker run of the ghcr image, so the
|
|
163
|
+
// image name is the command-line marker; the binary and source-build plans
|
|
164
|
+
// run the strata command, so the binary name is the marker.
|
|
165
|
+
const port = this.port(config);
|
|
166
|
+
if (this.buildMode(config) === 'docker') {
|
|
167
|
+
return { binary: STRATA_DOCKER_IMAGE, port };
|
|
168
|
+
}
|
|
169
|
+
return { binary: 'strata', port };
|
|
170
|
+
}
|
|
171
|
+
renderLaunch(config, _hw) {
|
|
172
|
+
const port = this.port(config);
|
|
173
|
+
const model = strataModelKey(config);
|
|
174
|
+
const modelId = model !== '' ? model : undefined;
|
|
175
|
+
const customArgs = customArgFlags(config);
|
|
176
|
+
const mode = this.buildMode(config);
|
|
177
|
+
if (mode === 'docker') {
|
|
178
|
+
// The container env is the spec surface's toEnv spellings (FAMILY,
|
|
179
|
+
// CONTEXT, VISION, ...) plus the card's Custom Arguments, plus the model
|
|
180
|
+
// the container serves. The model download happens inside the container
|
|
181
|
+
// on first start into the strata-data volume, so no host download.
|
|
182
|
+
const env = { ...envFromSpecs(STRATA_PARAMETERS, config), ...customArgEnv(config) };
|
|
183
|
+
if (model !== '') {
|
|
184
|
+
env.MODEL = model;
|
|
185
|
+
}
|
|
186
|
+
const envFlags = Object.entries(env).flatMap(([key, value]) => ['-e', `${key}=${value}`]);
|
|
187
|
+
const containerName = `strata-${port}`;
|
|
188
|
+
return {
|
|
189
|
+
engineId: this.id,
|
|
190
|
+
kind: 'docker',
|
|
191
|
+
argv: [
|
|
192
|
+
'docker',
|
|
193
|
+
'run',
|
|
194
|
+
'-d',
|
|
195
|
+
'--name',
|
|
196
|
+
containerName,
|
|
197
|
+
'--gpus',
|
|
198
|
+
'all',
|
|
199
|
+
'-p',
|
|
200
|
+
`127.0.0.1:${port}:8080`,
|
|
201
|
+
'--ulimit',
|
|
202
|
+
'memlock=-1:-1',
|
|
203
|
+
'--shm-size',
|
|
204
|
+
'2g',
|
|
205
|
+
'--stop-timeout',
|
|
206
|
+
'120',
|
|
207
|
+
'-v',
|
|
208
|
+
'strata-data:/data',
|
|
209
|
+
...envFlags,
|
|
210
|
+
STRATA_DOCKER_IMAGE,
|
|
211
|
+
...customArgs,
|
|
212
|
+
],
|
|
213
|
+
env: {},
|
|
214
|
+
containerName,
|
|
215
|
+
...(modelId !== undefined ? { modelId } : {}),
|
|
216
|
+
port,
|
|
217
|
+
healthUrl: `http://127.0.0.1:${port}/health`,
|
|
218
|
+
os: _hw.os,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
if (mode === 'binary') {
|
|
222
|
+
// The strata Terminal the install script places on the PATH: a
|
|
223
|
+
// non-interactive launch that downloads what it needs and serves.
|
|
224
|
+
const flags = flagsFromSpecs(STRATA_PARAMETERS, config);
|
|
225
|
+
return {
|
|
226
|
+
engineId: this.id,
|
|
227
|
+
kind: 'process',
|
|
228
|
+
argv: [
|
|
229
|
+
'strata',
|
|
230
|
+
'launch',
|
|
231
|
+
...(model !== '' ? ['--model', model] : []),
|
|
232
|
+
'--yes',
|
|
233
|
+
'--no-tui',
|
|
234
|
+
'--port',
|
|
235
|
+
String(port),
|
|
236
|
+
...flags,
|
|
237
|
+
...customArgs,
|
|
238
|
+
],
|
|
239
|
+
env: {},
|
|
240
|
+
...(modelId !== undefined ? { modelId } : {}),
|
|
241
|
+
port,
|
|
242
|
+
healthUrl: `http://127.0.0.1:${port}/health`,
|
|
243
|
+
os: _hw.os,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
// The source build: run the OS wrapper (setup.sh on Linux/Mac,
|
|
247
|
+
// START-HERE.bat on Windows) with the model. It reuses the engine the Get
|
|
248
|
+
// step built (the acquisition build step), downloads the named model, and
|
|
249
|
+
// starts the engine. Running the wrapper (rather than a pre-written
|
|
250
|
+
// run-<model> start script) is model-aware and self-contained, so the
|
|
251
|
+
// launch does not depend on the build step having written a script for this
|
|
252
|
+
// exact model. The deploy step resolves the wrapper to an absolute path in
|
|
253
|
+
// the checkout before spawning.
|
|
254
|
+
// The source-build wrapper is OS-specific (setup.sh on Linux/Mac,
|
|
255
|
+
// START-HERE.bat on Windows), so the argv comes from the host OS's launch
|
|
256
|
+
// function. The config reads (family, vision, context) are OS-agnostic and
|
|
257
|
+
// resolve their defaults from the parameter surface, so the defaults have
|
|
258
|
+
// one home.
|
|
259
|
+
const { family, vision, context } = strataDefaults(config);
|
|
260
|
+
const sourceLaunch = STRATA_SOURCE_LAUNCH[_hw.os];
|
|
261
|
+
return {
|
|
262
|
+
engineId: this.id,
|
|
263
|
+
kind: 'process',
|
|
264
|
+
argv: sourceLaunch({ model, family, vision, context, port, customArgs }),
|
|
265
|
+
env: {},
|
|
266
|
+
...(modelId !== undefined ? { modelId } : {}),
|
|
267
|
+
port,
|
|
268
|
+
healthUrl: `http://127.0.0.1:${port}/health`,
|
|
269
|
+
os: _hw.os,
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
async deploy(plan, platform, onProgress, options) {
|
|
273
|
+
if (plan.kind === 'docker') {
|
|
274
|
+
// Auto Rebuild off (the card's checkbox): the image pull is skipped and
|
|
275
|
+
// the already-present image starts. The image pull is the docker build
|
|
276
|
+
// step: the card's button reads "Building..." for it, and its
|
|
277
|
+
// `$ <command>` line reaches the launch run's log sink before the child
|
|
278
|
+
// spawns.
|
|
279
|
+
if (autoRebuildEnabled(options?.autoRebuild)) {
|
|
280
|
+
onProgress?.('build');
|
|
281
|
+
const pull = await auditRun(this.host, `docker pull ${STRATA_DOCKER_IMAGE}`, options?.onLog);
|
|
282
|
+
if (!pull.ok) {
|
|
283
|
+
return { ok: false, detail: `docker pull failed: ${pull.detail ?? 'unknown'}` };
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
const handle = this.host.spawn(plan.argv ?? [], plan.env ?? {});
|
|
287
|
+
trackChild(this.children, this.planKey(plan), handle);
|
|
288
|
+
return { ok: true, handle };
|
|
289
|
+
}
|
|
290
|
+
if (plan.kind === 'process') {
|
|
291
|
+
const engineDir = platform?.engineDirectory;
|
|
292
|
+
// The binary plan runs the strata command (on the PATH after the install
|
|
293
|
+
// script), so its build step is the one-line install. The source-build
|
|
294
|
+
// plan runs the OS wrapper in the checkout, so its build step is the git
|
|
295
|
+
// sync plus the engine's own wrapper (the acquisition build steps), and
|
|
296
|
+
// the launch resolves the wrapper to an absolute path in that checkout.
|
|
297
|
+
const isBinary = plan.argv?.[0] === 'strata';
|
|
298
|
+
let buildLogs = '';
|
|
299
|
+
if (isBinary) {
|
|
300
|
+
// Auto Rebuild off (the card's checkbox): the install is skipped and
|
|
301
|
+
// the already-installed strata command starts. The install script
|
|
302
|
+
// downloads the Terminal: the card's button reads "Downloading..."
|
|
303
|
+
// for it, and its `$ <command>` line reaches the launch run's log
|
|
304
|
+
// sink before the child spawns.
|
|
305
|
+
if (autoRebuildEnabled(options?.autoRebuild)) {
|
|
306
|
+
onProgress?.('download');
|
|
307
|
+
const install = await auditRun(this.host, STRATA_BINARY_INSTALL, options?.onLog);
|
|
308
|
+
if (!install.ok) {
|
|
309
|
+
return { ok: false, detail: `strata install failed: ${install.detail ?? 'unknown'}` };
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
// The source build needs the checkout directory to resolve the OS
|
|
315
|
+
// wrapper; without it the launch cannot find the engine.
|
|
316
|
+
if (engineDir === undefined) {
|
|
317
|
+
return {
|
|
318
|
+
ok: false,
|
|
319
|
+
detail: 'the source build needs an engine directory (the Get step checkout) to run the OS wrapper',
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
if (autoRebuildEnabled(options?.autoRebuild)) {
|
|
323
|
+
// The conditional rebuild fetches the checkout, prices it against the
|
|
324
|
+
// remote branch, and rebuilds only when it is behind (or a fresh
|
|
325
|
+
// clone). The decision, the build command, and its output are
|
|
326
|
+
// captured into buildLogs and threaded to the card's Logs section.
|
|
327
|
+
const sync = await syncEngineForDeploy(this.host, {
|
|
328
|
+
engineId: this.id,
|
|
329
|
+
directory: engineDir,
|
|
330
|
+
...(platform !== undefined ? { platform } : {}),
|
|
331
|
+
...(options !== undefined ? { options } : {}),
|
|
332
|
+
// The host OS the build steps pick for: a Windows host reads the
|
|
333
|
+
// engine's Windows build steps when the user carries no build-
|
|
334
|
+
// command override.
|
|
335
|
+
...(plan.os !== undefined ? { os: plan.os } : {}),
|
|
336
|
+
...(onProgress !== undefined ? { onProgress } : {}),
|
|
337
|
+
});
|
|
338
|
+
buildLogs = sync.buildLogs;
|
|
339
|
+
if (!sync.ok) {
|
|
340
|
+
return { ok: false, detail: sync.detail ?? 'unknown', logs: buildLogs };
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
const withLogs = (result) => buildLogs !== '' ? { ...result, logs: buildLogs } : result;
|
|
345
|
+
// The source-build plan names the OS wrapper relative to the checkout;
|
|
346
|
+
// resolve it to an absolute path so spawn finds it (spawn resolves a bare
|
|
347
|
+
// name against PATH, not the cwd). The binary plan's strata is on the
|
|
348
|
+
// PATH, so it spawns as-is.
|
|
349
|
+
const argv = plan.argv ?? [];
|
|
350
|
+
const spawnArgv = !isBinary && engineDir !== undefined
|
|
351
|
+
? [join(engineDir, argv[0] ?? 'setup.sh'), ...argv.slice(1)]
|
|
352
|
+
: argv;
|
|
353
|
+
const handle = this.host.spawn(spawnArgv, plan.env ?? {}, engineDir);
|
|
354
|
+
trackChild(this.children, this.planKey(plan), handle);
|
|
355
|
+
return withLogs({ ok: true, handle });
|
|
356
|
+
}
|
|
357
|
+
// A compose plan is a no-op for Strata.
|
|
358
|
+
return { ok: true };
|
|
359
|
+
}
|
|
360
|
+
async healthCheck(plan, options) {
|
|
361
|
+
// The Strata Terminal downloads its engine and the model files before it
|
|
362
|
+
// can serve, so the health endpoint is not up for a long time (the model
|
|
363
|
+
// download can be tens of gigabytes). A plain poll times out and reads the
|
|
364
|
+
// start as broken, so this poll reads the tracked process's output and
|
|
365
|
+
// reports the start phase: a 200 is ready, a process that ended before
|
|
366
|
+
// readiness is failed, and a process still fetching its files after the
|
|
367
|
+
// attempt cap is downloading (in progress, not a failure) so the card
|
|
368
|
+
// re-polls instead of showing a broken launch. The shared logHealthPoll
|
|
369
|
+
// wrap carries the URL-query rule (one `> GET` line ahead of the settled
|
|
370
|
+
// verdict, retries silent).
|
|
371
|
+
return logHealthPoll(options?.onLog, plan.healthUrl, async () => {
|
|
372
|
+
const pollMs = options?.pollMs ?? HEALTH_POLL_DEFAULT_MS;
|
|
373
|
+
const maxAttempts = options?.maxAttempts ?? HEALTH_POLL_MAX_ATTEMPTS;
|
|
374
|
+
// The tracked handle is read before the loop: trackChild drops the map
|
|
375
|
+
// entry when the child ends, so a late read would miss the exit state
|
|
376
|
+
// the early-exit check needs.
|
|
377
|
+
const handle = this.children.get(this.planKey(plan));
|
|
378
|
+
let last = { status: 0, ok: false };
|
|
379
|
+
let lastPreReady = null;
|
|
380
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
381
|
+
// The state read runs before the fetch: a child that settled (a crash,
|
|
382
|
+
// a pkill, or a spawn failure) will never report 200, so the poll
|
|
383
|
+
// ends here with a failed result instead of the full attempt cap.
|
|
384
|
+
if (handle?.hasExited?.() === true) {
|
|
385
|
+
return {
|
|
386
|
+
healthy: false,
|
|
387
|
+
status: last.status,
|
|
388
|
+
state: 'failed',
|
|
389
|
+
detail: 'the engine process exited before it reported ready',
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
last = await this.host.fetch(plan.healthUrl);
|
|
393
|
+
if (last.status === 200) {
|
|
394
|
+
return { healthy: true, status: 200, state: 'ready' };
|
|
395
|
+
}
|
|
396
|
+
// A running tracked process reports its start phase from its output. A
|
|
397
|
+
// missing handle (no deploy tracked one, or the process already ended)
|
|
398
|
+
// falls through to the plain poll: the health URL stays down, so the
|
|
399
|
+
// loop times out and reads the start as failed.
|
|
400
|
+
if (handle !== undefined) {
|
|
401
|
+
lastPreReady = strataPreReadyState(handle.logs ?? '');
|
|
402
|
+
}
|
|
403
|
+
if (pollMs > 0 && attempt < maxAttempts) {
|
|
404
|
+
await delay(pollMs);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
// The engine did not report ready within the attempt cap. If it was still
|
|
408
|
+
// downloading its files, read the start as in progress (downloading): the
|
|
409
|
+
// download is not a broken launch, and the card re-polls until the engine
|
|
410
|
+
// reports ready. If the download was done and the engine was starting,
|
|
411
|
+
// read the start as failed (a stuck start timed out).
|
|
412
|
+
if (lastPreReady === 'downloading') {
|
|
413
|
+
return {
|
|
414
|
+
healthy: false,
|
|
415
|
+
status: last.status,
|
|
416
|
+
state: 'downloading',
|
|
417
|
+
detail: 'the engine is still downloading its model files',
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
return {
|
|
421
|
+
healthy: false,
|
|
422
|
+
status: last.status,
|
|
423
|
+
state: 'failed',
|
|
424
|
+
detail: `health check did not return 200 within ${maxAttempts} attempts`,
|
|
425
|
+
};
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
async stop(plan, log) {
|
|
429
|
+
if (plan.kind === 'docker' && plan.containerName !== undefined) {
|
|
430
|
+
await auditRun(this.host, `docker stop ${plan.containerName}`, log);
|
|
431
|
+
}
|
|
432
|
+
// The binary plan stops through the strata command; the source-build plan
|
|
433
|
+
// has no strata command, so it stops by signalling the tracked process.
|
|
434
|
+
if (plan.kind === 'process' && plan.argv?.[0] === 'strata') {
|
|
435
|
+
await auditRun(this.host, 'strata launch --stop', log);
|
|
436
|
+
}
|
|
437
|
+
const handle = this.children.get(this.planKey(plan));
|
|
438
|
+
if (handle !== undefined) {
|
|
439
|
+
handle.kill();
|
|
440
|
+
this.children.delete(this.planKey(plan));
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
// No tracked child (an engine a DSH restart re-adopted): signal the pid
|
|
444
|
+
// the stored launch record stamped on the plan, so the stop reaches a
|
|
445
|
+
// process this adapter instance did not spawn.
|
|
446
|
+
await stopProcessPlan(this.host, plan, log);
|
|
447
|
+
}
|
|
448
|
+
buildMode(config) {
|
|
449
|
+
const mode = config.buildMode;
|
|
450
|
+
if (mode === 'docker' || mode === 'local' || mode === 'binary') {
|
|
451
|
+
return mode;
|
|
452
|
+
}
|
|
453
|
+
// The binary install is the README's one-line path (the one docs/AI_SETUP.md
|
|
454
|
+
// walks an agent through), so a bare config renders the binary plan.
|
|
455
|
+
return 'binary';
|
|
456
|
+
}
|
|
457
|
+
port(config) {
|
|
458
|
+
// 8080 is the port the strata launch CLI binds by default, so a bare
|
|
459
|
+
// config launches on it.
|
|
460
|
+
return typeof config.port === 'number' ? config.port : 8080;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
//# sourceMappingURL=strataAdapter.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Strata Arch Linux build profile. Arch builds Strata through the shared
|
|
3
|
+
* Linux route (the engine's own setup.sh), so this profile reuses the shared
|
|
4
|
+
* Linux profile and carries no build steps of its own.
|
|
5
|
+
* @module dsh-plugin-local-infer/providers/engines/strata/strataArch
|
|
6
|
+
*/
|
|
7
|
+
import type { EngineOsProfile } from '../engineOs.ts';
|
|
8
|
+
export declare const STRATA_ARCH: EngineOsProfile;
|
|
9
|
+
//# sourceMappingURL=strataArch.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Strata Arch Linux build profile. Arch builds Strata through the shared
|
|
3
|
+
* Linux route (the engine's own setup.sh), so this profile reuses the shared
|
|
4
|
+
* Linux profile and carries no build steps of its own.
|
|
5
|
+
* @module dsh-plugin-local-infer/providers/engines/strata/strataArch
|
|
6
|
+
*/
|
|
7
|
+
import { STRATA_LINUX } from "./strataLinux.js";
|
|
8
|
+
export const STRATA_ARCH = STRATA_LINUX;
|
|
9
|
+
//# sourceMappingURL=strataArch.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Strata Debian build profile. Debian builds Strata through the shared
|
|
3
|
+
* Linux route (the engine's own setup.sh), so this profile reuses the shared
|
|
4
|
+
* Linux profile and carries no build steps of its own.
|
|
5
|
+
* @module dsh-plugin-local-infer/providers/engines/strata/strataDebian
|
|
6
|
+
*/
|
|
7
|
+
import type { EngineOsProfile } from '../engineOs.ts';
|
|
8
|
+
export declare const STRATA_DEBIAN: EngineOsProfile;
|
|
9
|
+
//# sourceMappingURL=strataDebian.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Strata Debian build profile. Debian builds Strata through the shared
|
|
3
|
+
* Linux route (the engine's own setup.sh), so this profile reuses the shared
|
|
4
|
+
* Linux profile and carries no build steps of its own.
|
|
5
|
+
* @module dsh-plugin-local-infer/providers/engines/strata/strataDebian
|
|
6
|
+
*/
|
|
7
|
+
import { STRATA_LINUX } from "./strataLinux.js";
|
|
8
|
+
export const STRATA_DEBIAN = STRATA_LINUX;
|
|
9
|
+
//# sourceMappingURL=strataDebian.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Strata Fedora build profile. Fedora builds Strata through the shared
|
|
3
|
+
* Linux route (the engine's own setup.sh), so this profile reuses the shared
|
|
4
|
+
* Linux profile and carries no build steps of its own.
|
|
5
|
+
* @module dsh-plugin-local-infer/providers/engines/strata/strataFedora
|
|
6
|
+
*/
|
|
7
|
+
import type { EngineOsProfile } from '../engineOs.ts';
|
|
8
|
+
export declare const STRATA_FEDORA: EngineOsProfile;
|
|
9
|
+
//# sourceMappingURL=strataFedora.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Strata Fedora build profile. Fedora builds Strata through the shared
|
|
3
|
+
* Linux route (the engine's own setup.sh), so this profile reuses the shared
|
|
4
|
+
* Linux profile and carries no build steps of its own.
|
|
5
|
+
* @module dsh-plugin-local-infer/providers/engines/strata/strataFedora
|
|
6
|
+
*/
|
|
7
|
+
import { STRATA_LINUX } from "./strataLinux.js";
|
|
8
|
+
export const STRATA_FEDORA = STRATA_LINUX;
|
|
9
|
+
//# sourceMappingURL=strataFedora.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Strata shared Linux build profile. Every Linux distro (Arch, Debian,
|
|
3
|
+
* Fedora) builds Strata through the engine's own setup.sh: the README's
|
|
4
|
+
* Build-from-source route, which downloads what it needs and installs the
|
|
5
|
+
* `strata` Terminal to the path. `--yes` takes the recommended answer to every
|
|
6
|
+
* question and `--no-start` builds and installs without starting the server,
|
|
7
|
+
* which the adapter's launch step then does. There is no build directory,
|
|
8
|
+
* because setup.sh installs the binary to the path. The distro profiles reuse
|
|
9
|
+
* this profile.
|
|
10
|
+
* @module dsh-plugin-local-infer/providers/engines/strata/strataLinux
|
|
11
|
+
*/
|
|
12
|
+
import type { EngineOsProfile } from '../engineOs.ts';
|
|
13
|
+
import { type StrataSourceLaunchArgs } from './strata.ts';
|
|
14
|
+
export declare const STRATA_LINUX: EngineOsProfile;
|
|
15
|
+
/**
|
|
16
|
+
* strataLinuxSourceLaunch renders the source-build launch argv for the Linux
|
|
17
|
+
* route: the engine's own setup.sh with --yes (unattended) and the resolved
|
|
18
|
+
* model, family, vision, context, and port. macOS reuses this route.
|
|
19
|
+
*/
|
|
20
|
+
export declare function strataLinuxSourceLaunch(args: StrataSourceLaunchArgs): string[];
|
|
21
|
+
//# sourceMappingURL=strataLinux.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Strata shared Linux build profile. Every Linux distro (Arch, Debian,
|
|
3
|
+
* Fedora) builds Strata through the engine's own setup.sh: the README's
|
|
4
|
+
* Build-from-source route, which downloads what it needs and installs the
|
|
5
|
+
* `strata` Terminal to the path. `--yes` takes the recommended answer to every
|
|
6
|
+
* question and `--no-start` builds and installs without starting the server,
|
|
7
|
+
* which the adapter's launch step then does. There is no build directory,
|
|
8
|
+
* because setup.sh installs the binary to the path. The distro profiles reuse
|
|
9
|
+
* this profile.
|
|
10
|
+
* @module dsh-plugin-local-infer/providers/engines/strata/strataLinux
|
|
11
|
+
*/
|
|
12
|
+
import { strataSourceLaunchArgs } from "./strata.js";
|
|
13
|
+
import { SYSTEM_DEPS } from "../../systemDeps.js";
|
|
14
|
+
export const STRATA_LINUX = {
|
|
15
|
+
buildSteps: ['cd {dir} && ./setup.sh --yes --no-start'],
|
|
16
|
+
binary: 'strata',
|
|
17
|
+
// The Strata source build git-clones the repo and runs setup.sh, which
|
|
18
|
+
// downloads what it needs; the only host deps are git (the clone) and curl
|
|
19
|
+
// (the model download).
|
|
20
|
+
deps: [SYSTEM_DEPS.git, SYSTEM_DEPS.curl],
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* strataLinuxSourceLaunch renders the source-build launch argv for the Linux
|
|
24
|
+
* route: the engine's own setup.sh with --yes (unattended) and the resolved
|
|
25
|
+
* model, family, vision, context, and port. macOS reuses this route.
|
|
26
|
+
*/
|
|
27
|
+
export function strataLinuxSourceLaunch(args) {
|
|
28
|
+
return strataSourceLaunchArgs('setup.sh', args);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=strataLinux.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Strata macOS build profile. macOS builds Strata through the engine's own
|
|
3
|
+
* setup.sh, the same route as Linux (the README's setup walks both), so this
|
|
4
|
+
* profile reuses the shared Linux build steps; the binary keeps its plain
|
|
5
|
+
* name (no .exe on macOS).
|
|
6
|
+
* @module dsh-plugin-local-infer/providers/engines/strata/strataMacOS
|
|
7
|
+
*/
|
|
8
|
+
import type { EngineOsProfile } from '../engineOs.ts';
|
|
9
|
+
import type { StrataSourceLaunchArgs } from './strata.ts';
|
|
10
|
+
export declare const STRATA_MACOS: EngineOsProfile;
|
|
11
|
+
/**
|
|
12
|
+
* strataMacOSSourceLaunch reuses the Linux source-build launch: macOS builds
|
|
13
|
+
* through the same setup.sh route, so the argv is identical.
|
|
14
|
+
*/
|
|
15
|
+
export declare function strataMacOSSourceLaunch(args: StrataSourceLaunchArgs): string[];
|
|
16
|
+
//# sourceMappingURL=strataMacOS.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Strata macOS build profile. macOS builds Strata through the engine's own
|
|
3
|
+
* setup.sh, the same route as Linux (the README's setup walks both), so this
|
|
4
|
+
* profile reuses the shared Linux build steps; the binary keeps its plain
|
|
5
|
+
* name (no .exe on macOS).
|
|
6
|
+
* @module dsh-plugin-local-infer/providers/engines/strata/strataMacOS
|
|
7
|
+
*/
|
|
8
|
+
import { STRATA_LINUX, strataLinuxSourceLaunch } from "./strataLinux.js";
|
|
9
|
+
export const STRATA_MACOS = STRATA_LINUX;
|
|
10
|
+
/**
|
|
11
|
+
* strataMacOSSourceLaunch reuses the Linux source-build launch: macOS builds
|
|
12
|
+
* through the same setup.sh route, so the argv is identical.
|
|
13
|
+
*/
|
|
14
|
+
export function strataMacOSSourceLaunch(args) {
|
|
15
|
+
return strataLinuxSourceLaunch(args);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=strataMacOS.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Strata Windows build profile. The Windows source route is the engine's
|
|
3
|
+
* own START-HERE.bat wrapper (docs/SOURCE_INSTALL.md, From source: Windows),
|
|
4
|
+
* not the Linux setup.sh. `--yes` accepts the recommended answer to every
|
|
5
|
+
* question, so the step runs unattended. The wrapper acquires a ready-made
|
|
6
|
+
* engine when one fits the PC, and compiles one when it does not: the
|
|
7
|
+
* compile needs the Visual Studio 2022 Build Tools with the C++ workload
|
|
8
|
+
* (the sources are C++20, so VS2019 is too old). When setup cannot find the
|
|
9
|
+
* toolchain, point STRATA_VCVARS at vcvars64.bat before running. The build
|
|
10
|
+
* keeps its dependencies and products in the source install and writes the
|
|
11
|
+
* launch scripts (run-<model>.bat) and run configs (strata-<model>.json)
|
|
12
|
+
* into the checkout, so the profile carries no build directory. Updates run
|
|
13
|
+
* through UPDATE.bat.
|
|
14
|
+
* @module dsh-plugin-local-infer/providers/engines/strata/strataWindows
|
|
15
|
+
*/
|
|
16
|
+
import type { EngineOsProfile } from '../engineOs.ts';
|
|
17
|
+
import { type StrataSourceLaunchArgs } from './strata.ts';
|
|
18
|
+
export declare const STRATA_WINDOWS: EngineOsProfile;
|
|
19
|
+
/**
|
|
20
|
+
* strataWindowsSourceLaunch renders the source-build launch argv for the
|
|
21
|
+
* Windows route: the engine's own START-HERE.bat wrapper with --yes
|
|
22
|
+
* (unattended) and the resolved model, family, vision, context, and port. The
|
|
23
|
+
* wrapper acquires a ready-made engine when one fits the PC, and compiles one
|
|
24
|
+
* (the Visual Studio 2022 C++ toolchain) when it does not.
|
|
25
|
+
*/
|
|
26
|
+
export declare function strataWindowsSourceLaunch(args: StrataSourceLaunchArgs): string[];
|
|
27
|
+
//# sourceMappingURL=strataWindows.d.ts.map
|