@infernetprotocol/cli 0.1.48 → 0.1.49
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/commands/start.js +29 -25
- package/package.json +7 -7
package/commands/start.js
CHANGED
|
@@ -629,50 +629,54 @@ async function runDaemon(args, ctx) {
|
|
|
629
629
|
let result;
|
|
630
630
|
if (command === 'model_install') {
|
|
631
631
|
const modelName = String(args?.model);
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
632
|
+
// The node decides the backend by HARDWARE: prefer vLLM (GPU),
|
|
633
|
+
// fall back to Ollama (CPU/Mac). A catalog model carries an
|
|
634
|
+
// `hf` repo (ungated, vLLM-servable); a bare `hf:` name is
|
|
635
|
+
// vLLM-only; everything else is an Ollama tag.
|
|
636
|
+
const hfRepo = args?.hf
|
|
637
|
+
? String(args.hf)
|
|
638
|
+
: (modelName.startsWith('hf:') ? modelName.slice(3) : null);
|
|
639
|
+
|
|
640
|
+
if (vllmInstalled() && hfRepo) {
|
|
641
|
+
// GPU path — serve the HF weights on vLLM. Keep the friendly
|
|
642
|
+
// name (e.g. "qwen2.5:7b" or "hf:org/repo") as the served
|
|
643
|
+
// model name so chat requests + served_models match, but the
|
|
644
|
+
// engine underneath is vLLM.
|
|
642
645
|
const token = process.env.HF_TOKEN || (await resolveHfToken().catch(() => null));
|
|
643
|
-
const localPath = await downloadHfModel(
|
|
644
|
-
// Serve the repo id, not a computed cache path — vLLM
|
|
645
|
-
// resolves it straight from the HF cache we just filled
|
|
646
|
-
// (the snapshot dir is a commit hash, not "main"). Serve
|
|
647
|
-
// under the hf: pull name so it matches chat requests and
|
|
648
|
-
// gets advertised in served_models → shows in /chat.
|
|
649
|
-
const serve = await startVllmServe({ source: repoId, servedName: modelName, token });
|
|
646
|
+
const localPath = await downloadHfModel(hfRepo, token);
|
|
650
647
|
// Don't report "completed" on spawn — wait until vLLM has
|
|
651
648
|
// mapped the weights and /v1/models actually lists the model.
|
|
652
|
-
// If it never comes up (OOM, unsupported arch,
|
|
653
|
-
// fail the command WITH the log
|
|
654
|
-
|
|
655
|
-
process.stdout.write(`[${new Date().toISOString()}] ${modelName} downloaded; waiting for vLLM to load weights…\n`);
|
|
649
|
+
// If it never comes up (OOM, unsupported arch, gated repo),
|
|
650
|
+
// fail the command WITH the log root cause instead of lying.
|
|
651
|
+
const serve = await startVllmServe({ source: hfRepo, servedName: modelName, token });
|
|
652
|
+
process.stdout.write(`[${new Date().toISOString()}] ${modelName} (${hfRepo}) downloaded; waiting for vLLM to load weights…\n`);
|
|
656
653
|
const up = await waitForVllmModel(modelName, { pid: serve.pid, timeoutMs: 300_000 });
|
|
657
654
|
if (!up.serving) {
|
|
658
655
|
const tail = await extractVllmError();
|
|
659
656
|
throw new Error(
|
|
660
|
-
`vLLM failed to serve ${modelName}: ${up.reason}.` +
|
|
657
|
+
`vLLM failed to serve ${modelName} (${hfRepo}): ${up.reason}.` +
|
|
661
658
|
(tail ? `\n--- vllm.log (root cause) ---\n${tail}` : ' (no vllm.log output)')
|
|
662
659
|
);
|
|
663
660
|
}
|
|
664
|
-
// Serving for real — bust the specs cache so the very next
|
|
665
|
-
// heartbeat advertises the new model in served_models
|
|
666
|
-
// (otherwise it's stale until the TTL lapses).
|
|
667
661
|
invalidateSpecsCache();
|
|
668
662
|
result = {
|
|
669
663
|
model: modelName,
|
|
670
664
|
backend: 'vllm',
|
|
665
|
+
source: hfRepo,
|
|
671
666
|
localPath,
|
|
672
667
|
vllm: { pid: serve.pid, port: serve.port },
|
|
673
668
|
note: `Serving on vLLM :${serve.port} and advertised in served_models.`,
|
|
674
669
|
};
|
|
670
|
+
} else if (modelName.startsWith('hf:')) {
|
|
671
|
+
// hf: model requested but this node has no vLLM (CPU/Mac).
|
|
672
|
+
throw new Error(
|
|
673
|
+
`${modelName} needs vLLM, which isn't installed on this node. ` +
|
|
674
|
+
`Re-run the installer on an NVIDIA host (it installs vLLM), or: pip install vllm. ` +
|
|
675
|
+
`Alternatively push an Ollama model — those run on CPU.`
|
|
676
|
+
);
|
|
675
677
|
} else {
|
|
678
|
+
// CPU/Mac path (or a GPU box without a vLLM-servable repo) —
|
|
679
|
+
// Ollama serves the GGUF tag.
|
|
676
680
|
const fits = await checkModelFits(modelName);
|
|
677
681
|
if (fits && !fits.ok) {
|
|
678
682
|
throw new Error(formatFitFailure(modelName, fits));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infernetprotocol/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.49",
|
|
4
4
|
"description": "GPU-node CLI / daemon for the Infernet Protocol — register a GPU server with a Supabase control plane and start earning.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"ora": "^9.4.0",
|
|
31
31
|
"react": "^17.0.2",
|
|
32
32
|
"react-blessed": "^0.7.2",
|
|
33
|
-
"@infernetprotocol/auth": "0.1.
|
|
34
|
-
"@infernetprotocol/config": "0.1.
|
|
35
|
-
"@infernetprotocol/engine": "0.1.
|
|
36
|
-
"@infernetprotocol/
|
|
37
|
-
"@infernetprotocol/
|
|
38
|
-
"@infernetprotocol/rpc-adapter": "0.1.
|
|
33
|
+
"@infernetprotocol/auth": "0.1.49",
|
|
34
|
+
"@infernetprotocol/config": "0.1.49",
|
|
35
|
+
"@infernetprotocol/engine": "0.1.49",
|
|
36
|
+
"@infernetprotocol/gpu": "0.1.49",
|
|
37
|
+
"@infernetprotocol/deploy-providers": "0.1.49",
|
|
38
|
+
"@infernetprotocol/rpc-adapter": "0.1.49"
|
|
39
39
|
},
|
|
40
40
|
"repository": {
|
|
41
41
|
"type": "git",
|