@llmgateway/models 0.0.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 (112) hide show
  1. package/dist/get-cheapest-from-available-providers.d.ts +30 -0
  2. package/dist/get-cheapest-from-available-providers.js +183 -0
  3. package/dist/get-cheapest-from-available-providers.js.map +1 -0
  4. package/dist/get-cheapest-model-for-provider.d.ts +2 -0
  5. package/dist/get-cheapest-model-for-provider.js +49 -0
  6. package/dist/get-cheapest-model-for-provider.js.map +1 -0
  7. package/dist/get-provider-endpoint.d.ts +3 -0
  8. package/dist/get-provider-endpoint.js +243 -0
  9. package/dist/get-provider-endpoint.js.map +1 -0
  10. package/dist/get-provider-headers.d.ts +5 -0
  11. package/dist/get-provider-headers.js +45 -0
  12. package/dist/get-provider-headers.js.map +1 -0
  13. package/dist/helpers.d.ts +1 -0
  14. package/dist/helpers.js +27 -0
  15. package/dist/helpers.js.map +1 -0
  16. package/dist/index.d.ts +16 -0
  17. package/dist/index.js +17 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/models/alibaba.d.ts +686 -0
  20. package/dist/models/alibaba.js +789 -0
  21. package/dist/models/alibaba.js.map +1 -0
  22. package/dist/models/anthropic.d.ts +572 -0
  23. package/dist/models/anthropic.js +638 -0
  24. package/dist/models/anthropic.js.map +1 -0
  25. package/dist/models/aws-bedrock.d.ts +1 -0
  26. package/dist/models/aws-bedrock.js +2 -0
  27. package/dist/models/aws-bedrock.js.map +1 -0
  28. package/dist/models/bytedance.d.ts +131 -0
  29. package/dist/models/bytedance.js +151 -0
  30. package/dist/models/bytedance.js.map +1 -0
  31. package/dist/models/deepseek.d.ts +175 -0
  32. package/dist/models/deepseek.js +197 -0
  33. package/dist/models/deepseek.js.map +1 -0
  34. package/dist/models/google.d.ts +1065 -0
  35. package/dist/models/google.js +1201 -0
  36. package/dist/models/google.js.map +1 -0
  37. package/dist/models/llmgateway.d.ts +39 -0
  38. package/dist/models/llmgateway.js +59 -0
  39. package/dist/models/llmgateway.js.map +1 -0
  40. package/dist/models/meta.d.ts +263 -0
  41. package/dist/models/meta.js +300 -0
  42. package/dist/models/meta.js.map +1 -0
  43. package/dist/models/microsoft.d.ts +1 -0
  44. package/dist/models/microsoft.js +2 -0
  45. package/dist/models/microsoft.js.map +1 -0
  46. package/dist/models/minimax.d.ts +59 -0
  47. package/dist/models/minimax.js +68 -0
  48. package/dist/models/minimax.js.map +1 -0
  49. package/dist/models/mistral.d.ts +78 -0
  50. package/dist/models/mistral.js +92 -0
  51. package/dist/models/mistral.js.map +1 -0
  52. package/dist/models/moonshot.d.ts +165 -0
  53. package/dist/models/moonshot.js +184 -0
  54. package/dist/models/moonshot.js.map +1 -0
  55. package/dist/models/nousresearch.d.ts +21 -0
  56. package/dist/models/nousresearch.js +26 -0
  57. package/dist/models/nousresearch.js.map +1 -0
  58. package/dist/models/openai.d.ts +1018 -0
  59. package/dist/models/openai.js +1213 -0
  60. package/dist/models/openai.js.map +1 -0
  61. package/dist/models/perplexity.d.ts +67 -0
  62. package/dist/models/perplexity.js +78 -0
  63. package/dist/models/perplexity.js.map +1 -0
  64. package/dist/models/routeway.d.ts +161 -0
  65. package/dist/models/routeway.js +187 -0
  66. package/dist/models/routeway.js.map +1 -0
  67. package/dist/models/xai.d.ts +270 -0
  68. package/dist/models/xai.js +311 -0
  69. package/dist/models/xai.js.map +1 -0
  70. package/dist/models/zai.d.ts +492 -0
  71. package/dist/models/zai.js +551 -0
  72. package/dist/models/zai.js.map +1 -0
  73. package/dist/models.d.ts +5304 -0
  74. package/dist/models.js +37 -0
  75. package/dist/models.js.map +1 -0
  76. package/dist/models.spec.d.ts +1 -0
  77. package/dist/models.spec.js +263 -0
  78. package/dist/models.spec.js.map +1 -0
  79. package/dist/prepare-request-body.d.ts +10 -0
  80. package/dist/prepare-request-body.js +1081 -0
  81. package/dist/prepare-request-body.js.map +1 -0
  82. package/dist/prepare-request-body.spec.d.ts +1 -0
  83. package/dist/prepare-request-body.spec.js +231 -0
  84. package/dist/prepare-request-body.spec.js.map +1 -0
  85. package/dist/process-image-url.d.ts +4 -0
  86. package/dist/process-image-url.js +121 -0
  87. package/dist/process-image-url.js.map +1 -0
  88. package/dist/provider.d.ts +9 -0
  89. package/dist/provider.js +64 -0
  90. package/dist/provider.js.map +1 -0
  91. package/dist/providers.d.ts +405 -0
  92. package/dist/providers.js +413 -0
  93. package/dist/providers.js.map +1 -0
  94. package/dist/testing.d.ts +7 -0
  95. package/dist/testing.js +19 -0
  96. package/dist/testing.js.map +1 -0
  97. package/dist/transform-anthropic-messages.d.ts +2 -0
  98. package/dist/transform-anthropic-messages.js +185 -0
  99. package/dist/transform-anthropic-messages.js.map +1 -0
  100. package/dist/transform-google-messages.d.ts +25 -0
  101. package/dist/transform-google-messages.js +122 -0
  102. package/dist/transform-google-messages.js.map +1 -0
  103. package/dist/type-guards.d.ts +20 -0
  104. package/dist/type-guards.js +35 -0
  105. package/dist/type-guards.js.map +1 -0
  106. package/dist/types.d.ts +291 -0
  107. package/dist/types.js +28 -0
  108. package/dist/types.js.map +1 -0
  109. package/dist/validate-provider-key.d.ts +4 -0
  110. package/dist/validate-provider-key.js +113 -0
  111. package/dist/validate-provider-key.js.map +1 -0
  112. package/package.json +29 -0
@@ -0,0 +1,405 @@
1
+ export interface ProviderEnvConfig {
2
+ required: {
3
+ apiKey?: string;
4
+ [key: string]: string | undefined;
5
+ };
6
+ optional?: Record<string, string>;
7
+ }
8
+ export interface ProviderDefinition {
9
+ id: string;
10
+ name: string;
11
+ description: string;
12
+ env: ProviderEnvConfig;
13
+ streaming?: boolean;
14
+ cancellation?: boolean;
15
+ color?: string;
16
+ website?: string | null;
17
+ announcement?: string | null;
18
+ apiKeyInstructions?: string;
19
+ learnMore?: string;
20
+ priority?: number;
21
+ }
22
+ export declare const providers: [{
23
+ readonly id: "llmgateway";
24
+ readonly name: "LLM Gateway";
25
+ readonly description: "LLMGateway is a framework for building and deploying large language models.";
26
+ readonly env: {
27
+ readonly required: {
28
+ readonly apiKey: "LLM_LLMGATEWAY_API_KEY";
29
+ };
30
+ };
31
+ readonly streaming: true;
32
+ readonly cancellation: true;
33
+ readonly color: "#6366f1";
34
+ readonly website: "https://llmgateway.io";
35
+ readonly announcement: null;
36
+ }, {
37
+ readonly id: "openai";
38
+ readonly name: "OpenAI";
39
+ readonly description: "OpenAI is an AI research and deployment company. Our mission is to ensure that artificial general intelligence benefits all of humanity.";
40
+ readonly env: {
41
+ readonly required: {
42
+ readonly apiKey: "LLM_OPENAI_API_KEY";
43
+ };
44
+ };
45
+ readonly streaming: true;
46
+ readonly cancellation: true;
47
+ readonly color: "#0ea5e9";
48
+ readonly website: "https://openai.com";
49
+ readonly announcement: null;
50
+ }, {
51
+ readonly id: "anthropic";
52
+ readonly name: "Anthropic";
53
+ readonly description: "Anthropic is a research and deployment company focused on building safe and useful AI.";
54
+ readonly env: {
55
+ readonly required: {
56
+ readonly apiKey: "LLM_ANTHROPIC_API_KEY";
57
+ };
58
+ };
59
+ readonly streaming: true;
60
+ readonly cancellation: true;
61
+ readonly color: "#8b5cf6";
62
+ readonly website: "https://anthropic.com";
63
+ readonly announcement: null;
64
+ }, {
65
+ readonly id: "google-ai-studio";
66
+ readonly name: "Google AI Studio";
67
+ readonly description: "Google AI Studio is a platform for accessing Google's Gemini models.";
68
+ readonly env: {
69
+ readonly required: {
70
+ readonly apiKey: "LLM_GOOGLE_AI_STUDIO_API_KEY";
71
+ };
72
+ };
73
+ readonly streaming: true;
74
+ readonly cancellation: true;
75
+ readonly color: "#4285f4";
76
+ readonly website: "https://ai.google.com";
77
+ readonly announcement: null;
78
+ }, {
79
+ readonly id: "google-vertex";
80
+ readonly name: "Google Vertex AI";
81
+ readonly description: "Google Vertex AI is a platform for accessing Google's Gemini models via Vertex AI.";
82
+ readonly env: {
83
+ readonly required: {
84
+ readonly apiKey: "LLM_GOOGLE_VERTEX_API_KEY";
85
+ readonly project: "LLM_GOOGLE_CLOUD_PROJECT";
86
+ };
87
+ readonly optional: {
88
+ readonly region: "LLM_GOOGLE_VERTEX_REGION";
89
+ };
90
+ };
91
+ readonly streaming: true;
92
+ readonly cancellation: true;
93
+ readonly color: "#4285f4";
94
+ readonly website: "https://cloud.google.com/vertex-ai";
95
+ readonly announcement: null;
96
+ readonly priority: 0.5;
97
+ }, {
98
+ readonly id: "groq";
99
+ readonly name: "Groq";
100
+ readonly description: "Groq's ultra-fast LPU inference with various models";
101
+ readonly env: {
102
+ readonly required: {
103
+ readonly apiKey: "LLM_GROQ_API_KEY";
104
+ };
105
+ };
106
+ readonly streaming: true;
107
+ readonly cancellation: true;
108
+ readonly color: "#F55036";
109
+ readonly website: "https://groq.com";
110
+ readonly announcement: null;
111
+ }, {
112
+ readonly id: "cerebras";
113
+ readonly name: "Cerebras";
114
+ readonly description: "Cerebras high-performance inference with ultra-fast throughput";
115
+ readonly env: {
116
+ readonly required: {
117
+ readonly apiKey: "LLM_CEREBRAS_API_KEY";
118
+ };
119
+ };
120
+ readonly streaming: true;
121
+ readonly cancellation: true;
122
+ readonly color: "#6b46c1";
123
+ readonly website: "https://cerebras.ai";
124
+ readonly announcement: null;
125
+ }, {
126
+ readonly id: "xai";
127
+ readonly name: "xAI";
128
+ readonly description: "xAI's Grok large language models";
129
+ readonly env: {
130
+ readonly required: {
131
+ readonly apiKey: "LLM_X_AI_API_KEY";
132
+ };
133
+ };
134
+ readonly streaming: true;
135
+ readonly cancellation: true;
136
+ readonly color: "#000000";
137
+ readonly website: "https://x.ai";
138
+ readonly announcement: null;
139
+ }, {
140
+ readonly id: "deepseek";
141
+ readonly name: "DeepSeek";
142
+ readonly description: "DeepSeek's high-performance language models with OpenAI-compatible API";
143
+ readonly env: {
144
+ readonly required: {
145
+ readonly apiKey: "LLM_DEEPSEEK_API_KEY";
146
+ };
147
+ };
148
+ readonly streaming: true;
149
+ readonly cancellation: true;
150
+ readonly color: "#FF6B00";
151
+ readonly website: "https://deepseek.com";
152
+ readonly announcement: null;
153
+ }, {
154
+ readonly id: "alibaba";
155
+ readonly name: "Alibaba Cloud";
156
+ readonly description: "Alibaba Cloud's Qwen large language models with OpenAI-compatible API";
157
+ readonly env: {
158
+ readonly required: {
159
+ readonly apiKey: "LLM_ALIBABA_API_KEY";
160
+ };
161
+ };
162
+ readonly streaming: true;
163
+ readonly cancellation: true;
164
+ readonly color: "#FF6A00";
165
+ readonly website: "https://www.alibabacloud.com";
166
+ readonly announcement: null;
167
+ }, {
168
+ readonly id: "novita";
169
+ readonly name: "NovitaAI";
170
+ readonly description: "NovitaAI's OpenAI-compatible large language models";
171
+ readonly env: {
172
+ readonly required: {
173
+ readonly apiKey: "LLM_NOVITA_AI_API_KEY";
174
+ };
175
+ };
176
+ readonly streaming: true;
177
+ readonly cancellation: true;
178
+ readonly color: "#9333ea";
179
+ readonly website: "https://novita.ai";
180
+ readonly announcement: null;
181
+ }, {
182
+ readonly id: "aws-bedrock";
183
+ readonly name: "AWS Bedrock";
184
+ readonly description: "Amazon Bedrock - fully managed service for foundation models";
185
+ readonly env: {
186
+ readonly required: {
187
+ readonly apiKey: "LLM_AWS_BEDROCK_API_KEY";
188
+ };
189
+ readonly optional: {
190
+ readonly baseUrl: "LLM_AWS_BEDROCK_BASE_URL";
191
+ readonly region: "LLM_AWS_BEDROCK_REGION";
192
+ };
193
+ };
194
+ readonly priority: 0.9;
195
+ readonly streaming: true;
196
+ readonly cancellation: true;
197
+ readonly color: "#FF9900";
198
+ readonly website: "https://aws.amazon.com/bedrock";
199
+ readonly announcement: null;
200
+ readonly apiKeyInstructions: "Use AWS Bedrock Long-Term API Keys (not IAM service account or private keys)";
201
+ readonly learnMore: "https://docs.llmgateway.io/integrations/aws-bedrock";
202
+ }, {
203
+ readonly id: "azure";
204
+ readonly name: "Azure";
205
+ readonly description: "Microsoft Azure - enterprise-grade OpenAI models";
206
+ readonly env: {
207
+ readonly required: {
208
+ readonly apiKey: "LLM_AZURE_API_KEY";
209
+ readonly resource: "LLM_AZURE_RESOURCE";
210
+ };
211
+ readonly optional: {
212
+ readonly deploymentType: "LLM_AZURE_DEPLOYMENT_TYPE";
213
+ readonly apiVersion: "LLM_AZURE_API_VERSION";
214
+ };
215
+ };
216
+ readonly streaming: true;
217
+ readonly cancellation: true;
218
+ readonly color: "#0078D4";
219
+ readonly website: "https://azure.microsoft.com/en-us/products/ai-services/openai-service";
220
+ readonly announcement: null;
221
+ readonly apiKeyInstructions: "The resource name can be found in your Azure base URL: https://<resource-name>.openai.azure.com";
222
+ readonly learnMore: "https://docs.llmgateway.io/integrations/azure";
223
+ }, {
224
+ readonly id: "zai";
225
+ readonly name: "Z AI";
226
+ readonly description: "Z AI's OpenAI-compatible large language models";
227
+ readonly env: {
228
+ readonly required: {
229
+ readonly apiKey: "LLM_Z_AI_API_KEY";
230
+ };
231
+ };
232
+ readonly streaming: true;
233
+ readonly cancellation: true;
234
+ readonly color: "#22c55e";
235
+ readonly website: "https://z.ai";
236
+ readonly announcement: null;
237
+ }, {
238
+ readonly id: "moonshot";
239
+ readonly name: "Moonshot AI";
240
+ readonly description: "Moonshot AI's OpenAI-compatible large language models";
241
+ readonly env: {
242
+ readonly required: {
243
+ readonly apiKey: "LLM_MOONSHOT_API_KEY";
244
+ };
245
+ };
246
+ readonly streaming: true;
247
+ readonly cancellation: true;
248
+ readonly color: "#4B9EFF";
249
+ readonly website: "https://moonshot.ai";
250
+ readonly announcement: null;
251
+ }, {
252
+ readonly id: "perplexity";
253
+ readonly name: "Perplexity";
254
+ readonly description: "Perplexity's AI models for search and conversation with real-time web access";
255
+ readonly env: {
256
+ readonly required: {
257
+ readonly apiKey: "LLM_PERPLEXITY_API_KEY";
258
+ };
259
+ };
260
+ readonly streaming: true;
261
+ readonly cancellation: true;
262
+ readonly color: "#20B2AA";
263
+ readonly website: "https://perplexity.ai";
264
+ readonly announcement: null;
265
+ }, {
266
+ readonly id: "nebius";
267
+ readonly name: "Nebius AI";
268
+ readonly description: "Nebius AI Studio - OpenAI-compatible API for large language models";
269
+ readonly env: {
270
+ readonly required: {
271
+ readonly apiKey: "LLM_NEBIUS_API_KEY";
272
+ };
273
+ };
274
+ readonly streaming: true;
275
+ readonly cancellation: true;
276
+ readonly color: "#3b82f6";
277
+ readonly website: "https://nebius.com";
278
+ readonly announcement: null;
279
+ }, {
280
+ readonly id: "mistral";
281
+ readonly name: "Mistral AI";
282
+ readonly description: "Mistral AI's large language models";
283
+ readonly env: {
284
+ readonly required: {
285
+ readonly apiKey: "LLM_MISTRAL_API_KEY";
286
+ };
287
+ };
288
+ readonly streaming: true;
289
+ readonly cancellation: true;
290
+ readonly color: "#FF7000";
291
+ readonly website: "https://mistral.ai";
292
+ readonly announcement: null;
293
+ }, {
294
+ readonly id: "canopywave";
295
+ readonly name: "CanopyWave";
296
+ readonly description: "CanopyWave is a platform for running large language models with OpenAI-compatible API";
297
+ readonly env: {
298
+ readonly required: {
299
+ readonly apiKey: "LLM_CANOPY_WAVE_API_KEY";
300
+ };
301
+ };
302
+ readonly streaming: true;
303
+ readonly cancellation: true;
304
+ readonly color: "#10b981";
305
+ readonly website: "https://canopywave.io";
306
+ readonly announcement: null;
307
+ }, {
308
+ readonly id: "inference.net";
309
+ readonly name: "Inference.net";
310
+ readonly description: "Inference.net is a platform for running large language models in the cloud.";
311
+ readonly env: {
312
+ readonly required: {
313
+ readonly apiKey: "LLM_INFERENCE_NET_API_KEY";
314
+ };
315
+ };
316
+ readonly streaming: true;
317
+ readonly cancellation: true;
318
+ readonly color: "#10b981";
319
+ readonly website: "https://inference.net";
320
+ readonly announcement: null;
321
+ }, {
322
+ readonly id: "together.ai";
323
+ readonly name: "Together AI";
324
+ readonly description: "Together AI is a platform for running large language models in the cloud with fast inference.";
325
+ readonly env: {
326
+ readonly required: {
327
+ readonly apiKey: "LLM_TOGETHER_AI_API_KEY";
328
+ };
329
+ };
330
+ readonly streaming: true;
331
+ readonly cancellation: true;
332
+ readonly color: "#ff6b35";
333
+ readonly website: "https://together.ai";
334
+ readonly announcement: null;
335
+ }, {
336
+ readonly id: "routeway";
337
+ readonly name: "RouteWay";
338
+ readonly description: "RouteWay's OpenAI-compatible large language models";
339
+ readonly env: {
340
+ readonly required: {
341
+ readonly apiKey: "LLM_ROUTEWAY_API_KEY";
342
+ };
343
+ };
344
+ readonly streaming: true;
345
+ readonly cancellation: true;
346
+ readonly color: "#4f46e5";
347
+ readonly website: "https://routeway.ai";
348
+ readonly announcement: null;
349
+ }, {
350
+ readonly id: "custom";
351
+ readonly name: "Custom";
352
+ readonly description: "Custom OpenAI-compatible provider with configurable base URL";
353
+ readonly env: {
354
+ readonly required: {};
355
+ };
356
+ readonly streaming: true;
357
+ readonly cancellation: true;
358
+ readonly color: "#6b7280";
359
+ readonly website: null;
360
+ readonly announcement: null;
361
+ }, {
362
+ readonly id: "cloudrift";
363
+ readonly name: "CloudRift";
364
+ readonly description: "CloudRift is a platform for running large language models in the cloud with fast inference.";
365
+ readonly env: {
366
+ readonly required: {
367
+ readonly apiKey: "LLM_CLOUD_RIFT_API_KEY";
368
+ };
369
+ };
370
+ readonly streaming: true;
371
+ readonly cancellation: true;
372
+ readonly color: "#00d4aa";
373
+ readonly website: "https://www.cloudrift.ai";
374
+ readonly announcement: "DeepSeek & Kimi K2 are 30-50% cheaper than the competition!";
375
+ }, {
376
+ readonly id: "nanogpt";
377
+ readonly name: "NanoGPT";
378
+ readonly description: "NanoGPT offers a large selection of models";
379
+ readonly env: {
380
+ readonly required: {
381
+ readonly apiKey: "LLM_NANO_GPT_API_KEY";
382
+ };
383
+ };
384
+ readonly streaming: true;
385
+ readonly cancellation: true;
386
+ readonly color: "#10b981";
387
+ readonly website: "https://nano-gpt.com";
388
+ readonly announcement: null;
389
+ }, {
390
+ readonly id: "bytedance";
391
+ readonly name: "ByteDance";
392
+ readonly description: "ByteDance's ModelArk platform with OpenAI-compatible API for large language models";
393
+ readonly env: {
394
+ readonly required: {
395
+ readonly apiKey: "LLM_BYTEDANCE_API_KEY";
396
+ };
397
+ };
398
+ readonly streaming: true;
399
+ readonly cancellation: true;
400
+ readonly color: "#FF4757";
401
+ readonly website: "https://www.byteplus.com/en/product/modelark";
402
+ readonly announcement: null;
403
+ }];
404
+ export type ProviderId = (typeof providers)[number]["id"];
405
+ export declare function getProviderDefinition(providerId: ProviderId | string): ProviderDefinition | undefined;