llm-strings 1.2.0 → 1.3.0
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/README.md +1 -3
- package/dist/ai-sdk.cjs +355 -9
- package/dist/ai-sdk.cjs.map +1 -1
- package/dist/ai-sdk.d.cts +5 -4
- package/dist/ai-sdk.d.ts +5 -4
- package/dist/ai-sdk.js +87 -8
- package/dist/ai-sdk.js.map +1 -1
- package/dist/{chunk-RPXK2A7O.js → chunk-7HE4RH6X.js} +4 -4
- package/dist/{chunk-2ARD4TFU.js → chunk-NZR5DUX5.js} +2 -2
- package/dist/{chunk-W4NIQY7M.js → chunk-OCJX4QFJ.js} +318 -4
- package/dist/chunk-OCJX4QFJ.js.map +1 -0
- package/dist/{chunk-BCOUH7LH.js → chunk-TQJ2ABCT.js} +2 -2
- package/dist/index.cjs +317 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/normalize.cjs +157 -3
- package/dist/normalize.cjs.map +1 -1
- package/dist/normalize.d.cts +1 -1
- package/dist/normalize.d.ts +1 -1
- package/dist/normalize.js +2 -2
- package/dist/parse.cjs +27 -0
- package/dist/parse.cjs.map +1 -1
- package/dist/parse.d.cts +1 -1
- package/dist/parse.d.ts +1 -1
- package/dist/parse.js +2 -2
- package/dist/{provider-core-BiAl8MCV.d.cts → provider-core-B934MuhJ.d.cts} +2 -2
- package/dist/{provider-core-BiAl8MCV.d.ts → provider-core-B934MuhJ.d.ts} +2 -2
- package/dist/providers.cjs +610 -4
- package/dist/providers.cjs.map +1 -1
- package/dist/providers.d.cts +2 -2
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +294 -2
- package/dist/providers.js.map +1 -1
- package/dist/validate.cjs +317 -3
- package/dist/validate.cjs.map +1 -1
- package/dist/validate.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-W4NIQY7M.js.map +0 -1
- /package/dist/{chunk-RPXK2A7O.js.map → chunk-7HE4RH6X.js.map} +0 -0
- /package/dist/{chunk-2ARD4TFU.js.map → chunk-NZR5DUX5.js.map} +0 -0
- /package/dist/{chunk-BCOUH7LH.js.map → chunk-TQJ2ABCT.js.map} +0 -0
package/dist/providers.cjs
CHANGED
|
@@ -49,8 +49,10 @@ function hasOwn(object, key) {
|
|
|
49
49
|
}
|
|
50
50
|
var HOST_ALIASES = {
|
|
51
51
|
openai: "api.openai.com",
|
|
52
|
+
azure: "models.inference.ai.azure.com",
|
|
52
53
|
anthropic: "api.anthropic.com",
|
|
53
54
|
google: "generativelanguage.googleapis.com",
|
|
55
|
+
"google-vertex": "aiplatform.googleapis.com",
|
|
54
56
|
aistudio: "generativelanguage.googleapis.com",
|
|
55
57
|
mistral: "api.mistral.ai",
|
|
56
58
|
cohere: "api.cohere.com",
|
|
@@ -60,8 +62,16 @@ var HOST_ALIASES = {
|
|
|
60
62
|
alibaba: "dashscope-intl.aliyuncs.com",
|
|
61
63
|
alibabacloud: "dashscope-intl.aliyuncs.com",
|
|
62
64
|
dashscope: "dashscope-intl.aliyuncs.com",
|
|
65
|
+
groq: "api.groq.com",
|
|
66
|
+
fal: "fal.run",
|
|
63
67
|
fireworks: "api.fireworks.ai",
|
|
64
68
|
fireworksai: "api.fireworks.ai",
|
|
69
|
+
"black-forest-labs": "api.bfl.ai",
|
|
70
|
+
bfl: "api.bfl.ai",
|
|
71
|
+
deepseek: "api.deepseek.com",
|
|
72
|
+
moonshotai: "api.moonshot.ai",
|
|
73
|
+
moonshot: "api.moonshot.ai",
|
|
74
|
+
perplexity: "api.perplexity.ai",
|
|
65
75
|
venice: "api.venice.ai",
|
|
66
76
|
parasail: "api.parasail.io",
|
|
67
77
|
deepinfra: "api.deepinfra.com",
|
|
@@ -70,6 +80,23 @@ var HOST_ALIASES = {
|
|
|
70
80
|
novitaai: "api.novita.ai",
|
|
71
81
|
grok: "api.x.ai",
|
|
72
82
|
xai: "api.x.ai",
|
|
83
|
+
together: "api.together.xyz",
|
|
84
|
+
togetherai: "api.together.xyz",
|
|
85
|
+
cerebras: "api.cerebras.ai",
|
|
86
|
+
replicate: "api.replicate.com",
|
|
87
|
+
prodia: "api.prodia.com",
|
|
88
|
+
luma: "api.lumalabs.ai",
|
|
89
|
+
bytedance: "ark.cn-beijing.volces.com",
|
|
90
|
+
kling: "api.klingai.com",
|
|
91
|
+
elevenlabs: "api.elevenlabs.io",
|
|
92
|
+
assemblyai: "api.assemblyai.com",
|
|
93
|
+
deepgram: "api.deepgram.com",
|
|
94
|
+
gladia: "api.gladia.io",
|
|
95
|
+
lmnt: "api.lmnt.com",
|
|
96
|
+
hume: "api.hume.ai",
|
|
97
|
+
revai: "api.rev.ai",
|
|
98
|
+
baseten: "api.baseten.co",
|
|
99
|
+
huggingface: "api-inference.huggingface.co",
|
|
73
100
|
wandb: "api.inference.wandb.ai",
|
|
74
101
|
weightsandbiases: "api.inference.wandb.ai",
|
|
75
102
|
baidu: "qianfan.baidubce.com",
|
|
@@ -78,6 +105,18 @@ var HOST_ALIASES = {
|
|
|
78
105
|
xiaomi: "api.xiaomimimo.com",
|
|
79
106
|
minimax: "api.minimax.io"
|
|
80
107
|
};
|
|
108
|
+
var HOST_ALIAS_PROVIDERS = {
|
|
109
|
+
aistudio: "google",
|
|
110
|
+
vertex: "google-vertex",
|
|
111
|
+
grok: "xai",
|
|
112
|
+
bfl: "black-forest-labs",
|
|
113
|
+
moonshot: "moonshotai",
|
|
114
|
+
alibaba: "alibaba",
|
|
115
|
+
alibabacloud: "alibaba",
|
|
116
|
+
dashscope: "alibaba",
|
|
117
|
+
togetherai: "together",
|
|
118
|
+
fireworksai: "fireworks"
|
|
119
|
+
};
|
|
81
120
|
function readProcessEnv() {
|
|
82
121
|
return typeof process !== "undefined" && process.env ? process.env : {};
|
|
83
122
|
}
|
|
@@ -114,6 +153,9 @@ function providerFromHostAlias(alias) {
|
|
|
114
153
|
if (hasOwn(PROVIDER_PARAMS, normalizedAlias)) {
|
|
115
154
|
return normalizedAlias;
|
|
116
155
|
}
|
|
156
|
+
if (hasOwn(HOST_ALIAS_PROVIDERS, normalizedAlias)) {
|
|
157
|
+
return HOST_ALIAS_PROVIDERS[normalizedAlias];
|
|
158
|
+
}
|
|
117
159
|
return void 0;
|
|
118
160
|
}
|
|
119
161
|
function detectProvider(host) {
|
|
@@ -121,6 +163,34 @@ function detectProvider(host) {
|
|
|
121
163
|
if (host.includes("openrouter")) return "openrouter";
|
|
122
164
|
if (host.includes("gateway.ai.vercel")) return "vercel";
|
|
123
165
|
if (host.includes("amazonaws") || host.includes("bedrock")) return "bedrock";
|
|
166
|
+
if (host.includes("aiplatform.googleapis")) return "google-vertex";
|
|
167
|
+
if (host.includes("api.x.ai")) return "xai";
|
|
168
|
+
if (host.includes("groq")) return "groq";
|
|
169
|
+
if (host.includes("fal.run") || host.includes("fal.ai")) return "fal";
|
|
170
|
+
if (host.includes("deepinfra")) return "deepinfra";
|
|
171
|
+
if (host.includes("bfl.ai")) return "black-forest-labs";
|
|
172
|
+
if (host.includes("together")) return "together";
|
|
173
|
+
if (host.includes("fireworks")) return "fireworks";
|
|
174
|
+
if (host.includes("deepseek")) return "deepseek";
|
|
175
|
+
if (host.includes("moonshot")) return "moonshotai";
|
|
176
|
+
if (host.includes("perplexity")) return "perplexity";
|
|
177
|
+
if (host.includes("dashscope") || host.includes("aliyuncs")) return "alibaba";
|
|
178
|
+
if (host.includes("cerebras")) return "cerebras";
|
|
179
|
+
if (host.includes("replicate")) return "replicate";
|
|
180
|
+
if (host.includes("prodia")) return "prodia";
|
|
181
|
+
if (host.includes("lumalabs") || host.includes("luma")) return "luma";
|
|
182
|
+
if (host.includes("volces") || host.includes("bytedance")) return "bytedance";
|
|
183
|
+
if (host.includes("kling")) return "kling";
|
|
184
|
+
if (host.includes("elevenlabs")) return "elevenlabs";
|
|
185
|
+
if (host.includes("assemblyai")) return "assemblyai";
|
|
186
|
+
if (host.includes("deepgram")) return "deepgram";
|
|
187
|
+
if (host.includes("gladia")) return "gladia";
|
|
188
|
+
if (host.includes("lmnt")) return "lmnt";
|
|
189
|
+
if (host.includes("hume")) return "hume";
|
|
190
|
+
if (host.includes("rev.ai")) return "revai";
|
|
191
|
+
if (host.includes("baseten")) return "baseten";
|
|
192
|
+
if (host.includes("huggingface")) return "huggingface";
|
|
193
|
+
if (host.includes("azure")) return "azure";
|
|
124
194
|
if (host.includes("openai")) return "openai";
|
|
125
195
|
if (host.includes("anthropic") || host.includes("claude")) return "anthropic";
|
|
126
196
|
if (host.includes("googleapis") || host.includes("google")) return "google";
|
|
@@ -175,6 +245,33 @@ var ALIASES = {
|
|
|
175
245
|
cachePoint: "cache",
|
|
176
246
|
cache_point: "cache"
|
|
177
247
|
};
|
|
248
|
+
var OPENAI_COMPATIBLE_PARAMS = {
|
|
249
|
+
temperature: "temperature",
|
|
250
|
+
max_tokens: "max_tokens",
|
|
251
|
+
top_p: "top_p",
|
|
252
|
+
top_k: "top_k",
|
|
253
|
+
frequency_penalty: "frequency_penalty",
|
|
254
|
+
presence_penalty: "presence_penalty",
|
|
255
|
+
stop: "stop",
|
|
256
|
+
n: "n",
|
|
257
|
+
seed: "seed",
|
|
258
|
+
stream: "stream",
|
|
259
|
+
effort: "reasoning_effort"
|
|
260
|
+
};
|
|
261
|
+
var GOOGLE_COMPATIBLE_PARAMS = {
|
|
262
|
+
temperature: "temperature",
|
|
263
|
+
max_tokens: "maxOutputTokens",
|
|
264
|
+
top_p: "topP",
|
|
265
|
+
top_k: "topK",
|
|
266
|
+
frequency_penalty: "frequencyPenalty",
|
|
267
|
+
presence_penalty: "presencePenalty",
|
|
268
|
+
stop: "stopSequences",
|
|
269
|
+
n: "candidateCount",
|
|
270
|
+
stream: "stream",
|
|
271
|
+
seed: "seed",
|
|
272
|
+
responseMimeType: "responseMimeType",
|
|
273
|
+
responseSchema: "responseSchema"
|
|
274
|
+
};
|
|
178
275
|
var PROVIDER_PARAMS = {
|
|
179
276
|
openai: {
|
|
180
277
|
temperature: "temperature",
|
|
@@ -188,6 +285,7 @@ var PROVIDER_PARAMS = {
|
|
|
188
285
|
stream: "stream",
|
|
189
286
|
effort: "reasoning_effort"
|
|
190
287
|
},
|
|
288
|
+
azure: OPENAI_COMPATIBLE_PARAMS,
|
|
191
289
|
anthropic: {
|
|
192
290
|
temperature: "temperature",
|
|
193
291
|
max_tokens: "max_tokens",
|
|
@@ -213,6 +311,7 @@ var PROVIDER_PARAMS = {
|
|
|
213
311
|
responseMimeType: "responseMimeType",
|
|
214
312
|
responseSchema: "responseSchema"
|
|
215
313
|
},
|
|
314
|
+
"google-vertex": GOOGLE_COMPATIBLE_PARAMS,
|
|
216
315
|
mistral: {
|
|
217
316
|
temperature: "temperature",
|
|
218
317
|
max_tokens: "max_tokens",
|
|
@@ -276,8 +375,139 @@ var PROVIDER_PARAMS = {
|
|
|
276
375
|
seed: "seed",
|
|
277
376
|
stream: "stream",
|
|
278
377
|
effort: "reasoning_effort"
|
|
378
|
+
},
|
|
379
|
+
xai: OPENAI_COMPATIBLE_PARAMS,
|
|
380
|
+
groq: OPENAI_COMPATIBLE_PARAMS,
|
|
381
|
+
fal: {},
|
|
382
|
+
deepinfra: OPENAI_COMPATIBLE_PARAMS,
|
|
383
|
+
"black-forest-labs": {},
|
|
384
|
+
together: OPENAI_COMPATIBLE_PARAMS,
|
|
385
|
+
fireworks: OPENAI_COMPATIBLE_PARAMS,
|
|
386
|
+
deepseek: OPENAI_COMPATIBLE_PARAMS,
|
|
387
|
+
moonshotai: OPENAI_COMPATIBLE_PARAMS,
|
|
388
|
+
perplexity: OPENAI_COMPATIBLE_PARAMS,
|
|
389
|
+
alibaba: OPENAI_COMPATIBLE_PARAMS,
|
|
390
|
+
cerebras: OPENAI_COMPATIBLE_PARAMS,
|
|
391
|
+
replicate: {},
|
|
392
|
+
prodia: {},
|
|
393
|
+
luma: {},
|
|
394
|
+
bytedance: {},
|
|
395
|
+
kling: {},
|
|
396
|
+
elevenlabs: {},
|
|
397
|
+
assemblyai: {},
|
|
398
|
+
deepgram: {},
|
|
399
|
+
gladia: {},
|
|
400
|
+
lmnt: {},
|
|
401
|
+
hume: {},
|
|
402
|
+
revai: {},
|
|
403
|
+
baseten: OPENAI_COMPATIBLE_PARAMS,
|
|
404
|
+
huggingface: OPENAI_COMPATIBLE_PARAMS
|
|
405
|
+
};
|
|
406
|
+
var OPENAI_COMPATIBLE_PARAM_SPECS = {
|
|
407
|
+
temperature: {
|
|
408
|
+
type: "number",
|
|
409
|
+
min: 0,
|
|
410
|
+
max: 2,
|
|
411
|
+
default: 0.7,
|
|
412
|
+
description: "Controls randomness"
|
|
413
|
+
},
|
|
414
|
+
max_tokens: {
|
|
415
|
+
type: "number",
|
|
416
|
+
min: 1,
|
|
417
|
+
default: 4096,
|
|
418
|
+
description: "Maximum output tokens"
|
|
419
|
+
},
|
|
420
|
+
top_p: {
|
|
421
|
+
type: "number",
|
|
422
|
+
min: 0,
|
|
423
|
+
max: 1,
|
|
424
|
+
default: 1,
|
|
425
|
+
description: "Nucleus sampling"
|
|
426
|
+
},
|
|
427
|
+
top_k: {
|
|
428
|
+
type: "number",
|
|
429
|
+
min: 0,
|
|
430
|
+
default: 40,
|
|
431
|
+
description: "Top-K sampling"
|
|
432
|
+
},
|
|
433
|
+
frequency_penalty: {
|
|
434
|
+
type: "number",
|
|
435
|
+
min: -2,
|
|
436
|
+
max: 2,
|
|
437
|
+
default: 0,
|
|
438
|
+
description: "Penalize frequent tokens"
|
|
439
|
+
},
|
|
440
|
+
presence_penalty: {
|
|
441
|
+
type: "number",
|
|
442
|
+
min: -2,
|
|
443
|
+
max: 2,
|
|
444
|
+
default: 0,
|
|
445
|
+
description: "Penalize repeated topics"
|
|
446
|
+
},
|
|
447
|
+
stop: { type: "string", description: "Stop sequences" },
|
|
448
|
+
n: { type: "number", min: 1, default: 1, description: "Completions count" },
|
|
449
|
+
seed: { type: "number", description: "Random seed" },
|
|
450
|
+
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
451
|
+
reasoning_effort: {
|
|
452
|
+
type: "string",
|
|
453
|
+
values: ["none", "minimal", "low", "medium", "high", "xhigh"],
|
|
454
|
+
default: "medium",
|
|
455
|
+
description: "Reasoning effort"
|
|
279
456
|
}
|
|
280
457
|
};
|
|
458
|
+
var GOOGLE_COMPATIBLE_PARAM_SPECS = {
|
|
459
|
+
temperature: {
|
|
460
|
+
type: "number",
|
|
461
|
+
min: 0,
|
|
462
|
+
max: 2,
|
|
463
|
+
default: 0.7,
|
|
464
|
+
description: "Controls randomness"
|
|
465
|
+
},
|
|
466
|
+
maxOutputTokens: {
|
|
467
|
+
type: "number",
|
|
468
|
+
min: 1,
|
|
469
|
+
default: 4096,
|
|
470
|
+
description: "Maximum output tokens"
|
|
471
|
+
},
|
|
472
|
+
topP: {
|
|
473
|
+
type: "number",
|
|
474
|
+
min: 0,
|
|
475
|
+
max: 1,
|
|
476
|
+
default: 1,
|
|
477
|
+
description: "Nucleus sampling"
|
|
478
|
+
},
|
|
479
|
+
topK: {
|
|
480
|
+
type: "number",
|
|
481
|
+
min: 0,
|
|
482
|
+
default: 40,
|
|
483
|
+
description: "Top-K sampling"
|
|
484
|
+
},
|
|
485
|
+
frequencyPenalty: {
|
|
486
|
+
type: "number",
|
|
487
|
+
min: -2,
|
|
488
|
+
max: 2,
|
|
489
|
+
default: 0,
|
|
490
|
+
description: "Penalize frequent tokens"
|
|
491
|
+
},
|
|
492
|
+
presencePenalty: {
|
|
493
|
+
type: "number",
|
|
494
|
+
min: -2,
|
|
495
|
+
max: 2,
|
|
496
|
+
default: 0,
|
|
497
|
+
description: "Penalize repeated topics"
|
|
498
|
+
},
|
|
499
|
+
stopSequences: { type: "string", description: "Stop sequences" },
|
|
500
|
+
candidateCount: {
|
|
501
|
+
type: "number",
|
|
502
|
+
min: 1,
|
|
503
|
+
default: 1,
|
|
504
|
+
description: "Candidate count"
|
|
505
|
+
},
|
|
506
|
+
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
507
|
+
seed: { type: "number", description: "Random seed" },
|
|
508
|
+
responseMimeType: { type: "string", description: "Response MIME type" },
|
|
509
|
+
responseSchema: { type: "string", description: "Response schema" }
|
|
510
|
+
};
|
|
281
511
|
var PARAM_SPECS = {
|
|
282
512
|
openai: {
|
|
283
513
|
temperature: {
|
|
@@ -325,6 +555,7 @@ var PARAM_SPECS = {
|
|
|
325
555
|
description: "Reasoning effort"
|
|
326
556
|
}
|
|
327
557
|
},
|
|
558
|
+
azure: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
328
559
|
anthropic: {
|
|
329
560
|
temperature: {
|
|
330
561
|
type: "number",
|
|
@@ -426,6 +657,7 @@ var PARAM_SPECS = {
|
|
|
426
657
|
responseMimeType: { type: "string", description: "Response MIME type" },
|
|
427
658
|
responseSchema: { type: "string", description: "Response schema" }
|
|
428
659
|
},
|
|
660
|
+
"google-vertex": GOOGLE_COMPATIBLE_PARAM_SPECS,
|
|
429
661
|
mistral: {
|
|
430
662
|
temperature: {
|
|
431
663
|
type: "number",
|
|
@@ -671,7 +903,33 @@ var PARAM_SPECS = {
|
|
|
671
903
|
default: "medium",
|
|
672
904
|
description: "Reasoning effort"
|
|
673
905
|
}
|
|
674
|
-
}
|
|
906
|
+
},
|
|
907
|
+
xai: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
908
|
+
groq: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
909
|
+
fal: {},
|
|
910
|
+
deepinfra: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
911
|
+
"black-forest-labs": {},
|
|
912
|
+
together: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
913
|
+
fireworks: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
914
|
+
deepseek: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
915
|
+
moonshotai: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
916
|
+
perplexity: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
917
|
+
alibaba: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
918
|
+
cerebras: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
919
|
+
replicate: {},
|
|
920
|
+
prodia: {},
|
|
921
|
+
luma: {},
|
|
922
|
+
bytedance: {},
|
|
923
|
+
kling: {},
|
|
924
|
+
elevenlabs: {},
|
|
925
|
+
assemblyai: {},
|
|
926
|
+
deepgram: {},
|
|
927
|
+
gladia: {},
|
|
928
|
+
lmnt: {},
|
|
929
|
+
hume: {},
|
|
930
|
+
revai: {},
|
|
931
|
+
baseten: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
932
|
+
huggingface: OPENAI_COMPATIBLE_PARAM_SPECS
|
|
675
933
|
};
|
|
676
934
|
function isReasoningModel(model) {
|
|
677
935
|
const name = model.includes("/") ? model.split("/").pop() : model;
|
|
@@ -728,34 +986,96 @@ function bedrockSupportsCaching(model) {
|
|
|
728
986
|
var CACHE_VALUES = {
|
|
729
987
|
openai: void 0,
|
|
730
988
|
// OpenAI auto-caches; no explicit param
|
|
989
|
+
azure: void 0,
|
|
731
990
|
anthropic: "ephemeral",
|
|
732
991
|
google: void 0,
|
|
733
992
|
// Google uses explicit caching API, not a param
|
|
993
|
+
"google-vertex": void 0,
|
|
734
994
|
mistral: void 0,
|
|
735
995
|
cohere: void 0,
|
|
736
996
|
bedrock: "ephemeral",
|
|
737
997
|
// Supported for Claude models on Bedrock
|
|
738
998
|
openrouter: void 0,
|
|
739
999
|
// Depends on underlying provider
|
|
740
|
-
vercel: void 0
|
|
1000
|
+
vercel: void 0,
|
|
741
1001
|
// Depends on underlying provider
|
|
1002
|
+
xai: void 0,
|
|
1003
|
+
groq: void 0,
|
|
1004
|
+
fal: void 0,
|
|
1005
|
+
deepinfra: void 0,
|
|
1006
|
+
"black-forest-labs": void 0,
|
|
1007
|
+
together: void 0,
|
|
1008
|
+
fireworks: void 0,
|
|
1009
|
+
deepseek: void 0,
|
|
1010
|
+
moonshotai: void 0,
|
|
1011
|
+
perplexity: void 0,
|
|
1012
|
+
alibaba: void 0,
|
|
1013
|
+
cerebras: void 0,
|
|
1014
|
+
replicate: void 0,
|
|
1015
|
+
prodia: void 0,
|
|
1016
|
+
luma: void 0,
|
|
1017
|
+
bytedance: void 0,
|
|
1018
|
+
kling: void 0,
|
|
1019
|
+
elevenlabs: void 0,
|
|
1020
|
+
assemblyai: void 0,
|
|
1021
|
+
deepgram: void 0,
|
|
1022
|
+
gladia: void 0,
|
|
1023
|
+
lmnt: void 0,
|
|
1024
|
+
hume: void 0,
|
|
1025
|
+
revai: void 0,
|
|
1026
|
+
baseten: void 0,
|
|
1027
|
+
huggingface: void 0
|
|
742
1028
|
};
|
|
743
1029
|
var CACHE_TTLS = {
|
|
744
1030
|
openai: void 0,
|
|
1031
|
+
azure: void 0,
|
|
745
1032
|
anthropic: ["5m", "1h"],
|
|
746
1033
|
google: void 0,
|
|
1034
|
+
"google-vertex": void 0,
|
|
747
1035
|
mistral: void 0,
|
|
748
1036
|
cohere: void 0,
|
|
749
1037
|
bedrock: ["5m", "1h"],
|
|
750
1038
|
// Claude on Bedrock uses same TTLs as direct Anthropic
|
|
751
1039
|
openrouter: void 0,
|
|
752
|
-
vercel: void 0
|
|
1040
|
+
vercel: void 0,
|
|
1041
|
+
xai: void 0,
|
|
1042
|
+
groq: void 0,
|
|
1043
|
+
fal: void 0,
|
|
1044
|
+
deepinfra: void 0,
|
|
1045
|
+
"black-forest-labs": void 0,
|
|
1046
|
+
together: void 0,
|
|
1047
|
+
fireworks: void 0,
|
|
1048
|
+
deepseek: void 0,
|
|
1049
|
+
moonshotai: void 0,
|
|
1050
|
+
perplexity: void 0,
|
|
1051
|
+
alibaba: void 0,
|
|
1052
|
+
cerebras: void 0,
|
|
1053
|
+
replicate: void 0,
|
|
1054
|
+
prodia: void 0,
|
|
1055
|
+
luma: void 0,
|
|
1056
|
+
bytedance: void 0,
|
|
1057
|
+
kling: void 0,
|
|
1058
|
+
elevenlabs: void 0,
|
|
1059
|
+
assemblyai: void 0,
|
|
1060
|
+
deepgram: void 0,
|
|
1061
|
+
gladia: void 0,
|
|
1062
|
+
lmnt: void 0,
|
|
1063
|
+
hume: void 0,
|
|
1064
|
+
revai: void 0,
|
|
1065
|
+
baseten: void 0,
|
|
1066
|
+
huggingface: void 0
|
|
753
1067
|
};
|
|
754
1068
|
var DURATION_RE = /^\d+[mh]$/;
|
|
755
1069
|
|
|
756
1070
|
// src/provider-meta.ts
|
|
757
1071
|
var PROVIDER_META = [
|
|
758
1072
|
{ id: "openai", name: "OpenAI", host: "api.openai.com", color: "#10a37f" },
|
|
1073
|
+
{
|
|
1074
|
+
id: "azure",
|
|
1075
|
+
name: "Azure OpenAI",
|
|
1076
|
+
host: "models.inference.ai.azure.com",
|
|
1077
|
+
color: "#0078d4"
|
|
1078
|
+
},
|
|
759
1079
|
{
|
|
760
1080
|
id: "anthropic",
|
|
761
1081
|
name: "Anthropic",
|
|
@@ -768,6 +1088,12 @@ var PROVIDER_META = [
|
|
|
768
1088
|
host: "generativelanguage.googleapis.com",
|
|
769
1089
|
color: "#4285f4"
|
|
770
1090
|
},
|
|
1091
|
+
{
|
|
1092
|
+
id: "google-vertex",
|
|
1093
|
+
name: "Google Vertex AI",
|
|
1094
|
+
host: "aiplatform.googleapis.com",
|
|
1095
|
+
color: "#34a853"
|
|
1096
|
+
},
|
|
771
1097
|
{ id: "mistral", name: "Mistral", host: "api.mistral.ai", color: "#ff7000" },
|
|
772
1098
|
{ id: "cohere", name: "Cohere", host: "api.cohere.com", color: "#39594d" },
|
|
773
1099
|
{
|
|
@@ -787,6 +1113,112 @@ var PROVIDER_META = [
|
|
|
787
1113
|
name: "Vercel",
|
|
788
1114
|
host: "gateway.ai.vercel.app",
|
|
789
1115
|
color: "#ededed"
|
|
1116
|
+
},
|
|
1117
|
+
{ id: "xai", name: "xAI", host: "api.x.ai", color: "#111111" },
|
|
1118
|
+
{ id: "groq", name: "Groq", host: "api.groq.com", color: "#f55036" },
|
|
1119
|
+
{ id: "fal", name: "Fal", host: "fal.run", color: "#111111" },
|
|
1120
|
+
{
|
|
1121
|
+
id: "deepinfra",
|
|
1122
|
+
name: "DeepInfra",
|
|
1123
|
+
host: "api.deepinfra.com",
|
|
1124
|
+
color: "#2563eb"
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
id: "black-forest-labs",
|
|
1128
|
+
name: "Black Forest Labs",
|
|
1129
|
+
host: "api.bfl.ai",
|
|
1130
|
+
color: "#111111"
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
id: "together",
|
|
1134
|
+
name: "Together.ai",
|
|
1135
|
+
host: "api.together.xyz",
|
|
1136
|
+
color: "#ff4f00"
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
id: "fireworks",
|
|
1140
|
+
name: "Fireworks",
|
|
1141
|
+
host: "api.fireworks.ai",
|
|
1142
|
+
color: "#7c3aed"
|
|
1143
|
+
},
|
|
1144
|
+
{
|
|
1145
|
+
id: "deepseek",
|
|
1146
|
+
name: "DeepSeek",
|
|
1147
|
+
host: "api.deepseek.com",
|
|
1148
|
+
color: "#4d6bfe"
|
|
1149
|
+
},
|
|
1150
|
+
{
|
|
1151
|
+
id: "moonshotai",
|
|
1152
|
+
name: "Moonshot AI",
|
|
1153
|
+
host: "api.moonshot.ai",
|
|
1154
|
+
color: "#6b46ff"
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
id: "perplexity",
|
|
1158
|
+
name: "Perplexity",
|
|
1159
|
+
host: "api.perplexity.ai",
|
|
1160
|
+
color: "#20b8cd"
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
id: "alibaba",
|
|
1164
|
+
name: "Alibaba",
|
|
1165
|
+
host: "dashscope-intl.aliyuncs.com",
|
|
1166
|
+
color: "#ff6a00"
|
|
1167
|
+
},
|
|
1168
|
+
{
|
|
1169
|
+
id: "cerebras",
|
|
1170
|
+
name: "Cerebras",
|
|
1171
|
+
host: "api.cerebras.ai",
|
|
1172
|
+
color: "#d71920"
|
|
1173
|
+
},
|
|
1174
|
+
{
|
|
1175
|
+
id: "replicate",
|
|
1176
|
+
name: "Replicate",
|
|
1177
|
+
host: "api.replicate.com",
|
|
1178
|
+
color: "#111111"
|
|
1179
|
+
},
|
|
1180
|
+
{ id: "prodia", name: "Prodia", host: "api.prodia.com", color: "#6d28d9" },
|
|
1181
|
+
{ id: "luma", name: "Luma", host: "api.lumalabs.ai", color: "#111111" },
|
|
1182
|
+
{
|
|
1183
|
+
id: "bytedance",
|
|
1184
|
+
name: "ByteDance",
|
|
1185
|
+
host: "ark.cn-beijing.volces.com",
|
|
1186
|
+
color: "#2563eb"
|
|
1187
|
+
},
|
|
1188
|
+
{ id: "kling", name: "Kling AI", host: "api.klingai.com", color: "#111111" },
|
|
1189
|
+
{
|
|
1190
|
+
id: "elevenlabs",
|
|
1191
|
+
name: "ElevenLabs",
|
|
1192
|
+
host: "api.elevenlabs.io",
|
|
1193
|
+
color: "#111111"
|
|
1194
|
+
},
|
|
1195
|
+
{
|
|
1196
|
+
id: "assemblyai",
|
|
1197
|
+
name: "AssemblyAI",
|
|
1198
|
+
host: "api.assemblyai.com",
|
|
1199
|
+
color: "#4f46e5"
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
id: "deepgram",
|
|
1203
|
+
name: "Deepgram",
|
|
1204
|
+
host: "api.deepgram.com",
|
|
1205
|
+
color: "#13ef93"
|
|
1206
|
+
},
|
|
1207
|
+
{ id: "gladia", name: "Gladia", host: "api.gladia.io", color: "#7c3aed" },
|
|
1208
|
+
{ id: "lmnt", name: "LMNT", host: "api.lmnt.com", color: "#14b8a6" },
|
|
1209
|
+
{ id: "hume", name: "Hume", host: "api.hume.ai", color: "#8b5cf6" },
|
|
1210
|
+
{ id: "revai", name: "Rev.ai", host: "api.rev.ai", color: "#ef4444" },
|
|
1211
|
+
{
|
|
1212
|
+
id: "baseten",
|
|
1213
|
+
name: "Baseten",
|
|
1214
|
+
host: "api.baseten.co",
|
|
1215
|
+
color: "#111111"
|
|
1216
|
+
},
|
|
1217
|
+
{
|
|
1218
|
+
id: "huggingface",
|
|
1219
|
+
name: "Hugging Face",
|
|
1220
|
+
host: "api-inference.huggingface.co",
|
|
1221
|
+
color: "#ffcc4d"
|
|
790
1222
|
}
|
|
791
1223
|
];
|
|
792
1224
|
var MODELS = {
|
|
@@ -801,6 +1233,7 @@ var MODELS = {
|
|
|
801
1233
|
"o4-mini",
|
|
802
1234
|
"o1-pro"
|
|
803
1235
|
],
|
|
1236
|
+
azure: ["gpt-5.2", "gpt-4.1", "o3", "o4-mini"],
|
|
804
1237
|
anthropic: [
|
|
805
1238
|
"claude-opus-4-6",
|
|
806
1239
|
"claude-sonnet-4-6",
|
|
@@ -813,6 +1246,12 @@ var MODELS = {
|
|
|
813
1246
|
"gemini-2.5-pro",
|
|
814
1247
|
"gemini-2.5-flash"
|
|
815
1248
|
],
|
|
1249
|
+
"google-vertex": [
|
|
1250
|
+
"gemini-3-pro-preview",
|
|
1251
|
+
"gemini-3-flash-preview",
|
|
1252
|
+
"gemini-2.5-pro",
|
|
1253
|
+
"gemini-2.5-flash"
|
|
1254
|
+
],
|
|
816
1255
|
mistral: [
|
|
817
1256
|
"mistral-large-latest",
|
|
818
1257
|
"mistral-medium-latest",
|
|
@@ -848,8 +1287,147 @@ var MODELS = {
|
|
|
848
1287
|
"google/gemini-3-flash-preview",
|
|
849
1288
|
"mistral/mistral-large-latest",
|
|
850
1289
|
"qwen/qwen2.5-pro"
|
|
1290
|
+
],
|
|
1291
|
+
xai: ["grok-4", "grok-3", "grok-3-mini"],
|
|
1292
|
+
groq: ["openai/gpt-oss-120b", "llama-3.3-70b-versatile"],
|
|
1293
|
+
fal: ["fal-ai/flux-pro", "fal-ai/imagen4/preview"],
|
|
1294
|
+
deepinfra: [
|
|
1295
|
+
"meta-llama/Meta-Llama-3.1-70B-Instruct",
|
|
1296
|
+
"deepseek-ai/DeepSeek-V3"
|
|
1297
|
+
],
|
|
1298
|
+
"black-forest-labs": ["flux-pro-1.1", "flux-kontext-pro"],
|
|
1299
|
+
together: [
|
|
1300
|
+
"meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
|
1301
|
+
"deepseek-ai/DeepSeek-V3"
|
|
1302
|
+
],
|
|
1303
|
+
fireworks: [
|
|
1304
|
+
"accounts/fireworks/models/llama-v3p1-70b-instruct",
|
|
1305
|
+
"accounts/fireworks/models/deepseek-v3"
|
|
1306
|
+
],
|
|
1307
|
+
deepseek: ["deepseek-chat", "deepseek-reasoner"],
|
|
1308
|
+
moonshotai: ["kimi-k2-0905-preview", "moonshot-v1-128k"],
|
|
1309
|
+
perplexity: ["sonar", "sonar-pro", "sonar-reasoning"],
|
|
1310
|
+
alibaba: ["qwen-plus", "qwen-max", "qwen3-coder-plus"],
|
|
1311
|
+
cerebras: ["llama3.1-8b", "llama-3.3-70b"],
|
|
1312
|
+
replicate: [
|
|
1313
|
+
"black-forest-labs/flux-schnell",
|
|
1314
|
+
"meta/meta-llama-3-70b-instruct"
|
|
1315
|
+
],
|
|
1316
|
+
prodia: ["sdxl", "flux-schnell"],
|
|
1317
|
+
luma: ["ray-2", "photon-1"],
|
|
1318
|
+
bytedance: ["seedream-4-0", "seedance-1-0-pro"],
|
|
1319
|
+
kling: ["kling-v2.1", "kling-v1.6"],
|
|
1320
|
+
elevenlabs: ["eleven_multilingual_v2", "eleven_turbo_v2_5"],
|
|
1321
|
+
assemblyai: ["universal"],
|
|
1322
|
+
deepgram: ["nova-3", "nova-2"],
|
|
1323
|
+
gladia: ["solaria-1"],
|
|
1324
|
+
lmnt: ["aurora"],
|
|
1325
|
+
hume: ["octave"],
|
|
1326
|
+
revai: ["machine"],
|
|
1327
|
+
baseten: ["meta-llama/Llama-3.1-8B-Instruct", "deepseek-ai/DeepSeek-R1"],
|
|
1328
|
+
huggingface: [
|
|
1329
|
+
"meta-llama/Llama-3.1-8B-Instruct",
|
|
1330
|
+
"mistralai/Mistral-7B-Instruct-v0.3"
|
|
851
1331
|
]
|
|
852
1332
|
};
|
|
1333
|
+
var OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS = {
|
|
1334
|
+
temperature: {
|
|
1335
|
+
type: "number",
|
|
1336
|
+
min: 0,
|
|
1337
|
+
max: 2,
|
|
1338
|
+
default: 0.7,
|
|
1339
|
+
description: "Controls randomness"
|
|
1340
|
+
},
|
|
1341
|
+
max_tokens: {
|
|
1342
|
+
type: "number",
|
|
1343
|
+
min: 1,
|
|
1344
|
+
default: 4096,
|
|
1345
|
+
description: "Maximum output tokens"
|
|
1346
|
+
},
|
|
1347
|
+
top_p: {
|
|
1348
|
+
type: "number",
|
|
1349
|
+
min: 0,
|
|
1350
|
+
max: 1,
|
|
1351
|
+
default: 1,
|
|
1352
|
+
description: "Nucleus sampling"
|
|
1353
|
+
},
|
|
1354
|
+
top_k: {
|
|
1355
|
+
type: "number",
|
|
1356
|
+
min: 0,
|
|
1357
|
+
default: 40,
|
|
1358
|
+
description: "Top-K sampling"
|
|
1359
|
+
},
|
|
1360
|
+
frequency_penalty: {
|
|
1361
|
+
type: "number",
|
|
1362
|
+
min: -2,
|
|
1363
|
+
max: 2,
|
|
1364
|
+
default: 0,
|
|
1365
|
+
description: "Penalize frequent tokens"
|
|
1366
|
+
},
|
|
1367
|
+
presence_penalty: {
|
|
1368
|
+
type: "number",
|
|
1369
|
+
min: -2,
|
|
1370
|
+
max: 2,
|
|
1371
|
+
default: 0,
|
|
1372
|
+
description: "Penalize repeated topics"
|
|
1373
|
+
},
|
|
1374
|
+
stop: { type: "string", default: "", description: "Stop sequences" },
|
|
1375
|
+
n: { type: "number", min: 1, default: 1, description: "Completions count" },
|
|
1376
|
+
seed: { type: "number", default: "", description: "Random seed" },
|
|
1377
|
+
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
1378
|
+
effort: {
|
|
1379
|
+
type: "enum",
|
|
1380
|
+
values: ["none", "minimal", "low", "medium", "high", "xhigh"],
|
|
1381
|
+
default: "medium",
|
|
1382
|
+
description: "Reasoning effort"
|
|
1383
|
+
}
|
|
1384
|
+
};
|
|
1385
|
+
var GOOGLE_COMPATIBLE_CANONICAL_PARAM_SPECS = {
|
|
1386
|
+
temperature: {
|
|
1387
|
+
type: "number",
|
|
1388
|
+
min: 0,
|
|
1389
|
+
max: 2,
|
|
1390
|
+
default: 0.7,
|
|
1391
|
+
description: "Controls randomness"
|
|
1392
|
+
},
|
|
1393
|
+
max_tokens: {
|
|
1394
|
+
type: "number",
|
|
1395
|
+
min: 1,
|
|
1396
|
+
default: 4096,
|
|
1397
|
+
description: "Maximum output tokens"
|
|
1398
|
+
},
|
|
1399
|
+
top_p: {
|
|
1400
|
+
type: "number",
|
|
1401
|
+
min: 0,
|
|
1402
|
+
max: 1,
|
|
1403
|
+
default: 1,
|
|
1404
|
+
description: "Nucleus sampling"
|
|
1405
|
+
},
|
|
1406
|
+
top_k: {
|
|
1407
|
+
type: "number",
|
|
1408
|
+
min: 0,
|
|
1409
|
+
default: 40,
|
|
1410
|
+
description: "Top-K sampling"
|
|
1411
|
+
},
|
|
1412
|
+
frequency_penalty: {
|
|
1413
|
+
type: "number",
|
|
1414
|
+
min: -2,
|
|
1415
|
+
max: 2,
|
|
1416
|
+
default: 0,
|
|
1417
|
+
description: "Penalize frequent tokens"
|
|
1418
|
+
},
|
|
1419
|
+
presence_penalty: {
|
|
1420
|
+
type: "number",
|
|
1421
|
+
min: -2,
|
|
1422
|
+
max: 2,
|
|
1423
|
+
default: 0,
|
|
1424
|
+
description: "Penalize repeated topics"
|
|
1425
|
+
},
|
|
1426
|
+
stop: { type: "string", default: "", description: "Stop sequences" },
|
|
1427
|
+
n: { type: "number", min: 1, default: 1, description: "Candidate count" },
|
|
1428
|
+
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
1429
|
+
seed: { type: "number", default: "", description: "Random seed" }
|
|
1430
|
+
};
|
|
853
1431
|
var CANONICAL_PARAM_SPECS = {
|
|
854
1432
|
openai: {
|
|
855
1433
|
temperature: {
|
|
@@ -897,6 +1475,7 @@ var CANONICAL_PARAM_SPECS = {
|
|
|
897
1475
|
description: "Reasoning effort"
|
|
898
1476
|
}
|
|
899
1477
|
},
|
|
1478
|
+
azure: OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
900
1479
|
anthropic: {
|
|
901
1480
|
temperature: {
|
|
902
1481
|
type: "number",
|
|
@@ -991,6 +1570,7 @@ var CANONICAL_PARAM_SPECS = {
|
|
|
991
1570
|
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
992
1571
|
seed: { type: "number", default: "", description: "Random seed" }
|
|
993
1572
|
},
|
|
1573
|
+
"google-vertex": GOOGLE_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
994
1574
|
mistral: {
|
|
995
1575
|
temperature: {
|
|
996
1576
|
type: "number",
|
|
@@ -1233,7 +1813,33 @@ var CANONICAL_PARAM_SPECS = {
|
|
|
1233
1813
|
default: "medium",
|
|
1234
1814
|
description: "Reasoning effort"
|
|
1235
1815
|
}
|
|
1236
|
-
}
|
|
1816
|
+
},
|
|
1817
|
+
xai: OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
1818
|
+
groq: OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
1819
|
+
fal: {},
|
|
1820
|
+
deepinfra: OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
1821
|
+
"black-forest-labs": {},
|
|
1822
|
+
together: OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
1823
|
+
fireworks: OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
1824
|
+
deepseek: OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
1825
|
+
moonshotai: OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
1826
|
+
perplexity: OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
1827
|
+
alibaba: OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
1828
|
+
cerebras: OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
1829
|
+
replicate: {},
|
|
1830
|
+
prodia: {},
|
|
1831
|
+
luma: {},
|
|
1832
|
+
bytedance: {},
|
|
1833
|
+
kling: {},
|
|
1834
|
+
elevenlabs: {},
|
|
1835
|
+
assemblyai: {},
|
|
1836
|
+
deepgram: {},
|
|
1837
|
+
gladia: {},
|
|
1838
|
+
lmnt: {},
|
|
1839
|
+
hume: {},
|
|
1840
|
+
revai: {},
|
|
1841
|
+
baseten: OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
1842
|
+
huggingface: OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS
|
|
1237
1843
|
};
|
|
1238
1844
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1239
1845
|
0 && (module.exports = {
|