@eve-horizon/cli 0.2.30 → 0.2.32
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/dist/index.js +133 -21
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -51204,7 +51204,7 @@ Requires Docker Desktop; k3d and kubectl are auto-managed by the CLI.`,
|
|
|
51204
51204
|
]
|
|
51205
51205
|
},
|
|
51206
51206
|
ollama: {
|
|
51207
|
-
description: "Manage inference targets, installs, models, and
|
|
51207
|
+
description: "Manage inference targets, installs, models, aliases, and platform managed availability.",
|
|
51208
51208
|
usage: "eve ollama <subcommand> [options]",
|
|
51209
51209
|
subcommands: {
|
|
51210
51210
|
targets: {
|
|
@@ -51217,7 +51217,7 @@ Requires Docker Desktop; k3d and kubectl are auto-managed by the CLI.`,
|
|
|
51217
51217
|
options: [
|
|
51218
51218
|
"add: --name <name> --base-url <url> [--scope-kind <kind>] [--scope-id <id>] [--target-type <type>] [--transport-profile <profile>] [--api-key-ref <secret-ref>]",
|
|
51219
51219
|
"rm: <target-id>",
|
|
51220
|
-
"test: <target-id>
|
|
51220
|
+
"test: <target-id>"
|
|
51221
51221
|
]
|
|
51222
51222
|
},
|
|
51223
51223
|
models: {
|
|
@@ -51267,15 +51267,25 @@ Requires Docker Desktop; k3d and kubectl are auto-managed by the CLI.`,
|
|
|
51267
51267
|
"set: --scope-kind <kind> [--scope-id <id>] --preferred-target-id <target-id> [--fallback-to-alias-target true|false]",
|
|
51268
51268
|
"rm: --scope-kind <kind> [--scope-id <id>]"
|
|
51269
51269
|
]
|
|
51270
|
+
},
|
|
51271
|
+
managed: {
|
|
51272
|
+
description: "List, publish, and unpublish platform-managed catalog models",
|
|
51273
|
+
usage: "eve ollama managed <list|publish|unpublish> [options]",
|
|
51274
|
+
options: [
|
|
51275
|
+
"list: [--json]",
|
|
51276
|
+
"publish: --canonical <id> --provider <name> --slug <provider_model_slug> --target-id <id> [--requires-warm-start true|false] [--enabled true|false] [--json]",
|
|
51277
|
+
"unpublish: --canonical <id> [--json]"
|
|
51278
|
+
]
|
|
51270
51279
|
}
|
|
51271
51280
|
},
|
|
51272
51281
|
examples: [
|
|
51273
51282
|
"eve ollama target add --name local --base-url http://localhost:11434 --scope-kind platform --target-type external_ollama",
|
|
51274
51283
|
"eve ollama model add --canonical gpt-oss:120b --provider ollama --slug gpt-oss:120b",
|
|
51275
51284
|
"eve ollama install add --target-id itgt_xxx --model-id imod_xxx --min-target-capacity 1",
|
|
51276
|
-
"eve ollama
|
|
51277
|
-
"eve ollama
|
|
51278
|
-
"eve ollama
|
|
51285
|
+
"eve ollama assignments --scope-kind platform",
|
|
51286
|
+
"eve ollama managed list",
|
|
51287
|
+
"eve ollama managed publish --canonical deepseek-r1 --provider ollama --slug deepseek-r1:latest --target-id itgt_xxx",
|
|
51288
|
+
"eve ollama managed unpublish --canonical deepseek-r1"
|
|
51279
51289
|
]
|
|
51280
51290
|
},
|
|
51281
51291
|
migrate: {
|
|
@@ -59673,6 +59683,38 @@ var InferenceRoutePolicySchema = external_exports.object({
|
|
|
59673
59683
|
created_at: external_exports.string(),
|
|
59674
59684
|
updated_at: external_exports.string()
|
|
59675
59685
|
});
|
|
59686
|
+
var InferenceManagedModelSchema = external_exports.object({
|
|
59687
|
+
canonical_model_id: external_exports.string(),
|
|
59688
|
+
provider: external_exports.string(),
|
|
59689
|
+
provider_model_slug: external_exports.string(),
|
|
59690
|
+
target_id: external_exports.string(),
|
|
59691
|
+
requires_warm_start: external_exports.boolean().default(false),
|
|
59692
|
+
enabled: external_exports.boolean().default(true)
|
|
59693
|
+
});
|
|
59694
|
+
var InferenceManagedModelsSchema = external_exports.record(InferenceManagedModelSchema);
|
|
59695
|
+
var UpsertInferenceManagedModelRequestSchema = external_exports.object({
|
|
59696
|
+
canonical_model_id: external_exports.string(),
|
|
59697
|
+
provider: external_exports.string(),
|
|
59698
|
+
provider_model_slug: external_exports.string(),
|
|
59699
|
+
target_id: external_exports.string(),
|
|
59700
|
+
requires_warm_start: external_exports.boolean().optional().default(false),
|
|
59701
|
+
enabled: external_exports.boolean().optional().default(true)
|
|
59702
|
+
});
|
|
59703
|
+
var InferenceManagedModelResponseSchema = external_exports.object({
|
|
59704
|
+
canonical_model_id: external_exports.string(),
|
|
59705
|
+
provider: external_exports.string(),
|
|
59706
|
+
provider_model_slug: external_exports.string(),
|
|
59707
|
+
target_id: external_exports.string(),
|
|
59708
|
+
requires_warm_start: external_exports.boolean(),
|
|
59709
|
+
enabled: external_exports.boolean()
|
|
59710
|
+
});
|
|
59711
|
+
var InferenceManagedModelListResponseSchema = external_exports.object({
|
|
59712
|
+
data: external_exports.array(InferenceManagedModelResponseSchema)
|
|
59713
|
+
});
|
|
59714
|
+
var InferenceManagedModelUpsertResponseSchema = external_exports.object({
|
|
59715
|
+
data: InferenceManagedModelResponseSchema,
|
|
59716
|
+
created_install: external_exports.boolean()
|
|
59717
|
+
});
|
|
59676
59718
|
var CreateInferenceTargetRequestSchema = external_exports.object({
|
|
59677
59719
|
scope_kind: InferenceScopeKindSchema,
|
|
59678
59720
|
scope_id: external_exports.string().optional(),
|
|
@@ -75237,20 +75279,18 @@ async function handleModels(subcommand, positionals, flags, context2) {
|
|
|
75237
75279
|
switch (subcommand) {
|
|
75238
75280
|
case "list":
|
|
75239
75281
|
case void 0:
|
|
75240
|
-
return handleList8(
|
|
75282
|
+
return handleList8(context2, json);
|
|
75241
75283
|
default:
|
|
75242
|
-
throw new Error("Usage: eve models list [--
|
|
75284
|
+
throw new Error("Usage: eve models list [--json]");
|
|
75243
75285
|
}
|
|
75244
75286
|
}
|
|
75245
|
-
async function handleList8(
|
|
75246
|
-
const
|
|
75247
|
-
const query = managedOnly ? "?managed=true" : "";
|
|
75248
|
-
const response = await requestJson(context2, `/models${query}`);
|
|
75287
|
+
async function handleList8(context2, json) {
|
|
75288
|
+
const response = await requestJson(context2, "/models");
|
|
75249
75289
|
if (json) {
|
|
75250
75290
|
outputJson(response, json);
|
|
75251
75291
|
return;
|
|
75252
75292
|
}
|
|
75253
|
-
if (response.byok
|
|
75293
|
+
if (response.byok) {
|
|
75254
75294
|
console.log("BYOK (Bring Your Own Key)");
|
|
75255
75295
|
console.log("========================");
|
|
75256
75296
|
console.log(` ${response.byok.description}`);
|
|
@@ -78057,6 +78097,14 @@ function requireString(flags, key) {
|
|
|
78057
78097
|
if (!value) throw new Error(`Missing required flag --${key}`);
|
|
78058
78098
|
return value;
|
|
78059
78099
|
}
|
|
78100
|
+
function asBoolean(flags, key) {
|
|
78101
|
+
const value = asString(flags, key);
|
|
78102
|
+
if (value === void 0) return void 0;
|
|
78103
|
+
return value === "true" || value === "1";
|
|
78104
|
+
}
|
|
78105
|
+
function normalizeManagedModelRows(payload) {
|
|
78106
|
+
return Array.isArray(payload) ? payload : payload.data;
|
|
78107
|
+
}
|
|
78060
78108
|
function printTable(headers, rows) {
|
|
78061
78109
|
const widths = headers.map((header, idx) => Math.max(header.length, ...rows.map((row) => row[idx]?.length ?? 0)));
|
|
78062
78110
|
const line = `+${widths.map((w) => "-".repeat(w + 2)).join("+")}+`;
|
|
@@ -78147,14 +78195,8 @@ async function handleOllama(subcommand, positionals, flags, context2) {
|
|
|
78147
78195
|
}
|
|
78148
78196
|
if (action === "test") {
|
|
78149
78197
|
const targetId = positionals[1];
|
|
78150
|
-
if (!targetId) throw new Error("Usage: eve ollama target test <target-id>
|
|
78151
|
-
const
|
|
78152
|
-
const orgId = asString(flags, "org-id");
|
|
78153
|
-
const projectId = asString(flags, "project-id");
|
|
78154
|
-
if (orgId) query.set("org_id", orgId);
|
|
78155
|
-
if (projectId) query.set("project_id", projectId);
|
|
78156
|
-
const suffix = query.toString() ? `?${query.toString()}` : "";
|
|
78157
|
-
const result = await requestJson(context2, `/inference/targets/${targetId}/test${suffix}`, {
|
|
78198
|
+
if (!targetId) throw new Error("Usage: eve ollama target test <target-id>");
|
|
78199
|
+
const result = await requestJson(context2, `/inference/targets/${targetId}/test`, {
|
|
78158
78200
|
method: "POST"
|
|
78159
78201
|
});
|
|
78160
78202
|
outputJson(result, json);
|
|
@@ -78439,8 +78481,78 @@ async function handleOllama(subcommand, positionals, flags, context2) {
|
|
|
78439
78481
|
}
|
|
78440
78482
|
throw new Error("Usage: eve ollama install <add|rm> --target-id <id> --model-id <id>");
|
|
78441
78483
|
}
|
|
78484
|
+
case "managed": {
|
|
78485
|
+
const action = positionals[0];
|
|
78486
|
+
if (action === "list") {
|
|
78487
|
+
const response = await requestJson(
|
|
78488
|
+
context2,
|
|
78489
|
+
"/inference/managed-models"
|
|
78490
|
+
);
|
|
78491
|
+
const managed = normalizeManagedModelRows(response);
|
|
78492
|
+
outputJson(managed, json);
|
|
78493
|
+
if (json) return;
|
|
78494
|
+
if (managed.length === 0) {
|
|
78495
|
+
console.log("No managed models published.");
|
|
78496
|
+
return;
|
|
78497
|
+
}
|
|
78498
|
+
printTable(
|
|
78499
|
+
["Canonical", "Provider", "Slug", "Target ID", "Warm Start", "Enabled"],
|
|
78500
|
+
managed.map((item) => [
|
|
78501
|
+
item.canonical_model_id,
|
|
78502
|
+
item.provider,
|
|
78503
|
+
item.provider_model_slug,
|
|
78504
|
+
item.target_id,
|
|
78505
|
+
item.requires_warm_start ? "yes" : "no",
|
|
78506
|
+
item.enabled ? "yes" : "no"
|
|
78507
|
+
])
|
|
78508
|
+
);
|
|
78509
|
+
return;
|
|
78510
|
+
}
|
|
78511
|
+
if (action === "publish") {
|
|
78512
|
+
const body = {
|
|
78513
|
+
canonical_model_id: requireString(flags, "canonical"),
|
|
78514
|
+
provider: requireString(flags, "provider"),
|
|
78515
|
+
provider_model_slug: requireString(flags, "slug"),
|
|
78516
|
+
target_id: requireString(flags, "target-id")
|
|
78517
|
+
};
|
|
78518
|
+
const requiresWarmStart = asBoolean(flags, "requires-warm-start");
|
|
78519
|
+
const enabled = asBoolean(flags, "enabled");
|
|
78520
|
+
if (requiresWarmStart !== void 0) {
|
|
78521
|
+
body.requires_warm_start = requiresWarmStart;
|
|
78522
|
+
}
|
|
78523
|
+
if (enabled !== void 0) {
|
|
78524
|
+
body.enabled = enabled;
|
|
78525
|
+
}
|
|
78526
|
+
const result = await requestJson(context2, "/inference/managed-models", {
|
|
78527
|
+
method: "POST",
|
|
78528
|
+
body
|
|
78529
|
+
});
|
|
78530
|
+
outputJson(result, json);
|
|
78531
|
+
if (!json) {
|
|
78532
|
+
console.log(
|
|
78533
|
+
`Published managed model ${result.data.canonical_model_id} (install ${result.created_install ? "created" : "already present"}).`
|
|
78534
|
+
);
|
|
78535
|
+
}
|
|
78536
|
+
return;
|
|
78537
|
+
}
|
|
78538
|
+
if (action === "unpublish") {
|
|
78539
|
+
const canonicalModelId = requireString(flags, "canonical");
|
|
78540
|
+
await requestJson(context2, `/inference/managed-models/${encodeURIComponent(canonicalModelId)}`, {
|
|
78541
|
+
method: "DELETE"
|
|
78542
|
+
});
|
|
78543
|
+
const payload = { canonical_model_id: canonicalModelId };
|
|
78544
|
+
outputJson(payload, json);
|
|
78545
|
+
if (!json) {
|
|
78546
|
+
console.log(`Unpublished managed model ${canonicalModelId}`);
|
|
78547
|
+
}
|
|
78548
|
+
return;
|
|
78549
|
+
}
|
|
78550
|
+
throw new Error("Usage: eve ollama managed <list|publish|unpublish> ...");
|
|
78551
|
+
}
|
|
78442
78552
|
default:
|
|
78443
|
-
throw new Error(
|
|
78553
|
+
throw new Error(
|
|
78554
|
+
"Usage: eve ollama <targets|target|models|model|aliases|alias|installs|install|assignments|route-policies|route-policy|managed>"
|
|
78555
|
+
);
|
|
78444
78556
|
}
|
|
78445
78557
|
}
|
|
78446
78558
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eve-horizon/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.32",
|
|
4
4
|
"description": "Eve Horizon CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"assets",
|
|
19
19
|
"README.md"
|
|
20
20
|
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "rm -rf dist && esbuild src/index.ts --bundle --platform=node --target=node22 --outfile=dist/index.js --format=cjs --external:yaml"
|
|
23
|
+
},
|
|
21
24
|
"publishConfig": {
|
|
22
25
|
"access": "public"
|
|
23
26
|
},
|
|
@@ -28,14 +31,11 @@
|
|
|
28
31
|
"yaml": "^2.5.1"
|
|
29
32
|
},
|
|
30
33
|
"devDependencies": {
|
|
34
|
+
"@eve/migrate": "workspace:*",
|
|
35
|
+
"@eve/shared": "workspace:*",
|
|
31
36
|
"@types/node": "^22.0.0",
|
|
32
37
|
"esbuild": "^0.27.3",
|
|
33
38
|
"postgres": "^3.4.0",
|
|
34
|
-
"typescript": "^5.7.0"
|
|
35
|
-
"@eve/shared": "0.0.1",
|
|
36
|
-
"@eve/migrate": "0.0.1"
|
|
37
|
-
},
|
|
38
|
-
"scripts": {
|
|
39
|
-
"build": "rm -rf dist && esbuild src/index.ts --bundle --platform=node --target=node22 --outfile=dist/index.js --format=cjs --external:yaml"
|
|
39
|
+
"typescript": "^5.7.0"
|
|
40
40
|
}
|
|
41
|
-
}
|
|
41
|
+
}
|