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.
Files changed (49) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +339 -339
  3. package/dist/ai-sdk.cjs +1146 -117
  4. package/dist/ai-sdk.d.cts +1 -1
  5. package/dist/ai-sdk.d.ts +1 -1
  6. package/dist/ai-sdk.js +95 -58
  7. package/dist/{chunk-7HE4RH6X.js → chunk-4BE457QA.js} +16 -29
  8. package/dist/{chunk-TQJ2ABCT.js → chunk-6HQOCOQI.js} +1 -2
  9. package/dist/{chunk-NZR5DUX5.js → chunk-7Z7DCLZN.js} +14 -3
  10. package/dist/{chunk-OCJX4QFJ.js → chunk-PCJDQTOV.js} +520 -76
  11. package/dist/index.cjs +542 -95
  12. package/dist/index.d.cts +1 -1
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.js +4 -5
  15. package/dist/normalize.cjs +1065 -63
  16. package/dist/normalize.d.cts +1 -1
  17. package/dist/normalize.d.ts +1 -1
  18. package/dist/normalize.js +2 -3
  19. package/dist/parse.cjs +1075 -1
  20. package/dist/parse.d.cts +4 -4
  21. package/dist/parse.d.ts +4 -4
  22. package/dist/parse.js +2 -3
  23. package/dist/{provider-core-B934MuhJ.d.cts → provider-core-B1GMszQP.d.cts} +2 -3
  24. package/dist/{provider-core-B934MuhJ.d.ts → provider-core-B1GMszQP.d.ts} +2 -3
  25. package/dist/providers.cjs +542 -697
  26. package/dist/providers.d.cts +3 -8
  27. package/dist/providers.d.ts +3 -8
  28. package/dist/providers.js +25 -624
  29. package/dist/validate.cjs +542 -95
  30. package/dist/validate.d.cts +1 -1
  31. package/dist/validate.d.ts +1 -1
  32. package/dist/validate.js +4 -5
  33. package/package.json +16 -2
  34. package/dist/ai-sdk.cjs.map +0 -1
  35. package/dist/ai-sdk.js.map +0 -1
  36. package/dist/chunk-7HE4RH6X.js.map +0 -1
  37. package/dist/chunk-NZR5DUX5.js.map +0 -1
  38. package/dist/chunk-OCJX4QFJ.js.map +0 -1
  39. package/dist/chunk-TQJ2ABCT.js.map +0 -1
  40. package/dist/index.cjs.map +0 -1
  41. package/dist/index.js.map +0 -1
  42. package/dist/normalize.cjs.map +0 -1
  43. package/dist/normalize.js.map +0 -1
  44. package/dist/parse.cjs.map +0 -1
  45. package/dist/parse.js.map +0 -1
  46. package/dist/providers.cjs.map +0 -1
  47. package/dist/providers.js.map +0 -1
  48. package/dist/validate.cjs.map +0 -1
  49. package/dist/validate.js.map +0 -1
package/dist/parse.cjs CHANGED
@@ -118,6 +118,1081 @@ function resolveHostAlias(host, env = readProcessEnv()) {
118
118
  alias
119
119
  };
120
120
  }
121
+ var OPENAI_COMPATIBLE_PARAMS = {
122
+ temperature: "temperature",
123
+ max_tokens: "max_tokens",
124
+ max_completion_tokens: "max_completion_tokens",
125
+ top_p: "top_p",
126
+ top_k: "top_k",
127
+ frequency_penalty: "frequency_penalty",
128
+ presence_penalty: "presence_penalty",
129
+ stop: "stop",
130
+ n: "n",
131
+ seed: "seed",
132
+ stream: "stream",
133
+ effort: "reasoning_effort"
134
+ };
135
+ var COMMON_IMAGE_PARAMS = {
136
+ prompt: "prompt",
137
+ negative_prompt: "negative_prompt",
138
+ seed: "seed",
139
+ image_size: "image_size",
140
+ aspect_ratio: "aspect_ratio",
141
+ output_format: "output_format",
142
+ width: "width",
143
+ height: "height"
144
+ };
145
+ var FAL_PARAMS = {
146
+ ...COMMON_IMAGE_PARAMS,
147
+ num_images: "num_images",
148
+ enable_safety_checker: "enable_safety_checker",
149
+ enable_safety_checks: "enable_safety_checks",
150
+ enable_prompt_expansion: "enable_prompt_expansion",
151
+ expand_prompt: "expand_prompt"
152
+ };
153
+ var REPLICATE_PARAMS = {
154
+ ...COMMON_IMAGE_PARAMS,
155
+ input: "input",
156
+ version: "version",
157
+ num_outputs: "num_outputs",
158
+ num_inference_steps: "num_inference_steps",
159
+ guidance_scale: "guidance_scale",
160
+ stream: "stream",
161
+ webhook: "webhook",
162
+ webhook_events_filter: "webhook_events_filter"
163
+ };
164
+ var PRODIA_PARAMS = {
165
+ ...COMMON_IMAGE_PARAMS,
166
+ model: "model",
167
+ style_preset: "style_preset",
168
+ steps: "steps",
169
+ cfg_scale: "cfg_scale",
170
+ upscale: "upscale",
171
+ sampler: "sampler",
172
+ type: "type",
173
+ config: "config",
174
+ price: "price"
175
+ };
176
+ var LUMA_PARAMS = {
177
+ prompt: "prompt",
178
+ model: "model",
179
+ aspect_ratio: "aspect_ratio",
180
+ keyframes: "keyframes",
181
+ loop: "loop",
182
+ duration: "duration",
183
+ type: "type",
184
+ image_ref: "image_ref",
185
+ video: "video",
186
+ source: "source"
187
+ };
188
+ var OPENROUTER_ROUTING_PARAMS = {
189
+ provider: "provider",
190
+ order: "order",
191
+ "provider.order": "provider.order",
192
+ only: "only",
193
+ "provider.only": "provider.only",
194
+ ignore: "ignore",
195
+ "provider.ignore": "provider.ignore",
196
+ allow_fallbacks: "allow_fallbacks",
197
+ "provider.allow_fallbacks": "provider.allow_fallbacks",
198
+ require_parameters: "require_parameters",
199
+ "provider.require_parameters": "provider.require_parameters",
200
+ data_collection: "data_collection",
201
+ "provider.data_collection": "provider.data_collection",
202
+ zdr: "zdr",
203
+ "provider.zdr": "provider.zdr",
204
+ enforce_distillable_text: "enforce_distillable_text",
205
+ "provider.enforce_distillable_text": "provider.enforce_distillable_text",
206
+ quantizations: "quantizations",
207
+ "provider.quantizations": "provider.quantizations",
208
+ sort: "sort",
209
+ "provider.sort": "provider.sort",
210
+ preferred_min_throughput: "preferred_min_throughput",
211
+ "provider.preferred_min_throughput": "provider.preferred_min_throughput",
212
+ preferred_max_latency: "preferred_max_latency",
213
+ "provider.preferred_max_latency": "provider.preferred_max_latency",
214
+ max_price: "max_price",
215
+ "provider.max_price": "provider.max_price",
216
+ transforms: "transforms",
217
+ plugins: "plugins"
218
+ };
219
+ var GOOGLE_COMPATIBLE_PARAMS = {
220
+ temperature: "temperature",
221
+ max_tokens: "maxOutputTokens",
222
+ top_p: "topP",
223
+ top_k: "topK",
224
+ frequency_penalty: "frequencyPenalty",
225
+ presence_penalty: "presencePenalty",
226
+ stop: "stopSequences",
227
+ n: "candidateCount",
228
+ stream: "stream",
229
+ seed: "seed",
230
+ responseMimeType: "responseMimeType",
231
+ responseSchema: "responseSchema"
232
+ };
233
+ var PROVIDER_PARAMS = {
234
+ openai: {
235
+ temperature: "temperature",
236
+ max_tokens: "max_tokens",
237
+ max_completion_tokens: "max_completion_tokens",
238
+ top_p: "top_p",
239
+ frequency_penalty: "frequency_penalty",
240
+ presence_penalty: "presence_penalty",
241
+ stop: "stop",
242
+ n: "n",
243
+ seed: "seed",
244
+ stream: "stream",
245
+ effort: "reasoning_effort"
246
+ },
247
+ azure: OPENAI_COMPATIBLE_PARAMS,
248
+ anthropic: {
249
+ temperature: "temperature",
250
+ max_tokens: "max_tokens",
251
+ top_p: "top_p",
252
+ top_k: "top_k",
253
+ stop: "stop_sequences",
254
+ stream: "stream",
255
+ effort: "effort",
256
+ cache: "cache_control",
257
+ cache_ttl: "cache_ttl"
258
+ },
259
+ google: {
260
+ temperature: "temperature",
261
+ max_tokens: "maxOutputTokens",
262
+ top_p: "topP",
263
+ top_k: "topK",
264
+ frequency_penalty: "frequencyPenalty",
265
+ presence_penalty: "presencePenalty",
266
+ stop: "stopSequences",
267
+ n: "candidateCount",
268
+ stream: "stream",
269
+ seed: "seed",
270
+ responseMimeType: "responseMimeType",
271
+ responseSchema: "responseSchema"
272
+ },
273
+ "google-vertex": GOOGLE_COMPATIBLE_PARAMS,
274
+ mistral: {
275
+ temperature: "temperature",
276
+ max_tokens: "max_tokens",
277
+ top_p: "top_p",
278
+ frequency_penalty: "frequency_penalty",
279
+ presence_penalty: "presence_penalty",
280
+ stop: "stop",
281
+ n: "n",
282
+ seed: "random_seed",
283
+ stream: "stream",
284
+ safe_prompt: "safe_prompt",
285
+ min_tokens: "min_tokens"
286
+ },
287
+ cohere: {
288
+ temperature: "temperature",
289
+ max_tokens: "max_tokens",
290
+ top_p: "p",
291
+ top_k: "k",
292
+ frequency_penalty: "frequency_penalty",
293
+ presence_penalty: "presence_penalty",
294
+ stop: "stop_sequences",
295
+ stream: "stream",
296
+ seed: "seed"
297
+ },
298
+ bedrock: {
299
+ // Bedrock Converse API uses camelCase
300
+ temperature: "temperature",
301
+ max_tokens: "maxTokens",
302
+ top_p: "topP",
303
+ top_k: "topK",
304
+ // Claude models via additionalModelRequestFields
305
+ stop: "stopSequences",
306
+ stream: "stream",
307
+ cache: "cache_control",
308
+ cache_ttl: "cache_ttl"
309
+ },
310
+ openrouter: {
311
+ // OpenAI-compatible API with extra routing params
312
+ temperature: "temperature",
313
+ max_tokens: "max_tokens",
314
+ max_completion_tokens: "max_completion_tokens",
315
+ top_p: "top_p",
316
+ top_k: "top_k",
317
+ frequency_penalty: "frequency_penalty",
318
+ presence_penalty: "presence_penalty",
319
+ stop: "stop",
320
+ n: "n",
321
+ seed: "seed",
322
+ stream: "stream",
323
+ effort: "reasoning_effort",
324
+ ...OPENROUTER_ROUTING_PARAMS
325
+ },
326
+ vercel: {
327
+ // OpenAI-compatible gateway
328
+ temperature: "temperature",
329
+ max_tokens: "max_tokens",
330
+ max_completion_tokens: "max_completion_tokens",
331
+ top_p: "top_p",
332
+ top_k: "top_k",
333
+ frequency_penalty: "frequency_penalty",
334
+ presence_penalty: "presence_penalty",
335
+ stop: "stop",
336
+ n: "n",
337
+ seed: "seed",
338
+ stream: "stream",
339
+ effort: "reasoning_effort"
340
+ },
341
+ xai: OPENAI_COMPATIBLE_PARAMS,
342
+ groq: OPENAI_COMPATIBLE_PARAMS,
343
+ fal: FAL_PARAMS,
344
+ deepinfra: OPENAI_COMPATIBLE_PARAMS,
345
+ "black-forest-labs": {},
346
+ together: OPENAI_COMPATIBLE_PARAMS,
347
+ fireworks: OPENAI_COMPATIBLE_PARAMS,
348
+ deepseek: OPENAI_COMPATIBLE_PARAMS,
349
+ moonshotai: OPENAI_COMPATIBLE_PARAMS,
350
+ perplexity: OPENAI_COMPATIBLE_PARAMS,
351
+ alibaba: OPENAI_COMPATIBLE_PARAMS,
352
+ cerebras: OPENAI_COMPATIBLE_PARAMS,
353
+ replicate: REPLICATE_PARAMS,
354
+ prodia: PRODIA_PARAMS,
355
+ luma: LUMA_PARAMS,
356
+ bytedance: {},
357
+ kling: {},
358
+ elevenlabs: {},
359
+ assemblyai: {},
360
+ deepgram: {},
361
+ gladia: {},
362
+ lmnt: {},
363
+ hume: {},
364
+ revai: {},
365
+ baseten: OPENAI_COMPATIBLE_PARAMS,
366
+ huggingface: OPENAI_COMPATIBLE_PARAMS
367
+ };
368
+ var REASONING_EFFORT_VALUES = [
369
+ "none",
370
+ "minimal",
371
+ "low",
372
+ "medium",
373
+ "high",
374
+ "xhigh",
375
+ "max"
376
+ ];
377
+ var OPENAI_COMPATIBLE_PARAM_SPECS = {
378
+ temperature: {
379
+ type: "number",
380
+ min: 0,
381
+ max: 2,
382
+ default: 0.7,
383
+ description: "Controls randomness"
384
+ },
385
+ max_tokens: {
386
+ type: "number",
387
+ min: 1,
388
+ default: 4096,
389
+ description: "Maximum output tokens"
390
+ },
391
+ max_completion_tokens: {
392
+ type: "number",
393
+ min: 1,
394
+ default: 4096,
395
+ description: "Maximum completion tokens (reasoning models)"
396
+ },
397
+ top_p: {
398
+ type: "number",
399
+ min: 0,
400
+ max: 1,
401
+ default: 1,
402
+ description: "Nucleus sampling"
403
+ },
404
+ top_k: {
405
+ type: "number",
406
+ min: 0,
407
+ default: 40,
408
+ description: "Top-K sampling"
409
+ },
410
+ frequency_penalty: {
411
+ type: "number",
412
+ min: -2,
413
+ max: 2,
414
+ default: 0,
415
+ description: "Penalize frequent tokens"
416
+ },
417
+ presence_penalty: {
418
+ type: "number",
419
+ min: -2,
420
+ max: 2,
421
+ default: 0,
422
+ description: "Penalize repeated topics"
423
+ },
424
+ stop: { type: "string", description: "Stop sequences" },
425
+ n: { type: "number", min: 1, default: 1, description: "Completions count" },
426
+ seed: { type: "number", description: "Random seed" },
427
+ stream: { type: "boolean", default: false, description: "Stream response" },
428
+ reasoning_effort: {
429
+ type: "string",
430
+ values: REASONING_EFFORT_VALUES,
431
+ default: "medium",
432
+ description: "Reasoning effort"
433
+ }
434
+ };
435
+ var OPENROUTER_ROUTING_PARAM_SPECS = {
436
+ provider: { type: "string", description: "Provider routing preferences" },
437
+ order: { type: "string", description: "Provider order" },
438
+ "provider.order": { type: "string", description: "Provider order" },
439
+ only: { type: "string", description: "Provider allowlist" },
440
+ "provider.only": { type: "string", description: "Provider allowlist" },
441
+ ignore: { type: "string", description: "Provider blocklist" },
442
+ "provider.ignore": { type: "string", description: "Provider blocklist" },
443
+ allow_fallbacks: {
444
+ type: "boolean",
445
+ default: true,
446
+ description: "Allow fallback providers"
447
+ },
448
+ "provider.allow_fallbacks": {
449
+ type: "boolean",
450
+ default: true,
451
+ description: "Allow fallback providers"
452
+ },
453
+ require_parameters: {
454
+ type: "boolean",
455
+ default: false,
456
+ description: "Only route to providers that support all request params"
457
+ },
458
+ "provider.require_parameters": {
459
+ type: "boolean",
460
+ default: false,
461
+ description: "Only route to providers that support all request params"
462
+ },
463
+ data_collection: {
464
+ type: "string",
465
+ values: ["allow", "deny"],
466
+ default: "allow",
467
+ description: "Provider data collection policy"
468
+ },
469
+ "provider.data_collection": {
470
+ type: "string",
471
+ values: ["allow", "deny"],
472
+ default: "allow",
473
+ description: "Provider data collection policy"
474
+ },
475
+ zdr: {
476
+ type: "boolean",
477
+ description: "Require zero data retention providers"
478
+ },
479
+ "provider.zdr": {
480
+ type: "boolean",
481
+ description: "Require zero data retention providers"
482
+ },
483
+ enforce_distillable_text: {
484
+ type: "boolean",
485
+ description: "Require providers that allow text distillation"
486
+ },
487
+ "provider.enforce_distillable_text": {
488
+ type: "boolean",
489
+ description: "Require providers that allow text distillation"
490
+ },
491
+ quantizations: {
492
+ type: "string",
493
+ description: "Allowed provider quantization levels"
494
+ },
495
+ "provider.quantizations": {
496
+ type: "string",
497
+ description: "Allowed provider quantization levels"
498
+ },
499
+ sort: {
500
+ type: "string",
501
+ values: ["price", "throughput", "latency", "cost", "ttft", "tps"],
502
+ description: "Provider sort strategy"
503
+ },
504
+ "provider.sort": {
505
+ type: "string",
506
+ values: ["price", "throughput", "latency", "cost", "ttft", "tps"],
507
+ description: "Provider sort strategy"
508
+ },
509
+ preferred_min_throughput: {
510
+ type: "number",
511
+ min: 0,
512
+ description: "Preferred minimum provider throughput"
513
+ },
514
+ "provider.preferred_min_throughput": {
515
+ type: "number",
516
+ min: 0,
517
+ description: "Preferred minimum provider throughput"
518
+ },
519
+ preferred_max_latency: {
520
+ type: "number",
521
+ min: 0,
522
+ description: "Preferred maximum provider latency"
523
+ },
524
+ "provider.preferred_max_latency": {
525
+ type: "number",
526
+ min: 0,
527
+ description: "Preferred maximum provider latency"
528
+ },
529
+ max_price: {
530
+ type: "string",
531
+ description: "Maximum provider price filter"
532
+ },
533
+ "provider.max_price": {
534
+ type: "string",
535
+ description: "Maximum provider price filter"
536
+ },
537
+ transforms: {
538
+ type: "string",
539
+ description: "Legacy OpenRouter message transforms"
540
+ },
541
+ plugins: {
542
+ type: "string",
543
+ description: "OpenRouter request plugins"
544
+ }
545
+ };
546
+ var FAL_PARAM_SPECS = {
547
+ prompt: { type: "string", description: "Prompt" },
548
+ negative_prompt: { type: "string", description: "Negative prompt" },
549
+ seed: { type: "number", description: "Random seed" },
550
+ num_images: {
551
+ type: "number",
552
+ min: 1,
553
+ description: "Number of images to generate"
554
+ },
555
+ image_size: { type: "string", description: "Output image size" },
556
+ aspect_ratio: { type: "string", description: "Output aspect ratio" },
557
+ enable_safety_checker: {
558
+ type: "boolean",
559
+ description: "Enable safety checker"
560
+ },
561
+ enable_safety_checks: {
562
+ type: "boolean",
563
+ description: "Enable safety checker"
564
+ },
565
+ enable_prompt_expansion: {
566
+ type: "boolean",
567
+ description: "Enable prompt expansion"
568
+ },
569
+ expand_prompt: {
570
+ type: "boolean",
571
+ description: "Enable prompt expansion"
572
+ },
573
+ output_format: {
574
+ type: "string",
575
+ values: ["jpeg", "jpg", "png", "webp", "gif"],
576
+ description: "Output image format"
577
+ },
578
+ width: { type: "number", min: 1, description: "Image width" },
579
+ height: { type: "number", min: 1, description: "Image height" }
580
+ };
581
+ var REPLICATE_PARAM_SPECS = {
582
+ prompt: { type: "string", description: "Prompt" },
583
+ negative_prompt: { type: "string", description: "Negative prompt" },
584
+ input: { type: "string", description: "Model input object" },
585
+ version: { type: "string", description: "Model version" },
586
+ seed: { type: "number", description: "Random seed" },
587
+ num_outputs: {
588
+ type: "number",
589
+ min: 1,
590
+ description: "Number of outputs to generate"
591
+ },
592
+ num_inference_steps: {
593
+ type: "number",
594
+ min: 1,
595
+ description: "Number of inference steps"
596
+ },
597
+ guidance_scale: {
598
+ type: "number",
599
+ min: 0,
600
+ description: "Guidance scale"
601
+ },
602
+ image_size: { type: "string", description: "Output image size" },
603
+ aspect_ratio: { type: "string", description: "Output aspect ratio" },
604
+ output_format: { type: "string", description: "Output format" },
605
+ width: { type: "number", min: 1, description: "Image width" },
606
+ height: { type: "number", min: 1, description: "Image height" },
607
+ stream: { type: "boolean", description: "Request streaming output" },
608
+ webhook: { type: "string", description: "Webhook URL" },
609
+ webhook_events_filter: {
610
+ type: "string",
611
+ description: "Webhook events filter"
612
+ }
613
+ };
614
+ var PRODIA_PARAM_SPECS = {
615
+ model: { type: "string", description: "Model name" },
616
+ prompt: { type: "string", description: "Prompt" },
617
+ negative_prompt: { type: "string", description: "Negative prompt" },
618
+ style_preset: { type: "string", description: "Style preset" },
619
+ steps: { type: "number", min: 1, description: "Generation steps" },
620
+ cfg_scale: { type: "number", min: 0, description: "CFG scale" },
621
+ seed: { type: "number", description: "Random seed" },
622
+ upscale: { type: "boolean", description: "Enable 2x upscale" },
623
+ sampler: { type: "string", description: "Sampler" },
624
+ width: { type: "number", min: 1, max: 1024, description: "Image width" },
625
+ height: { type: "number", min: 1, max: 1024, description: "Image height" },
626
+ image_size: { type: "string", description: "Output image size" },
627
+ aspect_ratio: { type: "string", description: "Output aspect ratio" },
628
+ output_format: { type: "string", description: "Output format" },
629
+ type: { type: "string", description: "Prodia v2 job type" },
630
+ config: { type: "string", description: "Prodia v2 job config" },
631
+ price: { type: "boolean", description: "Include Prodia v2 job price" }
632
+ };
633
+ var LUMA_PARAM_SPECS = {
634
+ prompt: { type: "string", description: "Prompt" },
635
+ model: { type: "string", description: "Model name" },
636
+ aspect_ratio: { type: "string", description: "Output aspect ratio" },
637
+ keyframes: { type: "string", description: "Generation keyframes" },
638
+ loop: { type: "boolean", description: "Generate a looping video" },
639
+ duration: { type: "string", description: "Generation duration" },
640
+ type: { type: "string", description: "Generation type" },
641
+ image_ref: { type: "string", description: "Image reference" },
642
+ video: { type: "string", description: "Video options" },
643
+ source: { type: "string", description: "Source generation or media" }
644
+ };
645
+ var GOOGLE_COMPATIBLE_PARAM_SPECS = {
646
+ temperature: {
647
+ type: "number",
648
+ min: 0,
649
+ max: 2,
650
+ default: 0.7,
651
+ description: "Controls randomness"
652
+ },
653
+ maxOutputTokens: {
654
+ type: "number",
655
+ min: 1,
656
+ default: 4096,
657
+ description: "Maximum output tokens"
658
+ },
659
+ topP: {
660
+ type: "number",
661
+ min: 0,
662
+ max: 1,
663
+ default: 1,
664
+ description: "Nucleus sampling"
665
+ },
666
+ topK: {
667
+ type: "number",
668
+ min: 0,
669
+ default: 40,
670
+ description: "Top-K sampling"
671
+ },
672
+ frequencyPenalty: {
673
+ type: "number",
674
+ min: -2,
675
+ max: 2,
676
+ default: 0,
677
+ description: "Penalize frequent tokens"
678
+ },
679
+ presencePenalty: {
680
+ type: "number",
681
+ min: -2,
682
+ max: 2,
683
+ default: 0,
684
+ description: "Penalize repeated topics"
685
+ },
686
+ stopSequences: { type: "string", description: "Stop sequences" },
687
+ candidateCount: {
688
+ type: "number",
689
+ min: 1,
690
+ default: 1,
691
+ description: "Candidate count"
692
+ },
693
+ stream: { type: "boolean", default: false, description: "Stream response" },
694
+ seed: { type: "number", description: "Random seed" },
695
+ responseMimeType: { type: "string", description: "Response MIME type" },
696
+ responseSchema: { type: "string", description: "Response schema" }
697
+ };
698
+ var PARAM_SPECS = {
699
+ openai: {
700
+ temperature: {
701
+ type: "number",
702
+ min: 0,
703
+ max: 2,
704
+ default: 0.7,
705
+ description: "Controls randomness"
706
+ },
707
+ max_tokens: {
708
+ type: "number",
709
+ min: 1,
710
+ default: 4096,
711
+ description: "Maximum output tokens"
712
+ },
713
+ max_completion_tokens: {
714
+ type: "number",
715
+ min: 1,
716
+ default: 4096,
717
+ description: "Maximum completion tokens (reasoning models)"
718
+ },
719
+ top_p: {
720
+ type: "number",
721
+ min: 0,
722
+ max: 1,
723
+ default: 1,
724
+ description: "Nucleus sampling"
725
+ },
726
+ frequency_penalty: {
727
+ type: "number",
728
+ min: -2,
729
+ max: 2,
730
+ default: 0,
731
+ description: "Penalize frequent tokens"
732
+ },
733
+ presence_penalty: {
734
+ type: "number",
735
+ min: -2,
736
+ max: 2,
737
+ default: 0,
738
+ description: "Penalize repeated topics"
739
+ },
740
+ stop: { type: "string", description: "Stop sequences" },
741
+ n: { type: "number", min: 1, default: 1, description: "Completions count" },
742
+ seed: { type: "number", description: "Random seed" },
743
+ stream: { type: "boolean", default: false, description: "Stream response" },
744
+ reasoning_effort: {
745
+ type: "string",
746
+ values: REASONING_EFFORT_VALUES,
747
+ default: "medium",
748
+ description: "Reasoning effort"
749
+ }
750
+ },
751
+ azure: OPENAI_COMPATIBLE_PARAM_SPECS,
752
+ anthropic: {
753
+ temperature: {
754
+ type: "number",
755
+ min: 0,
756
+ max: 1,
757
+ default: 0.7,
758
+ description: "Controls randomness"
759
+ },
760
+ max_tokens: {
761
+ type: "number",
762
+ min: 1,
763
+ default: 4096,
764
+ description: "Maximum output tokens"
765
+ },
766
+ top_p: {
767
+ type: "number",
768
+ min: 0,
769
+ max: 1,
770
+ default: 1,
771
+ description: "Nucleus sampling"
772
+ },
773
+ top_k: {
774
+ type: "number",
775
+ min: 0,
776
+ default: 40,
777
+ description: "Top-K sampling"
778
+ },
779
+ stop_sequences: { type: "string", description: "Stop sequences" },
780
+ stream: { type: "boolean", default: false, description: "Stream response" },
781
+ effort: {
782
+ type: "string",
783
+ values: REASONING_EFFORT_VALUES,
784
+ default: "low",
785
+ description: "Thinking effort"
786
+ },
787
+ cache_control: {
788
+ type: "string",
789
+ values: ["ephemeral"],
790
+ default: "ephemeral",
791
+ description: "Cache control"
792
+ },
793
+ cache_ttl: {
794
+ type: "string",
795
+ values: ["5m", "1h"],
796
+ default: "5m",
797
+ description: "Cache TTL"
798
+ }
799
+ },
800
+ google: {
801
+ temperature: {
802
+ type: "number",
803
+ min: 0,
804
+ max: 2,
805
+ default: 0.7,
806
+ description: "Controls randomness"
807
+ },
808
+ maxOutputTokens: {
809
+ type: "number",
810
+ min: 1,
811
+ default: 4096,
812
+ description: "Maximum output tokens"
813
+ },
814
+ topP: {
815
+ type: "number",
816
+ min: 0,
817
+ max: 1,
818
+ default: 1,
819
+ description: "Nucleus sampling"
820
+ },
821
+ topK: {
822
+ type: "number",
823
+ min: 0,
824
+ default: 40,
825
+ description: "Top-K sampling"
826
+ },
827
+ frequencyPenalty: {
828
+ type: "number",
829
+ min: -2,
830
+ max: 2,
831
+ default: 0,
832
+ description: "Penalize frequent tokens"
833
+ },
834
+ presencePenalty: {
835
+ type: "number",
836
+ min: -2,
837
+ max: 2,
838
+ default: 0,
839
+ description: "Penalize repeated topics"
840
+ },
841
+ stopSequences: { type: "string", description: "Stop sequences" },
842
+ candidateCount: {
843
+ type: "number",
844
+ min: 1,
845
+ default: 1,
846
+ description: "Candidate count"
847
+ },
848
+ stream: { type: "boolean", default: false, description: "Stream response" },
849
+ seed: { type: "number", description: "Random seed" },
850
+ responseMimeType: { type: "string", description: "Response MIME type" },
851
+ responseSchema: { type: "string", description: "Response schema" }
852
+ },
853
+ "google-vertex": GOOGLE_COMPATIBLE_PARAM_SPECS,
854
+ mistral: {
855
+ temperature: {
856
+ type: "number",
857
+ min: 0,
858
+ max: 1,
859
+ default: 0.7,
860
+ description: "Controls randomness"
861
+ },
862
+ max_tokens: {
863
+ type: "number",
864
+ min: 1,
865
+ default: 4096,
866
+ description: "Maximum output tokens"
867
+ },
868
+ top_p: {
869
+ type: "number",
870
+ min: 0,
871
+ max: 1,
872
+ default: 1,
873
+ description: "Nucleus sampling"
874
+ },
875
+ frequency_penalty: {
876
+ type: "number",
877
+ min: -2,
878
+ max: 2,
879
+ default: 0,
880
+ description: "Penalize frequent tokens"
881
+ },
882
+ presence_penalty: {
883
+ type: "number",
884
+ min: -2,
885
+ max: 2,
886
+ default: 0,
887
+ description: "Penalize repeated topics"
888
+ },
889
+ stop: { type: "string", description: "Stop sequences" },
890
+ n: { type: "number", min: 1, default: 1, description: "Completions count" },
891
+ random_seed: { type: "number", description: "Random seed" },
892
+ stream: { type: "boolean", default: false, description: "Stream response" },
893
+ safe_prompt: {
894
+ type: "boolean",
895
+ default: false,
896
+ description: "Enable safe prompt"
897
+ },
898
+ min_tokens: {
899
+ type: "number",
900
+ min: 0,
901
+ default: 0,
902
+ description: "Minimum tokens"
903
+ }
904
+ },
905
+ cohere: {
906
+ temperature: {
907
+ type: "number",
908
+ min: 0,
909
+ max: 1,
910
+ default: 0.7,
911
+ description: "Controls randomness"
912
+ },
913
+ max_tokens: {
914
+ type: "number",
915
+ min: 1,
916
+ default: 4096,
917
+ description: "Maximum output tokens"
918
+ },
919
+ p: {
920
+ type: "number",
921
+ min: 0,
922
+ max: 1,
923
+ default: 1,
924
+ description: "Nucleus sampling (p)"
925
+ },
926
+ k: {
927
+ type: "number",
928
+ min: 0,
929
+ max: 500,
930
+ default: 40,
931
+ description: "Top-K sampling (k)"
932
+ },
933
+ frequency_penalty: {
934
+ type: "number",
935
+ min: 0,
936
+ max: 1,
937
+ default: 0,
938
+ description: "Penalize frequent tokens"
939
+ },
940
+ presence_penalty: {
941
+ type: "number",
942
+ min: 0,
943
+ max: 1,
944
+ default: 0,
945
+ description: "Penalize repeated topics"
946
+ },
947
+ stop_sequences: { type: "string", description: "Stop sequences" },
948
+ stream: { type: "boolean", default: false, description: "Stream response" },
949
+ seed: { type: "number", description: "Random seed" }
950
+ },
951
+ bedrock: {
952
+ // Converse API inferenceConfig params
953
+ temperature: {
954
+ type: "number",
955
+ min: 0,
956
+ max: 1,
957
+ default: 0.7,
958
+ description: "Controls randomness"
959
+ },
960
+ maxTokens: {
961
+ type: "number",
962
+ min: 1,
963
+ default: 4096,
964
+ description: "Maximum output tokens"
965
+ },
966
+ topP: {
967
+ type: "number",
968
+ min: 0,
969
+ max: 1,
970
+ default: 1,
971
+ description: "Nucleus sampling"
972
+ },
973
+ topK: {
974
+ type: "number",
975
+ min: 0,
976
+ default: 40,
977
+ description: "Top-K sampling"
978
+ },
979
+ stopSequences: { type: "string", description: "Stop sequences" },
980
+ stream: { type: "boolean", default: false, description: "Stream response" },
981
+ cache_control: {
982
+ type: "string",
983
+ values: ["ephemeral"],
984
+ default: "ephemeral",
985
+ description: "Cache control"
986
+ },
987
+ cache_ttl: {
988
+ type: "string",
989
+ values: ["5m", "1h"],
990
+ default: "5m",
991
+ description: "Cache TTL"
992
+ }
993
+ },
994
+ openrouter: {
995
+ // Loose validation — proxies to many providers with varying ranges
996
+ temperature: {
997
+ type: "number",
998
+ min: 0,
999
+ max: 2,
1000
+ default: 0.7,
1001
+ description: "Controls randomness"
1002
+ },
1003
+ max_tokens: {
1004
+ type: "number",
1005
+ min: 1,
1006
+ default: 4096,
1007
+ description: "Maximum output tokens"
1008
+ },
1009
+ max_completion_tokens: {
1010
+ type: "number",
1011
+ min: 1,
1012
+ default: 4096,
1013
+ description: "Maximum completion tokens (reasoning models)"
1014
+ },
1015
+ top_p: {
1016
+ type: "number",
1017
+ min: 0,
1018
+ max: 1,
1019
+ default: 1,
1020
+ description: "Nucleus sampling"
1021
+ },
1022
+ top_k: {
1023
+ type: "number",
1024
+ min: 0,
1025
+ default: 40,
1026
+ description: "Top-K sampling"
1027
+ },
1028
+ frequency_penalty: {
1029
+ type: "number",
1030
+ min: -2,
1031
+ max: 2,
1032
+ default: 0,
1033
+ description: "Penalize frequent tokens"
1034
+ },
1035
+ presence_penalty: {
1036
+ type: "number",
1037
+ min: -2,
1038
+ max: 2,
1039
+ default: 0,
1040
+ description: "Penalize repeated topics"
1041
+ },
1042
+ stop: { type: "string", description: "Stop sequences" },
1043
+ n: { type: "number", min: 1, default: 1, description: "Completions count" },
1044
+ seed: { type: "number", description: "Random seed" },
1045
+ stream: { type: "boolean", default: false, description: "Stream response" },
1046
+ reasoning_effort: {
1047
+ type: "string",
1048
+ values: REASONING_EFFORT_VALUES,
1049
+ default: "medium",
1050
+ description: "Reasoning effort"
1051
+ },
1052
+ ...OPENROUTER_ROUTING_PARAM_SPECS
1053
+ },
1054
+ vercel: {
1055
+ // Loose validation — proxies to many providers with varying ranges
1056
+ temperature: {
1057
+ type: "number",
1058
+ min: 0,
1059
+ max: 2,
1060
+ default: 0.7,
1061
+ description: "Controls randomness"
1062
+ },
1063
+ max_tokens: {
1064
+ type: "number",
1065
+ min: 1,
1066
+ default: 4096,
1067
+ description: "Maximum output tokens"
1068
+ },
1069
+ max_completion_tokens: {
1070
+ type: "number",
1071
+ min: 1,
1072
+ default: 4096,
1073
+ description: "Maximum completion tokens (reasoning models)"
1074
+ },
1075
+ top_p: {
1076
+ type: "number",
1077
+ min: 0,
1078
+ max: 1,
1079
+ default: 1,
1080
+ description: "Nucleus sampling"
1081
+ },
1082
+ top_k: {
1083
+ type: "number",
1084
+ min: 0,
1085
+ default: 40,
1086
+ description: "Top-K sampling"
1087
+ },
1088
+ frequency_penalty: {
1089
+ type: "number",
1090
+ min: -2,
1091
+ max: 2,
1092
+ default: 0,
1093
+ description: "Penalize frequent tokens"
1094
+ },
1095
+ presence_penalty: {
1096
+ type: "number",
1097
+ min: -2,
1098
+ max: 2,
1099
+ default: 0,
1100
+ description: "Penalize repeated topics"
1101
+ },
1102
+ stop: { type: "string", description: "Stop sequences" },
1103
+ n: { type: "number", min: 1, default: 1, description: "Completions count" },
1104
+ seed: { type: "number", description: "Random seed" },
1105
+ stream: { type: "boolean", default: false, description: "Stream response" },
1106
+ reasoning_effort: {
1107
+ type: "string",
1108
+ values: REASONING_EFFORT_VALUES,
1109
+ default: "medium",
1110
+ description: "Reasoning effort"
1111
+ },
1112
+ order: { type: "string", description: "Gateway provider order" },
1113
+ only: { type: "string", description: "Gateway provider allowlist" },
1114
+ models: { type: "string", description: "Gateway fallback models" },
1115
+ tags: { type: "string", description: "Gateway usage tags" },
1116
+ sort: {
1117
+ type: "string",
1118
+ values: ["cost", "ttft", "tps"],
1119
+ description: "Gateway provider sort strategy"
1120
+ },
1121
+ caching: {
1122
+ type: "string",
1123
+ values: ["auto"],
1124
+ description: "Gateway automatic caching strategy"
1125
+ },
1126
+ user: { type: "string", description: "Gateway usage user identifier" },
1127
+ byok: { type: "string", description: "Gateway BYOK credentials" },
1128
+ zero_data_retention: {
1129
+ type: "boolean",
1130
+ description: "Gateway zero data retention routing"
1131
+ },
1132
+ zeroDataRetention: {
1133
+ type: "boolean",
1134
+ description: "Gateway zero data retention routing"
1135
+ },
1136
+ disallow_prompt_training: {
1137
+ type: "boolean",
1138
+ description: "Gateway prompt training opt-out routing"
1139
+ },
1140
+ disallowPromptTraining: {
1141
+ type: "boolean",
1142
+ description: "Gateway prompt training opt-out routing"
1143
+ },
1144
+ hipaa_compliant: {
1145
+ type: "boolean",
1146
+ description: "Gateway HIPAA-compliant routing"
1147
+ },
1148
+ hipaaCompliant: {
1149
+ type: "boolean",
1150
+ description: "Gateway HIPAA-compliant routing"
1151
+ },
1152
+ quota_entity_id: {
1153
+ type: "string",
1154
+ description: "Gateway quota entity identifier"
1155
+ },
1156
+ quotaEntityId: {
1157
+ type: "string",
1158
+ description: "Gateway quota entity identifier"
1159
+ },
1160
+ provider_timeouts: {
1161
+ type: "string",
1162
+ description: "Gateway provider timeouts"
1163
+ },
1164
+ providerTimeouts: {
1165
+ type: "string",
1166
+ description: "Gateway provider timeouts"
1167
+ }
1168
+ },
1169
+ xai: OPENAI_COMPATIBLE_PARAM_SPECS,
1170
+ groq: OPENAI_COMPATIBLE_PARAM_SPECS,
1171
+ fal: FAL_PARAM_SPECS,
1172
+ deepinfra: OPENAI_COMPATIBLE_PARAM_SPECS,
1173
+ "black-forest-labs": {},
1174
+ together: OPENAI_COMPATIBLE_PARAM_SPECS,
1175
+ fireworks: OPENAI_COMPATIBLE_PARAM_SPECS,
1176
+ deepseek: OPENAI_COMPATIBLE_PARAM_SPECS,
1177
+ moonshotai: OPENAI_COMPATIBLE_PARAM_SPECS,
1178
+ perplexity: OPENAI_COMPATIBLE_PARAM_SPECS,
1179
+ alibaba: OPENAI_COMPATIBLE_PARAM_SPECS,
1180
+ cerebras: OPENAI_COMPATIBLE_PARAM_SPECS,
1181
+ replicate: REPLICATE_PARAM_SPECS,
1182
+ prodia: PRODIA_PARAM_SPECS,
1183
+ luma: LUMA_PARAM_SPECS,
1184
+ bytedance: {},
1185
+ kling: {},
1186
+ elevenlabs: {},
1187
+ assemblyai: {},
1188
+ deepgram: {},
1189
+ gladia: {},
1190
+ lmnt: {},
1191
+ hume: {},
1192
+ revai: {},
1193
+ baseten: OPENAI_COMPATIBLE_PARAM_SPECS,
1194
+ huggingface: OPENAI_COMPATIBLE_PARAM_SPECS
1195
+ };
121
1196
 
122
1197
  // src/parse.ts
123
1198
  function parse(connectionString) {
@@ -157,4 +1232,3 @@ function build(config) {
157
1232
  build,
158
1233
  parse
159
1234
  });
160
- //# sourceMappingURL=parse.cjs.map