@skydiveai/pi-server 0.1.0-beta.1249 → 0.1.0-beta.1310
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.d.mts +112 -112
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -208,30 +208,7 @@ declare function createPrewarm({
|
|
|
208
208
|
*/
|
|
209
209
|
declare const KNOWN_PI_PROVIDERS: readonly ["amazon-bedrock", "anthropic", "google", "google-vertex", "openai", "azure-openai-responses", "openai-codex", "deepseek", "github-copilot", "xai", "groq", "cerebras", "openrouter", "vercel-ai-gateway", "zai", "mistral", "minimax", "minimax-cn", "moonshotai", "moonshotai-cn", "huggingface", "fireworks", "opencode", "opencode-go", "kimi-coding", "cloudflare-workers-ai", "cloudflare-ai-gateway", "xiaomi", "xiaomi-token-plan-cn", "xiaomi-token-plan-ams", "xiaomi-token-plan-sgp"];
|
|
210
210
|
declare const modelSpecSchema: z.ZodDiscriminatedUnion<"api", [z.ZodObject<{
|
|
211
|
-
|
|
212
|
-
compat: z.ZodOptional<z.ZodObject<{
|
|
213
|
-
supportsReasoningEffort: z.ZodOptional<z.ZodBoolean>;
|
|
214
|
-
requiresThinkingAsText: z.ZodOptional<z.ZodBoolean>;
|
|
215
|
-
thinkingFormat: z.ZodOptional<z.ZodEnum<["openai", "openrouter", "deepseek", "zai", "qwen", "qwen-chat-template"]>>;
|
|
216
|
-
supportsStrictMode: z.ZodOptional<z.ZodBoolean>;
|
|
217
|
-
maxTokensField: z.ZodOptional<z.ZodEnum<["max_completion_tokens", "max_tokens"]>>;
|
|
218
|
-
cacheControlFormat: z.ZodOptional<z.ZodLiteral<"anthropic">>;
|
|
219
|
-
}, "strip", z.ZodTypeAny, {
|
|
220
|
-
supportsReasoningEffort?: boolean | undefined;
|
|
221
|
-
requiresThinkingAsText?: boolean | undefined;
|
|
222
|
-
thinkingFormat?: "openai" | "deepseek" | "openrouter" | "zai" | "qwen" | "qwen-chat-template" | undefined;
|
|
223
|
-
supportsStrictMode?: boolean | undefined;
|
|
224
|
-
maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
|
|
225
|
-
cacheControlFormat?: "anthropic" | undefined;
|
|
226
|
-
}, {
|
|
227
|
-
supportsReasoningEffort?: boolean | undefined;
|
|
228
|
-
requiresThinkingAsText?: boolean | undefined;
|
|
229
|
-
thinkingFormat?: "openai" | "deepseek" | "openrouter" | "zai" | "qwen" | "qwen-chat-template" | undefined;
|
|
230
|
-
supportsStrictMode?: boolean | undefined;
|
|
231
|
-
maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
|
|
232
|
-
cacheControlFormat?: "anthropic" | undefined;
|
|
233
|
-
}>>; /** Exact model id the serving endpoint expects. */
|
|
234
|
-
id: z.ZodString; /** Display name shown in pi surfaces and session logs. */
|
|
211
|
+
/** Exact model id the serving endpoint expects. */id: z.ZodString; /** Display name shown in pi surfaces and session logs. */
|
|
235
212
|
name: z.ZodString; /** pi-ai provider key — also the auth-storage key for `apiKey`. */
|
|
236
213
|
provider: z.ZodEnum<["amazon-bedrock", "anthropic", "google", "google-vertex", "openai", "azure-openai-responses", "openai-codex", "deepseek", "github-copilot", "xai", "groq", "cerebras", "openrouter", "vercel-ai-gateway", "zai", "mistral", "minimax", "minimax-cn", "moonshotai", "moonshotai-cn", "huggingface", "fireworks", "opencode", "opencode-go", "kimi-coding", "cloudflare-workers-ai", "cloudflare-ai-gateway", "xiaomi", "xiaomi-token-plan-cn", "xiaomi-token-plan-ams", "xiaomi-token-plan-sgp"]>; /** Provider API root, e.g. "https://openrouter.ai/api/v1". */
|
|
237
214
|
baseUrl: z.ZodString;
|
|
@@ -268,24 +245,35 @@ declare const modelSpecSchema: z.ZodDiscriminatedUnion<"api", [z.ZodObject<{
|
|
|
268
245
|
* placeholder that layer recognizes — the value is opaque to this server.
|
|
269
246
|
*/
|
|
270
247
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
maxTokens: number;
|
|
281
|
-
compat?: {
|
|
248
|
+
api: z.ZodLiteral<"openai-completions">;
|
|
249
|
+
compat: z.ZodOptional<z.ZodObject<{
|
|
250
|
+
supportsReasoningEffort: z.ZodOptional<z.ZodBoolean>;
|
|
251
|
+
requiresThinkingAsText: z.ZodOptional<z.ZodBoolean>;
|
|
252
|
+
thinkingFormat: z.ZodOptional<z.ZodEnum<["openai", "openrouter", "deepseek", "zai", "qwen", "qwen-chat-template"]>>;
|
|
253
|
+
supportsStrictMode: z.ZodOptional<z.ZodBoolean>;
|
|
254
|
+
maxTokensField: z.ZodOptional<z.ZodEnum<["max_completion_tokens", "max_tokens"]>>;
|
|
255
|
+
cacheControlFormat: z.ZodOptional<z.ZodLiteral<"anthropic">>;
|
|
256
|
+
}, "strip", z.ZodTypeAny, {
|
|
282
257
|
supportsReasoningEffort?: boolean | undefined;
|
|
283
258
|
requiresThinkingAsText?: boolean | undefined;
|
|
284
|
-
thinkingFormat?: "
|
|
259
|
+
thinkingFormat?: "deepseek" | "openai" | "openrouter" | "qwen" | "qwen-chat-template" | "zai" | undefined;
|
|
285
260
|
supportsStrictMode?: boolean | undefined;
|
|
286
261
|
maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
|
|
287
262
|
cacheControlFormat?: "anthropic" | undefined;
|
|
288
|
-
}
|
|
263
|
+
}, {
|
|
264
|
+
supportsReasoningEffort?: boolean | undefined;
|
|
265
|
+
requiresThinkingAsText?: boolean | undefined;
|
|
266
|
+
thinkingFormat?: "deepseek" | "openai" | "openrouter" | "qwen" | "qwen-chat-template" | "zai" | undefined;
|
|
267
|
+
supportsStrictMode?: boolean | undefined;
|
|
268
|
+
maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
|
|
269
|
+
cacheControlFormat?: "anthropic" | undefined;
|
|
270
|
+
}>>;
|
|
271
|
+
}, "strip", z.ZodTypeAny, {
|
|
272
|
+
id: string;
|
|
273
|
+
name: string;
|
|
274
|
+
provider: "amazon-bedrock" | "anthropic" | "azure-openai-responses" | "cerebras" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "deepseek" | "fireworks" | "github-copilot" | "google" | "google-vertex" | "groq" | "huggingface" | "kimi-coding" | "minimax" | "minimax-cn" | "mistral" | "moonshotai" | "moonshotai-cn" | "openai" | "openai-codex" | "opencode" | "opencode-go" | "openrouter" | "vercel-ai-gateway" | "xai" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "zai";
|
|
275
|
+
baseUrl: string;
|
|
276
|
+
reasoning: boolean;
|
|
289
277
|
thinkingLevelMap?: {
|
|
290
278
|
off?: string | null | undefined;
|
|
291
279
|
minimal?: string | null | undefined;
|
|
@@ -294,25 +282,25 @@ declare const modelSpecSchema: z.ZodDiscriminatedUnion<"api", [z.ZodObject<{
|
|
|
294
282
|
high?: string | null | undefined;
|
|
295
283
|
xhigh?: string | null | undefined;
|
|
296
284
|
} | undefined;
|
|
297
|
-
|
|
298
|
-
}, {
|
|
299
|
-
api: "openai-completions";
|
|
300
|
-
id: string;
|
|
301
|
-
name: string;
|
|
302
|
-
provider: "amazon-bedrock" | "anthropic" | "google" | "google-vertex" | "openai" | "azure-openai-responses" | "openai-codex" | "deepseek" | "github-copilot" | "xai" | "groq" | "cerebras" | "openrouter" | "vercel-ai-gateway" | "zai" | "mistral" | "minimax" | "minimax-cn" | "moonshotai" | "moonshotai-cn" | "huggingface" | "fireworks" | "opencode" | "opencode-go" | "kimi-coding" | "cloudflare-workers-ai" | "cloudflare-ai-gateway" | "xiaomi" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-sgp";
|
|
303
|
-
baseUrl: string;
|
|
304
|
-
reasoning: boolean;
|
|
305
|
-
input: ["text" | "image", ...("text" | "image")[]];
|
|
285
|
+
input: ["image" | "text", ...("image" | "text")[]];
|
|
306
286
|
contextWindow: number;
|
|
307
287
|
maxTokens: number;
|
|
288
|
+
apiKey?: string | undefined;
|
|
289
|
+
api: "openai-completions";
|
|
308
290
|
compat?: {
|
|
309
291
|
supportsReasoningEffort?: boolean | undefined;
|
|
310
292
|
requiresThinkingAsText?: boolean | undefined;
|
|
311
|
-
thinkingFormat?: "
|
|
293
|
+
thinkingFormat?: "deepseek" | "openai" | "openrouter" | "qwen" | "qwen-chat-template" | "zai" | undefined;
|
|
312
294
|
supportsStrictMode?: boolean | undefined;
|
|
313
295
|
maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
|
|
314
296
|
cacheControlFormat?: "anthropic" | undefined;
|
|
315
297
|
} | undefined;
|
|
298
|
+
}, {
|
|
299
|
+
id: string;
|
|
300
|
+
name: string;
|
|
301
|
+
provider: "amazon-bedrock" | "anthropic" | "azure-openai-responses" | "cerebras" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "deepseek" | "fireworks" | "github-copilot" | "google" | "google-vertex" | "groq" | "huggingface" | "kimi-coding" | "minimax" | "minimax-cn" | "mistral" | "moonshotai" | "moonshotai-cn" | "openai" | "openai-codex" | "opencode" | "opencode-go" | "openrouter" | "vercel-ai-gateway" | "xai" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "zai";
|
|
302
|
+
baseUrl: string;
|
|
303
|
+
reasoning: boolean;
|
|
316
304
|
thinkingLevelMap?: {
|
|
317
305
|
off?: string | null | undefined;
|
|
318
306
|
minimal?: string | null | undefined;
|
|
@@ -321,20 +309,21 @@ declare const modelSpecSchema: z.ZodDiscriminatedUnion<"api", [z.ZodObject<{
|
|
|
321
309
|
high?: string | null | undefined;
|
|
322
310
|
xhigh?: string | null | undefined;
|
|
323
311
|
} | undefined;
|
|
312
|
+
input: ["image" | "text", ...("image" | "text")[]];
|
|
313
|
+
contextWindow: number;
|
|
314
|
+
maxTokens: number;
|
|
324
315
|
apiKey?: string | undefined;
|
|
316
|
+
api: "openai-completions";
|
|
317
|
+
compat?: {
|
|
318
|
+
supportsReasoningEffort?: boolean | undefined;
|
|
319
|
+
requiresThinkingAsText?: boolean | undefined;
|
|
320
|
+
thinkingFormat?: "deepseek" | "openai" | "openrouter" | "qwen" | "qwen-chat-template" | "zai" | undefined;
|
|
321
|
+
supportsStrictMode?: boolean | undefined;
|
|
322
|
+
maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
|
|
323
|
+
cacheControlFormat?: "anthropic" | undefined;
|
|
324
|
+
} | undefined;
|
|
325
325
|
}>, z.ZodObject<{
|
|
326
|
-
|
|
327
|
-
compat: z.ZodOptional<z.ZodObject<{
|
|
328
|
-
supportsEagerToolInputStreaming: z.ZodOptional<z.ZodBoolean>;
|
|
329
|
-
supportsLongCacheRetention: z.ZodOptional<z.ZodBoolean>;
|
|
330
|
-
}, "strip", z.ZodTypeAny, {
|
|
331
|
-
supportsEagerToolInputStreaming?: boolean | undefined;
|
|
332
|
-
supportsLongCacheRetention?: boolean | undefined;
|
|
333
|
-
}, {
|
|
334
|
-
supportsEagerToolInputStreaming?: boolean | undefined;
|
|
335
|
-
supportsLongCacheRetention?: boolean | undefined;
|
|
336
|
-
}>>; /** Exact model id the serving endpoint expects. */
|
|
337
|
-
id: z.ZodString; /** Display name shown in pi surfaces and session logs. */
|
|
326
|
+
/** Exact model id the serving endpoint expects. */id: z.ZodString; /** Display name shown in pi surfaces and session logs. */
|
|
338
327
|
name: z.ZodString; /** pi-ai provider key — also the auth-storage key for `apiKey`. */
|
|
339
328
|
provider: z.ZodEnum<["amazon-bedrock", "anthropic", "google", "google-vertex", "openai", "azure-openai-responses", "openai-codex", "deepseek", "github-copilot", "xai", "groq", "cerebras", "openrouter", "vercel-ai-gateway", "zai", "mistral", "minimax", "minimax-cn", "moonshotai", "moonshotai-cn", "huggingface", "fireworks", "opencode", "opencode-go", "kimi-coding", "cloudflare-workers-ai", "cloudflare-ai-gateway", "xiaomi", "xiaomi-token-plan-cn", "xiaomi-token-plan-ams", "xiaomi-token-plan-sgp"]>; /** Provider API root, e.g. "https://openrouter.ai/api/v1". */
|
|
340
329
|
baseUrl: z.ZodString;
|
|
@@ -371,20 +360,23 @@ declare const modelSpecSchema: z.ZodDiscriminatedUnion<"api", [z.ZodObject<{
|
|
|
371
360
|
* placeholder that layer recognizes — the value is opaque to this server.
|
|
372
361
|
*/
|
|
373
362
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
363
|
+
api: z.ZodLiteral<"anthropic-messages">;
|
|
364
|
+
compat: z.ZodOptional<z.ZodObject<{
|
|
365
|
+
supportsEagerToolInputStreaming: z.ZodOptional<z.ZodBoolean>;
|
|
366
|
+
supportsLongCacheRetention: z.ZodOptional<z.ZodBoolean>;
|
|
367
|
+
}, "strip", z.ZodTypeAny, {
|
|
368
|
+
supportsEagerToolInputStreaming?: boolean | undefined;
|
|
369
|
+
supportsLongCacheRetention?: boolean | undefined;
|
|
370
|
+
}, {
|
|
371
|
+
supportsEagerToolInputStreaming?: boolean | undefined;
|
|
372
|
+
supportsLongCacheRetention?: boolean | undefined;
|
|
373
|
+
}>>;
|
|
374
374
|
}, "strip", z.ZodTypeAny, {
|
|
375
|
-
api: "anthropic-messages";
|
|
376
375
|
id: string;
|
|
377
376
|
name: string;
|
|
378
|
-
provider: "amazon-bedrock" | "anthropic" | "
|
|
377
|
+
provider: "amazon-bedrock" | "anthropic" | "azure-openai-responses" | "cerebras" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "deepseek" | "fireworks" | "github-copilot" | "google" | "google-vertex" | "groq" | "huggingface" | "kimi-coding" | "minimax" | "minimax-cn" | "mistral" | "moonshotai" | "moonshotai-cn" | "openai" | "openai-codex" | "opencode" | "opencode-go" | "openrouter" | "vercel-ai-gateway" | "xai" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "zai";
|
|
379
378
|
baseUrl: string;
|
|
380
379
|
reasoning: boolean;
|
|
381
|
-
input: ["text" | "image", ...("text" | "image")[]];
|
|
382
|
-
contextWindow: number;
|
|
383
|
-
maxTokens: number;
|
|
384
|
-
compat?: {
|
|
385
|
-
supportsEagerToolInputStreaming?: boolean | undefined;
|
|
386
|
-
supportsLongCacheRetention?: boolean | undefined;
|
|
387
|
-
} | undefined;
|
|
388
380
|
thinkingLevelMap?: {
|
|
389
381
|
off?: string | null | undefined;
|
|
390
382
|
minimal?: string | null | undefined;
|
|
@@ -393,21 +385,21 @@ declare const modelSpecSchema: z.ZodDiscriminatedUnion<"api", [z.ZodObject<{
|
|
|
393
385
|
high?: string | null | undefined;
|
|
394
386
|
xhigh?: string | null | undefined;
|
|
395
387
|
} | undefined;
|
|
396
|
-
|
|
397
|
-
}, {
|
|
398
|
-
api: "anthropic-messages";
|
|
399
|
-
id: string;
|
|
400
|
-
name: string;
|
|
401
|
-
provider: "amazon-bedrock" | "anthropic" | "google" | "google-vertex" | "openai" | "azure-openai-responses" | "openai-codex" | "deepseek" | "github-copilot" | "xai" | "groq" | "cerebras" | "openrouter" | "vercel-ai-gateway" | "zai" | "mistral" | "minimax" | "minimax-cn" | "moonshotai" | "moonshotai-cn" | "huggingface" | "fireworks" | "opencode" | "opencode-go" | "kimi-coding" | "cloudflare-workers-ai" | "cloudflare-ai-gateway" | "xiaomi" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-sgp";
|
|
402
|
-
baseUrl: string;
|
|
403
|
-
reasoning: boolean;
|
|
404
|
-
input: ["text" | "image", ...("text" | "image")[]];
|
|
388
|
+
input: ["image" | "text", ...("image" | "text")[]];
|
|
405
389
|
contextWindow: number;
|
|
406
390
|
maxTokens: number;
|
|
391
|
+
apiKey?: string | undefined;
|
|
392
|
+
api: "anthropic-messages";
|
|
407
393
|
compat?: {
|
|
408
394
|
supportsEagerToolInputStreaming?: boolean | undefined;
|
|
409
395
|
supportsLongCacheRetention?: boolean | undefined;
|
|
410
396
|
} | undefined;
|
|
397
|
+
}, {
|
|
398
|
+
id: string;
|
|
399
|
+
name: string;
|
|
400
|
+
provider: "amazon-bedrock" | "anthropic" | "azure-openai-responses" | "cerebras" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "deepseek" | "fireworks" | "github-copilot" | "google" | "google-vertex" | "groq" | "huggingface" | "kimi-coding" | "minimax" | "minimax-cn" | "mistral" | "moonshotai" | "moonshotai-cn" | "openai" | "openai-codex" | "opencode" | "opencode-go" | "openrouter" | "vercel-ai-gateway" | "xai" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "zai";
|
|
401
|
+
baseUrl: string;
|
|
402
|
+
reasoning: boolean;
|
|
411
403
|
thinkingLevelMap?: {
|
|
412
404
|
off?: string | null | undefined;
|
|
413
405
|
minimal?: string | null | undefined;
|
|
@@ -416,7 +408,15 @@ declare const modelSpecSchema: z.ZodDiscriminatedUnion<"api", [z.ZodObject<{
|
|
|
416
408
|
high?: string | null | undefined;
|
|
417
409
|
xhigh?: string | null | undefined;
|
|
418
410
|
} | undefined;
|
|
411
|
+
input: ["image" | "text", ...("image" | "text")[]];
|
|
412
|
+
contextWindow: number;
|
|
413
|
+
maxTokens: number;
|
|
419
414
|
apiKey?: string | undefined;
|
|
415
|
+
api: "anthropic-messages";
|
|
416
|
+
compat?: {
|
|
417
|
+
supportsEagerToolInputStreaming?: boolean | undefined;
|
|
418
|
+
supportsLongCacheRetention?: boolean | undefined;
|
|
419
|
+
} | undefined;
|
|
420
420
|
}>]>;
|
|
421
421
|
type ModelSpec = z.infer<typeof modelSpecSchema>;
|
|
422
422
|
/**
|
|
@@ -426,16 +426,20 @@ type ModelSpec = z.infer<typeof modelSpecSchema>;
|
|
|
426
426
|
*/
|
|
427
427
|
declare function parseModelSpec(input: unknown, log: Logger): ModelSpec | null;
|
|
428
428
|
declare function buildModelFromSpec(spec: ModelSpec): {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
429
|
+
id: string;
|
|
430
|
+
name: string;
|
|
431
|
+
provider: "amazon-bedrock" | "anthropic" | "azure-openai-responses" | "cerebras" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "deepseek" | "fireworks" | "github-copilot" | "google" | "google-vertex" | "groq" | "huggingface" | "kimi-coding" | "minimax" | "minimax-cn" | "mistral" | "moonshotai" | "moonshotai-cn" | "openai" | "openai-codex" | "opencode" | "opencode-go" | "openrouter" | "vercel-ai-gateway" | "xai" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "zai";
|
|
432
|
+
baseUrl: string;
|
|
433
|
+
reasoning: boolean;
|
|
434
|
+
thinkingLevelMap?: {
|
|
435
|
+
off?: string | null | undefined;
|
|
436
|
+
minimal?: string | null | undefined;
|
|
437
|
+
low?: string | null | undefined;
|
|
438
|
+
medium?: string | null | undefined;
|
|
439
|
+
high?: string | null | undefined;
|
|
440
|
+
xhigh?: string | null | undefined;
|
|
436
441
|
} | undefined;
|
|
437
|
-
|
|
438
|
-
input: ["text" | "image", ...("text" | "image")[]];
|
|
442
|
+
input: ["image" | "text", ...("image" | "text")[]];
|
|
439
443
|
cost: {
|
|
440
444
|
input: number;
|
|
441
445
|
output: number;
|
|
@@ -444,6 +448,21 @@ declare function buildModelFromSpec(spec: ModelSpec): {
|
|
|
444
448
|
};
|
|
445
449
|
contextWindow: number;
|
|
446
450
|
maxTokens: number;
|
|
451
|
+
api: "openai-completions";
|
|
452
|
+
compat?: {
|
|
453
|
+
supportsReasoningEffort?: boolean | undefined;
|
|
454
|
+
requiresThinkingAsText?: boolean | undefined;
|
|
455
|
+
thinkingFormat?: "deepseek" | "openai" | "openrouter" | "qwen" | "qwen-chat-template" | "zai" | undefined;
|
|
456
|
+
supportsStrictMode?: boolean | undefined;
|
|
457
|
+
maxTokensField?: "max_completion_tokens" | "max_tokens" | undefined;
|
|
458
|
+
cacheControlFormat?: "anthropic" | undefined;
|
|
459
|
+
} | undefined;
|
|
460
|
+
} | {
|
|
461
|
+
id: string;
|
|
462
|
+
name: string;
|
|
463
|
+
provider: "amazon-bedrock" | "anthropic" | "azure-openai-responses" | "cerebras" | "cloudflare-ai-gateway" | "cloudflare-workers-ai" | "deepseek" | "fireworks" | "github-copilot" | "google" | "google-vertex" | "groq" | "huggingface" | "kimi-coding" | "minimax" | "minimax-cn" | "mistral" | "moonshotai" | "moonshotai-cn" | "openai" | "openai-codex" | "opencode" | "opencode-go" | "openrouter" | "vercel-ai-gateway" | "xai" | "xiaomi" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-sgp" | "zai";
|
|
464
|
+
baseUrl: string;
|
|
465
|
+
reasoning: boolean;
|
|
447
466
|
thinkingLevelMap?: {
|
|
448
467
|
off?: string | null | undefined;
|
|
449
468
|
minimal?: string | null | undefined;
|
|
@@ -452,18 +471,7 @@ declare function buildModelFromSpec(spec: ModelSpec): {
|
|
|
452
471
|
high?: string | null | undefined;
|
|
453
472
|
xhigh?: string | null | undefined;
|
|
454
473
|
} | undefined;
|
|
455
|
-
|
|
456
|
-
name: string;
|
|
457
|
-
provider: "amazon-bedrock" | "anthropic" | "google" | "google-vertex" | "openai" | "azure-openai-responses" | "openai-codex" | "deepseek" | "github-copilot" | "xai" | "groq" | "cerebras" | "openrouter" | "vercel-ai-gateway" | "zai" | "mistral" | "minimax" | "minimax-cn" | "moonshotai" | "moonshotai-cn" | "huggingface" | "fireworks" | "opencode" | "opencode-go" | "kimi-coding" | "cloudflare-workers-ai" | "cloudflare-ai-gateway" | "xiaomi" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-sgp";
|
|
458
|
-
baseUrl: string;
|
|
459
|
-
reasoning: boolean;
|
|
460
|
-
} | {
|
|
461
|
-
compat?: {
|
|
462
|
-
supportsEagerToolInputStreaming?: boolean | undefined;
|
|
463
|
-
supportsLongCacheRetention?: boolean | undefined;
|
|
464
|
-
} | undefined;
|
|
465
|
-
api: "anthropic-messages";
|
|
466
|
-
input: ["text" | "image", ...("text" | "image")[]];
|
|
474
|
+
input: ["image" | "text", ...("image" | "text")[]];
|
|
467
475
|
cost: {
|
|
468
476
|
input: number;
|
|
469
477
|
output: number;
|
|
@@ -472,19 +480,11 @@ declare function buildModelFromSpec(spec: ModelSpec): {
|
|
|
472
480
|
};
|
|
473
481
|
contextWindow: number;
|
|
474
482
|
maxTokens: number;
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
medium?: string | null | undefined;
|
|
480
|
-
high?: string | null | undefined;
|
|
481
|
-
xhigh?: string | null | undefined;
|
|
483
|
+
api: "anthropic-messages";
|
|
484
|
+
compat?: {
|
|
485
|
+
supportsEagerToolInputStreaming?: boolean | undefined;
|
|
486
|
+
supportsLongCacheRetention?: boolean | undefined;
|
|
482
487
|
} | undefined;
|
|
483
|
-
id: string;
|
|
484
|
-
name: string;
|
|
485
|
-
provider: "amazon-bedrock" | "anthropic" | "google" | "google-vertex" | "openai" | "azure-openai-responses" | "openai-codex" | "deepseek" | "github-copilot" | "xai" | "groq" | "cerebras" | "openrouter" | "vercel-ai-gateway" | "zai" | "mistral" | "minimax" | "minimax-cn" | "moonshotai" | "moonshotai-cn" | "huggingface" | "fireworks" | "opencode" | "opencode-go" | "kimi-coding" | "cloudflare-workers-ai" | "cloudflare-ai-gateway" | "xiaomi" | "xiaomi-token-plan-cn" | "xiaomi-token-plan-ams" | "xiaomi-token-plan-sgp";
|
|
486
|
-
baseUrl: string;
|
|
487
|
-
reasoning: boolean;
|
|
488
488
|
};
|
|
489
489
|
/**
|
|
490
490
|
* Resolve the model a request should run on: a valid `x_model` wins,
|
|
@@ -557,10 +557,10 @@ declare const payloadSchema: z.ZodObject<{
|
|
|
557
557
|
blockReason: z.ZodEnum<["insufficient_balance", "payment_failed", "hard_spend_limit_reached"]>;
|
|
558
558
|
message: z.ZodString;
|
|
559
559
|
}, "strict", z.ZodTypeAny, {
|
|
560
|
-
blockReason: "
|
|
560
|
+
blockReason: "hard_spend_limit_reached" | "insufficient_balance" | "payment_failed";
|
|
561
561
|
message: string;
|
|
562
562
|
}, {
|
|
563
|
-
blockReason: "
|
|
563
|
+
blockReason: "hard_spend_limit_reached" | "insufficient_balance" | "payment_failed";
|
|
564
564
|
message: string;
|
|
565
565
|
}>;
|
|
566
566
|
type BillingBlockedProviderSignal = z.infer<typeof payloadSchema>;
|