llm-strings 1.3.0 → 1.5.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/LICENSE +21 -0
- package/README.md +339 -339
- package/dist/ai-sdk.cjs +1146 -117
- package/dist/ai-sdk.d.cts +1 -1
- package/dist/ai-sdk.d.ts +1 -1
- package/dist/ai-sdk.js +95 -58
- package/dist/{chunk-7HE4RH6X.js → chunk-4BE457QA.js} +16 -29
- package/dist/{chunk-TQJ2ABCT.js → chunk-6HQOCOQI.js} +1 -2
- package/dist/{chunk-NZR5DUX5.js → chunk-7Z7DCLZN.js} +14 -3
- package/dist/{chunk-OCJX4QFJ.js → chunk-PCJDQTOV.js} +520 -76
- package/dist/index.cjs +542 -95
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -5
- package/dist/normalize.cjs +1065 -63
- package/dist/normalize.d.cts +1 -1
- package/dist/normalize.d.ts +1 -1
- package/dist/normalize.js +2 -3
- package/dist/parse.cjs +1075 -1
- package/dist/parse.d.cts +4 -4
- package/dist/parse.d.ts +4 -4
- package/dist/parse.js +2 -3
- package/dist/{provider-core-B934MuhJ.d.cts → provider-core-B1GMszQP.d.cts} +2 -3
- package/dist/{provider-core-B934MuhJ.d.ts → provider-core-B1GMszQP.d.ts} +2 -3
- package/dist/providers.cjs +542 -697
- package/dist/providers.d.cts +3 -8
- package/dist/providers.d.ts +3 -8
- package/dist/providers.js +25 -624
- package/dist/validate.cjs +542 -95
- package/dist/validate.d.cts +1 -1
- package/dist/validate.d.ts +1 -1
- package/dist/validate.js +4 -5
- package/package.json +16 -2
- package/dist/ai-sdk.cjs.map +0 -1
- package/dist/ai-sdk.js.map +0 -1
- package/dist/chunk-7HE4RH6X.js.map +0 -1
- package/dist/chunk-NZR5DUX5.js.map +0 -1
- package/dist/chunk-OCJX4QFJ.js.map +0 -1
- package/dist/chunk-TQJ2ABCT.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/normalize.cjs.map +0 -1
- package/dist/normalize.js.map +0 -1
- package/dist/parse.cjs.map +0 -1
- package/dist/parse.js.map +0 -1
- package/dist/providers.cjs.map +0 -1
- package/dist/providers.js.map +0 -1
- package/dist/validate.cjs.map +0 -1
- package/dist/validate.js.map +0 -1
package/dist/providers.cjs
CHANGED
|
@@ -24,9 +24,7 @@ __export(providers_exports, {
|
|
|
24
24
|
CACHE_TTLS: () => CACHE_TTLS,
|
|
25
25
|
CACHE_VALUES: () => CACHE_VALUES,
|
|
26
26
|
CANONICAL_PARAM_SPECS: () => CANONICAL_PARAM_SPECS,
|
|
27
|
-
DURATION_RE: () => DURATION_RE,
|
|
28
27
|
HOST_ALIASES: () => HOST_ALIASES,
|
|
29
|
-
MODELS: () => MODELS,
|
|
30
28
|
PARAM_SPECS: () => PARAM_SPECS,
|
|
31
29
|
PROVIDER_META: () => PROVIDER_META,
|
|
32
30
|
PROVIDER_PARAMS: () => PROVIDER_PARAMS,
|
|
@@ -38,6 +36,7 @@ __export(providers_exports, {
|
|
|
38
36
|
detectProvider: () => detectProvider,
|
|
39
37
|
isGatewayProvider: () => isGatewayProvider,
|
|
40
38
|
isReasoningModel: () => isReasoningModel,
|
|
39
|
+
modelMatchesFamily: () => modelMatchesFamily,
|
|
41
40
|
providerFromHostAlias: () => providerFromHostAlias,
|
|
42
41
|
resolveHostAlias: () => resolveHostAlias
|
|
43
42
|
});
|
|
@@ -158,44 +157,92 @@ function providerFromHostAlias(alias) {
|
|
|
158
157
|
}
|
|
159
158
|
return void 0;
|
|
160
159
|
}
|
|
160
|
+
function canonicalHostName(host) {
|
|
161
|
+
return normalizeHostValue(host).toLowerCase().split(":")[0] ?? host;
|
|
162
|
+
}
|
|
163
|
+
function hostMatches(host, ...domains) {
|
|
164
|
+
return domains.some((domain) => {
|
|
165
|
+
const normalizedDomain = domain.toLowerCase();
|
|
166
|
+
return host === normalizedDomain || host.endsWith(`.${normalizedDomain}`);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function hostHasLabel(host, ...labels) {
|
|
170
|
+
const hostLabels = host.split(".");
|
|
171
|
+
return labels.some((label) => hostLabels.includes(label.toLowerCase()));
|
|
172
|
+
}
|
|
173
|
+
function hostHasLabelPrefix(host, ...prefixes) {
|
|
174
|
+
const hostLabels = host.split(".");
|
|
175
|
+
return prefixes.some(
|
|
176
|
+
(prefix) => hostLabels.some((label) => label.startsWith(prefix.toLowerCase()))
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
var MODEL_FAMILY_DELIMITERS = /* @__PURE__ */ new Set(["-", "."]);
|
|
180
|
+
function normalizeModelForMatching(model) {
|
|
181
|
+
return model.trim().toLowerCase();
|
|
182
|
+
}
|
|
183
|
+
function modelLeafName(model) {
|
|
184
|
+
const normalized = normalizeModelForMatching(model);
|
|
185
|
+
const slash = normalized.lastIndexOf("/");
|
|
186
|
+
return slash >= 0 ? normalized.slice(slash + 1) : normalized;
|
|
187
|
+
}
|
|
188
|
+
function modelMatchesFamily(model, family) {
|
|
189
|
+
const name = modelLeafName(model);
|
|
190
|
+
const normalizedFamily = normalizeModelForMatching(family);
|
|
191
|
+
if (!name || !normalizedFamily) return false;
|
|
192
|
+
if (name === normalizedFamily) return true;
|
|
193
|
+
const delimiter = name[normalizedFamily.length];
|
|
194
|
+
return name.startsWith(normalizedFamily) && delimiter !== void 0 && MODEL_FAMILY_DELIMITERS.has(delimiter);
|
|
195
|
+
}
|
|
161
196
|
function detectProvider(host) {
|
|
162
|
-
host = host
|
|
163
|
-
if (host
|
|
164
|
-
if (host.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
if (host
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
if (host.
|
|
171
|
-
if (host.
|
|
172
|
-
if (host.
|
|
173
|
-
if (host.
|
|
174
|
-
if (host.
|
|
175
|
-
if (host.
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
if (host.
|
|
179
|
-
if (host.
|
|
180
|
-
if (host.
|
|
181
|
-
if (host
|
|
182
|
-
if (host
|
|
183
|
-
if (host.
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if (host.
|
|
187
|
-
if (host.
|
|
188
|
-
if (host.
|
|
189
|
-
if (host.
|
|
190
|
-
if (host
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
if (host.
|
|
194
|
-
if (host.
|
|
195
|
-
if (host
|
|
196
|
-
if (host
|
|
197
|
-
if (host.
|
|
198
|
-
if (host.
|
|
197
|
+
host = canonicalHostName(host);
|
|
198
|
+
if (hostMatches(host, "openrouter", "openrouter.ai")) return "openrouter";
|
|
199
|
+
if (hostMatches(host, "vercel", "gateway.ai.vercel.app", "gateway.ai.vercel.sh")) {
|
|
200
|
+
return "vercel";
|
|
201
|
+
}
|
|
202
|
+
if (hostMatches(host, "bedrock", "amazonaws.com") || hostHasLabelPrefix(host, "bedrock")) {
|
|
203
|
+
return "bedrock";
|
|
204
|
+
}
|
|
205
|
+
if (hostMatches(host, "aiplatform.googleapis.com")) return "google-vertex";
|
|
206
|
+
if (hostMatches(host, "xai", "x.ai", "api.x.ai")) return "xai";
|
|
207
|
+
if (hostMatches(host, "groq", "groq.com", "api.groq.com")) return "groq";
|
|
208
|
+
if (hostMatches(host, "fal", "fal.run", "fal.ai")) return "fal";
|
|
209
|
+
if (hostMatches(host, "deepinfra", "deepinfra.com")) return "deepinfra";
|
|
210
|
+
if (hostMatches(host, "bfl", "bfl.ai", "api.bfl.ai")) {
|
|
211
|
+
return "black-forest-labs";
|
|
212
|
+
}
|
|
213
|
+
if (hostMatches(host, "together", "together.xyz")) return "together";
|
|
214
|
+
if (hostMatches(host, "fireworks", "fireworks.ai")) return "fireworks";
|
|
215
|
+
if (hostMatches(host, "deepseek", "deepseek.com")) return "deepseek";
|
|
216
|
+
if (hostMatches(host, "moonshot", "moonshot.ai")) return "moonshotai";
|
|
217
|
+
if (hostMatches(host, "perplexity", "perplexity.ai")) return "perplexity";
|
|
218
|
+
if (hostMatches(host, "alibaba", "aliyuncs.com") || hostHasLabelPrefix(host, "dashscope")) {
|
|
219
|
+
return "alibaba";
|
|
220
|
+
}
|
|
221
|
+
if (hostMatches(host, "cerebras", "cerebras.ai")) return "cerebras";
|
|
222
|
+
if (hostMatches(host, "replicate", "replicate.com")) return "replicate";
|
|
223
|
+
if (hostMatches(host, "prodia", "prodia.com")) return "prodia";
|
|
224
|
+
if (hostMatches(host, "luma", "lumalabs.ai")) return "luma";
|
|
225
|
+
if (hostMatches(host, "bytedance", "volces.com") || hostHasLabel(host, "bytedance")) {
|
|
226
|
+
return "bytedance";
|
|
227
|
+
}
|
|
228
|
+
if (hostMatches(host, "kling", "klingai.com")) return "kling";
|
|
229
|
+
if (hostMatches(host, "elevenlabs", "elevenlabs.io")) return "elevenlabs";
|
|
230
|
+
if (hostMatches(host, "assemblyai", "assemblyai.com")) return "assemblyai";
|
|
231
|
+
if (hostMatches(host, "deepgram", "deepgram.com")) return "deepgram";
|
|
232
|
+
if (hostMatches(host, "gladia", "gladia.io")) return "gladia";
|
|
233
|
+
if (hostMatches(host, "lmnt", "lmnt.com")) return "lmnt";
|
|
234
|
+
if (hostMatches(host, "hume", "hume.ai")) return "hume";
|
|
235
|
+
if (hostMatches(host, "revai", "rev.ai")) return "revai";
|
|
236
|
+
if (hostMatches(host, "baseten", "baseten.co")) return "baseten";
|
|
237
|
+
if (hostMatches(host, "huggingface", "huggingface.co")) return "huggingface";
|
|
238
|
+
if (hostMatches(host, "azure", "azure.com")) return "azure";
|
|
239
|
+
if (hostMatches(host, "openai", "openai.com")) return "openai";
|
|
240
|
+
if (hostMatches(host, "anthropic", "anthropic.com", "claude.ai")) {
|
|
241
|
+
return "anthropic";
|
|
242
|
+
}
|
|
243
|
+
if (hostMatches(host, "google", "googleapis.com")) return "google";
|
|
244
|
+
if (hostMatches(host, "mistral", "mistral.ai")) return "mistral";
|
|
245
|
+
if (hostMatches(host, "cohere", "cohere.com")) return "cohere";
|
|
199
246
|
return void 0;
|
|
200
247
|
}
|
|
201
248
|
var ALIASES = {
|
|
@@ -238,7 +285,10 @@ var ALIASES = {
|
|
|
238
285
|
num_completions: "n",
|
|
239
286
|
// effort / reasoning
|
|
240
287
|
reasoning_effort: "effort",
|
|
288
|
+
reasoningEffort: "effort",
|
|
241
289
|
reasoning: "effort",
|
|
290
|
+
thinking_effort: "effort",
|
|
291
|
+
thinkingEffort: "effort",
|
|
242
292
|
// cache
|
|
243
293
|
cache_control: "cache",
|
|
244
294
|
cacheControl: "cache",
|
|
@@ -248,6 +298,7 @@ var ALIASES = {
|
|
|
248
298
|
var OPENAI_COMPATIBLE_PARAMS = {
|
|
249
299
|
temperature: "temperature",
|
|
250
300
|
max_tokens: "max_tokens",
|
|
301
|
+
max_completion_tokens: "max_completion_tokens",
|
|
251
302
|
top_p: "top_p",
|
|
252
303
|
top_k: "top_k",
|
|
253
304
|
frequency_penalty: "frequency_penalty",
|
|
@@ -258,6 +309,90 @@ var OPENAI_COMPATIBLE_PARAMS = {
|
|
|
258
309
|
stream: "stream",
|
|
259
310
|
effort: "reasoning_effort"
|
|
260
311
|
};
|
|
312
|
+
var COMMON_IMAGE_PARAMS = {
|
|
313
|
+
prompt: "prompt",
|
|
314
|
+
negative_prompt: "negative_prompt",
|
|
315
|
+
seed: "seed",
|
|
316
|
+
image_size: "image_size",
|
|
317
|
+
aspect_ratio: "aspect_ratio",
|
|
318
|
+
output_format: "output_format",
|
|
319
|
+
width: "width",
|
|
320
|
+
height: "height"
|
|
321
|
+
};
|
|
322
|
+
var FAL_PARAMS = {
|
|
323
|
+
...COMMON_IMAGE_PARAMS,
|
|
324
|
+
num_images: "num_images",
|
|
325
|
+
enable_safety_checker: "enable_safety_checker",
|
|
326
|
+
enable_safety_checks: "enable_safety_checks",
|
|
327
|
+
enable_prompt_expansion: "enable_prompt_expansion",
|
|
328
|
+
expand_prompt: "expand_prompt"
|
|
329
|
+
};
|
|
330
|
+
var REPLICATE_PARAMS = {
|
|
331
|
+
...COMMON_IMAGE_PARAMS,
|
|
332
|
+
input: "input",
|
|
333
|
+
version: "version",
|
|
334
|
+
num_outputs: "num_outputs",
|
|
335
|
+
num_inference_steps: "num_inference_steps",
|
|
336
|
+
guidance_scale: "guidance_scale",
|
|
337
|
+
stream: "stream",
|
|
338
|
+
webhook: "webhook",
|
|
339
|
+
webhook_events_filter: "webhook_events_filter"
|
|
340
|
+
};
|
|
341
|
+
var PRODIA_PARAMS = {
|
|
342
|
+
...COMMON_IMAGE_PARAMS,
|
|
343
|
+
model: "model",
|
|
344
|
+
style_preset: "style_preset",
|
|
345
|
+
steps: "steps",
|
|
346
|
+
cfg_scale: "cfg_scale",
|
|
347
|
+
upscale: "upscale",
|
|
348
|
+
sampler: "sampler",
|
|
349
|
+
type: "type",
|
|
350
|
+
config: "config",
|
|
351
|
+
price: "price"
|
|
352
|
+
};
|
|
353
|
+
var LUMA_PARAMS = {
|
|
354
|
+
prompt: "prompt",
|
|
355
|
+
model: "model",
|
|
356
|
+
aspect_ratio: "aspect_ratio",
|
|
357
|
+
keyframes: "keyframes",
|
|
358
|
+
loop: "loop",
|
|
359
|
+
duration: "duration",
|
|
360
|
+
type: "type",
|
|
361
|
+
image_ref: "image_ref",
|
|
362
|
+
video: "video",
|
|
363
|
+
source: "source"
|
|
364
|
+
};
|
|
365
|
+
var OPENROUTER_ROUTING_PARAMS = {
|
|
366
|
+
provider: "provider",
|
|
367
|
+
order: "order",
|
|
368
|
+
"provider.order": "provider.order",
|
|
369
|
+
only: "only",
|
|
370
|
+
"provider.only": "provider.only",
|
|
371
|
+
ignore: "ignore",
|
|
372
|
+
"provider.ignore": "provider.ignore",
|
|
373
|
+
allow_fallbacks: "allow_fallbacks",
|
|
374
|
+
"provider.allow_fallbacks": "provider.allow_fallbacks",
|
|
375
|
+
require_parameters: "require_parameters",
|
|
376
|
+
"provider.require_parameters": "provider.require_parameters",
|
|
377
|
+
data_collection: "data_collection",
|
|
378
|
+
"provider.data_collection": "provider.data_collection",
|
|
379
|
+
zdr: "zdr",
|
|
380
|
+
"provider.zdr": "provider.zdr",
|
|
381
|
+
enforce_distillable_text: "enforce_distillable_text",
|
|
382
|
+
"provider.enforce_distillable_text": "provider.enforce_distillable_text",
|
|
383
|
+
quantizations: "quantizations",
|
|
384
|
+
"provider.quantizations": "provider.quantizations",
|
|
385
|
+
sort: "sort",
|
|
386
|
+
"provider.sort": "provider.sort",
|
|
387
|
+
preferred_min_throughput: "preferred_min_throughput",
|
|
388
|
+
"provider.preferred_min_throughput": "provider.preferred_min_throughput",
|
|
389
|
+
preferred_max_latency: "preferred_max_latency",
|
|
390
|
+
"provider.preferred_max_latency": "provider.preferred_max_latency",
|
|
391
|
+
max_price: "max_price",
|
|
392
|
+
"provider.max_price": "provider.max_price",
|
|
393
|
+
transforms: "transforms",
|
|
394
|
+
plugins: "plugins"
|
|
395
|
+
};
|
|
261
396
|
var GOOGLE_COMPATIBLE_PARAMS = {
|
|
262
397
|
temperature: "temperature",
|
|
263
398
|
max_tokens: "maxOutputTokens",
|
|
@@ -276,6 +411,7 @@ var PROVIDER_PARAMS = {
|
|
|
276
411
|
openai: {
|
|
277
412
|
temperature: "temperature",
|
|
278
413
|
max_tokens: "max_tokens",
|
|
414
|
+
max_completion_tokens: "max_completion_tokens",
|
|
279
415
|
top_p: "top_p",
|
|
280
416
|
frequency_penalty: "frequency_penalty",
|
|
281
417
|
presence_penalty: "presence_penalty",
|
|
@@ -352,6 +488,7 @@ var PROVIDER_PARAMS = {
|
|
|
352
488
|
// OpenAI-compatible API with extra routing params
|
|
353
489
|
temperature: "temperature",
|
|
354
490
|
max_tokens: "max_tokens",
|
|
491
|
+
max_completion_tokens: "max_completion_tokens",
|
|
355
492
|
top_p: "top_p",
|
|
356
493
|
top_k: "top_k",
|
|
357
494
|
frequency_penalty: "frequency_penalty",
|
|
@@ -360,12 +497,14 @@ var PROVIDER_PARAMS = {
|
|
|
360
497
|
n: "n",
|
|
361
498
|
seed: "seed",
|
|
362
499
|
stream: "stream",
|
|
363
|
-
effort: "reasoning_effort"
|
|
500
|
+
effort: "reasoning_effort",
|
|
501
|
+
...OPENROUTER_ROUTING_PARAMS
|
|
364
502
|
},
|
|
365
503
|
vercel: {
|
|
366
504
|
// OpenAI-compatible gateway
|
|
367
505
|
temperature: "temperature",
|
|
368
506
|
max_tokens: "max_tokens",
|
|
507
|
+
max_completion_tokens: "max_completion_tokens",
|
|
369
508
|
top_p: "top_p",
|
|
370
509
|
top_k: "top_k",
|
|
371
510
|
frequency_penalty: "frequency_penalty",
|
|
@@ -378,7 +517,7 @@ var PROVIDER_PARAMS = {
|
|
|
378
517
|
},
|
|
379
518
|
xai: OPENAI_COMPATIBLE_PARAMS,
|
|
380
519
|
groq: OPENAI_COMPATIBLE_PARAMS,
|
|
381
|
-
fal:
|
|
520
|
+
fal: FAL_PARAMS,
|
|
382
521
|
deepinfra: OPENAI_COMPATIBLE_PARAMS,
|
|
383
522
|
"black-forest-labs": {},
|
|
384
523
|
together: OPENAI_COMPATIBLE_PARAMS,
|
|
@@ -388,9 +527,9 @@ var PROVIDER_PARAMS = {
|
|
|
388
527
|
perplexity: OPENAI_COMPATIBLE_PARAMS,
|
|
389
528
|
alibaba: OPENAI_COMPATIBLE_PARAMS,
|
|
390
529
|
cerebras: OPENAI_COMPATIBLE_PARAMS,
|
|
391
|
-
replicate:
|
|
392
|
-
prodia:
|
|
393
|
-
luma:
|
|
530
|
+
replicate: REPLICATE_PARAMS,
|
|
531
|
+
prodia: PRODIA_PARAMS,
|
|
532
|
+
luma: LUMA_PARAMS,
|
|
394
533
|
bytedance: {},
|
|
395
534
|
kling: {},
|
|
396
535
|
elevenlabs: {},
|
|
@@ -403,6 +542,15 @@ var PROVIDER_PARAMS = {
|
|
|
403
542
|
baseten: OPENAI_COMPATIBLE_PARAMS,
|
|
404
543
|
huggingface: OPENAI_COMPATIBLE_PARAMS
|
|
405
544
|
};
|
|
545
|
+
var REASONING_EFFORT_VALUES = [
|
|
546
|
+
"none",
|
|
547
|
+
"minimal",
|
|
548
|
+
"low",
|
|
549
|
+
"medium",
|
|
550
|
+
"high",
|
|
551
|
+
"xhigh",
|
|
552
|
+
"max"
|
|
553
|
+
];
|
|
406
554
|
var OPENAI_COMPATIBLE_PARAM_SPECS = {
|
|
407
555
|
temperature: {
|
|
408
556
|
type: "number",
|
|
@@ -417,6 +565,12 @@ var OPENAI_COMPATIBLE_PARAM_SPECS = {
|
|
|
417
565
|
default: 4096,
|
|
418
566
|
description: "Maximum output tokens"
|
|
419
567
|
},
|
|
568
|
+
max_completion_tokens: {
|
|
569
|
+
type: "number",
|
|
570
|
+
min: 1,
|
|
571
|
+
default: 4096,
|
|
572
|
+
description: "Maximum completion tokens (reasoning models)"
|
|
573
|
+
},
|
|
420
574
|
top_p: {
|
|
421
575
|
type: "number",
|
|
422
576
|
min: 0,
|
|
@@ -450,11 +604,221 @@ var OPENAI_COMPATIBLE_PARAM_SPECS = {
|
|
|
450
604
|
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
451
605
|
reasoning_effort: {
|
|
452
606
|
type: "string",
|
|
453
|
-
values:
|
|
607
|
+
values: REASONING_EFFORT_VALUES,
|
|
454
608
|
default: "medium",
|
|
455
609
|
description: "Reasoning effort"
|
|
456
610
|
}
|
|
457
611
|
};
|
|
612
|
+
var OPENROUTER_ROUTING_PARAM_SPECS = {
|
|
613
|
+
provider: { type: "string", description: "Provider routing preferences" },
|
|
614
|
+
order: { type: "string", description: "Provider order" },
|
|
615
|
+
"provider.order": { type: "string", description: "Provider order" },
|
|
616
|
+
only: { type: "string", description: "Provider allowlist" },
|
|
617
|
+
"provider.only": { type: "string", description: "Provider allowlist" },
|
|
618
|
+
ignore: { type: "string", description: "Provider blocklist" },
|
|
619
|
+
"provider.ignore": { type: "string", description: "Provider blocklist" },
|
|
620
|
+
allow_fallbacks: {
|
|
621
|
+
type: "boolean",
|
|
622
|
+
default: true,
|
|
623
|
+
description: "Allow fallback providers"
|
|
624
|
+
},
|
|
625
|
+
"provider.allow_fallbacks": {
|
|
626
|
+
type: "boolean",
|
|
627
|
+
default: true,
|
|
628
|
+
description: "Allow fallback providers"
|
|
629
|
+
},
|
|
630
|
+
require_parameters: {
|
|
631
|
+
type: "boolean",
|
|
632
|
+
default: false,
|
|
633
|
+
description: "Only route to providers that support all request params"
|
|
634
|
+
},
|
|
635
|
+
"provider.require_parameters": {
|
|
636
|
+
type: "boolean",
|
|
637
|
+
default: false,
|
|
638
|
+
description: "Only route to providers that support all request params"
|
|
639
|
+
},
|
|
640
|
+
data_collection: {
|
|
641
|
+
type: "string",
|
|
642
|
+
values: ["allow", "deny"],
|
|
643
|
+
default: "allow",
|
|
644
|
+
description: "Provider data collection policy"
|
|
645
|
+
},
|
|
646
|
+
"provider.data_collection": {
|
|
647
|
+
type: "string",
|
|
648
|
+
values: ["allow", "deny"],
|
|
649
|
+
default: "allow",
|
|
650
|
+
description: "Provider data collection policy"
|
|
651
|
+
},
|
|
652
|
+
zdr: {
|
|
653
|
+
type: "boolean",
|
|
654
|
+
description: "Require zero data retention providers"
|
|
655
|
+
},
|
|
656
|
+
"provider.zdr": {
|
|
657
|
+
type: "boolean",
|
|
658
|
+
description: "Require zero data retention providers"
|
|
659
|
+
},
|
|
660
|
+
enforce_distillable_text: {
|
|
661
|
+
type: "boolean",
|
|
662
|
+
description: "Require providers that allow text distillation"
|
|
663
|
+
},
|
|
664
|
+
"provider.enforce_distillable_text": {
|
|
665
|
+
type: "boolean",
|
|
666
|
+
description: "Require providers that allow text distillation"
|
|
667
|
+
},
|
|
668
|
+
quantizations: {
|
|
669
|
+
type: "string",
|
|
670
|
+
description: "Allowed provider quantization levels"
|
|
671
|
+
},
|
|
672
|
+
"provider.quantizations": {
|
|
673
|
+
type: "string",
|
|
674
|
+
description: "Allowed provider quantization levels"
|
|
675
|
+
},
|
|
676
|
+
sort: {
|
|
677
|
+
type: "string",
|
|
678
|
+
values: ["price", "throughput", "latency", "cost", "ttft", "tps"],
|
|
679
|
+
description: "Provider sort strategy"
|
|
680
|
+
},
|
|
681
|
+
"provider.sort": {
|
|
682
|
+
type: "string",
|
|
683
|
+
values: ["price", "throughput", "latency", "cost", "ttft", "tps"],
|
|
684
|
+
description: "Provider sort strategy"
|
|
685
|
+
},
|
|
686
|
+
preferred_min_throughput: {
|
|
687
|
+
type: "number",
|
|
688
|
+
min: 0,
|
|
689
|
+
description: "Preferred minimum provider throughput"
|
|
690
|
+
},
|
|
691
|
+
"provider.preferred_min_throughput": {
|
|
692
|
+
type: "number",
|
|
693
|
+
min: 0,
|
|
694
|
+
description: "Preferred minimum provider throughput"
|
|
695
|
+
},
|
|
696
|
+
preferred_max_latency: {
|
|
697
|
+
type: "number",
|
|
698
|
+
min: 0,
|
|
699
|
+
description: "Preferred maximum provider latency"
|
|
700
|
+
},
|
|
701
|
+
"provider.preferred_max_latency": {
|
|
702
|
+
type: "number",
|
|
703
|
+
min: 0,
|
|
704
|
+
description: "Preferred maximum provider latency"
|
|
705
|
+
},
|
|
706
|
+
max_price: {
|
|
707
|
+
type: "string",
|
|
708
|
+
description: "Maximum provider price filter"
|
|
709
|
+
},
|
|
710
|
+
"provider.max_price": {
|
|
711
|
+
type: "string",
|
|
712
|
+
description: "Maximum provider price filter"
|
|
713
|
+
},
|
|
714
|
+
transforms: {
|
|
715
|
+
type: "string",
|
|
716
|
+
description: "Legacy OpenRouter message transforms"
|
|
717
|
+
},
|
|
718
|
+
plugins: {
|
|
719
|
+
type: "string",
|
|
720
|
+
description: "OpenRouter request plugins"
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
var FAL_PARAM_SPECS = {
|
|
724
|
+
prompt: { type: "string", description: "Prompt" },
|
|
725
|
+
negative_prompt: { type: "string", description: "Negative prompt" },
|
|
726
|
+
seed: { type: "number", description: "Random seed" },
|
|
727
|
+
num_images: {
|
|
728
|
+
type: "number",
|
|
729
|
+
min: 1,
|
|
730
|
+
description: "Number of images to generate"
|
|
731
|
+
},
|
|
732
|
+
image_size: { type: "string", description: "Output image size" },
|
|
733
|
+
aspect_ratio: { type: "string", description: "Output aspect ratio" },
|
|
734
|
+
enable_safety_checker: {
|
|
735
|
+
type: "boolean",
|
|
736
|
+
description: "Enable safety checker"
|
|
737
|
+
},
|
|
738
|
+
enable_safety_checks: {
|
|
739
|
+
type: "boolean",
|
|
740
|
+
description: "Enable safety checker"
|
|
741
|
+
},
|
|
742
|
+
enable_prompt_expansion: {
|
|
743
|
+
type: "boolean",
|
|
744
|
+
description: "Enable prompt expansion"
|
|
745
|
+
},
|
|
746
|
+
expand_prompt: {
|
|
747
|
+
type: "boolean",
|
|
748
|
+
description: "Enable prompt expansion"
|
|
749
|
+
},
|
|
750
|
+
output_format: {
|
|
751
|
+
type: "string",
|
|
752
|
+
values: ["jpeg", "jpg", "png", "webp", "gif"],
|
|
753
|
+
description: "Output image format"
|
|
754
|
+
},
|
|
755
|
+
width: { type: "number", min: 1, description: "Image width" },
|
|
756
|
+
height: { type: "number", min: 1, description: "Image height" }
|
|
757
|
+
};
|
|
758
|
+
var REPLICATE_PARAM_SPECS = {
|
|
759
|
+
prompt: { type: "string", description: "Prompt" },
|
|
760
|
+
negative_prompt: { type: "string", description: "Negative prompt" },
|
|
761
|
+
input: { type: "string", description: "Model input object" },
|
|
762
|
+
version: { type: "string", description: "Model version" },
|
|
763
|
+
seed: { type: "number", description: "Random seed" },
|
|
764
|
+
num_outputs: {
|
|
765
|
+
type: "number",
|
|
766
|
+
min: 1,
|
|
767
|
+
description: "Number of outputs to generate"
|
|
768
|
+
},
|
|
769
|
+
num_inference_steps: {
|
|
770
|
+
type: "number",
|
|
771
|
+
min: 1,
|
|
772
|
+
description: "Number of inference steps"
|
|
773
|
+
},
|
|
774
|
+
guidance_scale: {
|
|
775
|
+
type: "number",
|
|
776
|
+
min: 0,
|
|
777
|
+
description: "Guidance scale"
|
|
778
|
+
},
|
|
779
|
+
image_size: { type: "string", description: "Output image size" },
|
|
780
|
+
aspect_ratio: { type: "string", description: "Output aspect ratio" },
|
|
781
|
+
output_format: { type: "string", description: "Output format" },
|
|
782
|
+
width: { type: "number", min: 1, description: "Image width" },
|
|
783
|
+
height: { type: "number", min: 1, description: "Image height" },
|
|
784
|
+
stream: { type: "boolean", description: "Request streaming output" },
|
|
785
|
+
webhook: { type: "string", description: "Webhook URL" },
|
|
786
|
+
webhook_events_filter: {
|
|
787
|
+
type: "string",
|
|
788
|
+
description: "Webhook events filter"
|
|
789
|
+
}
|
|
790
|
+
};
|
|
791
|
+
var PRODIA_PARAM_SPECS = {
|
|
792
|
+
model: { type: "string", description: "Model name" },
|
|
793
|
+
prompt: { type: "string", description: "Prompt" },
|
|
794
|
+
negative_prompt: { type: "string", description: "Negative prompt" },
|
|
795
|
+
style_preset: { type: "string", description: "Style preset" },
|
|
796
|
+
steps: { type: "number", min: 1, description: "Generation steps" },
|
|
797
|
+
cfg_scale: { type: "number", min: 0, description: "CFG scale" },
|
|
798
|
+
seed: { type: "number", description: "Random seed" },
|
|
799
|
+
upscale: { type: "boolean", description: "Enable 2x upscale" },
|
|
800
|
+
sampler: { type: "string", description: "Sampler" },
|
|
801
|
+
width: { type: "number", min: 1, max: 1024, description: "Image width" },
|
|
802
|
+
height: { type: "number", min: 1, max: 1024, description: "Image height" },
|
|
803
|
+
image_size: { type: "string", description: "Output image size" },
|
|
804
|
+
aspect_ratio: { type: "string", description: "Output aspect ratio" },
|
|
805
|
+
output_format: { type: "string", description: "Output format" },
|
|
806
|
+
type: { type: "string", description: "Prodia v2 job type" },
|
|
807
|
+
config: { type: "string", description: "Prodia v2 job config" },
|
|
808
|
+
price: { type: "boolean", description: "Include Prodia v2 job price" }
|
|
809
|
+
};
|
|
810
|
+
var LUMA_PARAM_SPECS = {
|
|
811
|
+
prompt: { type: "string", description: "Prompt" },
|
|
812
|
+
model: { type: "string", description: "Model name" },
|
|
813
|
+
aspect_ratio: { type: "string", description: "Output aspect ratio" },
|
|
814
|
+
keyframes: { type: "string", description: "Generation keyframes" },
|
|
815
|
+
loop: { type: "boolean", description: "Generate a looping video" },
|
|
816
|
+
duration: { type: "string", description: "Generation duration" },
|
|
817
|
+
type: { type: "string", description: "Generation type" },
|
|
818
|
+
image_ref: { type: "string", description: "Image reference" },
|
|
819
|
+
video: { type: "string", description: "Video options" },
|
|
820
|
+
source: { type: "string", description: "Source generation or media" }
|
|
821
|
+
};
|
|
458
822
|
var GOOGLE_COMPATIBLE_PARAM_SPECS = {
|
|
459
823
|
temperature: {
|
|
460
824
|
type: "number",
|
|
@@ -523,6 +887,12 @@ var PARAM_SPECS = {
|
|
|
523
887
|
default: 4096,
|
|
524
888
|
description: "Maximum output tokens"
|
|
525
889
|
},
|
|
890
|
+
max_completion_tokens: {
|
|
891
|
+
type: "number",
|
|
892
|
+
min: 1,
|
|
893
|
+
default: 4096,
|
|
894
|
+
description: "Maximum completion tokens (reasoning models)"
|
|
895
|
+
},
|
|
526
896
|
top_p: {
|
|
527
897
|
type: "number",
|
|
528
898
|
min: 0,
|
|
@@ -550,7 +920,7 @@ var PARAM_SPECS = {
|
|
|
550
920
|
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
551
921
|
reasoning_effort: {
|
|
552
922
|
type: "string",
|
|
553
|
-
values:
|
|
923
|
+
values: REASONING_EFFORT_VALUES,
|
|
554
924
|
default: "medium",
|
|
555
925
|
description: "Reasoning effort"
|
|
556
926
|
}
|
|
@@ -587,8 +957,8 @@ var PARAM_SPECS = {
|
|
|
587
957
|
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
588
958
|
effort: {
|
|
589
959
|
type: "string",
|
|
590
|
-
values:
|
|
591
|
-
default: "
|
|
960
|
+
values: REASONING_EFFORT_VALUES,
|
|
961
|
+
default: "low",
|
|
592
962
|
description: "Thinking effort"
|
|
593
963
|
},
|
|
594
964
|
cache_control: {
|
|
@@ -813,6 +1183,12 @@ var PARAM_SPECS = {
|
|
|
813
1183
|
default: 4096,
|
|
814
1184
|
description: "Maximum output tokens"
|
|
815
1185
|
},
|
|
1186
|
+
max_completion_tokens: {
|
|
1187
|
+
type: "number",
|
|
1188
|
+
min: 1,
|
|
1189
|
+
default: 4096,
|
|
1190
|
+
description: "Maximum completion tokens (reasoning models)"
|
|
1191
|
+
},
|
|
816
1192
|
top_p: {
|
|
817
1193
|
type: "number",
|
|
818
1194
|
min: 0,
|
|
@@ -846,10 +1222,11 @@ var PARAM_SPECS = {
|
|
|
846
1222
|
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
847
1223
|
reasoning_effort: {
|
|
848
1224
|
type: "string",
|
|
849
|
-
values:
|
|
1225
|
+
values: REASONING_EFFORT_VALUES,
|
|
850
1226
|
default: "medium",
|
|
851
1227
|
description: "Reasoning effort"
|
|
852
|
-
}
|
|
1228
|
+
},
|
|
1229
|
+
...OPENROUTER_ROUTING_PARAM_SPECS
|
|
853
1230
|
},
|
|
854
1231
|
vercel: {
|
|
855
1232
|
// Loose validation — proxies to many providers with varying ranges
|
|
@@ -866,6 +1243,12 @@ var PARAM_SPECS = {
|
|
|
866
1243
|
default: 4096,
|
|
867
1244
|
description: "Maximum output tokens"
|
|
868
1245
|
},
|
|
1246
|
+
max_completion_tokens: {
|
|
1247
|
+
type: "number",
|
|
1248
|
+
min: 1,
|
|
1249
|
+
default: 4096,
|
|
1250
|
+
description: "Maximum completion tokens (reasoning models)"
|
|
1251
|
+
},
|
|
869
1252
|
top_p: {
|
|
870
1253
|
type: "number",
|
|
871
1254
|
min: 0,
|
|
@@ -899,14 +1282,70 @@ var PARAM_SPECS = {
|
|
|
899
1282
|
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
900
1283
|
reasoning_effort: {
|
|
901
1284
|
type: "string",
|
|
902
|
-
values:
|
|
1285
|
+
values: REASONING_EFFORT_VALUES,
|
|
903
1286
|
default: "medium",
|
|
904
1287
|
description: "Reasoning effort"
|
|
1288
|
+
},
|
|
1289
|
+
order: { type: "string", description: "Gateway provider order" },
|
|
1290
|
+
only: { type: "string", description: "Gateway provider allowlist" },
|
|
1291
|
+
models: { type: "string", description: "Gateway fallback models" },
|
|
1292
|
+
tags: { type: "string", description: "Gateway usage tags" },
|
|
1293
|
+
sort: {
|
|
1294
|
+
type: "string",
|
|
1295
|
+
values: ["cost", "ttft", "tps"],
|
|
1296
|
+
description: "Gateway provider sort strategy"
|
|
1297
|
+
},
|
|
1298
|
+
caching: {
|
|
1299
|
+
type: "string",
|
|
1300
|
+
values: ["auto"],
|
|
1301
|
+
description: "Gateway automatic caching strategy"
|
|
1302
|
+
},
|
|
1303
|
+
user: { type: "string", description: "Gateway usage user identifier" },
|
|
1304
|
+
byok: { type: "string", description: "Gateway BYOK credentials" },
|
|
1305
|
+
zero_data_retention: {
|
|
1306
|
+
type: "boolean",
|
|
1307
|
+
description: "Gateway zero data retention routing"
|
|
1308
|
+
},
|
|
1309
|
+
zeroDataRetention: {
|
|
1310
|
+
type: "boolean",
|
|
1311
|
+
description: "Gateway zero data retention routing"
|
|
1312
|
+
},
|
|
1313
|
+
disallow_prompt_training: {
|
|
1314
|
+
type: "boolean",
|
|
1315
|
+
description: "Gateway prompt training opt-out routing"
|
|
1316
|
+
},
|
|
1317
|
+
disallowPromptTraining: {
|
|
1318
|
+
type: "boolean",
|
|
1319
|
+
description: "Gateway prompt training opt-out routing"
|
|
1320
|
+
},
|
|
1321
|
+
hipaa_compliant: {
|
|
1322
|
+
type: "boolean",
|
|
1323
|
+
description: "Gateway HIPAA-compliant routing"
|
|
1324
|
+
},
|
|
1325
|
+
hipaaCompliant: {
|
|
1326
|
+
type: "boolean",
|
|
1327
|
+
description: "Gateway HIPAA-compliant routing"
|
|
1328
|
+
},
|
|
1329
|
+
quota_entity_id: {
|
|
1330
|
+
type: "string",
|
|
1331
|
+
description: "Gateway quota entity identifier"
|
|
1332
|
+
},
|
|
1333
|
+
quotaEntityId: {
|
|
1334
|
+
type: "string",
|
|
1335
|
+
description: "Gateway quota entity identifier"
|
|
1336
|
+
},
|
|
1337
|
+
provider_timeouts: {
|
|
1338
|
+
type: "string",
|
|
1339
|
+
description: "Gateway provider timeouts"
|
|
1340
|
+
},
|
|
1341
|
+
providerTimeouts: {
|
|
1342
|
+
type: "string",
|
|
1343
|
+
description: "Gateway provider timeouts"
|
|
905
1344
|
}
|
|
906
1345
|
},
|
|
907
1346
|
xai: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
908
1347
|
groq: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
909
|
-
fal:
|
|
1348
|
+
fal: FAL_PARAM_SPECS,
|
|
910
1349
|
deepinfra: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
911
1350
|
"black-forest-labs": {},
|
|
912
1351
|
together: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
@@ -916,9 +1355,9 @@ var PARAM_SPECS = {
|
|
|
916
1355
|
perplexity: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
917
1356
|
alibaba: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
918
1357
|
cerebras: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
919
|
-
replicate:
|
|
920
|
-
prodia:
|
|
921
|
-
luma:
|
|
1358
|
+
replicate: REPLICATE_PARAM_SPECS,
|
|
1359
|
+
prodia: PRODIA_PARAM_SPECS,
|
|
1360
|
+
luma: LUMA_PARAM_SPECS,
|
|
922
1361
|
bytedance: {},
|
|
923
1362
|
kling: {},
|
|
924
1363
|
elevenlabs: {},
|
|
@@ -932,11 +1371,13 @@ var PARAM_SPECS = {
|
|
|
932
1371
|
huggingface: OPENAI_COMPATIBLE_PARAM_SPECS
|
|
933
1372
|
};
|
|
934
1373
|
function isReasoningModel(model) {
|
|
935
|
-
const name =
|
|
936
|
-
|
|
1374
|
+
const name = modelLeafName(model);
|
|
1375
|
+
const oSeries = name.match(/^o\d+/)?.[0];
|
|
1376
|
+
const gptSeries = name.match(/^gpt-[5-9]/)?.[0];
|
|
1377
|
+
return (oSeries ? modelMatchesFamily(name, oSeries) : false) || (gptSeries ? modelMatchesFamily(name, gptSeries) : false);
|
|
937
1378
|
}
|
|
938
1379
|
function canHostOpenAIModels(provider) {
|
|
939
|
-
return provider === "openai" || provider === "openrouter" || provider === "vercel";
|
|
1380
|
+
return provider === "openai" || provider === "azure" || provider === "openrouter" || provider === "vercel";
|
|
940
1381
|
}
|
|
941
1382
|
function isGatewayProvider(provider) {
|
|
942
1383
|
return provider === "openrouter" || provider === "vercel";
|
|
@@ -944,29 +1385,27 @@ function isGatewayProvider(provider) {
|
|
|
944
1385
|
function detectGatewaySubProvider(model) {
|
|
945
1386
|
const slash = model.indexOf("/");
|
|
946
1387
|
if (slash < 1) return void 0;
|
|
947
|
-
const prefix = model.slice(0, slash);
|
|
948
|
-
const direct =
|
|
949
|
-
"openai",
|
|
950
|
-
"anthropic",
|
|
951
|
-
"google",
|
|
952
|
-
"
|
|
953
|
-
"
|
|
954
|
-
|
|
955
|
-
|
|
1388
|
+
const prefix = normalizeModelForMatching(model.slice(0, slash));
|
|
1389
|
+
const direct = {
|
|
1390
|
+
openai: "openai",
|
|
1391
|
+
anthropic: "anthropic",
|
|
1392
|
+
google: "google",
|
|
1393
|
+
vertex: "google",
|
|
1394
|
+
"google-vertex": "google",
|
|
1395
|
+
mistral: "mistral",
|
|
1396
|
+
cohere: "cohere"
|
|
1397
|
+
};
|
|
1398
|
+
return direct[prefix];
|
|
956
1399
|
}
|
|
957
1400
|
var REASONING_MODEL_UNSUPPORTED = /* @__PURE__ */ new Set([
|
|
958
1401
|
"temperature",
|
|
959
1402
|
"top_p",
|
|
1403
|
+
"top_k",
|
|
960
1404
|
"frequency_penalty",
|
|
961
1405
|
"presence_penalty",
|
|
962
1406
|
"n"
|
|
963
1407
|
]);
|
|
964
1408
|
function detectBedrockModelFamily(model) {
|
|
965
|
-
const parts = model.split(".");
|
|
966
|
-
let prefix = parts[0];
|
|
967
|
-
if (["us", "eu", "apac", "global"].includes(prefix) && parts.length > 1) {
|
|
968
|
-
prefix = parts[1];
|
|
969
|
-
}
|
|
970
1409
|
const families = [
|
|
971
1410
|
"anthropic",
|
|
972
1411
|
"meta",
|
|
@@ -975,12 +1414,18 @@ function detectBedrockModelFamily(model) {
|
|
|
975
1414
|
"cohere",
|
|
976
1415
|
"ai21"
|
|
977
1416
|
];
|
|
978
|
-
|
|
1417
|
+
const parts = modelLeafName(model).split(".");
|
|
1418
|
+
return families.find((family) => parts.includes(family));
|
|
979
1419
|
}
|
|
980
1420
|
function bedrockSupportsCaching(model) {
|
|
981
1421
|
const family = detectBedrockModelFamily(model);
|
|
982
1422
|
if (family === "anthropic") return true;
|
|
983
|
-
if (family === "amazon"
|
|
1423
|
+
if (family === "amazon") {
|
|
1424
|
+
const parts = modelLeafName(model).split(".");
|
|
1425
|
+
const amazonIndex = parts.indexOf("amazon");
|
|
1426
|
+
const modelName = amazonIndex >= 0 ? parts[amazonIndex + 1] : void 0;
|
|
1427
|
+
return modelName ? modelMatchesFamily(modelName, "nova") : false;
|
|
1428
|
+
}
|
|
984
1429
|
return false;
|
|
985
1430
|
}
|
|
986
1431
|
var CACHE_VALUES = {
|
|
@@ -1065,7 +1510,6 @@ var CACHE_TTLS = {
|
|
|
1065
1510
|
baseten: void 0,
|
|
1066
1511
|
huggingface: void 0
|
|
1067
1512
|
};
|
|
1068
|
-
var DURATION_RE = /^\d+[mh]$/;
|
|
1069
1513
|
|
|
1070
1514
|
// src/provider-meta.ts
|
|
1071
1515
|
var PROVIDER_META = [
|
|
@@ -1221,635 +1665,36 @@ var PROVIDER_META = [
|
|
|
1221
1665
|
color: "#ffcc4d"
|
|
1222
1666
|
}
|
|
1223
1667
|
];
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
"
|
|
1228
|
-
"
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
google: [
|
|
1244
|
-
"gemini-3-pro-preview",
|
|
1245
|
-
"gemini-3-flash-preview",
|
|
1246
|
-
"gemini-2.5-pro",
|
|
1247
|
-
"gemini-2.5-flash"
|
|
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
|
-
],
|
|
1255
|
-
mistral: [
|
|
1256
|
-
"mistral-large-latest",
|
|
1257
|
-
"mistral-medium-latest",
|
|
1258
|
-
"mistral-small-latest",
|
|
1259
|
-
"codestral-latest",
|
|
1260
|
-
"magistral-medium-latest"
|
|
1261
|
-
],
|
|
1262
|
-
cohere: [
|
|
1263
|
-
"command-a-03-2025",
|
|
1264
|
-
"command-r-plus-08-2024",
|
|
1265
|
-
"command-r-08-2024",
|
|
1266
|
-
"command-r7b-12-2024"
|
|
1267
|
-
],
|
|
1268
|
-
bedrock: [
|
|
1269
|
-
"anthropic.claude-opus-4-6-v1",
|
|
1270
|
-
"anthropic.claude-sonnet-4-6-v1",
|
|
1271
|
-
"anthropic.claude-haiku-4-5-v1",
|
|
1272
|
-
"amazon.nova-pro-v1",
|
|
1273
|
-
"amazon.nova-lite-v1",
|
|
1274
|
-
"meta.llama3-70b-instruct-v1:0"
|
|
1275
|
-
],
|
|
1276
|
-
openrouter: [
|
|
1277
|
-
"openai/gpt-5.2",
|
|
1278
|
-
"anthropic/claude-opus-4-6",
|
|
1279
|
-
"google/gemini-2.5-pro",
|
|
1280
|
-
"mistral/mistral-large-latest"
|
|
1281
|
-
],
|
|
1282
|
-
vercel: [
|
|
1283
|
-
"openai/gpt-5.2",
|
|
1284
|
-
"anthropic/claude-opus-4-6",
|
|
1285
|
-
"google/gemini-2.5-pro",
|
|
1286
|
-
"google/gemini-3-pro-preview",
|
|
1287
|
-
"google/gemini-3-flash-preview",
|
|
1288
|
-
"mistral/mistral-large-latest",
|
|
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"
|
|
1331
|
-
]
|
|
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"
|
|
1668
|
+
function toCanonicalParamSpec(spec) {
|
|
1669
|
+
return {
|
|
1670
|
+
...spec,
|
|
1671
|
+
type: spec.values ? "enum" : spec.type,
|
|
1672
|
+
default: spec.default ?? (spec.type === "string" && !spec.values ? "" : void 0)
|
|
1673
|
+
};
|
|
1674
|
+
}
|
|
1675
|
+
function deriveCanonicalParamSpecs() {
|
|
1676
|
+
const specs = {};
|
|
1677
|
+
for (const provider of Object.keys(PROVIDER_PARAMS)) {
|
|
1678
|
+
specs[provider] = {};
|
|
1679
|
+
for (const [canonicalName, providerName] of Object.entries(
|
|
1680
|
+
PROVIDER_PARAMS[provider]
|
|
1681
|
+
)) {
|
|
1682
|
+
const spec = PARAM_SPECS[provider][providerName];
|
|
1683
|
+
if (spec) {
|
|
1684
|
+
specs[provider][canonicalName] = toCanonicalParamSpec(spec);
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1383
1687
|
}
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
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
|
-
};
|
|
1431
|
-
var CANONICAL_PARAM_SPECS = {
|
|
1432
|
-
openai: {
|
|
1433
|
-
temperature: {
|
|
1434
|
-
type: "number",
|
|
1435
|
-
min: 0,
|
|
1436
|
-
max: 2,
|
|
1437
|
-
default: 0.7,
|
|
1438
|
-
description: "Controls randomness"
|
|
1439
|
-
},
|
|
1440
|
-
max_tokens: {
|
|
1441
|
-
type: "number",
|
|
1442
|
-
min: 1,
|
|
1443
|
-
default: 4096,
|
|
1444
|
-
description: "Maximum output tokens"
|
|
1445
|
-
},
|
|
1446
|
-
top_p: {
|
|
1447
|
-
type: "number",
|
|
1448
|
-
min: 0,
|
|
1449
|
-
max: 1,
|
|
1450
|
-
default: 1,
|
|
1451
|
-
description: "Nucleus sampling"
|
|
1452
|
-
},
|
|
1453
|
-
frequency_penalty: {
|
|
1454
|
-
type: "number",
|
|
1455
|
-
min: -2,
|
|
1456
|
-
max: 2,
|
|
1457
|
-
default: 0,
|
|
1458
|
-
description: "Penalize frequent tokens"
|
|
1459
|
-
},
|
|
1460
|
-
presence_penalty: {
|
|
1461
|
-
type: "number",
|
|
1462
|
-
min: -2,
|
|
1463
|
-
max: 2,
|
|
1464
|
-
default: 0,
|
|
1465
|
-
description: "Penalize repeated topics"
|
|
1466
|
-
},
|
|
1467
|
-
stop: { type: "string", default: "", description: "Stop sequences" },
|
|
1468
|
-
n: { type: "number", min: 1, default: 1, description: "Completions count" },
|
|
1469
|
-
seed: { type: "number", default: "", description: "Random seed" },
|
|
1470
|
-
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
1471
|
-
effort: {
|
|
1472
|
-
type: "enum",
|
|
1473
|
-
values: ["none", "minimal", "low", "medium", "high", "xhigh"],
|
|
1474
|
-
default: "medium",
|
|
1475
|
-
description: "Reasoning effort"
|
|
1476
|
-
}
|
|
1477
|
-
},
|
|
1478
|
-
azure: OPENAI_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
1479
|
-
anthropic: {
|
|
1480
|
-
temperature: {
|
|
1481
|
-
type: "number",
|
|
1482
|
-
min: 0,
|
|
1483
|
-
max: 1,
|
|
1484
|
-
default: 0.7,
|
|
1485
|
-
description: "Controls randomness"
|
|
1486
|
-
},
|
|
1487
|
-
max_tokens: {
|
|
1488
|
-
type: "number",
|
|
1489
|
-
min: 1,
|
|
1490
|
-
default: 4096,
|
|
1491
|
-
description: "Maximum output tokens"
|
|
1492
|
-
},
|
|
1493
|
-
top_p: {
|
|
1494
|
-
type: "number",
|
|
1495
|
-
min: 0,
|
|
1496
|
-
max: 1,
|
|
1497
|
-
default: 1,
|
|
1498
|
-
description: "Nucleus sampling"
|
|
1499
|
-
},
|
|
1500
|
-
top_k: {
|
|
1501
|
-
type: "number",
|
|
1502
|
-
min: 0,
|
|
1503
|
-
default: 40,
|
|
1504
|
-
description: "Top-K sampling"
|
|
1505
|
-
},
|
|
1506
|
-
stop: { type: "string", default: "", description: "Stop sequences" },
|
|
1507
|
-
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
1508
|
-
effort: {
|
|
1509
|
-
type: "enum",
|
|
1510
|
-
values: ["low", "medium", "high", "max"],
|
|
1511
|
-
default: "medium",
|
|
1512
|
-
description: "Thinking effort"
|
|
1513
|
-
},
|
|
1514
|
-
cache: {
|
|
1515
|
-
type: "enum",
|
|
1516
|
-
values: ["ephemeral"],
|
|
1517
|
-
default: "ephemeral",
|
|
1518
|
-
description: "Cache control"
|
|
1519
|
-
},
|
|
1520
|
-
cache_ttl: {
|
|
1521
|
-
type: "enum",
|
|
1522
|
-
values: ["5m", "1h"],
|
|
1523
|
-
default: "5m",
|
|
1524
|
-
description: "Cache TTL"
|
|
1525
|
-
}
|
|
1526
|
-
},
|
|
1527
|
-
google: {
|
|
1528
|
-
temperature: {
|
|
1529
|
-
type: "number",
|
|
1530
|
-
min: 0,
|
|
1531
|
-
max: 2,
|
|
1532
|
-
default: 0.7,
|
|
1533
|
-
description: "Controls randomness"
|
|
1534
|
-
},
|
|
1535
|
-
max_tokens: {
|
|
1536
|
-
type: "number",
|
|
1537
|
-
min: 1,
|
|
1538
|
-
default: 4096,
|
|
1539
|
-
description: "Maximum output tokens"
|
|
1540
|
-
},
|
|
1541
|
-
top_p: {
|
|
1542
|
-
type: "number",
|
|
1543
|
-
min: 0,
|
|
1544
|
-
max: 1,
|
|
1545
|
-
default: 1,
|
|
1546
|
-
description: "Nucleus sampling"
|
|
1547
|
-
},
|
|
1548
|
-
top_k: {
|
|
1549
|
-
type: "number",
|
|
1550
|
-
min: 0,
|
|
1551
|
-
default: 40,
|
|
1552
|
-
description: "Top-K sampling"
|
|
1553
|
-
},
|
|
1554
|
-
frequency_penalty: {
|
|
1555
|
-
type: "number",
|
|
1556
|
-
min: -2,
|
|
1557
|
-
max: 2,
|
|
1558
|
-
default: 0,
|
|
1559
|
-
description: "Penalize frequent tokens"
|
|
1560
|
-
},
|
|
1561
|
-
presence_penalty: {
|
|
1562
|
-
type: "number",
|
|
1563
|
-
min: -2,
|
|
1564
|
-
max: 2,
|
|
1565
|
-
default: 0,
|
|
1566
|
-
description: "Penalize repeated topics"
|
|
1567
|
-
},
|
|
1568
|
-
stop: { type: "string", default: "", description: "Stop sequences" },
|
|
1569
|
-
n: { type: "number", min: 1, default: 1, description: "Candidate count" },
|
|
1570
|
-
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
1571
|
-
seed: { type: "number", default: "", description: "Random seed" }
|
|
1572
|
-
},
|
|
1573
|
-
"google-vertex": GOOGLE_COMPATIBLE_CANONICAL_PARAM_SPECS,
|
|
1574
|
-
mistral: {
|
|
1575
|
-
temperature: {
|
|
1576
|
-
type: "number",
|
|
1577
|
-
min: 0,
|
|
1578
|
-
max: 1,
|
|
1579
|
-
default: 0.7,
|
|
1580
|
-
description: "Controls randomness"
|
|
1581
|
-
},
|
|
1582
|
-
max_tokens: {
|
|
1583
|
-
type: "number",
|
|
1584
|
-
min: 1,
|
|
1585
|
-
default: 4096,
|
|
1586
|
-
description: "Maximum output tokens"
|
|
1587
|
-
},
|
|
1588
|
-
top_p: {
|
|
1589
|
-
type: "number",
|
|
1590
|
-
min: 0,
|
|
1591
|
-
max: 1,
|
|
1592
|
-
default: 1,
|
|
1593
|
-
description: "Nucleus sampling"
|
|
1594
|
-
},
|
|
1595
|
-
frequency_penalty: {
|
|
1596
|
-
type: "number",
|
|
1597
|
-
min: -2,
|
|
1598
|
-
max: 2,
|
|
1599
|
-
default: 0,
|
|
1600
|
-
description: "Penalize frequent tokens"
|
|
1601
|
-
},
|
|
1602
|
-
presence_penalty: {
|
|
1603
|
-
type: "number",
|
|
1604
|
-
min: -2,
|
|
1605
|
-
max: 2,
|
|
1606
|
-
default: 0,
|
|
1607
|
-
description: "Penalize repeated topics"
|
|
1608
|
-
},
|
|
1609
|
-
stop: { type: "string", default: "", description: "Stop sequences" },
|
|
1610
|
-
n: { type: "number", min: 1, default: 1, description: "Completions count" },
|
|
1611
|
-
seed: { type: "number", default: "", description: "Random seed" },
|
|
1612
|
-
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
1613
|
-
safe_prompt: {
|
|
1614
|
-
type: "boolean",
|
|
1615
|
-
default: false,
|
|
1616
|
-
description: "Enable safe prompt"
|
|
1617
|
-
},
|
|
1618
|
-
min_tokens: {
|
|
1619
|
-
type: "number",
|
|
1620
|
-
min: 0,
|
|
1621
|
-
default: 0,
|
|
1622
|
-
description: "Minimum tokens"
|
|
1623
|
-
}
|
|
1624
|
-
},
|
|
1625
|
-
cohere: {
|
|
1626
|
-
temperature: {
|
|
1627
|
-
type: "number",
|
|
1628
|
-
min: 0,
|
|
1629
|
-
max: 1,
|
|
1630
|
-
default: 0.7,
|
|
1631
|
-
description: "Controls randomness"
|
|
1632
|
-
},
|
|
1633
|
-
max_tokens: {
|
|
1634
|
-
type: "number",
|
|
1635
|
-
min: 1,
|
|
1636
|
-
default: 4096,
|
|
1637
|
-
description: "Maximum output tokens"
|
|
1638
|
-
},
|
|
1639
|
-
top_p: {
|
|
1640
|
-
type: "number",
|
|
1641
|
-
min: 0,
|
|
1642
|
-
max: 1,
|
|
1643
|
-
default: 1,
|
|
1644
|
-
description: "Nucleus sampling (p)"
|
|
1645
|
-
},
|
|
1646
|
-
top_k: {
|
|
1647
|
-
type: "number",
|
|
1648
|
-
min: 0,
|
|
1649
|
-
max: 500,
|
|
1650
|
-
default: 40,
|
|
1651
|
-
description: "Top-K sampling (k)"
|
|
1652
|
-
},
|
|
1653
|
-
frequency_penalty: {
|
|
1654
|
-
type: "number",
|
|
1655
|
-
min: 0,
|
|
1656
|
-
max: 1,
|
|
1657
|
-
default: 0,
|
|
1658
|
-
description: "Penalize frequent tokens"
|
|
1659
|
-
},
|
|
1660
|
-
presence_penalty: {
|
|
1661
|
-
type: "number",
|
|
1662
|
-
min: 0,
|
|
1663
|
-
max: 1,
|
|
1664
|
-
default: 0,
|
|
1665
|
-
description: "Penalize repeated topics"
|
|
1666
|
-
},
|
|
1667
|
-
stop: { type: "string", default: "", description: "Stop sequences" },
|
|
1668
|
-
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
1669
|
-
seed: { type: "number", default: "", description: "Random seed" }
|
|
1670
|
-
},
|
|
1671
|
-
bedrock: {
|
|
1672
|
-
temperature: {
|
|
1673
|
-
type: "number",
|
|
1674
|
-
min: 0,
|
|
1675
|
-
max: 1,
|
|
1676
|
-
default: 0.7,
|
|
1677
|
-
description: "Controls randomness"
|
|
1678
|
-
},
|
|
1679
|
-
max_tokens: {
|
|
1680
|
-
type: "number",
|
|
1681
|
-
min: 1,
|
|
1682
|
-
default: 4096,
|
|
1683
|
-
description: "Maximum output tokens"
|
|
1684
|
-
},
|
|
1685
|
-
top_p: {
|
|
1686
|
-
type: "number",
|
|
1687
|
-
min: 0,
|
|
1688
|
-
max: 1,
|
|
1689
|
-
default: 1,
|
|
1690
|
-
description: "Nucleus sampling"
|
|
1691
|
-
},
|
|
1692
|
-
top_k: {
|
|
1693
|
-
type: "number",
|
|
1694
|
-
min: 0,
|
|
1695
|
-
default: 40,
|
|
1696
|
-
description: "Top-K sampling"
|
|
1697
|
-
},
|
|
1698
|
-
stop: { type: "string", default: "", description: "Stop sequences" },
|
|
1699
|
-
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
1700
|
-
cache: {
|
|
1701
|
-
type: "enum",
|
|
1702
|
-
values: ["ephemeral"],
|
|
1703
|
-
default: "ephemeral",
|
|
1704
|
-
description: "Cache control"
|
|
1705
|
-
},
|
|
1706
|
-
cache_ttl: {
|
|
1707
|
-
type: "enum",
|
|
1708
|
-
values: ["5m", "1h"],
|
|
1709
|
-
default: "5m",
|
|
1710
|
-
description: "Cache TTL"
|
|
1711
|
-
}
|
|
1712
|
-
},
|
|
1713
|
-
openrouter: {
|
|
1714
|
-
temperature: {
|
|
1715
|
-
type: "number",
|
|
1716
|
-
min: 0,
|
|
1717
|
-
max: 2,
|
|
1718
|
-
default: 0.7,
|
|
1719
|
-
description: "Controls randomness"
|
|
1720
|
-
},
|
|
1721
|
-
max_tokens: {
|
|
1722
|
-
type: "number",
|
|
1723
|
-
min: 1,
|
|
1724
|
-
default: 4096,
|
|
1725
|
-
description: "Maximum output tokens"
|
|
1726
|
-
},
|
|
1727
|
-
top_p: {
|
|
1728
|
-
type: "number",
|
|
1729
|
-
min: 0,
|
|
1730
|
-
max: 1,
|
|
1731
|
-
default: 1,
|
|
1732
|
-
description: "Nucleus sampling"
|
|
1733
|
-
},
|
|
1734
|
-
top_k: {
|
|
1735
|
-
type: "number",
|
|
1736
|
-
min: 0,
|
|
1737
|
-
default: 40,
|
|
1738
|
-
description: "Top-K sampling"
|
|
1739
|
-
},
|
|
1740
|
-
frequency_penalty: {
|
|
1741
|
-
type: "number",
|
|
1742
|
-
min: -2,
|
|
1743
|
-
max: 2,
|
|
1744
|
-
default: 0,
|
|
1745
|
-
description: "Penalize frequent tokens"
|
|
1746
|
-
},
|
|
1747
|
-
presence_penalty: {
|
|
1748
|
-
type: "number",
|
|
1749
|
-
min: -2,
|
|
1750
|
-
max: 2,
|
|
1751
|
-
default: 0,
|
|
1752
|
-
description: "Penalize repeated topics"
|
|
1753
|
-
},
|
|
1754
|
-
stop: { type: "string", default: "", description: "Stop sequences" },
|
|
1755
|
-
n: { type: "number", min: 1, default: 1, description: "Completions count" },
|
|
1756
|
-
seed: { type: "number", default: "", description: "Random seed" },
|
|
1757
|
-
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
1758
|
-
effort: {
|
|
1759
|
-
type: "enum",
|
|
1760
|
-
values: ["none", "minimal", "low", "medium", "high", "xhigh"],
|
|
1761
|
-
default: "medium",
|
|
1762
|
-
description: "Reasoning effort"
|
|
1763
|
-
}
|
|
1764
|
-
},
|
|
1765
|
-
vercel: {
|
|
1766
|
-
temperature: {
|
|
1767
|
-
type: "number",
|
|
1768
|
-
min: 0,
|
|
1769
|
-
max: 2,
|
|
1770
|
-
default: 0.7,
|
|
1771
|
-
description: "Controls randomness"
|
|
1772
|
-
},
|
|
1773
|
-
max_tokens: {
|
|
1774
|
-
type: "number",
|
|
1775
|
-
min: 1,
|
|
1776
|
-
default: 4096,
|
|
1777
|
-
description: "Maximum output tokens"
|
|
1778
|
-
},
|
|
1779
|
-
top_p: {
|
|
1780
|
-
type: "number",
|
|
1781
|
-
min: 0,
|
|
1782
|
-
max: 1,
|
|
1783
|
-
default: 1,
|
|
1784
|
-
description: "Nucleus sampling"
|
|
1785
|
-
},
|
|
1786
|
-
top_k: {
|
|
1787
|
-
type: "number",
|
|
1788
|
-
min: 0,
|
|
1789
|
-
default: 40,
|
|
1790
|
-
description: "Top-K sampling"
|
|
1791
|
-
},
|
|
1792
|
-
frequency_penalty: {
|
|
1793
|
-
type: "number",
|
|
1794
|
-
min: -2,
|
|
1795
|
-
max: 2,
|
|
1796
|
-
default: 0,
|
|
1797
|
-
description: "Penalize frequent tokens"
|
|
1798
|
-
},
|
|
1799
|
-
presence_penalty: {
|
|
1800
|
-
type: "number",
|
|
1801
|
-
min: -2,
|
|
1802
|
-
max: 2,
|
|
1803
|
-
default: 0,
|
|
1804
|
-
description: "Penalize repeated topics"
|
|
1805
|
-
},
|
|
1806
|
-
stop: { type: "string", default: "", description: "Stop sequences" },
|
|
1807
|
-
n: { type: "number", min: 1, default: 1, description: "Completions count" },
|
|
1808
|
-
seed: { type: "number", default: "", description: "Random seed" },
|
|
1809
|
-
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
1810
|
-
effort: {
|
|
1811
|
-
type: "enum",
|
|
1812
|
-
values: ["none", "minimal", "low", "medium", "high", "xhigh"],
|
|
1813
|
-
default: "medium",
|
|
1814
|
-
description: "Reasoning effort"
|
|
1815
|
-
}
|
|
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
|
|
1843
|
-
};
|
|
1688
|
+
return specs;
|
|
1689
|
+
}
|
|
1690
|
+
var CANONICAL_PARAM_SPECS = deriveCanonicalParamSpecs();
|
|
1844
1691
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1845
1692
|
0 && (module.exports = {
|
|
1846
1693
|
ALIASES,
|
|
1847
1694
|
CACHE_TTLS,
|
|
1848
1695
|
CACHE_VALUES,
|
|
1849
1696
|
CANONICAL_PARAM_SPECS,
|
|
1850
|
-
DURATION_RE,
|
|
1851
1697
|
HOST_ALIASES,
|
|
1852
|
-
MODELS,
|
|
1853
1698
|
PARAM_SPECS,
|
|
1854
1699
|
PROVIDER_META,
|
|
1855
1700
|
PROVIDER_PARAMS,
|
|
@@ -1861,7 +1706,7 @@ var CANONICAL_PARAM_SPECS = {
|
|
|
1861
1706
|
detectProvider,
|
|
1862
1707
|
isGatewayProvider,
|
|
1863
1708
|
isReasoningModel,
|
|
1709
|
+
modelMatchesFamily,
|
|
1864
1710
|
providerFromHostAlias,
|
|
1865
1711
|
resolveHostAlias
|
|
1866
1712
|
});
|
|
1867
|
-
//# sourceMappingURL=providers.cjs.map
|