@juspay/neurolink 12.5.0 → 12.5.1

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 (46) hide show
  1. package/CHANGELOG.md +1 -5
  2. package/dist/adapters/providerImageAdapter.js +43 -19
  3. package/dist/browser/neurolink.min.js +414 -414
  4. package/dist/cli/commands/setup.d.ts +12 -7
  5. package/dist/cli/commands/setup.js +17 -16
  6. package/dist/constants/contextWindows.js +23 -95
  7. package/dist/constants/enums.d.ts +111 -216
  8. package/dist/constants/enums.js +124 -240
  9. package/dist/factories/providerDescriptors.d.ts +2 -4
  10. package/dist/factories/providerDescriptors.js +83 -127
  11. package/dist/models/manifestRegistry.js +53 -4
  12. package/dist/providers/catalog/cerebras.json +75 -0
  13. package/dist/providers/catalog/cloudflare.json +121 -0
  14. package/dist/providers/catalog/fireworks.json +124 -0
  15. package/dist/providers/catalog/groq.json +127 -0
  16. package/dist/providers/catalog/index.generated.d.ts +3 -0
  17. package/dist/providers/catalog/index.generated.js +33 -0
  18. package/dist/providers/catalog/loader.d.ts +6 -0
  19. package/dist/providers/catalog/loader.js +115 -0
  20. package/dist/providers/catalog/mistral.json +244 -0
  21. package/dist/providers/catalog/perplexity.json +103 -0
  22. package/dist/providers/catalog/provider-catalog.schema.json +351 -0
  23. package/dist/providers/catalog/sambanova.json +129 -0
  24. package/dist/providers/catalog/schema.d.ts +123 -0
  25. package/dist/providers/catalog/schema.js +310 -0
  26. package/dist/providers/catalog/together-ai.json +172 -0
  27. package/dist/providers/catalog/xai.json +108 -0
  28. package/dist/providers/openaiCompatCatalog.d.ts +13 -13
  29. package/dist/providers/openaiCompatCatalog.js +15 -326
  30. package/dist/types/index.d.ts +2 -0
  31. package/dist/types/index.js +2 -0
  32. package/dist/types/providerCatalog.d.ts +149 -0
  33. package/dist/types/providerCatalog.generated.d.ts +2 -0
  34. package/dist/types/providerCatalog.generated.js +1 -0
  35. package/dist/types/providerCatalog.js +7 -0
  36. package/dist/types/providers.d.ts +14 -14
  37. package/dist/utils/modelChoices.d.ts +11 -3
  38. package/dist/utils/modelChoices.js +84 -190
  39. package/dist/utils/pricing.js +92 -127
  40. package/dist/utils/providerConfig.d.ts +1 -1
  41. package/dist/utils/providerConfig.js +24 -108
  42. package/package.json +2 -1
  43. package/dist/models/manifests/cerebras.d.ts +0 -9
  44. package/dist/models/manifests/cerebras.js +0 -19
  45. package/dist/models/manifests/sambanova.d.ts +0 -11
  46. package/dist/models/manifests/sambanova.js +0 -42
@@ -16,22 +16,24 @@ export var AIProviderName;
16
16
  AIProviderName["GOOGLE_AI"] = "google-ai";
17
17
  AIProviderName["HUGGINGFACE"] = "huggingface";
18
18
  AIProviderName["OLLAMA"] = "ollama";
19
- AIProviderName["MISTRAL"] = "mistral";
20
19
  AIProviderName["LITELLM"] = "litellm";
21
20
  AIProviderName["SAGEMAKER"] = "sagemaker";
22
21
  AIProviderName["DEEPSEEK"] = "deepseek";
23
22
  AIProviderName["NVIDIA_NIM"] = "nvidia-nim";
24
23
  AIProviderName["LM_STUDIO"] = "lm-studio";
25
24
  AIProviderName["LLAMACPP"] = "llamacpp";
26
- AIProviderName["XAI"] = "xai";
27
- AIProviderName["GROQ"] = "groq";
25
+ // ── BEGIN GENERATED(provider-members): provider catalog (pnpm run codegen:catalog) ──
28
26
  AIProviderName["CEREBRAS"] = "cerebras";
29
- AIProviderName["SAMBANOVA"] = "sambanova";
30
- AIProviderName["COHERE"] = "cohere";
31
- AIProviderName["TOGETHER_AI"] = "together-ai";
27
+ AIProviderName["CLOUDFLARE"] = "cloudflare";
32
28
  AIProviderName["FIREWORKS"] = "fireworks";
29
+ AIProviderName["GROQ"] = "groq";
30
+ AIProviderName["MISTRAL"] = "mistral";
33
31
  AIProviderName["PERPLEXITY"] = "perplexity";
34
- AIProviderName["CLOUDFLARE"] = "cloudflare";
32
+ AIProviderName["SAMBANOVA"] = "sambanova";
33
+ AIProviderName["TOGETHER_AI"] = "together-ai";
34
+ AIProviderName["XAI"] = "xai";
35
+ // ── END GENERATED(provider-members) ──
36
+ AIProviderName["COHERE"] = "cohere";
35
37
  AIProviderName["REPLICATE"] = "replicate";
36
38
  AIProviderName["VOYAGE"] = "voyage";
37
39
  AIProviderName["JINA"] = "jina";
@@ -500,69 +502,6 @@ export var AnthropicModels;
500
502
  /** @deprecated Retired from Anthropic API. Use CLAUDE_SONNET_4_6 instead. */
501
503
  AnthropicModels["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
502
504
  })(AnthropicModels || (AnthropicModels = {}));
503
- /**
504
- * Supported Models for Mistral AI
505
- */
506
- export var MistralModels;
507
- (function (MistralModels) {
508
- // Mistral Large (Latest)
509
- MistralModels["MISTRAL_LARGE_LATEST"] = "mistral-large-latest";
510
- MistralModels["MISTRAL_LARGE_2512"] = "mistral-large-2512";
511
- // Mistral Medium
512
- MistralModels["MISTRAL_MEDIUM_LATEST"] = "mistral-medium-latest";
513
- MistralModels["MISTRAL_MEDIUM_2508"] = "mistral-medium-2508";
514
- // Mistral Small
515
- MistralModels["MISTRAL_SMALL_LATEST"] = "mistral-small-latest";
516
- MistralModels["MISTRAL_SMALL_2506"] = "mistral-small-2506";
517
- // Magistral (Reasoning)
518
- MistralModels["MAGISTRAL_MEDIUM_LATEST"] = "magistral-medium-latest";
519
- MistralModels["MAGISTRAL_SMALL_LATEST"] = "magistral-small-latest";
520
- // Ministral (Edge Models)
521
- MistralModels["MINISTRAL_14B_2512"] = "ministral-14b-2512";
522
- MistralModels["MINISTRAL_8B_2512"] = "ministral-8b-2512";
523
- MistralModels["MINISTRAL_3B_2512"] = "ministral-3b-2512";
524
- // Codestral (Code Generation)
525
- MistralModels["CODESTRAL_LATEST"] = "codestral-latest";
526
- MistralModels["CODESTRAL_2508"] = "codestral-2508";
527
- MistralModels["CODESTRAL_EMBED"] = "codestral-embed";
528
- // Devstral (Software Development)
529
- MistralModels["DEVSTRAL_MEDIUM_LATEST"] = "devstral-medium-latest";
530
- MistralModels["DEVSTRAL_SMALL_LATEST"] = "devstral-small-latest";
531
- // Pixtral (Multimodal/Vision) — both retired by Mistral.
532
- /**
533
- * @deprecated Retired by Mistral on 2026-05-31. The id is also wrong: the
534
- * API string was `pixtral-large-2411`, and Mistral publishes no dateless
535
- * `pixtral-large` alias. Use MISTRAL_MEDIUM_LATEST instead.
536
- */
537
- MistralModels["PIXTRAL_LARGE"] = "pixtral-large";
538
- /**
539
- * @deprecated Retired by Mistral on 2025-12-31. The API string was
540
- * `pixtral-12b-2409`; no dateless alias is published. Mistral recommends
541
- * Ministral 3 14B as the replacement.
542
- */
543
- MistralModels["PIXTRAL_12B"] = "pixtral-12b";
544
- // Voxtral (Audio)
545
- MistralModels["VOXTRAL_SMALL_LATEST"] = "voxtral-small-latest";
546
- MistralModels["VOXTRAL_MINI_LATEST"] = "voxtral-mini-latest";
547
- // Devstral 2 Series (December 2025)
548
- MistralModels["DEVSTRAL_2"] = "devstral-2512";
549
- MistralModels["DEVSTRAL_SMALL_2"] = "devstral-small-2512";
550
- // Magistral Versioned (September 2025)
551
- MistralModels["MAGISTRAL_MEDIUM_2509"] = "magistral-medium-2509";
552
- MistralModels["MAGISTRAL_SMALL_2509"] = "magistral-small-2509";
553
- // Voxtral Transcribe 2 (February 2026)
554
- MistralModels["VOXTRAL_MINI_TRANSCRIBE_2"] = "voxtral-mini-2602";
555
- // OCR (December 2025)
556
- MistralModels["MISTRAL_OCR_3"] = "mistral-ocr-2512";
557
- MistralModels["MISTRAL_OCR_LATEST"] = "mistral-ocr-latest";
558
- // Specialized Models
559
- MistralModels["MISTRAL_NEMO"] = "mistral-nemo";
560
- MistralModels["MISTRAL_EMBED"] = "mistral-embed";
561
- MistralModels["MISTRAL_MODERATION_LATEST"] = "mistral-moderation-latest";
562
- // Mistral Small 4 Series (June 2026)
563
- MistralModels["MISTRAL_SMALL_4"] = "mistral-small-2603";
564
- MistralModels["MISTRAL_SMALL_CREATIVE"] = "mistral-small-creative";
565
- })(MistralModels || (MistralModels = {}));
566
505
  /**
567
506
  * Supported Models for Ollama (Local)
568
507
  * All models can be run locally without requiring API keys or cloud services
@@ -968,85 +907,6 @@ export var LlamaCppModels;
968
907
  /** Sentinel value — uses the model loaded by the llama-server process */
969
908
  LlamaCppModels["AUTO_DISCOVER"] = "";
970
909
  })(LlamaCppModels || (LlamaCppModels = {}));
971
- /**
972
- * xAI Grok models — accessible at api.x.ai/v1 (OpenAI-compatible).
973
- * @see https://docs.x.ai/docs/models
974
- */
975
- export var XaiModels;
976
- (function (XaiModels) {
977
- /** Latest Grok 3 — flagship; best for complex reasoning */
978
- XaiModels["GROK_3"] = "grok-3";
979
- /** Grok 3 Mini — faster + cheaper variant of Grok 3 */
980
- XaiModels["GROK_3_MINI"] = "grok-3-mini";
981
- /** Grok 2 latest — previous flagship; still supported */
982
- XaiModels["GROK_2_LATEST"] = "grok-2-latest";
983
- /** Grok 2 Vision — multimodal (text + images) */
984
- XaiModels["GROK_2_VISION_LATEST"] = "grok-2-vision-latest";
985
- /** Grok beta — pre-release / experimental access */
986
- XaiModels["GROK_BETA"] = "grok-beta";
987
- })(XaiModels || (XaiModels = {}));
988
- /**
989
- * Groq-hosted models — Llama / Mistral / Gemma at sub-100ms inference.
990
- * @see https://console.groq.com/docs/models
991
- */
992
- export var GroqModels;
993
- (function (GroqModels) {
994
- /** Llama 3.3 70B Versatile — production default */
995
- GroqModels["LLAMA_3_3_70B_VERSATILE"] = "llama-3.3-70b-versatile";
996
- /** Llama 3.1 8B Instant — low-latency tier */
997
- GroqModels["LLAMA_3_1_8B_INSTANT"] = "llama-3.1-8b-instant";
998
- /** Gemma 2 9B IT — Google's lightweight instruct model */
999
- GroqModels["GEMMA_2_9B_IT"] = "gemma2-9b-it";
1000
- /** Mixtral 8x7B 32K — Mistral's MoE model */
1001
- GroqModels["MIXTRAL_8X7B_32768"] = "mixtral-8x7b-32768";
1002
- /** Llama Guard 3 8B — safety classifier */
1003
- GroqModels["LLAMA_GUARD_3_8B"] = "llama-guard-3-8b";
1004
- /** Llama 3.2 90B Vision Preview — multimodal */
1005
- GroqModels["LLAMA_3_2_90B_VISION_PREVIEW"] = "llama-3.2-90b-vision-preview";
1006
- /** Llama 3.2 11B Vision Preview — smaller multimodal */
1007
- GroqModels["LLAMA_3_2_11B_VISION_PREVIEW"] = "llama-3.2-11b-vision-preview";
1008
- })(GroqModels || (GroqModels = {}));
1009
- /**
1010
- * Cerebras inference models (wafer-scale, OpenAI-compatible API).
1011
- * @see https://inference-docs.cerebras.ai/introduction
1012
- *
1013
- * Roster verified against a live authenticated `/v1/models` on 2026-08-27:
1014
- * only these two ids are served. The llama/qwen models the vendor docs
1015
- * once listed are retired and now 404.
1016
- */
1017
- export var CerebrasModels;
1018
- (function (CerebrasModels) {
1019
- /** OpenAI GPT-OSS 120B (open-weight) — production default */
1020
- CerebrasModels["GPT_OSS_120B"] = "gpt-oss-120b";
1021
- /** Google Gemma 4 31B */
1022
- CerebrasModels["GEMMA_4_31B"] = "gemma-4-31b";
1023
- })(CerebrasModels || (CerebrasModels = {}));
1024
- /**
1025
- * SambaNova Cloud models (RDU-accelerated, OpenAI-compatible API).
1026
- * @see https://docs.sambanova.ai
1027
- *
1028
- * Roster verified against a live authenticated `/v1/models` on 2026-08-27
1029
- * (exact ids — note the vendor's mixed casing). DeepSeek-V3.2 and
1030
- * gemma-4-31B-it are vendor "preview" models (limited capacity, may be
1031
- * removed at short notice); the rest are production.
1032
- */
1033
- export var SambanovaModels;
1034
- (function (SambanovaModels) {
1035
- /** Meta Llama 3.3 70B Instruct — production default, 128K context */
1036
- SambanovaModels["META_LLAMA_3_3_70B_INSTRUCT"] = "Meta-Llama-3.3-70B-Instruct";
1037
- /** OpenAI GPT-OSS 120B (open-weight), 128K context */
1038
- SambanovaModels["GPT_OSS_120B"] = "gpt-oss-120b";
1039
- /** DeepSeek V3.1 (reasoning), 128K context */
1040
- SambanovaModels["DEEPSEEK_V3_1"] = "DeepSeek-V3.1";
1041
- /** DeepSeek V3.2 (reasoning, vendor preview), 32K context */
1042
- SambanovaModels["DEEPSEEK_V3_2"] = "DeepSeek-V3.2";
1043
- /** MiniMax M2.7, 192K context */
1044
- SambanovaModels["MINIMAX_M2_7"] = "MiniMax-M2.7";
1045
- /** MiniMax M3 (vision per vendor dashboard) */
1046
- SambanovaModels["MINIMAX_M3"] = "MiniMax-M3";
1047
- /** Google Gemma 4 31B IT (vision: text+image+video, vendor preview), 128K context */
1048
- SambanovaModels["GEMMA_4_31B_IT"] = "gemma-4-31B-it";
1049
- })(SambanovaModels || (SambanovaModels = {}));
1050
910
  /**
1051
911
  * Cohere Command + Embed models.
1052
912
  * @see https://docs.cohere.com/docs/models
@@ -1075,97 +935,6 @@ export var CohereModels;
1075
935
  /** Rerank v3 English */
1076
936
  CohereModels["RERANK_ENGLISH_V3"] = "rerank-english-v3.0";
1077
937
  })(CohereModels || (CohereModels = {}));
1078
- /**
1079
- * Together AI hosted models — open-model gateway.
1080
- * @see https://docs.together.ai/docs/serverless-models
1081
- */
1082
- export var TogetherAIModels;
1083
- (function (TogetherAIModels) {
1084
- /** Llama 3.3 70B Instruct Turbo — production default */
1085
- TogetherAIModels["LLAMA_3_3_70B_INSTRUCT_TURBO"] = "meta-llama/Llama-3.3-70B-Instruct-Turbo";
1086
- /** Llama 3.1 405B Instruct Turbo — flagship size */
1087
- TogetherAIModels["LLAMA_3_1_405B_INSTRUCT_TURBO"] = "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo";
1088
- /** Llama 3.1 70B Instruct Turbo */
1089
- TogetherAIModels["LLAMA_3_1_70B_INSTRUCT_TURBO"] = "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo";
1090
- /** Llama 3.1 8B Instruct Turbo — fastest */
1091
- TogetherAIModels["LLAMA_3_1_8B_INSTRUCT_TURBO"] = "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo";
1092
- /** Mixtral 8x22B Instruct */
1093
- TogetherAIModels["MIXTRAL_8X22B_INSTRUCT"] = "mistralai/Mixtral-8x22B-Instruct-v0.1";
1094
- /** Mixtral 8x7B Instruct */
1095
- TogetherAIModels["MIXTRAL_8X7B_INSTRUCT"] = "mistralai/Mixtral-8x7B-Instruct-v0.1";
1096
- /** Qwen 2.5 72B Instruct Turbo */
1097
- TogetherAIModels["QWEN_2_5_72B_INSTRUCT_TURBO"] = "Qwen/Qwen2.5-72B-Instruct-Turbo";
1098
- /** Qwen 2.5 Coder 32B Instruct */
1099
- TogetherAIModels["QWEN_2_5_CODER_32B"] = "Qwen/Qwen2.5-Coder-32B-Instruct";
1100
- /** DeepSeek R1 — reasoning */
1101
- TogetherAIModels["DEEPSEEK_R1"] = "deepseek-ai/DeepSeek-R1";
1102
- /** DeepSeek V3 */
1103
- TogetherAIModels["DEEPSEEK_V3"] = "deepseek-ai/DeepSeek-V3";
1104
- /** Google Gemma 2 27B IT */
1105
- TogetherAIModels["GEMMA_2_27B_IT"] = "google/gemma-2-27b-it";
1106
- /** WizardLM 2 8x22B */
1107
- TogetherAIModels["WIZARDLM_2_8X22B"] = "microsoft/WizardLM-2-8x22B";
1108
- })(TogetherAIModels || (TogetherAIModels = {}));
1109
- /**
1110
- * Fireworks AI hosted models — fast open-model serving.
1111
- * @see https://fireworks.ai/models
1112
- *
1113
- * Note: the older Llama / Mixtral / Qwen 2.5 generation was rotated
1114
- * out of Fireworks' serverless tier. Current shipping defaults below.
1115
- */
1116
- export var FireworksModels;
1117
- (function (FireworksModels) {
1118
- /** DeepSeek V4 Pro — current general-purpose default */
1119
- FireworksModels["DEEPSEEK_V4_PRO"] = "accounts/fireworks/models/deepseek-v4-pro";
1120
- /** GLM 5.1 — Zhipu flagship */
1121
- FireworksModels["GLM_5P1"] = "accounts/fireworks/models/glm-5p1";
1122
- /** GLM 5 — broader coverage */
1123
- FireworksModels["GLM_5"] = "accounts/fireworks/models/glm-5";
1124
- /** Kimi K2.6 — Moonshot flagship */
1125
- FireworksModels["KIMI_K2P6"] = "accounts/fireworks/models/kimi-k2p6";
1126
- /** Kimi K2.5 — preceding Kimi */
1127
- FireworksModels["KIMI_K2P5"] = "accounts/fireworks/models/kimi-k2p5";
1128
- /** GPT-OSS 120B — Apache-2.0 OpenAI weights */
1129
- FireworksModels["GPT_OSS_120B"] = "accounts/fireworks/models/gpt-oss-120b";
1130
- })(FireworksModels || (FireworksModels = {}));
1131
- /**
1132
- * Perplexity Sonar models — built-in web grounding.
1133
- * @see https://docs.perplexity.ai/guides/model-cards
1134
- */
1135
- export var PerplexityModels;
1136
- (function (PerplexityModels) {
1137
- /** Sonar — production default with web search */
1138
- PerplexityModels["SONAR"] = "sonar";
1139
- /** Sonar Pro — better reasoning + larger context */
1140
- PerplexityModels["SONAR_PRO"] = "sonar-pro";
1141
- /** Sonar Reasoning — explicit reasoning traces */
1142
- PerplexityModels["SONAR_REASONING"] = "sonar-reasoning";
1143
- /** Sonar Reasoning Pro — flagship reasoning + web */
1144
- PerplexityModels["SONAR_REASONING_PRO"] = "sonar-reasoning-pro";
1145
- /** Sonar Deep Research — long-form research with citations */
1146
- PerplexityModels["SONAR_DEEP_RESEARCH"] = "sonar-deep-research";
1147
- })(PerplexityModels || (PerplexityModels = {}));
1148
- /**
1149
- * Cloudflare Workers AI models — edge-served open models.
1150
- * @see https://developers.cloudflare.com/workers-ai/models/
1151
- */
1152
- export var CloudflareModels;
1153
- (function (CloudflareModels) {
1154
- /** Llama 3.3 70B Instruct (FP8 fast) */
1155
- CloudflareModels["LLAMA_3_3_70B_FAST"] = "@cf/meta/llama-3.3-70b-instruct-fp8-fast";
1156
- /** Llama 3.1 70B Instruct */
1157
- CloudflareModels["LLAMA_3_1_70B_INSTRUCT"] = "@cf/meta/llama-3.1-70b-instruct";
1158
- /** Llama 3.1 8B Instruct fast */
1159
- CloudflareModels["LLAMA_3_1_8B_FAST"] = "@cf/meta/llama-3.1-8b-instruct-fast";
1160
- /** Llama 3.2 11B Vision Instruct */
1161
- CloudflareModels["LLAMA_3_2_11B_VISION"] = "@cf/meta/llama-3.2-11b-vision-instruct";
1162
- /** Mistral 7B Instruct v0.2 */
1163
- CloudflareModels["MISTRAL_7B_INSTRUCT_V0_2"] = "@cf/mistral/mistral-7b-instruct-v0.2";
1164
- /** Qwen 1.5 14B Chat AWQ */
1165
- CloudflareModels["QWEN_1P5_14B_CHAT_AWQ"] = "@cf/qwen/qwen1.5-14b-chat-awq";
1166
- /** Gemma 2B IT */
1167
- CloudflareModels["GEMMA_2B_IT_LORA"] = "@cf/google/gemma-2b-it-lora";
1168
- })(CloudflareModels || (CloudflareModels = {}));
1169
938
  /**
1170
939
  * Voyage AI embedding models — top-tier RAG embedders.
1171
940
  * @see https://docs.voyageai.com/docs/embeddings
@@ -1287,3 +1056,118 @@ export var ReplicateModels;
1287
1056
  * authentication failures during ongoing operations
1288
1057
  */
1289
1058
  export const TOKEN_EXPIRY_BUFFER_MS = 5 * 60 * 1000; // 5 minutes
1059
+ // ── BEGIN GENERATED(models-enums): provider catalog (pnpm run codegen:catalog) ──
1060
+ export var CerebrasModels;
1061
+ (function (CerebrasModels) {
1062
+ CerebrasModels["GPT_OSS_120B"] = "gpt-oss-120b";
1063
+ CerebrasModels["GEMMA_4_31B"] = "gemma-4-31b";
1064
+ })(CerebrasModels || (CerebrasModels = {}));
1065
+ export var CloudflareModels;
1066
+ (function (CloudflareModels) {
1067
+ CloudflareModels["LLAMA_3_3_70B_FAST"] = "@cf/meta/llama-3.3-70b-instruct-fp8-fast";
1068
+ CloudflareModels["LLAMA_3_1_70B_INSTRUCT"] = "@cf/meta/llama-3.1-70b-instruct";
1069
+ CloudflareModels["LLAMA_3_1_8B_FAST"] = "@cf/meta/llama-3.1-8b-instruct-fast";
1070
+ CloudflareModels["LLAMA_3_2_11B_VISION"] = "@cf/meta/llama-3.2-11b-vision-instruct";
1071
+ CloudflareModels["MISTRAL_7B_INSTRUCT_V0_2"] = "@cf/mistral/mistral-7b-instruct-v0.2";
1072
+ CloudflareModels["QWEN_1P5_14B_CHAT_AWQ"] = "@cf/qwen/qwen1.5-14b-chat-awq";
1073
+ CloudflareModels["GEMMA_2B_IT_LORA"] = "@cf/google/gemma-2b-it-lora";
1074
+ })(CloudflareModels || (CloudflareModels = {}));
1075
+ export var FireworksModels;
1076
+ (function (FireworksModels) {
1077
+ FireworksModels["DEEPSEEK_V4_PRO"] = "accounts/fireworks/models/deepseek-v4-pro";
1078
+ FireworksModels["GLM_5P1"] = "accounts/fireworks/models/glm-5p1";
1079
+ FireworksModels["GLM_5"] = "accounts/fireworks/models/glm-5";
1080
+ FireworksModels["KIMI_K2P6"] = "accounts/fireworks/models/kimi-k2p6";
1081
+ FireworksModels["KIMI_K2P5"] = "accounts/fireworks/models/kimi-k2p5";
1082
+ FireworksModels["GPT_OSS_120B"] = "accounts/fireworks/models/gpt-oss-120b";
1083
+ FireworksModels["LLAMA_V3P2_90B_VISION_INSTRUCT"] = "accounts/fireworks/models/llama-v3p2-90b-vision-instruct";
1084
+ FireworksModels["LLAMA_V3P2_11B_VISION_INSTRUCT"] = "accounts/fireworks/models/llama-v3p2-11b-vision-instruct";
1085
+ FireworksModels["PHI_3_VISION_128K_INSTRUCT"] = "accounts/fireworks/models/phi-3-vision-128k-instruct";
1086
+ })(FireworksModels || (FireworksModels = {}));
1087
+ export var GroqModels;
1088
+ (function (GroqModels) {
1089
+ GroqModels["LLAMA_3_3_70B_VERSATILE"] = "llama-3.3-70b-versatile";
1090
+ GroqModels["LLAMA_3_1_8B_INSTANT"] = "llama-3.1-8b-instant";
1091
+ GroqModels["GEMMA_2_9B_IT"] = "gemma2-9b-it";
1092
+ GroqModels["MIXTRAL_8X7B_32768"] = "mixtral-8x7b-32768";
1093
+ GroqModels["LLAMA_GUARD_3_8B"] = "llama-guard-3-8b";
1094
+ GroqModels["LLAMA_3_2_90B_VISION_PREVIEW"] = "llama-3.2-90b-vision-preview";
1095
+ GroqModels["LLAMA_3_2_11B_VISION_PREVIEW"] = "llama-3.2-11b-vision-preview";
1096
+ })(GroqModels || (GroqModels = {}));
1097
+ export var MistralModels;
1098
+ (function (MistralModels) {
1099
+ MistralModels["MISTRAL_LARGE_LATEST"] = "mistral-large-latest";
1100
+ MistralModels["MISTRAL_LARGE_2512"] = "mistral-large-2512";
1101
+ MistralModels["MISTRAL_MEDIUM_LATEST"] = "mistral-medium-latest";
1102
+ MistralModels["MISTRAL_MEDIUM_2508"] = "mistral-medium-2508";
1103
+ MistralModels["MISTRAL_SMALL_LATEST"] = "mistral-small-latest";
1104
+ MistralModels["MISTRAL_SMALL_2506"] = "mistral-small-2506";
1105
+ MistralModels["MAGISTRAL_MEDIUM_LATEST"] = "magistral-medium-latest";
1106
+ MistralModels["MAGISTRAL_SMALL_LATEST"] = "magistral-small-latest";
1107
+ MistralModels["MINISTRAL_14B_2512"] = "ministral-14b-2512";
1108
+ MistralModels["MINISTRAL_8B_2512"] = "ministral-8b-2512";
1109
+ MistralModels["MINISTRAL_3B_2512"] = "ministral-3b-2512";
1110
+ MistralModels["CODESTRAL_LATEST"] = "codestral-latest";
1111
+ MistralModels["CODESTRAL_2508"] = "codestral-2508";
1112
+ MistralModels["CODESTRAL_EMBED"] = "codestral-embed";
1113
+ MistralModels["DEVSTRAL_MEDIUM_LATEST"] = "devstral-medium-latest";
1114
+ MistralModels["DEVSTRAL_SMALL_LATEST"] = "devstral-small-latest";
1115
+ MistralModels["PIXTRAL_LARGE"] = "pixtral-large";
1116
+ MistralModels["PIXTRAL_12B"] = "pixtral-12b";
1117
+ MistralModels["VOXTRAL_SMALL_LATEST"] = "voxtral-small-latest";
1118
+ MistralModels["VOXTRAL_MINI_LATEST"] = "voxtral-mini-latest";
1119
+ MistralModels["DEVSTRAL_2"] = "devstral-2512";
1120
+ MistralModels["DEVSTRAL_SMALL_2"] = "devstral-small-2512";
1121
+ MistralModels["MAGISTRAL_MEDIUM_2509"] = "magistral-medium-2509";
1122
+ MistralModels["MAGISTRAL_SMALL_2509"] = "magistral-small-2509";
1123
+ MistralModels["VOXTRAL_MINI_TRANSCRIBE_2"] = "voxtral-mini-2602";
1124
+ MistralModels["MISTRAL_OCR_3"] = "mistral-ocr-2512";
1125
+ MistralModels["MISTRAL_OCR_LATEST"] = "mistral-ocr-latest";
1126
+ MistralModels["MISTRAL_NEMO"] = "mistral-nemo";
1127
+ MistralModels["MISTRAL_EMBED"] = "mistral-embed";
1128
+ MistralModels["MISTRAL_MODERATION_LATEST"] = "mistral-moderation-latest";
1129
+ MistralModels["MISTRAL_SMALL_4"] = "mistral-small-2603";
1130
+ MistralModels["MISTRAL_SMALL_CREATIVE"] = "mistral-small-creative";
1131
+ })(MistralModels || (MistralModels = {}));
1132
+ export var PerplexityModels;
1133
+ (function (PerplexityModels) {
1134
+ PerplexityModels["SONAR"] = "sonar";
1135
+ PerplexityModels["SONAR_PRO"] = "sonar-pro";
1136
+ PerplexityModels["SONAR_REASONING"] = "sonar-reasoning";
1137
+ PerplexityModels["SONAR_REASONING_PRO"] = "sonar-reasoning-pro";
1138
+ PerplexityModels["SONAR_DEEP_RESEARCH"] = "sonar-deep-research";
1139
+ })(PerplexityModels || (PerplexityModels = {}));
1140
+ export var SambanovaModels;
1141
+ (function (SambanovaModels) {
1142
+ SambanovaModels["META_LLAMA_3_3_70B_INSTRUCT"] = "Meta-Llama-3.3-70B-Instruct";
1143
+ SambanovaModels["GPT_OSS_120B"] = "gpt-oss-120b";
1144
+ SambanovaModels["DEEPSEEK_V3_1"] = "DeepSeek-V3.1";
1145
+ SambanovaModels["DEEPSEEK_V3_2"] = "DeepSeek-V3.2";
1146
+ SambanovaModels["MINIMAX_M2_7"] = "MiniMax-M2.7";
1147
+ SambanovaModels["MINIMAX_M3"] = "MiniMax-M3";
1148
+ SambanovaModels["GEMMA_4_31B_IT"] = "gemma-4-31B-it";
1149
+ })(SambanovaModels || (SambanovaModels = {}));
1150
+ export var TogetherAIModels;
1151
+ (function (TogetherAIModels) {
1152
+ TogetherAIModels["LLAMA_3_3_70B_INSTRUCT_TURBO"] = "meta-llama/Llama-3.3-70B-Instruct-Turbo";
1153
+ TogetherAIModels["LLAMA_3_1_405B_INSTRUCT_TURBO"] = "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo";
1154
+ TogetherAIModels["LLAMA_3_1_70B_INSTRUCT_TURBO"] = "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo";
1155
+ TogetherAIModels["LLAMA_3_1_8B_INSTRUCT_TURBO"] = "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo";
1156
+ TogetherAIModels["MIXTRAL_8X22B_INSTRUCT"] = "mistralai/Mixtral-8x22B-Instruct-v0.1";
1157
+ TogetherAIModels["MIXTRAL_8X7B_INSTRUCT"] = "mistralai/Mixtral-8x7B-Instruct-v0.1";
1158
+ TogetherAIModels["QWEN_2_5_72B_INSTRUCT_TURBO"] = "Qwen/Qwen2.5-72B-Instruct-Turbo";
1159
+ TogetherAIModels["QWEN_2_5_CODER_32B"] = "Qwen/Qwen2.5-Coder-32B-Instruct";
1160
+ TogetherAIModels["DEEPSEEK_R1"] = "deepseek-ai/DeepSeek-R1";
1161
+ TogetherAIModels["DEEPSEEK_V3"] = "deepseek-ai/DeepSeek-V3";
1162
+ TogetherAIModels["GEMMA_2_27B_IT"] = "google/gemma-2-27b-it";
1163
+ TogetherAIModels["WIZARDLM_2_8X22B"] = "microsoft/WizardLM-2-8x22B";
1164
+ })(TogetherAIModels || (TogetherAIModels = {}));
1165
+ export var XaiModels;
1166
+ (function (XaiModels) {
1167
+ XaiModels["GROK_3"] = "grok-3";
1168
+ XaiModels["GROK_3_MINI"] = "grok-3-mini";
1169
+ XaiModels["GROK_2_LATEST"] = "grok-2-latest";
1170
+ XaiModels["GROK_2_VISION_LATEST"] = "grok-2-vision-latest";
1171
+ XaiModels["GROK_BETA"] = "grok-beta";
1172
+ })(XaiModels || (XaiModels = {}));
1173
+ // ── END GENERATED(models-enums) ──
@@ -2,10 +2,8 @@ import { AIProviderName } from "../constants/enums.js";
2
2
  import type { ProviderDescriptor } from "../types/index.js";
3
3
  /**
4
4
  * Single source of truth for provider identity, credentials, defaults, and
5
- * runtime behavior classification. Pure data no provider-class imports,
6
- * no dynamic import(), no side effects beyond building the two derived
7
- * lookup maps below. Order follows the AIProviderName enum declaration
8
- * order (enums.ts:8-40) so this file stays easy to diff against it.
5
+ * runtime behavior classification — the hand-maintained providers plus the
6
+ * 8 JSON-catalog providers derived above.
9
7
  */
10
8
  export declare const PROVIDER_DESCRIPTORS: readonly ProviderDescriptor[];
11
9
  /** O(1) canonical-name → descriptor lookup. */
@@ -1,14 +1,18 @@
1
1
  import { AIProviderName } from "../constants/enums.js";
2
- import { GoogleAIModels, OpenAIModels, AnthropicModels, VertexModels, MistralModels, OllamaModels, LiteLLMModels, HuggingFaceModels, DeepSeekModels, NvidiaNimModels, OpenRouterModels, XaiModels, GroqModels, CerebrasModels, SambanovaModels, CohereModels, TogetherAIModels, FireworksModels, PerplexityModels, CloudflareModels, VoyageModels, JinaModels, StabilityModels, IdeogramModels, RecraftModels, ReplicateModels, } from "../constants/enums.js";
2
+ import { GoogleAIModels, OpenAIModels, AnthropicModels, VertexModels, MistralModels, OllamaModels, LiteLLMModels, HuggingFaceModels, DeepSeekModels, NvidiaNimModels, OpenRouterModels, CohereModels, VoyageModels, JinaModels, StabilityModels, IdeogramModels, RecraftModels, ReplicateModels, } from "../constants/enums.js";
3
3
  import { API_KEY_FORMATS } from "../utils/providerConfig.js";
4
+ import { getCatalogJsonEntries, catalogCredentialsKey, catalogEnvVar, } from "../providers/catalog/loader.js";
4
5
  /**
5
- * Single source of truth for provider identity, credentials, defaults, and
6
- * runtime behavior classification. Pure data no provider-class imports,
7
- * no dynamic import(), no side effects beyond building the two derived
8
- * lookup maps below. Order follows the AIProviderName enum declaration
9
- * order (enums.ts:8-40) so this file stays easy to diff against it.
6
+ * Hand-maintained provider identity, credentials, defaults, and runtime
7
+ * behavior classification for every provider EXCEPT the 8 JSON-catalog
8
+ * providers derived by buildCatalogDescriptors() below (see
9
+ * PROVIDER_DESCRIPTORS's own doc for why Mistral, a 9th catalog provider,
10
+ * stays here too). Pure data no provider-class imports, no dynamic
11
+ * import(), no side effects beyond building the two derived lookup maps
12
+ * below. Order follows the AIProviderName enum declaration order
13
+ * (enums.ts:8-40) so this file stays easy to diff against it.
10
14
  */
11
- export const PROVIDER_DESCRIPTORS = [
15
+ const HAND_DESCRIPTORS = [
12
16
  {
13
17
  name: AIProviderName.BEDROCK,
14
18
  defaultHealthSweepPriority: 5,
@@ -353,66 +357,6 @@ export const PROVIDER_DESCRIPTORS = [
353
357
  healthCheck: "env-only",
354
358
  setupUrl: "https://github.com/ggerganov/llama.cpp",
355
359
  },
356
- {
357
- name: AIProviderName.XAI,
358
- aliases: ["grok"],
359
- credentialsKey: "xai",
360
- envVars: {
361
- apiKey: "XAI_API_KEY",
362
- baseURL: "XAI_BASE_URL",
363
- model: "XAI_MODEL",
364
- },
365
- defaultModel: XaiModels.GROK_3,
366
- toolSupport: "native",
367
- localRuntime: false,
368
- healthCheck: "env-only",
369
- setupUrl: "https://console.x.ai/",
370
- },
371
- {
372
- name: AIProviderName.SAMBANOVA,
373
- aliases: [],
374
- credentialsKey: "sambanova",
375
- envVars: {
376
- apiKey: "SAMBANOVA_API_KEY",
377
- baseURL: "SAMBANOVA_BASE_URL",
378
- model: "SAMBANOVA_MODEL",
379
- },
380
- defaultModel: SambanovaModels.META_LLAMA_3_3_70B_INSTRUCT,
381
- toolSupport: "native",
382
- localRuntime: false,
383
- healthCheck: "env-only",
384
- setupUrl: "https://cloud.sambanova.ai/apis",
385
- },
386
- {
387
- name: AIProviderName.CEREBRAS,
388
- aliases: [],
389
- credentialsKey: "cerebras",
390
- envVars: {
391
- apiKey: "CEREBRAS_API_KEY",
392
- baseURL: "CEREBRAS_BASE_URL",
393
- model: "CEREBRAS_MODEL",
394
- },
395
- defaultModel: CerebrasModels.GPT_OSS_120B,
396
- toolSupport: "native",
397
- localRuntime: false,
398
- healthCheck: "env-only",
399
- setupUrl: "https://cloud.cerebras.ai",
400
- },
401
- {
402
- name: AIProviderName.GROQ,
403
- aliases: [],
404
- credentialsKey: "groq",
405
- envVars: {
406
- apiKey: "GROQ_API_KEY",
407
- baseURL: "GROQ_BASE_URL",
408
- model: "GROQ_MODEL",
409
- },
410
- defaultModel: GroqModels.LLAMA_3_3_70B_VERSATILE,
411
- toolSupport: "native",
412
- localRuntime: false,
413
- healthCheck: "env-only",
414
- setupUrl: "https://console.groq.com/keys",
415
- },
416
360
  {
417
361
  name: AIProviderName.COHERE,
418
362
  aliases: [],
@@ -428,66 +372,6 @@ export const PROVIDER_DESCRIPTORS = [
428
372
  healthCheck: "env-only",
429
373
  setupUrl: "https://dashboard.cohere.com/api-keys",
430
374
  },
431
- {
432
- name: AIProviderName.TOGETHER_AI,
433
- aliases: ["together"],
434
- credentialsKey: "together",
435
- envVars: {
436
- apiKey: "TOGETHER_API_KEY",
437
- baseURL: "TOGETHER_BASE_URL",
438
- model: "TOGETHER_MODEL",
439
- },
440
- defaultModel: TogetherAIModels.LLAMA_3_3_70B_INSTRUCT_TURBO,
441
- toolSupport: "native",
442
- localRuntime: false,
443
- healthCheck: "env-only",
444
- setupUrl: "https://api.together.xyz/settings/api-keys",
445
- },
446
- {
447
- name: AIProviderName.FIREWORKS,
448
- aliases: [],
449
- credentialsKey: "fireworks",
450
- envVars: {
451
- apiKey: "FIREWORKS_API_KEY",
452
- baseURL: "FIREWORKS_BASE_URL",
453
- model: "FIREWORKS_MODEL",
454
- },
455
- defaultModel: FireworksModels.DEEPSEEK_V4_PRO,
456
- toolSupport: "native",
457
- localRuntime: false,
458
- healthCheck: "env-only",
459
- setupUrl: "https://fireworks.ai/account/api-keys",
460
- },
461
- {
462
- name: AIProviderName.PERPLEXITY,
463
- aliases: ["pplx"],
464
- credentialsKey: "perplexity",
465
- envVars: {
466
- apiKey: "PERPLEXITY_API_KEY",
467
- baseURL: "PERPLEXITY_BASE_URL",
468
- model: "PERPLEXITY_MODEL",
469
- },
470
- defaultModel: PerplexityModels.SONAR,
471
- toolSupport: "native",
472
- localRuntime: false,
473
- healthCheck: "env-only",
474
- setupUrl: "https://www.perplexity.ai/settings/api",
475
- },
476
- {
477
- name: AIProviderName.CLOUDFLARE,
478
- aliases: ["workers-ai", "cf-ai"],
479
- credentialsKey: "cloudflare",
480
- envVars: {
481
- apiKey: "CLOUDFLARE_API_KEY",
482
- extraRequired: ["CLOUDFLARE_ACCOUNT_ID"],
483
- model: "CLOUDFLARE_MODEL",
484
- },
485
- defaultModel: CloudflareModels.LLAMA_3_3_70B_FAST,
486
- toolSupport: "native",
487
- localRuntime: false,
488
- healthCheck: "env-only",
489
- setupUrl: "https://dash.cloudflare.com/profile/api-tokens",
490
- },
491
375
  {
492
376
  name: AIProviderName.REPLICATE,
493
377
  aliases: [],
@@ -579,6 +463,78 @@ export const PROVIDER_DESCRIPTORS = [
579
463
  setupUrl: "https://www.recraft.ai/api",
580
464
  },
581
465
  ];
466
+ /**
467
+ * Builds ProviderDescriptor entries for 8 of the 9 JSON-catalog providers —
468
+ * cerebras, cloudflare, fireworks, groq, perplexity, sambanova, together-ai,
469
+ * xai. Every field is derived from the catalog JSON
470
+ * (src/lib/providers/catalog/<id>.json), never hand-typed.
471
+ *
472
+ * Mistral is the 9th catalog provider but is deliberately excluded here and
473
+ * stays in HAND_DESCRIPTORS above: its JSON setup.url
474
+ * ("https://console.mistral.ai/") diverges from the long-shipped descriptor
475
+ * setupUrl ("https://console.mistral.ai/api-keys" — a real value conflict,
476
+ * not missing enrichment), its envVars has no `model` key the JSON would
477
+ * otherwise add, and it carries 3 fields (timeouts, autoSelectPriority,
478
+ * apiKeyFormatPattern) no JSON field produces. Deriving it would either
479
+ * silently change setupUrl or require as many per-field overrides as the
480
+ * hand entry itself — so it is left alone.
481
+ */
482
+ function buildCatalogDescriptor(entry) {
483
+ // Cloudflare is the only catalog provider whose wire config is a
484
+ // baseURLTemplate + extra credential (accountId) rather than a plain
485
+ // baseURL env var — mirrors loader.ts's buildCatalogEntries()
486
+ // computedBaseURL.envVar formula exactly. Duplicated intentionally, the
487
+ // same way loader.ts itself duplicates toCamelCase from
488
+ // tools/codegen-catalog.ts (src/ must not import from tools/).
489
+ const envVars = entry.wire.baseURLTemplate
490
+ ? {
491
+ apiKey: catalogEnvVar(entry, "apiKey"),
492
+ extraRequired: [
493
+ `${entry.id.toUpperCase().replace(/-/g, "_")}_${(entry.wire.extraCredentials?.[0] ?? "accountId")
494
+ .replace(/([A-Z])/g, "_$1")
495
+ .toUpperCase()}`,
496
+ ],
497
+ model: catalogEnvVar(entry, "model"),
498
+ }
499
+ : {
500
+ apiKey: catalogEnvVar(entry, "apiKey"),
501
+ baseURL: catalogEnvVar(entry, "baseURL"),
502
+ model: catalogEnvVar(entry, "model"),
503
+ };
504
+ return {
505
+ name: entry.id,
506
+ aliases: entry.aliases,
507
+ credentialsKey: catalogCredentialsKey(entry),
508
+ envVars,
509
+ defaultModel: entry.models.default,
510
+ // All 9 catalog providers currently have capabilities.tools: true, so
511
+ // this is runtime-identical today either way. "none" (not an invented
512
+ // literal — it's the union's own no-tool-support member, the same one
513
+ // REPLICATE/VOYAGE/JINA/STABILITY/IDEOGRAM/RECRAFT use above) is the
514
+ // correct false-branch if a future catalog provider ships tools: false.
515
+ toolSupport: entry.capabilities.tools ? "native" : "none",
516
+ localRuntime: false,
517
+ healthCheck: "env-only",
518
+ setupUrl: entry.setup.url,
519
+ ...(entry.setup.apiKeyFormat
520
+ ? { apiKeyFormatPattern: new RegExp(entry.setup.apiKeyFormat) }
521
+ : {}),
522
+ };
523
+ }
524
+ function buildCatalogDescriptors() {
525
+ return getCatalogJsonEntries()
526
+ .filter((entry) => entry.id !== "mistral")
527
+ .map(buildCatalogDescriptor);
528
+ }
529
+ /**
530
+ * Single source of truth for provider identity, credentials, defaults, and
531
+ * runtime behavior classification — the hand-maintained providers plus the
532
+ * 8 JSON-catalog providers derived above.
533
+ */
534
+ export const PROVIDER_DESCRIPTORS = [
535
+ ...HAND_DESCRIPTORS,
536
+ ...buildCatalogDescriptors(),
537
+ ];
582
538
  /** O(1) canonical-name → descriptor lookup. */
583
539
  export const PROVIDER_DESCRIPTORS_BY_NAME = new Map(PROVIDER_DESCRIPTORS.map((d) => [d.name, d]));
584
540
  /**