@infernetprotocol/cli 0.1.89 → 0.1.91
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/house-models.js +2 -1
- package/commands/setup.js +4 -2
- package/commands/start.js +19 -1
- package/lib/house-models.js +12 -8
- package/package.json +9 -9
package/commands/house-models.js
CHANGED
|
@@ -36,7 +36,8 @@ Flags:
|
|
|
36
36
|
--help Show this help
|
|
37
37
|
|
|
38
38
|
Environment (beats config.json): INFERNET_HOUSE_MODELS=0,
|
|
39
|
-
INFERNET_UNCENSORED_MODELS=
|
|
39
|
+
INFERNET_UNCENSORED_MODELS=1 (uncensored are off unless opted in),
|
|
40
|
+
INFERNET_HOUSE_MODELS_MAX_GB=<n>.
|
|
40
41
|
|
|
41
42
|
House models are ON by default. The daemon checks
|
|
42
43
|
https://infernetprotocol.com/house-models.json on start and every 6 hours,
|
package/commands/setup.js
CHANGED
|
@@ -50,7 +50,8 @@ Flags:
|
|
|
50
50
|
--no-abliterated Don't default to the abliterated (uncensored) model
|
|
51
51
|
when it fits; pick the largest stock Qwen instead.
|
|
52
52
|
--no-house-models Don't pull Infernet house models (saved to config).
|
|
53
|
-
--
|
|
53
|
+
--uncensored-models Also serve uncensored house models (off by default; saved to config).
|
|
54
|
+
--no-uncensored-models Skip uncensored house models (the default; saved to config).
|
|
54
55
|
--house-models-max-gb <n>
|
|
55
56
|
Cap the disk house models may use (saved to config).
|
|
56
57
|
--backend <kind> Pin engine backend (vllm | ollama | mojo | stub). Default: auto (prefers vLLM, falls back to Ollama).
|
|
@@ -861,6 +862,7 @@ export default async function setup(args) {
|
|
|
861
862
|
if (isProvider) {
|
|
862
863
|
const patch = {};
|
|
863
864
|
if (args.has("no-house-models")) patch.enabled = false;
|
|
865
|
+
if (args.has("uncensored-models")) patch.uncensored = true;
|
|
864
866
|
if (args.has("no-uncensored-models")) patch.uncensored = false;
|
|
865
867
|
const capArg = Number(args.get("house-models-max-gb"));
|
|
866
868
|
if (args.get("house-models-max-gb") !== undefined && Number.isFinite(capArg)) patch.maxDiskGb = capArg;
|
|
@@ -991,7 +993,7 @@ export default async function setup(args) {
|
|
|
991
993
|
ok(`house models: ON — this node will pull the models listed at ${hs.manifestUrl}`);
|
|
992
994
|
process.stdout.write(` that fit it (RAM, and always leaving 10% of the disk free, 10-50 GB${hs.maxDiskGb != null ? `, capped at ${hs.maxDiskGb} GB` : ""}),\n`);
|
|
993
995
|
process.stdout.write(` in the background, and serve them on Infernet. Uncensored house models: ${hs.uncensored ? "on" : "off"}.\n`);
|
|
994
|
-
process.stdout.write(" Opt out: infernet house-models off (uncensored
|
|
996
|
+
process.stdout.write(" Opt out: infernet house-models off (uncensored are off unless you run: infernet house-models uncensored on)\n");
|
|
995
997
|
} else {
|
|
996
998
|
ok("house models: off (turn on with `infernet house-models on`)");
|
|
997
999
|
}
|
package/commands/start.js
CHANGED
|
@@ -87,7 +87,8 @@ Flags:
|
|
|
87
87
|
--once Run one heartbeat + one poll and exit (debug)
|
|
88
88
|
--no-house-models Don't pull Infernet house models for this run
|
|
89
89
|
(persist with \`infernet house-models off\`)
|
|
90
|
-
--
|
|
90
|
+
--uncensored-models Also serve uncensored house models (off by default)
|
|
91
|
+
--no-uncensored-models Skip uncensored house models (the default)
|
|
91
92
|
--house-models-max-gb <n> Cap the disk house models may use
|
|
92
93
|
--help Show this help
|
|
93
94
|
|
|
@@ -172,6 +173,7 @@ function passthroughArgs(args) {
|
|
|
172
173
|
if (args.has('no-advertise')) passthrough.push('--no-advertise');
|
|
173
174
|
if (args.has('once')) passthrough.push('--once');
|
|
174
175
|
if (args.has('no-house-models')) passthrough.push('--no-house-models');
|
|
176
|
+
if (args.has('uncensored-models')) passthrough.push('--uncensored-models');
|
|
175
177
|
if (args.has('no-uncensored-models')) passthrough.push('--no-uncensored-models');
|
|
176
178
|
const houseCap = args.get('house-models-max-gb');
|
|
177
179
|
if (houseCap) passthrough.push('--house-models-max-gb', houseCap);
|
|
@@ -423,6 +425,10 @@ async function runDaemon(args, ctx) {
|
|
|
423
425
|
}
|
|
424
426
|
return {
|
|
425
427
|
active_jobs: stats.activeJobIds.size,
|
|
428
|
+
// How many jobs this daemon runs at once. Without it the router
|
|
429
|
+
// guesses (1 on CPU-only nodes, 4 with a GPU) and a GPU node
|
|
430
|
+
// running one job at a time gets 3 queued behind it.
|
|
431
|
+
concurrency_cap: maxConcurrentJobs,
|
|
426
432
|
load_avg_1m: Array.isArray(host.load_avg) ? +host.load_avg[0]?.toFixed(2) : null,
|
|
427
433
|
ram: {
|
|
428
434
|
total_gb: +totalRamGb.toFixed(2),
|
|
@@ -629,10 +635,21 @@ async function runDaemon(args, ctx) {
|
|
|
629
635
|
// frees up.
|
|
630
636
|
if (stats.activeJobIds.size >= maxConcurrentJobs) return;
|
|
631
637
|
const polledAt = Date.now();
|
|
638
|
+
let refetch = false;
|
|
632
639
|
try {
|
|
633
640
|
const result = await client.pollJobs({ limit: 5 });
|
|
634
641
|
stats.pollsOk += 1;
|
|
642
|
+
const fetchedAt = Date.now();
|
|
635
643
|
for (const job of result?.jobs ?? []) {
|
|
644
|
+
// Jobs are awaited one by one, so after a long job the rest of
|
|
645
|
+
// this batch is minutes old. The control plane may have moved
|
|
646
|
+
// a queued job to a free node meanwhile (chat rebalancing), and
|
|
647
|
+
// running it here would only be refused at the first event.
|
|
648
|
+
// Fetch a fresh list instead.
|
|
649
|
+
if (Date.now() - fetchedAt > pollMs) {
|
|
650
|
+
refetch = true;
|
|
651
|
+
break;
|
|
652
|
+
}
|
|
636
653
|
// Skip jobs already being processed by this daemon — the
|
|
637
654
|
// server keeps returning 'assigned' jobs until we mark them
|
|
638
655
|
// complete, so without this guard the poll loop queues the
|
|
@@ -652,6 +669,7 @@ async function runDaemon(args, ctx) {
|
|
|
652
669
|
stats.pollsFailed += 1;
|
|
653
670
|
process.stderr.write(`job poll error: ${err?.message ?? err}\n`);
|
|
654
671
|
}
|
|
672
|
+
if (refetch && !stats.draining) await pollJobs();
|
|
655
673
|
}
|
|
656
674
|
|
|
657
675
|
/**
|
package/lib/house-models.js
CHANGED
|
@@ -19,9 +19,10 @@
|
|
|
19
19
|
* (10% of the disk, at least 10 GB, at most 50 GB), and house models as a
|
|
20
20
|
* whole stay under the operator's disk cap if one is set.
|
|
21
21
|
* - Opt out of everything with `--no-house-models`, `infernet house-models
|
|
22
|
-
* off` or INFERNET_HOUSE_MODELS=0
|
|
23
|
-
* `--
|
|
24
|
-
* INFERNET_UNCENSORED_MODELS=
|
|
22
|
+
* off` or INFERNET_HOUSE_MODELS=0. Uncensored house models are OFF unless
|
|
23
|
+
* the operator opts in with `--uncensored-models`, `infernet house-models
|
|
24
|
+
* uncensored on` or INFERNET_UNCENSORED_MODELS=1. Opting out removes what
|
|
25
|
+
* the daemon pulled.
|
|
25
26
|
*/
|
|
26
27
|
|
|
27
28
|
import fs from 'node:fs/promises';
|
|
@@ -159,15 +160,17 @@ export async function fetchManifest({ url = DEFAULT_MANIFEST_URL, fetchImpl = fe
|
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
/**
|
|
162
|
-
* Effective settings: CLI flags beat env, env beats config.json
|
|
163
|
-
* default
|
|
163
|
+
* Effective settings: CLI flags beat env, env beats config.json. House models
|
|
164
|
+
* default ON; uncensored house models default OFF and need an explicit opt-in
|
|
165
|
+
* (`--uncensored-models`, `infernet house-models uncensored on`,
|
|
166
|
+
* INFERNET_UNCENSORED_MODELS=1), so nobody serves them without choosing to.
|
|
164
167
|
*/
|
|
165
168
|
export function resolveSettings({ config = {}, env = process.env, args = null } = {}) {
|
|
166
169
|
const cfg = config?.houseModels ?? {};
|
|
167
170
|
let enabled = cfg.enabled !== false;
|
|
168
|
-
let uncensored = cfg.uncensored
|
|
171
|
+
let uncensored = cfg.uncensored === true;
|
|
169
172
|
let maxDiskGb = Number.isFinite(Number(cfg.maxDiskGb)) && cfg.maxDiskGb !== null ? Number(cfg.maxDiskGb) : null;
|
|
170
|
-
const sources = { enabled: cfg.enabled === false ? 'config' : 'default', uncensored: cfg.uncensored ===
|
|
173
|
+
const sources = { enabled: cfg.enabled === false ? 'config' : 'default', uncensored: typeof cfg.uncensored === 'boolean' ? 'config' : 'default' };
|
|
171
174
|
|
|
172
175
|
if (isOff(env.INFERNET_HOUSE_MODELS)) { enabled = false; sources.enabled = 'env INFERNET_HOUSE_MODELS'; }
|
|
173
176
|
else if (isOn(env.INFERNET_HOUSE_MODELS)) { enabled = true; sources.enabled = 'env INFERNET_HOUSE_MODELS'; }
|
|
@@ -181,6 +184,7 @@ export function resolveSettings({ config = {}, env = process.env, args = null }
|
|
|
181
184
|
}
|
|
182
185
|
|
|
183
186
|
if (args?.has?.('no-house-models')) { enabled = false; sources.enabled = '--no-house-models'; }
|
|
187
|
+
if (args?.has?.('uncensored-models')) { uncensored = true; sources.uncensored = '--uncensored-models'; }
|
|
184
188
|
if (args?.has?.('no-uncensored-models')) { uncensored = false; sources.uncensored = '--no-uncensored-models'; }
|
|
185
189
|
const argCap = Number(args?.get?.('house-models-max-gb'));
|
|
186
190
|
if (Number.isFinite(argCap) && args?.get?.('house-models-max-gb') !== undefined) maxDiskGb = argCap;
|
|
@@ -610,6 +614,6 @@ export function formatStatus({ settings, state, installed = null }) {
|
|
|
610
614
|
lines.push(` last sync: ${ls.at}${ls.errors?.length ? `, ${ls.errors.length} error(s): ${ls.errors.map((e) => `${e.name ?? 'manifest'}: ${e.error}`).join('; ')}` : ''}`);
|
|
611
615
|
for (const s of ls.skipped ?? []) lines.push(` skipped ${s.name}: ${s.reason}`);
|
|
612
616
|
}
|
|
613
|
-
lines.push(' opt out: infernet house-models off | uncensored
|
|
617
|
+
lines.push(' opt out: infernet house-models off | uncensored (off by default): infernet house-models uncensored on|off');
|
|
614
618
|
return lines.join('\n');
|
|
615
619
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infernetprotocol/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.91",
|
|
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",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"ora": "^9.4.1",
|
|
33
33
|
"react": "^17.0.2",
|
|
34
34
|
"react-blessed": "^0.7.2",
|
|
35
|
-
"@infernetprotocol/auth": "0.1.
|
|
36
|
-
"@infernetprotocol/config": "0.1.
|
|
37
|
-
"@infernetprotocol/deploy-providers": "0.1.
|
|
38
|
-
"@infernetprotocol/engine": "0.1.
|
|
39
|
-
"@infernetprotocol/gpu": "0.1.
|
|
40
|
-
"@infernetprotocol/liquid-agent": "0.1.
|
|
41
|
-
"@infernetprotocol/rpc-adapter": "0.1.
|
|
42
|
-
"@infernetprotocol/training": "0.1.
|
|
35
|
+
"@infernetprotocol/auth": "0.1.91",
|
|
36
|
+
"@infernetprotocol/config": "0.1.91",
|
|
37
|
+
"@infernetprotocol/deploy-providers": "0.1.91",
|
|
38
|
+
"@infernetprotocol/engine": "0.1.91",
|
|
39
|
+
"@infernetprotocol/gpu": "0.1.91",
|
|
40
|
+
"@infernetprotocol/liquid-agent": "0.1.91",
|
|
41
|
+
"@infernetprotocol/rpc-adapter": "0.1.91",
|
|
42
|
+
"@infernetprotocol/training": "0.1.91"
|
|
43
43
|
},
|
|
44
44
|
"repository": {
|
|
45
45
|
"type": "git",
|