@ornncompute/cli 1.0.313 → 1.0.315

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornncompute/cli",
3
- "version": "1.0.313",
3
+ "version": "1.0.315",
4
4
  "description": "Command-line interface for Ornn compute access workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,20 +1,35 @@
1
1
  // ../../packages/api-client/dist/inference/index.js
2
+ var inferenceApiTypes = [
3
+ "chat_completions",
4
+ "responses",
5
+ "messages",
6
+ "decisions"
7
+ ];
2
8
  function listModels(request, signal) {
3
9
  return request("/v1/inference/models", { method: "GET", signal });
4
10
  }
5
- function postInference(fetcher, path6, body2, signal) {
11
+ function listInferenceListings(request, query3 = {}, signal) {
12
+ return request(`/v1/inference/listings${queryString(query3)}`, {
13
+ method: "GET",
14
+ signal
15
+ });
16
+ }
17
+ function postInference(fetcher, path6, body2, listingId2, signal) {
6
18
  return fetcher(path6, {
7
19
  method: "POST",
8
- headers: { "Content-Type": "application/json" },
20
+ headers: {
21
+ "Content-Type": "application/json",
22
+ "X-Ornn-Listing-Id": listingId2
23
+ },
9
24
  body: JSON.stringify(body2),
10
25
  signal
11
26
  });
12
27
  }
13
- function createChatCompletion(fetcher, body2, signal) {
14
- return postInference(fetcher, "/v1/inference/chat/completions", body2, signal);
28
+ function createChatCompletion(fetcher, body2, listingId2, signal) {
29
+ return postInference(fetcher, "/v1/inference/chat/completions", body2, listingId2, signal);
15
30
  }
16
- function createDecision(fetcher, body2, signal) {
17
- return postInference(fetcher, "/v1/inference/decisions", body2, signal);
31
+ function createDecision(fetcher, body2, listingId2, signal) {
32
+ return postInference(fetcher, "/v1/inference/decisions", body2, listingId2, signal);
18
33
  }
19
34
  function queryString(query3) {
20
35
  const params = new URLSearchParams();
@@ -165,6 +180,7 @@ var rates = {
165
180
  };
166
181
  var createListing = z2.strictObject({
167
182
  public_model_id: text,
183
+ api_type: z2.enum(inferenceApiTypes).optional(),
168
184
  upstream_url: text,
169
185
  upstream_model: text,
170
186
  upstream_credential: z2.string().nullable().optional(),
@@ -279,26 +295,34 @@ var chargeUsage = "[--public-model-id ID] [--request-id UUID] [--from TIME --to
279
295
  var inferenceCapabilities = [
280
296
  operation({
281
297
  command: ["models", "list"],
282
- description: "List available inference models and their token prices in USD per million tokens.",
298
+ description: "List available public inference model IDs.",
283
299
  input: z2.strictObject({}),
284
300
  execute: (ctx) => listModels(ctx.fetch)
285
301
  }),
302
+ operation({
303
+ command: ["listings", "list"],
304
+ description: "List active inference offers with their API format and token prices.",
305
+ input: z2.strictObject({ public_model_id: text.optional() }),
306
+ usage: "[--public-model-id ID]",
307
+ execute: (ctx, input) => listInferenceListings(ctx.fetch, input)
308
+ }),
286
309
  operation({
287
310
  command: ["completions", "create"],
288
311
  description: "Call an inference model using a Chat Completions body. Generation parameters pass through unchanged. Spends the organization's credits; returns the upstream JSON response. MCP uses non-streaming responses.",
289
- input: z2.strictObject({ body: completionBody }),
312
+ input: z2.strictObject({ listing_id: z2.uuid(), body: completionBody }),
290
313
  mcpInput: z2.strictObject({
314
+ listing_id: z2.uuid(),
291
315
  body: completionBody.extend({ stream: z2.literal(false).nullable().optional() })
292
316
  }),
293
- usage: "--body JSON",
317
+ usage: "--body JSON --listing-id UUID",
294
318
  write: true,
295
- execute: async (ctx, { body: body2 }) => {
319
+ execute: async (ctx, { body: body2, listing_id }) => {
296
320
  if (body2.stream && ctx.cli?.interaction?.format !== "human") {
297
321
  throw new Error("Streaming returns raw SSE. Use --format human in the CLI, or stream=false in MCP.");
298
322
  }
299
323
  if (!ctx.fetchResponse)
300
324
  throw new Error("This client does not support completion responses.");
301
- const response = await createChatCompletion(ctx.fetchResponse, body2);
325
+ const response = await createChatCompletion(ctx.fetchResponse, body2, listing_id);
302
326
  return body2.stream ? response : response.json();
303
327
  }
304
328
  }),
@@ -306,18 +330,19 @@ var inferenceCapabilities = [
306
330
  command: ["decisions", "create"],
307
331
  description: "Ask questions about input using a Decisions model. Returns the provider's answers and spends the organization's credits at the listing's rates.",
308
332
  input: z2.strictObject({
333
+ listing_id: z2.uuid(),
309
334
  body: z2.looseObject({
310
335
  model: text,
311
336
  input: z2.union([z2.string(), z2.array(z2.looseObject({}))]),
312
337
  questions: z2.array(z2.looseObject({}))
313
338
  })
314
339
  }),
315
- usage: "--body JSON",
340
+ usage: "--body JSON --listing-id UUID",
316
341
  write: true,
317
- execute: async (ctx, { body: body2 }) => {
342
+ execute: async (ctx, { body: body2, listing_id }) => {
318
343
  if (!ctx.fetchResponse)
319
344
  throw new Error("This client does not support decision responses.");
320
- const response = await createDecision(ctx.fetchResponse, body2);
345
+ const response = await createDecision(ctx.fetchResponse, body2, listing_id);
321
346
  return response.json();
322
347
  }
323
348
  }),
@@ -374,7 +399,11 @@ var inferenceCapabilities = [
374
399
  command: [...staff ? [] : ["provider"], "models", "update"],
375
400
  staff,
376
401
  description: "Update an inference listing's endpoint, token prices, credential, or active flag. Send only changed fields; null clears a nullable value.",
377
- input: listingId.extend({ body: updateListing }),
402
+ input: listingId.extend({
403
+ body: staff ? updateListing.extend({
404
+ public_model_id: text.optional()
405
+ }) : updateListing
406
+ }),
378
407
  usage: "--listing-id UUID --body JSON",
379
408
  write: true,
380
409
  execute: (ctx, { listing_id, body: body2 }) => staff ? updateStaffInferenceListing(ctx.fetch, listing_id, body2) : updateProviderInferenceListing(ctx.fetch, listing_id, body2)
@@ -2365,9 +2394,10 @@ function getOrderBook(request, gpuSlug, books = {}, signal) {
2365
2394
  clusterId: books.clusterId
2366
2395
  })}`, { method: "GET", ...signal ? { signal } : {} });
2367
2396
  }
2368
- function listTrades(request, gpuSlug, books = {}) {
2397
+ function listTrades(request, gpuSlug, books = {}, signal) {
2369
2398
  return request(`${BASE3}/books/${encodeURIComponent(gpuSlug)}/trades${query2(scope(books))}`, {
2370
- method: "GET"
2399
+ method: "GET",
2400
+ ...signal ? { signal } : {}
2371
2401
  });
2372
2402
  }
2373
2403
  function quoteBid(request, bid, signal) {