@infernetprotocol/cli 0.1.38 → 0.1.39
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/inference.js +26 -0
- package/package.json +6 -6
package/commands/inference.js
CHANGED
|
@@ -32,6 +32,7 @@ Usage:
|
|
|
32
32
|
infernet inference serve --model <hf-id> [flags]
|
|
33
33
|
infernet inference status
|
|
34
34
|
infernet inference stop
|
|
35
|
+
infernet inference list
|
|
35
36
|
|
|
36
37
|
Flags (serve):
|
|
37
38
|
--model <hf-id> Required. e.g. meta-llama/Llama-3.1-70B-Instruct
|
|
@@ -171,6 +172,30 @@ async function cmdStatus() {
|
|
|
171
172
|
return 0;
|
|
172
173
|
}
|
|
173
174
|
|
|
175
|
+
async function cmdList() {
|
|
176
|
+
const cfg = await loadConfig().catch(() => ({}));
|
|
177
|
+
const controlPlaneUrl = cfg?.controlPlane?.url ?? process.env.NEXT_PUBLIC_APP_URL ?? "https://infernetprotocol.com";
|
|
178
|
+
const res = await fetch(`${controlPlaneUrl}/api/v1/petals/swarm`);
|
|
179
|
+
if (!res.ok) {
|
|
180
|
+
process.stderr.write(`error: HTTP ${res.status} from ${controlPlaneUrl}\n`);
|
|
181
|
+
return 1;
|
|
182
|
+
}
|
|
183
|
+
const { data } = await res.json();
|
|
184
|
+
if (!data?.models?.length) {
|
|
185
|
+
process.stdout.write(`(no Petals swarms active right now)\n`);
|
|
186
|
+
process.stdout.write(`Be the first — \`infernet inference serve --backend petals --model <hf-id>\`\n`);
|
|
187
|
+
return 0;
|
|
188
|
+
}
|
|
189
|
+
process.stdout.write(`\nPetals swarms — ${data.total_models} models · ${data.total_nodes} nodes serving\n\n`);
|
|
190
|
+
process.stdout.write(` ${"NODES".padEnd(7)} MODEL\n`);
|
|
191
|
+
process.stdout.write(` ${"─────".padEnd(7)} ─────\n`);
|
|
192
|
+
for (const m of data.models) {
|
|
193
|
+
process.stdout.write(` ${String(m.node_count).padEnd(7)} ${m.model}\n`);
|
|
194
|
+
}
|
|
195
|
+
process.stdout.write(`\nQuery as a user: tick \"Distribute across all nodes\" on /chat and pick a model above.\n\n`);
|
|
196
|
+
return 0;
|
|
197
|
+
}
|
|
198
|
+
|
|
174
199
|
async function cmdStop() {
|
|
175
200
|
const state = await readState();
|
|
176
201
|
if (!state?.pid) {
|
|
@@ -197,6 +222,7 @@ export default async function inference(args) {
|
|
|
197
222
|
case "serve": case "start": return cmdServe(args);
|
|
198
223
|
case "status": return cmdStatus();
|
|
199
224
|
case "stop": return cmdStop();
|
|
225
|
+
case "list": case "ls": return cmdList();
|
|
200
226
|
default:
|
|
201
227
|
process.stderr.write(sub ? `unknown subcommand: ${sub}\n\n` : "error: missing subcommand\n\n");
|
|
202
228
|
process.stderr.write(HELP);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infernetprotocol/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.39",
|
|
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,11 +30,11 @@
|
|
|
30
30
|
"ora": "^9.4.0",
|
|
31
31
|
"react": "^17.0.2",
|
|
32
32
|
"react-blessed": "^0.7.2",
|
|
33
|
-
"@infernetprotocol/
|
|
34
|
-
"@infernetprotocol/
|
|
35
|
-
"@infernetprotocol/deploy-providers": "0.1.
|
|
36
|
-
"@infernetprotocol/engine": "0.1.
|
|
37
|
-
"@infernetprotocol/gpu": "0.1.
|
|
33
|
+
"@infernetprotocol/config": "0.1.39",
|
|
34
|
+
"@infernetprotocol/auth": "0.1.39",
|
|
35
|
+
"@infernetprotocol/deploy-providers": "0.1.39",
|
|
36
|
+
"@infernetprotocol/engine": "0.1.39",
|
|
37
|
+
"@infernetprotocol/gpu": "0.1.39"
|
|
38
38
|
},
|
|
39
39
|
"repository": {
|
|
40
40
|
"type": "git",
|