aimodels 0.3.12 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +133 -66
- package/dist/index.d.ts +198 -113
- package/dist/index.js +2402 -2172
- package/package.json +20 -13
- package/LICENSE +0 -21
- package/dist/index.d.mts +0 -212
- package/dist/index.mjs +0 -2279
package/dist/index.mjs
DELETED
|
@@ -1,2279 +0,0 @@
|
|
|
1
|
-
// src/types/models.ts
|
|
2
|
-
var ModelCollection = class _ModelCollection extends Array {
|
|
3
|
-
/** Create a new ModelCollection from an array of models */
|
|
4
|
-
constructor(models2 = []) {
|
|
5
|
-
super();
|
|
6
|
-
if (models2.length > 0) {
|
|
7
|
-
this.push(...models2);
|
|
8
|
-
}
|
|
9
|
-
Object.setPrototypeOf(this, _ModelCollection.prototype);
|
|
10
|
-
}
|
|
11
|
-
/** Filter models by one or more capabilities (all must be present) */
|
|
12
|
-
can(...capabilities) {
|
|
13
|
-
return this.filter((model) => capabilities.every((cap) => model.can.includes(cap)));
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Fluent capability filters for better readability
|
|
17
|
-
* Each method filters models by a specific capability
|
|
18
|
-
*/
|
|
19
|
-
// Basic capabilities
|
|
20
|
-
canChat() {
|
|
21
|
-
return this.can("chat");
|
|
22
|
-
}
|
|
23
|
-
canReason() {
|
|
24
|
-
return this.can("reason");
|
|
25
|
-
}
|
|
26
|
-
// Text capabilities
|
|
27
|
-
canRead() {
|
|
28
|
-
return this.can("txt-in");
|
|
29
|
-
}
|
|
30
|
-
canWrite() {
|
|
31
|
-
return this.can("txt-out");
|
|
32
|
-
}
|
|
33
|
-
// Image capabilities
|
|
34
|
-
canSee() {
|
|
35
|
-
return this.can("img-in");
|
|
36
|
-
}
|
|
37
|
-
canGenerateImages() {
|
|
38
|
-
return this.can("img-out");
|
|
39
|
-
}
|
|
40
|
-
// Audio capabilities
|
|
41
|
-
canHear() {
|
|
42
|
-
return this.can("audio-in");
|
|
43
|
-
}
|
|
44
|
-
canSpeak() {
|
|
45
|
-
return this.can("audio-out");
|
|
46
|
-
}
|
|
47
|
-
// Output capabilities
|
|
48
|
-
canOutputJSON() {
|
|
49
|
-
return this.can("json-out");
|
|
50
|
-
}
|
|
51
|
-
canCallFunctions() {
|
|
52
|
-
return this.can("fn-out");
|
|
53
|
-
}
|
|
54
|
-
canGenerateEmbeddings() {
|
|
55
|
-
return this.can("vec-out");
|
|
56
|
-
}
|
|
57
|
-
/** Filter models by one or more languages (all must be supported) */
|
|
58
|
-
know(...languages) {
|
|
59
|
-
return this.filter((model) => languages.every((lang) => model.languages?.includes(lang)));
|
|
60
|
-
}
|
|
61
|
-
/** Override array filter to return ModelCollection */
|
|
62
|
-
filter(predicate) {
|
|
63
|
-
const filtered = Array.from(this).filter(predicate);
|
|
64
|
-
return new _ModelCollection(filtered);
|
|
65
|
-
}
|
|
66
|
-
/** Override array slice to return ModelCollection */
|
|
67
|
-
slice(start, end) {
|
|
68
|
-
const sliced = Array.from(this).slice(start, end);
|
|
69
|
-
return new _ModelCollection(sliced);
|
|
70
|
-
}
|
|
71
|
-
/** Find a model by its ID or alias */
|
|
72
|
-
id(modelId) {
|
|
73
|
-
return this.find(
|
|
74
|
-
(model) => model.id === modelId || model.aliases?.includes(modelId)
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
/** Get models available from a specific provider */
|
|
78
|
-
fromProvider(provider) {
|
|
79
|
-
return this.filter((model) => model.providers.includes(provider));
|
|
80
|
-
}
|
|
81
|
-
/** Get models available from a specific creator */
|
|
82
|
-
fromCreator(creator) {
|
|
83
|
-
return new _ModelCollection(
|
|
84
|
-
this.filter((model) => model.creator === creator)
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
/** Filter models by minimum context window size */
|
|
88
|
-
withMinContext(tokens) {
|
|
89
|
-
return this.filter((model) => {
|
|
90
|
-
const context = model.context;
|
|
91
|
-
if (context.type !== "token" && context.type !== "character") {
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
if (context.total === null) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
return context.total >= tokens;
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
/** Get all providers from all models in the collection deduplicated */
|
|
101
|
-
getProviders() {
|
|
102
|
-
return [...new Set(this.flatMap((model) => model.providers))];
|
|
103
|
-
}
|
|
104
|
-
getCreators() {
|
|
105
|
-
return [...new Set(this.map((model) => model.creator))];
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
// src/data/models/openai-models.json
|
|
110
|
-
var openai_models_default = {
|
|
111
|
-
creator: "openai",
|
|
112
|
-
models: [
|
|
113
|
-
{
|
|
114
|
-
id: "gpt-4",
|
|
115
|
-
name: "GPT-4",
|
|
116
|
-
license: "proprietary",
|
|
117
|
-
providers: [
|
|
118
|
-
"openai",
|
|
119
|
-
"azure"
|
|
120
|
-
],
|
|
121
|
-
can: [
|
|
122
|
-
"chat",
|
|
123
|
-
"txt-in",
|
|
124
|
-
"txt-out",
|
|
125
|
-
"json-out",
|
|
126
|
-
"fn-out"
|
|
127
|
-
],
|
|
128
|
-
context: {
|
|
129
|
-
type: "token",
|
|
130
|
-
total: 8192,
|
|
131
|
-
maxOutput: 4096
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
id: "gpt-4-turbo-preview",
|
|
136
|
-
extends: "gpt-4",
|
|
137
|
-
overrides: {
|
|
138
|
-
name: "GPT-4 Turbo",
|
|
139
|
-
context: {
|
|
140
|
-
type: "token",
|
|
141
|
-
total: 128e3,
|
|
142
|
-
maxOutput: 4096
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
id: "gpt-3.5-turbo",
|
|
148
|
-
name: "GPT-3.5 Turbo",
|
|
149
|
-
license: "proprietary",
|
|
150
|
-
providers: [
|
|
151
|
-
"openai",
|
|
152
|
-
"azure"
|
|
153
|
-
],
|
|
154
|
-
can: [
|
|
155
|
-
"chat",
|
|
156
|
-
"txt-in",
|
|
157
|
-
"txt-out",
|
|
158
|
-
"json-out",
|
|
159
|
-
"fn-out"
|
|
160
|
-
],
|
|
161
|
-
context: {
|
|
162
|
-
type: "token",
|
|
163
|
-
total: 16385,
|
|
164
|
-
maxOutput: 4096
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
id: "gpt-3.5-turbo-16k",
|
|
169
|
-
extends: "gpt-3.5-turbo",
|
|
170
|
-
overrides: {
|
|
171
|
-
name: "GPT-3.5 Turbo 16K",
|
|
172
|
-
context: {
|
|
173
|
-
type: "token",
|
|
174
|
-
total: 16385,
|
|
175
|
-
maxOutput: 4096
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
id: "gpt-3.5-turbo-instruct",
|
|
181
|
-
name: "GPT-3.5 Turbo Instruct",
|
|
182
|
-
license: "proprietary",
|
|
183
|
-
providers: [
|
|
184
|
-
"openai",
|
|
185
|
-
"azure"
|
|
186
|
-
],
|
|
187
|
-
can: [
|
|
188
|
-
"txt-in",
|
|
189
|
-
"txt-out"
|
|
190
|
-
],
|
|
191
|
-
context: {
|
|
192
|
-
type: "token",
|
|
193
|
-
total: 4096,
|
|
194
|
-
maxOutput: 4096
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
id: "gpt-4o",
|
|
199
|
-
name: "GPT-4o",
|
|
200
|
-
license: "proprietary",
|
|
201
|
-
providers: [
|
|
202
|
-
"openai",
|
|
203
|
-
"azure"
|
|
204
|
-
],
|
|
205
|
-
can: [
|
|
206
|
-
"chat",
|
|
207
|
-
"txt-in",
|
|
208
|
-
"txt-out",
|
|
209
|
-
"img-in",
|
|
210
|
-
"json-out",
|
|
211
|
-
"fn-out"
|
|
212
|
-
],
|
|
213
|
-
context: {
|
|
214
|
-
type: "token",
|
|
215
|
-
total: 128e3,
|
|
216
|
-
maxOutput: 16384
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
id: "chatgpt-4o-latest",
|
|
221
|
-
extends: "gpt-4o",
|
|
222
|
-
overrides: {
|
|
223
|
-
name: "GPT-4o used in ChatGPT"
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
id: "gpt-4o-2024-11-20",
|
|
228
|
-
extends: "gpt-4o",
|
|
229
|
-
overrides: {
|
|
230
|
-
name: "GPT-4o (2024-11-20)"
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
id: "gpt-4o-2024-08-06",
|
|
235
|
-
extends: "gpt-4o",
|
|
236
|
-
overrides: {
|
|
237
|
-
name: "GPT-4o (2024-08-06)"
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
id: "gpt-4o-2024-05-13",
|
|
242
|
-
extends: "gpt-4o",
|
|
243
|
-
overrides: {
|
|
244
|
-
name: "GPT-4o (2024-05-13)",
|
|
245
|
-
context: {
|
|
246
|
-
type: "token",
|
|
247
|
-
total: 128e3,
|
|
248
|
-
maxOutput: 4096
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
id: "gpt-4o-mini",
|
|
254
|
-
extends: "gpt-4o",
|
|
255
|
-
overrides: {
|
|
256
|
-
name: "GPT-4o Mini",
|
|
257
|
-
context: {
|
|
258
|
-
type: "token",
|
|
259
|
-
total: 128e3,
|
|
260
|
-
maxOutput: 16384
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
id: "gpt-4o-audio-preview",
|
|
266
|
-
extends: "gpt-4o",
|
|
267
|
-
overrides: {
|
|
268
|
-
name: "GPT-4o Audio",
|
|
269
|
-
can: [
|
|
270
|
-
"chat",
|
|
271
|
-
"txt-in",
|
|
272
|
-
"txt-out",
|
|
273
|
-
"audio-in",
|
|
274
|
-
"json-out",
|
|
275
|
-
"fn-out"
|
|
276
|
-
],
|
|
277
|
-
context: {
|
|
278
|
-
type: "token",
|
|
279
|
-
total: 128e3,
|
|
280
|
-
maxOutput: 16384
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
id: "gpt-4o-audio-preview-2024-12-17",
|
|
286
|
-
extends: "gpt-4o-audio-preview",
|
|
287
|
-
overrides: {
|
|
288
|
-
name: "GPT-4o Audio (2024-12-17)"
|
|
289
|
-
}
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
id: "gpt-4o-audio-preview-2024-10-01",
|
|
293
|
-
extends: "gpt-4o-audio-preview",
|
|
294
|
-
overrides: {
|
|
295
|
-
name: "GPT-4o Audio (2024-10-01)"
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
id: "gpt-4o-mini-audio-preview",
|
|
300
|
-
extends: "gpt-4o-mini",
|
|
301
|
-
overrides: {
|
|
302
|
-
name: "GPT-4o Mini Audio",
|
|
303
|
-
can: [
|
|
304
|
-
"chat",
|
|
305
|
-
"txt-in",
|
|
306
|
-
"txt-out",
|
|
307
|
-
"audio-in",
|
|
308
|
-
"audio-out",
|
|
309
|
-
"json-out",
|
|
310
|
-
"fn-out"
|
|
311
|
-
],
|
|
312
|
-
context: {
|
|
313
|
-
type: "token",
|
|
314
|
-
total: 128e3,
|
|
315
|
-
maxOutput: 16384
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
id: "gpt-4o-mini-audio-preview-2024-12-17",
|
|
321
|
-
extends: "gpt-4o-mini-audio-preview",
|
|
322
|
-
overrides: {
|
|
323
|
-
name: "GPT-4o Mini Audio (2024-12-17)"
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
id: "gpt-4o-realtime-preview",
|
|
328
|
-
extends: "gpt-4o",
|
|
329
|
-
overrides: {
|
|
330
|
-
name: "GPT-4o Realtime",
|
|
331
|
-
can: [
|
|
332
|
-
"chat",
|
|
333
|
-
"txt-in",
|
|
334
|
-
"txt-out",
|
|
335
|
-
"audio-in",
|
|
336
|
-
"json-out",
|
|
337
|
-
"fn-out"
|
|
338
|
-
],
|
|
339
|
-
context: {
|
|
340
|
-
type: "token",
|
|
341
|
-
total: 128e3,
|
|
342
|
-
maxOutput: 4096
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
},
|
|
346
|
-
{
|
|
347
|
-
id: "gpt-4o-realtime-preview-2024-12-17",
|
|
348
|
-
extends: "gpt-4o-realtime-preview",
|
|
349
|
-
overrides: {
|
|
350
|
-
name: "GPT-4o Realtime (2024-12-17)"
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
id: "gpt-4o-realtime-preview-2024-10-01",
|
|
355
|
-
extends: "gpt-4o-realtime-preview",
|
|
356
|
-
overrides: {
|
|
357
|
-
name: "GPT-4o Realtime (2024-10-01)"
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
id: "gpt-4o-mini-realtime-preview",
|
|
362
|
-
extends: "gpt-4o-mini",
|
|
363
|
-
overrides: {
|
|
364
|
-
name: "GPT-4o Mini Realtime",
|
|
365
|
-
can: [
|
|
366
|
-
"chat",
|
|
367
|
-
"txt-in",
|
|
368
|
-
"txt-out",
|
|
369
|
-
"audio-in",
|
|
370
|
-
"json-out",
|
|
371
|
-
"fn-out"
|
|
372
|
-
],
|
|
373
|
-
context: {
|
|
374
|
-
type: "token",
|
|
375
|
-
total: 128e3,
|
|
376
|
-
maxOutput: 4096
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
id: "gpt-4o-mini-realtime-preview-2024-12-17",
|
|
382
|
-
extends: "gpt-4o-mini-realtime-preview",
|
|
383
|
-
overrides: {
|
|
384
|
-
name: "GPT-4o Mini Realtime (2024-12-17)"
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
id: "o1",
|
|
389
|
-
name: "OpenAI O1",
|
|
390
|
-
license: "proprietary",
|
|
391
|
-
providers: [
|
|
392
|
-
"openai",
|
|
393
|
-
"azure"
|
|
394
|
-
],
|
|
395
|
-
can: [
|
|
396
|
-
"chat",
|
|
397
|
-
"txt-in",
|
|
398
|
-
"txt-out",
|
|
399
|
-
"img-in",
|
|
400
|
-
"json-out",
|
|
401
|
-
"fn-out",
|
|
402
|
-
"reason"
|
|
403
|
-
],
|
|
404
|
-
context: {
|
|
405
|
-
type: "token",
|
|
406
|
-
total: 2e5,
|
|
407
|
-
maxOutput: 1e5
|
|
408
|
-
}
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
id: "o1-2024-12-17",
|
|
412
|
-
extends: "o1",
|
|
413
|
-
overrides: {
|
|
414
|
-
name: "OpenAI O1 (2024-12-17)"
|
|
415
|
-
}
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
id: "o1-mini",
|
|
419
|
-
extends: "o1",
|
|
420
|
-
overrides: {
|
|
421
|
-
name: "OpenAI O1 Mini",
|
|
422
|
-
can: [
|
|
423
|
-
"chat",
|
|
424
|
-
"txt-in",
|
|
425
|
-
"txt-out",
|
|
426
|
-
"json-out",
|
|
427
|
-
"fn-out",
|
|
428
|
-
"reason"
|
|
429
|
-
],
|
|
430
|
-
context: {
|
|
431
|
-
type: "token",
|
|
432
|
-
total: 128e3,
|
|
433
|
-
maxOutput: 65536
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
},
|
|
437
|
-
{
|
|
438
|
-
id: "o1-mini-2024-09-12",
|
|
439
|
-
extends: "o1-mini",
|
|
440
|
-
overrides: {
|
|
441
|
-
name: "OpenAI O1 Mini (2024-09-12)"
|
|
442
|
-
}
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
id: "o1-preview",
|
|
446
|
-
extends: "o1",
|
|
447
|
-
overrides: {
|
|
448
|
-
name: "OpenAI O1 Preview",
|
|
449
|
-
context: {
|
|
450
|
-
type: "token",
|
|
451
|
-
total: 128e3,
|
|
452
|
-
maxOutput: 32768
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
},
|
|
456
|
-
{
|
|
457
|
-
id: "o1-preview-2024-09-12",
|
|
458
|
-
extends: "o1-preview",
|
|
459
|
-
overrides: {
|
|
460
|
-
name: "OpenAI O1 Preview (2024-09-12)"
|
|
461
|
-
}
|
|
462
|
-
},
|
|
463
|
-
{
|
|
464
|
-
id: "o3-mini",
|
|
465
|
-
name: "OpenAI O3 Mini",
|
|
466
|
-
license: "proprietary",
|
|
467
|
-
providers: [
|
|
468
|
-
"openai",
|
|
469
|
-
"azure"
|
|
470
|
-
],
|
|
471
|
-
can: [
|
|
472
|
-
"chat",
|
|
473
|
-
"txt-in",
|
|
474
|
-
"txt-out",
|
|
475
|
-
"json-out",
|
|
476
|
-
"fn-out",
|
|
477
|
-
"reason"
|
|
478
|
-
],
|
|
479
|
-
context: {
|
|
480
|
-
type: "token",
|
|
481
|
-
total: 2e5,
|
|
482
|
-
maxOutput: 1e5
|
|
483
|
-
}
|
|
484
|
-
},
|
|
485
|
-
{
|
|
486
|
-
id: "o3-mini-2025-01-31",
|
|
487
|
-
extends: "o3-mini",
|
|
488
|
-
overrides: {
|
|
489
|
-
name: "OpenAI O3 Mini (2025-01-31)"
|
|
490
|
-
}
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
id: "whisper-1",
|
|
494
|
-
name: "Whisper",
|
|
495
|
-
license: "proprietary",
|
|
496
|
-
providers: [
|
|
497
|
-
"openai",
|
|
498
|
-
"azure"
|
|
499
|
-
],
|
|
500
|
-
can: [
|
|
501
|
-
"audio-in",
|
|
502
|
-
"txt-out"
|
|
503
|
-
],
|
|
504
|
-
context: {
|
|
505
|
-
type: "audio-in",
|
|
506
|
-
total: null,
|
|
507
|
-
maxOutput: null
|
|
508
|
-
}
|
|
509
|
-
},
|
|
510
|
-
{
|
|
511
|
-
id: "tts-1",
|
|
512
|
-
name: "TTS-1",
|
|
513
|
-
license: "proprietary",
|
|
514
|
-
providers: [
|
|
515
|
-
"openai",
|
|
516
|
-
"azure"
|
|
517
|
-
],
|
|
518
|
-
can: [
|
|
519
|
-
"txt-in",
|
|
520
|
-
"audio-out"
|
|
521
|
-
],
|
|
522
|
-
context: {
|
|
523
|
-
type: "audio-out",
|
|
524
|
-
total: null,
|
|
525
|
-
maxOutput: null
|
|
526
|
-
}
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
id: "tts-1-hd",
|
|
530
|
-
extends: "tts-1",
|
|
531
|
-
overrides: {
|
|
532
|
-
name: "TTS-1 HD"
|
|
533
|
-
}
|
|
534
|
-
},
|
|
535
|
-
{
|
|
536
|
-
id: "dall-e-2",
|
|
537
|
-
name: "DALL-E 2",
|
|
538
|
-
license: "proprietary",
|
|
539
|
-
providers: [
|
|
540
|
-
"openai",
|
|
541
|
-
"azure"
|
|
542
|
-
],
|
|
543
|
-
can: [
|
|
544
|
-
"img-out"
|
|
545
|
-
],
|
|
546
|
-
context: {
|
|
547
|
-
maxOutput: 1,
|
|
548
|
-
sizes: [
|
|
549
|
-
"256x256",
|
|
550
|
-
"512x512",
|
|
551
|
-
"1024x1024"
|
|
552
|
-
],
|
|
553
|
-
qualities: [
|
|
554
|
-
"standard"
|
|
555
|
-
]
|
|
556
|
-
}
|
|
557
|
-
},
|
|
558
|
-
{
|
|
559
|
-
id: "dall-e-3",
|
|
560
|
-
name: "DALL-E 3",
|
|
561
|
-
license: "proprietary",
|
|
562
|
-
providers: [
|
|
563
|
-
"openai",
|
|
564
|
-
"azure"
|
|
565
|
-
],
|
|
566
|
-
can: [
|
|
567
|
-
"txt-in",
|
|
568
|
-
"img-out"
|
|
569
|
-
],
|
|
570
|
-
context: {
|
|
571
|
-
maxOutput: 1,
|
|
572
|
-
sizes: [
|
|
573
|
-
"1024x1024",
|
|
574
|
-
"1024x1792",
|
|
575
|
-
"1792x1024"
|
|
576
|
-
],
|
|
577
|
-
qualities: [
|
|
578
|
-
"standard",
|
|
579
|
-
"hd"
|
|
580
|
-
]
|
|
581
|
-
}
|
|
582
|
-
},
|
|
583
|
-
{
|
|
584
|
-
id: "text-embedding-ada-002",
|
|
585
|
-
name: "Text Embedding Ada 002",
|
|
586
|
-
license: "proprietary",
|
|
587
|
-
providers: [
|
|
588
|
-
"openai",
|
|
589
|
-
"azure"
|
|
590
|
-
],
|
|
591
|
-
can: [
|
|
592
|
-
"txt-in",
|
|
593
|
-
"vec-out"
|
|
594
|
-
],
|
|
595
|
-
context: {
|
|
596
|
-
type: "embedding",
|
|
597
|
-
total: 8191,
|
|
598
|
-
unit: "tokens",
|
|
599
|
-
dimensions: 1536,
|
|
600
|
-
embeddingType: "text",
|
|
601
|
-
normalized: true
|
|
602
|
-
}
|
|
603
|
-
},
|
|
604
|
-
{
|
|
605
|
-
id: "text-embedding-3-small",
|
|
606
|
-
name: "Text Embedding 3 Small",
|
|
607
|
-
license: "proprietary",
|
|
608
|
-
providers: [
|
|
609
|
-
"openai",
|
|
610
|
-
"azure"
|
|
611
|
-
],
|
|
612
|
-
can: [
|
|
613
|
-
"txt-in",
|
|
614
|
-
"vec-out"
|
|
615
|
-
],
|
|
616
|
-
context: {
|
|
617
|
-
type: "embedding",
|
|
618
|
-
total: 8191,
|
|
619
|
-
unit: "tokens",
|
|
620
|
-
dimensions: 1536,
|
|
621
|
-
embeddingType: "text",
|
|
622
|
-
normalized: true
|
|
623
|
-
}
|
|
624
|
-
},
|
|
625
|
-
{
|
|
626
|
-
id: "text-embedding-3-large",
|
|
627
|
-
name: "Text Embedding 3 Large",
|
|
628
|
-
license: "proprietary",
|
|
629
|
-
providers: [
|
|
630
|
-
"openai",
|
|
631
|
-
"azure"
|
|
632
|
-
],
|
|
633
|
-
can: [
|
|
634
|
-
"txt-in",
|
|
635
|
-
"vec-out"
|
|
636
|
-
],
|
|
637
|
-
context: {
|
|
638
|
-
type: "embedding",
|
|
639
|
-
total: 8191,
|
|
640
|
-
unit: "tokens",
|
|
641
|
-
dimensions: 3072,
|
|
642
|
-
embeddingType: "text",
|
|
643
|
-
normalized: true
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
]
|
|
647
|
-
};
|
|
648
|
-
|
|
649
|
-
// src/data/models/anthropic-models.json
|
|
650
|
-
var anthropic_models_default = {
|
|
651
|
-
creator: "anthropic",
|
|
652
|
-
models: [
|
|
653
|
-
{
|
|
654
|
-
id: "claude-3-opus-20240229",
|
|
655
|
-
name: "Claude 3 Opus",
|
|
656
|
-
license: "proprietary",
|
|
657
|
-
providers: ["anthropic", "aws", "google"],
|
|
658
|
-
can: [
|
|
659
|
-
"chat",
|
|
660
|
-
"txt-in",
|
|
661
|
-
"txt-out",
|
|
662
|
-
"img-in",
|
|
663
|
-
"json-out",
|
|
664
|
-
"fn-out"
|
|
665
|
-
],
|
|
666
|
-
context: {
|
|
667
|
-
type: "token",
|
|
668
|
-
total: 2e5,
|
|
669
|
-
maxOutput: 4096,
|
|
670
|
-
outputIsFixed: 1
|
|
671
|
-
},
|
|
672
|
-
aliases: ["claude-3-opus-latest", "claude-3-opus"]
|
|
673
|
-
},
|
|
674
|
-
{
|
|
675
|
-
id: "claude-3-sonnet-20240229",
|
|
676
|
-
name: "Claude 3 Sonnet",
|
|
677
|
-
license: "proprietary",
|
|
678
|
-
providers: ["anthropic", "aws", "google"],
|
|
679
|
-
can: [
|
|
680
|
-
"chat",
|
|
681
|
-
"txt-in",
|
|
682
|
-
"txt-out",
|
|
683
|
-
"img-in",
|
|
684
|
-
"json-out",
|
|
685
|
-
"fn-out"
|
|
686
|
-
],
|
|
687
|
-
context: {
|
|
688
|
-
type: "token",
|
|
689
|
-
total: 2e5,
|
|
690
|
-
maxOutput: 4096,
|
|
691
|
-
outputIsFixed: 1
|
|
692
|
-
},
|
|
693
|
-
aliases: ["claude-3-sonnet-latest", "claude-3-sonnet"]
|
|
694
|
-
},
|
|
695
|
-
{
|
|
696
|
-
id: "claude-3-haiku-20240307",
|
|
697
|
-
name: "Claude 3 Haiku",
|
|
698
|
-
license: "proprietary",
|
|
699
|
-
providers: ["anthropic", "aws", "google"],
|
|
700
|
-
can: [
|
|
701
|
-
"chat",
|
|
702
|
-
"txt-in",
|
|
703
|
-
"txt-out",
|
|
704
|
-
"img-in",
|
|
705
|
-
"json-out",
|
|
706
|
-
"fn-out"
|
|
707
|
-
],
|
|
708
|
-
context: {
|
|
709
|
-
type: "token",
|
|
710
|
-
total: 2e5,
|
|
711
|
-
maxOutput: 4096,
|
|
712
|
-
outputIsFixed: 1
|
|
713
|
-
},
|
|
714
|
-
aliases: ["claude-3-haiku"]
|
|
715
|
-
},
|
|
716
|
-
{
|
|
717
|
-
id: "claude-3-5-sonnet-20241022",
|
|
718
|
-
name: "Claude 3.5 Sonnet",
|
|
719
|
-
license: "proprietary",
|
|
720
|
-
providers: ["anthropic", "aws", "google"],
|
|
721
|
-
can: [
|
|
722
|
-
"chat",
|
|
723
|
-
"txt-in",
|
|
724
|
-
"txt-out",
|
|
725
|
-
"img-in",
|
|
726
|
-
"json-out",
|
|
727
|
-
"fn-out"
|
|
728
|
-
],
|
|
729
|
-
context: {
|
|
730
|
-
type: "token",
|
|
731
|
-
total: 2e5,
|
|
732
|
-
maxOutput: 8192,
|
|
733
|
-
outputIsFixed: 1
|
|
734
|
-
},
|
|
735
|
-
aliases: ["claude-3-5-sonnet-latest", "claude-3-5-sonnet"]
|
|
736
|
-
},
|
|
737
|
-
{
|
|
738
|
-
id: "claude-3-5-sonnet-20240620",
|
|
739
|
-
name: "Claude 3.5 Sonnet (2024-06-20)",
|
|
740
|
-
license: "proprietary",
|
|
741
|
-
providers: ["anthropic", "aws", "google"],
|
|
742
|
-
can: [
|
|
743
|
-
"chat",
|
|
744
|
-
"txt-in",
|
|
745
|
-
"txt-out",
|
|
746
|
-
"img-in",
|
|
747
|
-
"json-out",
|
|
748
|
-
"fn-out"
|
|
749
|
-
],
|
|
750
|
-
context: {
|
|
751
|
-
type: "token",
|
|
752
|
-
total: 2e5,
|
|
753
|
-
maxOutput: 8192,
|
|
754
|
-
outputIsFixed: 1
|
|
755
|
-
}
|
|
756
|
-
},
|
|
757
|
-
{
|
|
758
|
-
id: "claude-3-5-haiku-20241022",
|
|
759
|
-
name: "Claude 3.5 Haiku",
|
|
760
|
-
license: "proprietary",
|
|
761
|
-
providers: ["anthropic", "aws", "google"],
|
|
762
|
-
can: [
|
|
763
|
-
"chat",
|
|
764
|
-
"txt-in",
|
|
765
|
-
"txt-out",
|
|
766
|
-
"json-out",
|
|
767
|
-
"fn-out"
|
|
768
|
-
],
|
|
769
|
-
context: {
|
|
770
|
-
type: "token",
|
|
771
|
-
total: 2e5,
|
|
772
|
-
maxOutput: 8192,
|
|
773
|
-
outputIsFixed: 1
|
|
774
|
-
},
|
|
775
|
-
aliases: ["claude-3-5-haiku-latest", "claude-3-5-haiku"]
|
|
776
|
-
},
|
|
777
|
-
{
|
|
778
|
-
id: "claude-3-7-sonnet-20250219",
|
|
779
|
-
name: "Claude 3.7 Sonnet",
|
|
780
|
-
license: "proprietary",
|
|
781
|
-
providers: ["anthropic", "aws", "google"],
|
|
782
|
-
can: [
|
|
783
|
-
"chat",
|
|
784
|
-
"txt-in",
|
|
785
|
-
"txt-out",
|
|
786
|
-
"img-in",
|
|
787
|
-
"json-out",
|
|
788
|
-
"fn-out",
|
|
789
|
-
"reason"
|
|
790
|
-
],
|
|
791
|
-
context: {
|
|
792
|
-
type: "token",
|
|
793
|
-
total: 2e5,
|
|
794
|
-
maxOutput: 8192,
|
|
795
|
-
outputIsFixed: 1,
|
|
796
|
-
extended: {
|
|
797
|
-
reasoning: {
|
|
798
|
-
maxOutput: 64e3
|
|
799
|
-
},
|
|
800
|
-
experimental: {
|
|
801
|
-
maxOutput: 128e3
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
},
|
|
805
|
-
aliases: ["claude-3-7-sonnet-latest", "claude-3-7-sonnet"]
|
|
806
|
-
}
|
|
807
|
-
]
|
|
808
|
-
};
|
|
809
|
-
|
|
810
|
-
// src/data/models/meta-models.json
|
|
811
|
-
var meta_models_default = {
|
|
812
|
-
creator: "meta",
|
|
813
|
-
models: [
|
|
814
|
-
{
|
|
815
|
-
id: "llama3-70b-8192",
|
|
816
|
-
name: "Llama 3 70B",
|
|
817
|
-
license: "llama-3-community",
|
|
818
|
-
providers: ["groq"],
|
|
819
|
-
can: ["chat", "txt-in", "txt-out", "json-out", "fn-out"],
|
|
820
|
-
context: {
|
|
821
|
-
type: "token",
|
|
822
|
-
total: 8192,
|
|
823
|
-
maxOutput: 4096
|
|
824
|
-
}
|
|
825
|
-
},
|
|
826
|
-
{
|
|
827
|
-
id: "llama3-8b-8192",
|
|
828
|
-
name: "Llama 3 8B",
|
|
829
|
-
license: "llama-3-community",
|
|
830
|
-
providers: ["groq"],
|
|
831
|
-
can: ["chat", "txt-in", "txt-out", "json-out", "fn-out"],
|
|
832
|
-
context: {
|
|
833
|
-
type: "token",
|
|
834
|
-
total: 8192,
|
|
835
|
-
maxOutput: 4096
|
|
836
|
-
}
|
|
837
|
-
},
|
|
838
|
-
{
|
|
839
|
-
id: "llama-3.2-11b-vision-preview",
|
|
840
|
-
name: "Llama 3.2 11B Vision",
|
|
841
|
-
license: "llama-3-community",
|
|
842
|
-
providers: ["groq"],
|
|
843
|
-
can: ["chat", "txt-in", "txt-out", "img-in"],
|
|
844
|
-
context: {
|
|
845
|
-
type: "token",
|
|
846
|
-
total: 4096,
|
|
847
|
-
maxOutput: 4096
|
|
848
|
-
}
|
|
849
|
-
},
|
|
850
|
-
{
|
|
851
|
-
id: "llama-3.2-90b-vision-preview",
|
|
852
|
-
name: "Llama 3.2 90B Vision",
|
|
853
|
-
license: "llama-3-community",
|
|
854
|
-
providers: ["groq"],
|
|
855
|
-
can: ["chat", "txt-in", "txt-out", "img-in"],
|
|
856
|
-
context: {
|
|
857
|
-
type: "token",
|
|
858
|
-
total: 4096,
|
|
859
|
-
maxOutput: 4096
|
|
860
|
-
}
|
|
861
|
-
},
|
|
862
|
-
{
|
|
863
|
-
id: "llama-guard-3-8b",
|
|
864
|
-
name: "LlamaGuard 3 8B",
|
|
865
|
-
license: "llama-3-community",
|
|
866
|
-
providers: ["groq"],
|
|
867
|
-
can: ["chat", "txt-in", "txt-out"],
|
|
868
|
-
context: {
|
|
869
|
-
type: "token",
|
|
870
|
-
total: 4096,
|
|
871
|
-
maxOutput: 4096
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
]
|
|
875
|
-
};
|
|
876
|
-
|
|
877
|
-
// src/data/models/mistral-models.json
|
|
878
|
-
var mistral_models_default = {
|
|
879
|
-
creator: "mistral",
|
|
880
|
-
models: [
|
|
881
|
-
{
|
|
882
|
-
id: "mistral-large-2402",
|
|
883
|
-
name: "Mistral Large",
|
|
884
|
-
license: "proprietary",
|
|
885
|
-
providers: ["mistral", "azure"],
|
|
886
|
-
can: [
|
|
887
|
-
"chat",
|
|
888
|
-
"txt-in",
|
|
889
|
-
"txt-out",
|
|
890
|
-
"json-out",
|
|
891
|
-
"fn-out"
|
|
892
|
-
],
|
|
893
|
-
context: {
|
|
894
|
-
type: "token",
|
|
895
|
-
total: 32768,
|
|
896
|
-
maxOutput: 4096
|
|
897
|
-
}
|
|
898
|
-
},
|
|
899
|
-
{
|
|
900
|
-
id: "mistral-small-2402",
|
|
901
|
-
name: "Mistral Small",
|
|
902
|
-
license: "proprietary",
|
|
903
|
-
providers: ["mistral", "azure"],
|
|
904
|
-
can: [
|
|
905
|
-
"chat",
|
|
906
|
-
"txt-in",
|
|
907
|
-
"txt-out",
|
|
908
|
-
"json-out",
|
|
909
|
-
"fn-out"
|
|
910
|
-
],
|
|
911
|
-
context: {
|
|
912
|
-
type: "token",
|
|
913
|
-
total: 32768,
|
|
914
|
-
maxOutput: 4096
|
|
915
|
-
}
|
|
916
|
-
},
|
|
917
|
-
{
|
|
918
|
-
id: "mistral-medium",
|
|
919
|
-
name: "Mistral Medium",
|
|
920
|
-
license: "proprietary",
|
|
921
|
-
providers: ["mistral"],
|
|
922
|
-
can: [
|
|
923
|
-
"chat",
|
|
924
|
-
"txt-in",
|
|
925
|
-
"txt-out"
|
|
926
|
-
],
|
|
927
|
-
context: {
|
|
928
|
-
type: "token",
|
|
929
|
-
total: 32768,
|
|
930
|
-
maxOutput: 4096
|
|
931
|
-
}
|
|
932
|
-
},
|
|
933
|
-
{
|
|
934
|
-
id: "open-mistral-7b",
|
|
935
|
-
name: "Open Mistral 7B",
|
|
936
|
-
license: "apache-2.0",
|
|
937
|
-
providers: ["mistral", "groq"],
|
|
938
|
-
can: [
|
|
939
|
-
"chat",
|
|
940
|
-
"txt-in",
|
|
941
|
-
"txt-out"
|
|
942
|
-
],
|
|
943
|
-
context: {
|
|
944
|
-
type: "token",
|
|
945
|
-
total: 32768,
|
|
946
|
-
maxOutput: 4096
|
|
947
|
-
}
|
|
948
|
-
},
|
|
949
|
-
{
|
|
950
|
-
id: "open-mixtral-8x7b",
|
|
951
|
-
name: "Open Mixtral 8x7B",
|
|
952
|
-
license: "apache-2.0",
|
|
953
|
-
providers: ["mistral", "groq"],
|
|
954
|
-
can: [
|
|
955
|
-
"chat",
|
|
956
|
-
"txt-in",
|
|
957
|
-
"txt-out"
|
|
958
|
-
],
|
|
959
|
-
context: {
|
|
960
|
-
type: "token",
|
|
961
|
-
total: 32768,
|
|
962
|
-
maxOutput: 4096
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
]
|
|
966
|
-
};
|
|
967
|
-
|
|
968
|
-
// src/data/models/google-models.json
|
|
969
|
-
var google_models_default = {
|
|
970
|
-
creator: "google",
|
|
971
|
-
models: [
|
|
972
|
-
{
|
|
973
|
-
id: "gemini-2.0-flash",
|
|
974
|
-
name: "Gemini 2.0 Flash",
|
|
975
|
-
license: "proprietary",
|
|
976
|
-
providers: ["google"],
|
|
977
|
-
can: ["chat", "txt-in", "txt-out", "json-out", "fn-out", "img-in", "audio-in", "reason"],
|
|
978
|
-
context: {
|
|
979
|
-
type: "token",
|
|
980
|
-
total: 1048576,
|
|
981
|
-
maxOutput: 8192
|
|
982
|
-
},
|
|
983
|
-
aliases: ["gemini-2.0-flash-001"]
|
|
984
|
-
},
|
|
985
|
-
{
|
|
986
|
-
id: "gemini-2.0-flash-lite",
|
|
987
|
-
name: "Gemini 2.0 Flash Lite",
|
|
988
|
-
license: "proprietary",
|
|
989
|
-
providers: ["google"],
|
|
990
|
-
can: ["chat", "txt-in", "txt-out", "json-out", "fn-out", "img-in", "audio-in"],
|
|
991
|
-
context: {
|
|
992
|
-
type: "token",
|
|
993
|
-
total: 1048576,
|
|
994
|
-
maxOutput: 8192
|
|
995
|
-
},
|
|
996
|
-
aliases: ["gemini-2.0-flash-lite-preview-02-05"]
|
|
997
|
-
},
|
|
998
|
-
{
|
|
999
|
-
id: "gemini-1.5-flash",
|
|
1000
|
-
name: "Gemini 1.5 Flash",
|
|
1001
|
-
license: "proprietary",
|
|
1002
|
-
providers: ["google"],
|
|
1003
|
-
can: ["chat", "txt-in", "txt-out", "json-out", "fn-out", "img-in", "audio-in"],
|
|
1004
|
-
context: {
|
|
1005
|
-
type: "token",
|
|
1006
|
-
total: 2097152,
|
|
1007
|
-
maxOutput: 8192
|
|
1008
|
-
}
|
|
1009
|
-
},
|
|
1010
|
-
{
|
|
1011
|
-
id: "gemini-1.5-flash-8b",
|
|
1012
|
-
name: "Gemini 1.5 Flash 8B",
|
|
1013
|
-
license: "proprietary",
|
|
1014
|
-
providers: ["google"],
|
|
1015
|
-
can: ["chat", "txt-in", "txt-out", "json-out", "fn-out", "img-in", "audio-in"],
|
|
1016
|
-
context: {
|
|
1017
|
-
type: "token",
|
|
1018
|
-
total: 2097152,
|
|
1019
|
-
maxOutput: 8192
|
|
1020
|
-
}
|
|
1021
|
-
},
|
|
1022
|
-
{
|
|
1023
|
-
id: "gemini-1.5-pro",
|
|
1024
|
-
name: "Gemini 1.5 Pro",
|
|
1025
|
-
license: "proprietary",
|
|
1026
|
-
providers: ["google"],
|
|
1027
|
-
can: ["chat", "txt-in", "txt-out", "json-out", "fn-out", "img-in", "audio-in", "reason"],
|
|
1028
|
-
context: {
|
|
1029
|
-
type: "token",
|
|
1030
|
-
total: 2097152,
|
|
1031
|
-
maxOutput: 8192
|
|
1032
|
-
},
|
|
1033
|
-
aliases: ["gemini-1.5-pro-latest", "gemini-1.5-pro-001", "gemini-1.5-pro-002"]
|
|
1034
|
-
},
|
|
1035
|
-
{
|
|
1036
|
-
id: "text-embedding-004",
|
|
1037
|
-
name: "Text Embedding 004",
|
|
1038
|
-
license: "proprietary",
|
|
1039
|
-
providers: ["google"],
|
|
1040
|
-
can: ["txt-in", "vec-out"],
|
|
1041
|
-
context: {
|
|
1042
|
-
type: "token",
|
|
1043
|
-
total: 2048,
|
|
1044
|
-
maxOutput: 768
|
|
1045
|
-
}
|
|
1046
|
-
},
|
|
1047
|
-
{
|
|
1048
|
-
id: "gemma-7b-it",
|
|
1049
|
-
name: "Gemma 7B Instruct",
|
|
1050
|
-
license: "apache-2.0",
|
|
1051
|
-
providers: ["google"],
|
|
1052
|
-
can: ["chat", "txt-in", "txt-out", "json-out", "fn-out"],
|
|
1053
|
-
context: {
|
|
1054
|
-
type: "token",
|
|
1055
|
-
total: 8192,
|
|
1056
|
-
maxOutput: 4096
|
|
1057
|
-
}
|
|
1058
|
-
},
|
|
1059
|
-
{
|
|
1060
|
-
id: "gemma-2b-it",
|
|
1061
|
-
name: "Gemma 2B Instruct",
|
|
1062
|
-
license: "apache-2.0",
|
|
1063
|
-
providers: ["google"],
|
|
1064
|
-
can: ["chat", "txt-in", "txt-out", "json-out", "fn-out"],
|
|
1065
|
-
context: {
|
|
1066
|
-
type: "token",
|
|
1067
|
-
total: 8192,
|
|
1068
|
-
maxOutput: 4096
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
]
|
|
1072
|
-
};
|
|
1073
|
-
|
|
1074
|
-
// src/data/models/deepseek-models.json
|
|
1075
|
-
var deepseek_models_default = {
|
|
1076
|
-
creator: "deepseek",
|
|
1077
|
-
models: [
|
|
1078
|
-
{
|
|
1079
|
-
id: "deepseek-chat",
|
|
1080
|
-
name: "DeepSeek V3",
|
|
1081
|
-
license: "apache-2.0",
|
|
1082
|
-
providers: ["deepseek"],
|
|
1083
|
-
can: [
|
|
1084
|
-
"chat",
|
|
1085
|
-
"txt-in",
|
|
1086
|
-
"txt-out",
|
|
1087
|
-
"json-out",
|
|
1088
|
-
"fn-out"
|
|
1089
|
-
],
|
|
1090
|
-
context: {
|
|
1091
|
-
type: "token",
|
|
1092
|
-
total: 131072,
|
|
1093
|
-
maxOutput: 8192
|
|
1094
|
-
}
|
|
1095
|
-
},
|
|
1096
|
-
{
|
|
1097
|
-
id: "deepseek-reasoner",
|
|
1098
|
-
name: "DeepSeek R1",
|
|
1099
|
-
license: "apache-2.0",
|
|
1100
|
-
providers: ["deepseek"],
|
|
1101
|
-
can: [
|
|
1102
|
-
"chat",
|
|
1103
|
-
"txt-in",
|
|
1104
|
-
"txt-out",
|
|
1105
|
-
"json-out",
|
|
1106
|
-
"fn-out",
|
|
1107
|
-
"reason"
|
|
1108
|
-
],
|
|
1109
|
-
context: {
|
|
1110
|
-
type: "token",
|
|
1111
|
-
total: 131072,
|
|
1112
|
-
maxOutput: 8192
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
]
|
|
1116
|
-
};
|
|
1117
|
-
|
|
1118
|
-
// src/data/models/xai-models.json
|
|
1119
|
-
var xai_models_default = {
|
|
1120
|
-
creator: "xai",
|
|
1121
|
-
models: [
|
|
1122
|
-
{
|
|
1123
|
-
id: "grok-2-vision-1212",
|
|
1124
|
-
name: "Grok 2 Vision",
|
|
1125
|
-
creator: "xai",
|
|
1126
|
-
license: "proprietary",
|
|
1127
|
-
providers: ["xai"],
|
|
1128
|
-
can: ["chat", "txt-in", "txt-out", "img-in"],
|
|
1129
|
-
context: {
|
|
1130
|
-
type: "token",
|
|
1131
|
-
total: 32768,
|
|
1132
|
-
maxOutput: 4096
|
|
1133
|
-
},
|
|
1134
|
-
aliases: ["grok-2-vision", "grok-2-vision-latest"]
|
|
1135
|
-
},
|
|
1136
|
-
{
|
|
1137
|
-
id: "grok-2-1212",
|
|
1138
|
-
name: "Grok 2",
|
|
1139
|
-
creator: "xai",
|
|
1140
|
-
license: "proprietary",
|
|
1141
|
-
providers: ["xai"],
|
|
1142
|
-
can: ["chat", "txt-in", "txt-out"],
|
|
1143
|
-
context: {
|
|
1144
|
-
type: "token",
|
|
1145
|
-
total: 131072,
|
|
1146
|
-
maxOutput: 4096
|
|
1147
|
-
},
|
|
1148
|
-
aliases: ["grok-2", "grok-2-latest"]
|
|
1149
|
-
},
|
|
1150
|
-
{
|
|
1151
|
-
id: "grok-vision-beta",
|
|
1152
|
-
name: "Grok Vision Beta",
|
|
1153
|
-
creator: "xai",
|
|
1154
|
-
license: "proprietary",
|
|
1155
|
-
providers: ["xai"],
|
|
1156
|
-
can: ["chat", "txt-in", "txt-out", "img-in"],
|
|
1157
|
-
context: {
|
|
1158
|
-
type: "token",
|
|
1159
|
-
total: 8192,
|
|
1160
|
-
maxOutput: 4096
|
|
1161
|
-
}
|
|
1162
|
-
},
|
|
1163
|
-
{
|
|
1164
|
-
id: "grok-beta",
|
|
1165
|
-
name: "Grok Beta",
|
|
1166
|
-
creator: "xai",
|
|
1167
|
-
license: "proprietary",
|
|
1168
|
-
providers: ["xai"],
|
|
1169
|
-
can: ["chat", "txt-in", "txt-out"],
|
|
1170
|
-
context: {
|
|
1171
|
-
type: "token",
|
|
1172
|
-
total: 131072,
|
|
1173
|
-
maxOutput: 4096
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
]
|
|
1177
|
-
};
|
|
1178
|
-
|
|
1179
|
-
// src/data/models/cohere-models.json
|
|
1180
|
-
var cohere_models_default = {
|
|
1181
|
-
creator: "cohere",
|
|
1182
|
-
models: [
|
|
1183
|
-
{
|
|
1184
|
-
id: "command-r7b-12-2024",
|
|
1185
|
-
name: "Command R7B",
|
|
1186
|
-
creator: "cohere",
|
|
1187
|
-
license: "proprietary",
|
|
1188
|
-
providers: [
|
|
1189
|
-
"cohere"
|
|
1190
|
-
],
|
|
1191
|
-
can: [
|
|
1192
|
-
"chat",
|
|
1193
|
-
"txt-in",
|
|
1194
|
-
"txt-out",
|
|
1195
|
-
"json-out",
|
|
1196
|
-
"fn-out"
|
|
1197
|
-
],
|
|
1198
|
-
context: {
|
|
1199
|
-
type: "token",
|
|
1200
|
-
total: 128e3,
|
|
1201
|
-
maxOutput: 4096
|
|
1202
|
-
}
|
|
1203
|
-
},
|
|
1204
|
-
{
|
|
1205
|
-
id: "command-r-plus-08-2024",
|
|
1206
|
-
name: "Command R+",
|
|
1207
|
-
creator: "cohere",
|
|
1208
|
-
license: "proprietary",
|
|
1209
|
-
providers: [
|
|
1210
|
-
"cohere",
|
|
1211
|
-
"bedrock",
|
|
1212
|
-
"azure",
|
|
1213
|
-
"oracle"
|
|
1214
|
-
],
|
|
1215
|
-
can: [
|
|
1216
|
-
"chat",
|
|
1217
|
-
"txt-in",
|
|
1218
|
-
"txt-out",
|
|
1219
|
-
"json-out",
|
|
1220
|
-
"fn-out"
|
|
1221
|
-
],
|
|
1222
|
-
context: {
|
|
1223
|
-
type: "token",
|
|
1224
|
-
total: 128e3,
|
|
1225
|
-
maxOutput: 4096
|
|
1226
|
-
},
|
|
1227
|
-
aliases: [
|
|
1228
|
-
"command-r-plus"
|
|
1229
|
-
]
|
|
1230
|
-
},
|
|
1231
|
-
{
|
|
1232
|
-
id: "command-r-03-2024",
|
|
1233
|
-
name: "Command R",
|
|
1234
|
-
creator: "cohere",
|
|
1235
|
-
license: "proprietary",
|
|
1236
|
-
providers: [
|
|
1237
|
-
"cohere",
|
|
1238
|
-
"bedrock",
|
|
1239
|
-
"azure",
|
|
1240
|
-
"oracle"
|
|
1241
|
-
],
|
|
1242
|
-
can: [
|
|
1243
|
-
"chat",
|
|
1244
|
-
"txt-in",
|
|
1245
|
-
"txt-out",
|
|
1246
|
-
"reason",
|
|
1247
|
-
"json-out",
|
|
1248
|
-
"fn-out"
|
|
1249
|
-
],
|
|
1250
|
-
context: {
|
|
1251
|
-
type: "token",
|
|
1252
|
-
total: 128e3,
|
|
1253
|
-
maxOutput: 4096
|
|
1254
|
-
},
|
|
1255
|
-
aliases: [
|
|
1256
|
-
"command-r"
|
|
1257
|
-
]
|
|
1258
|
-
},
|
|
1259
|
-
{
|
|
1260
|
-
id: "command",
|
|
1261
|
-
name: "Command",
|
|
1262
|
-
creator: "cohere",
|
|
1263
|
-
license: "proprietary",
|
|
1264
|
-
providers: [
|
|
1265
|
-
"cohere",
|
|
1266
|
-
"bedrock",
|
|
1267
|
-
"oracle"
|
|
1268
|
-
],
|
|
1269
|
-
can: [
|
|
1270
|
-
"chat",
|
|
1271
|
-
"txt-in",
|
|
1272
|
-
"txt-out"
|
|
1273
|
-
],
|
|
1274
|
-
context: {
|
|
1275
|
-
type: "token",
|
|
1276
|
-
total: 4096,
|
|
1277
|
-
maxOutput: 4096
|
|
1278
|
-
}
|
|
1279
|
-
},
|
|
1280
|
-
{
|
|
1281
|
-
id: "command-light",
|
|
1282
|
-
name: "Command Light",
|
|
1283
|
-
creator: "cohere",
|
|
1284
|
-
license: "proprietary",
|
|
1285
|
-
providers: [
|
|
1286
|
-
"cohere",
|
|
1287
|
-
"bedrock",
|
|
1288
|
-
"oracle"
|
|
1289
|
-
],
|
|
1290
|
-
can: [
|
|
1291
|
-
"chat",
|
|
1292
|
-
"txt-in",
|
|
1293
|
-
"txt-out"
|
|
1294
|
-
],
|
|
1295
|
-
context: {
|
|
1296
|
-
type: "token",
|
|
1297
|
-
total: 4096,
|
|
1298
|
-
maxOutput: 4096
|
|
1299
|
-
}
|
|
1300
|
-
},
|
|
1301
|
-
{
|
|
1302
|
-
id: "embed-english-v3.0",
|
|
1303
|
-
name: "Embed English v3.0",
|
|
1304
|
-
creator: "cohere",
|
|
1305
|
-
license: "proprietary",
|
|
1306
|
-
providers: [
|
|
1307
|
-
"cohere",
|
|
1308
|
-
"bedrock",
|
|
1309
|
-
"azure",
|
|
1310
|
-
"oracle"
|
|
1311
|
-
],
|
|
1312
|
-
can: [
|
|
1313
|
-
"txt-in",
|
|
1314
|
-
"img-in",
|
|
1315
|
-
"vec-out"
|
|
1316
|
-
],
|
|
1317
|
-
context: {
|
|
1318
|
-
type: "token",
|
|
1319
|
-
total: 512,
|
|
1320
|
-
maxOutput: 1024
|
|
1321
|
-
}
|
|
1322
|
-
},
|
|
1323
|
-
{
|
|
1324
|
-
id: "embed-english-light-v3.0",
|
|
1325
|
-
name: "Embed English Light v3.0",
|
|
1326
|
-
creator: "cohere",
|
|
1327
|
-
license: "proprietary",
|
|
1328
|
-
providers: [
|
|
1329
|
-
"cohere",
|
|
1330
|
-
"oracle"
|
|
1331
|
-
],
|
|
1332
|
-
can: [
|
|
1333
|
-
"txt-in",
|
|
1334
|
-
"img-in",
|
|
1335
|
-
"vec-out"
|
|
1336
|
-
],
|
|
1337
|
-
context: {
|
|
1338
|
-
type: "token",
|
|
1339
|
-
total: 512,
|
|
1340
|
-
maxOutput: 384
|
|
1341
|
-
}
|
|
1342
|
-
},
|
|
1343
|
-
{
|
|
1344
|
-
id: "embed-multilingual-v3.0",
|
|
1345
|
-
name: "Embed Multilingual v3.0",
|
|
1346
|
-
creator: "cohere",
|
|
1347
|
-
license: "proprietary",
|
|
1348
|
-
providers: [
|
|
1349
|
-
"cohere",
|
|
1350
|
-
"bedrock",
|
|
1351
|
-
"azure",
|
|
1352
|
-
"oracle"
|
|
1353
|
-
],
|
|
1354
|
-
can: [
|
|
1355
|
-
"txt-in",
|
|
1356
|
-
"img-in",
|
|
1357
|
-
"vec-out"
|
|
1358
|
-
],
|
|
1359
|
-
context: {
|
|
1360
|
-
type: "token",
|
|
1361
|
-
total: 512,
|
|
1362
|
-
maxOutput: 1024
|
|
1363
|
-
}
|
|
1364
|
-
},
|
|
1365
|
-
{
|
|
1366
|
-
id: "embed-multilingual-light-v3.0",
|
|
1367
|
-
name: "Embed Multilingual Light v3.0",
|
|
1368
|
-
creator: "cohere",
|
|
1369
|
-
license: "proprietary",
|
|
1370
|
-
providers: [
|
|
1371
|
-
"cohere",
|
|
1372
|
-
"oracle"
|
|
1373
|
-
],
|
|
1374
|
-
can: [
|
|
1375
|
-
"txt-in",
|
|
1376
|
-
"img-in",
|
|
1377
|
-
"vec-out"
|
|
1378
|
-
],
|
|
1379
|
-
context: {
|
|
1380
|
-
type: "token",
|
|
1381
|
-
total: 512,
|
|
1382
|
-
maxOutput: 384
|
|
1383
|
-
}
|
|
1384
|
-
},
|
|
1385
|
-
{
|
|
1386
|
-
id: "rerank-v3.5",
|
|
1387
|
-
name: "Rerank v3.5",
|
|
1388
|
-
creator: "cohere",
|
|
1389
|
-
license: "proprietary",
|
|
1390
|
-
providers: [
|
|
1391
|
-
"cohere",
|
|
1392
|
-
"bedrock",
|
|
1393
|
-
"azure"
|
|
1394
|
-
],
|
|
1395
|
-
can: [
|
|
1396
|
-
"txt-in",
|
|
1397
|
-
"txt-out"
|
|
1398
|
-
],
|
|
1399
|
-
context: {
|
|
1400
|
-
type: "token",
|
|
1401
|
-
total: 4096,
|
|
1402
|
-
maxOutput: null
|
|
1403
|
-
}
|
|
1404
|
-
},
|
|
1405
|
-
{
|
|
1406
|
-
id: "rerank-english-v3.0",
|
|
1407
|
-
name: "Rerank English v3.0",
|
|
1408
|
-
creator: "cohere",
|
|
1409
|
-
license: "proprietary",
|
|
1410
|
-
providers: [
|
|
1411
|
-
"cohere",
|
|
1412
|
-
"azure"
|
|
1413
|
-
],
|
|
1414
|
-
can: [
|
|
1415
|
-
"txt-in",
|
|
1416
|
-
"txt-out"
|
|
1417
|
-
],
|
|
1418
|
-
context: {
|
|
1419
|
-
type: "token",
|
|
1420
|
-
total: 4096,
|
|
1421
|
-
maxOutput: null
|
|
1422
|
-
}
|
|
1423
|
-
},
|
|
1424
|
-
{
|
|
1425
|
-
id: "rerank-multilingual-v3.0",
|
|
1426
|
-
name: "Rerank Multilingual v3.0",
|
|
1427
|
-
creator: "cohere",
|
|
1428
|
-
license: "proprietary",
|
|
1429
|
-
providers: [
|
|
1430
|
-
"cohere",
|
|
1431
|
-
"azure"
|
|
1432
|
-
],
|
|
1433
|
-
can: [
|
|
1434
|
-
"txt-in",
|
|
1435
|
-
"txt-out"
|
|
1436
|
-
],
|
|
1437
|
-
context: {
|
|
1438
|
-
type: "token",
|
|
1439
|
-
total: 4096,
|
|
1440
|
-
maxOutput: null
|
|
1441
|
-
}
|
|
1442
|
-
}
|
|
1443
|
-
]
|
|
1444
|
-
};
|
|
1445
|
-
|
|
1446
|
-
// src/builders/models.ts
|
|
1447
|
-
function validateModel(raw) {
|
|
1448
|
-
if (typeof raw !== "object" || raw === null) {
|
|
1449
|
-
throw new Error("Model data must be an object");
|
|
1450
|
-
}
|
|
1451
|
-
const model = raw;
|
|
1452
|
-
const stringFields = ["id", "name", "creator", "license"];
|
|
1453
|
-
for (const field of stringFields) {
|
|
1454
|
-
if (typeof model[field] !== "string") {
|
|
1455
|
-
throw new Error(`Model ${field} must be a string`);
|
|
1456
|
-
}
|
|
1457
|
-
}
|
|
1458
|
-
if (model.extends !== void 0 && typeof model.extends !== "string") {
|
|
1459
|
-
throw new Error("Model extends must be a string");
|
|
1460
|
-
}
|
|
1461
|
-
if (model.overrides !== void 0) {
|
|
1462
|
-
if (typeof model.overrides !== "object" || model.overrides === null) {
|
|
1463
|
-
throw new Error("Model overrides must be an object");
|
|
1464
|
-
}
|
|
1465
|
-
const validOverrideFields = ["name", "creator", "license", "providers", "can", "languages", "aliases", "context"];
|
|
1466
|
-
const invalidFields = Object.keys(model.overrides).filter((field) => !validOverrideFields.includes(field));
|
|
1467
|
-
if (invalidFields.length > 0) {
|
|
1468
|
-
throw new Error(`Invalid override fields: ${invalidFields.join(", ")}`);
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1471
|
-
if (!Array.isArray(model.providers)) {
|
|
1472
|
-
throw new Error("Model providers must be an array");
|
|
1473
|
-
}
|
|
1474
|
-
if (!model.providers.every((p) => typeof p === "string")) {
|
|
1475
|
-
throw new Error("Model providers must be strings");
|
|
1476
|
-
}
|
|
1477
|
-
if (!Array.isArray(model.can)) {
|
|
1478
|
-
throw new Error("Model capabilities must be an array");
|
|
1479
|
-
}
|
|
1480
|
-
const validCapabilities = [
|
|
1481
|
-
"chat",
|
|
1482
|
-
"reason",
|
|
1483
|
-
"txt-in",
|
|
1484
|
-
"txt-out",
|
|
1485
|
-
"img-in",
|
|
1486
|
-
"img-out",
|
|
1487
|
-
"audio-in",
|
|
1488
|
-
"audio-out",
|
|
1489
|
-
"json-out",
|
|
1490
|
-
"fn-out",
|
|
1491
|
-
"vec-out"
|
|
1492
|
-
];
|
|
1493
|
-
if (!model.can.every((c) => validCapabilities.includes(c))) {
|
|
1494
|
-
throw new Error(`Model has invalid capabilities: ${model.can.join(", ")}`);
|
|
1495
|
-
}
|
|
1496
|
-
if (model.aliases !== void 0) {
|
|
1497
|
-
if (!Array.isArray(model.aliases)) {
|
|
1498
|
-
throw new Error("Model aliases must be an array");
|
|
1499
|
-
}
|
|
1500
|
-
if (!model.aliases.every((a) => typeof a === "string")) {
|
|
1501
|
-
throw new Error("Model aliases must be strings");
|
|
1502
|
-
}
|
|
1503
|
-
}
|
|
1504
|
-
if (typeof model.context !== "object" || model.context === null) {
|
|
1505
|
-
throw new Error("Model context must be an object");
|
|
1506
|
-
}
|
|
1507
|
-
const context = model.context;
|
|
1508
|
-
if (Array.isArray(context.sizes) && Array.isArray(context.qualities)) {
|
|
1509
|
-
if (typeof context.maxOutput !== "number") {
|
|
1510
|
-
throw new Error("Image model context.maxOutput must be a number");
|
|
1511
|
-
}
|
|
1512
|
-
} else if (context.type === "embedding") {
|
|
1513
|
-
if (typeof context.total !== "number") {
|
|
1514
|
-
throw new Error("Embedding model context.total must be a number");
|
|
1515
|
-
}
|
|
1516
|
-
if (typeof context.unit !== "string") {
|
|
1517
|
-
throw new Error("Embedding model context.unit must be a string");
|
|
1518
|
-
}
|
|
1519
|
-
if (typeof context.dimensions !== "number") {
|
|
1520
|
-
throw new Error("Embedding model context.dimensions must be a number");
|
|
1521
|
-
}
|
|
1522
|
-
} else {
|
|
1523
|
-
if (typeof context.total !== "number" && context.total !== null) {
|
|
1524
|
-
throw new Error("Token model context.total must be a number or null");
|
|
1525
|
-
}
|
|
1526
|
-
if (typeof context.maxOutput !== "number" && context.maxOutput !== null) {
|
|
1527
|
-
throw new Error("Token model context.maxOutput must be a number or null");
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1530
|
-
return {
|
|
1531
|
-
id: model.id,
|
|
1532
|
-
name: model.name,
|
|
1533
|
-
creator: model.creator,
|
|
1534
|
-
license: model.license,
|
|
1535
|
-
providers: model.providers,
|
|
1536
|
-
can: model.can,
|
|
1537
|
-
context: model.context,
|
|
1538
|
-
...model.languages ? { languages: model.languages } : {},
|
|
1539
|
-
...model.aliases ? { aliases: model.aliases } : {},
|
|
1540
|
-
...model.extends ? { extends: model.extends } : {},
|
|
1541
|
-
...model.overrides ? { overrides: model.overrides } : {}
|
|
1542
|
-
};
|
|
1543
|
-
}
|
|
1544
|
-
function resolveModel(model, allModels2, visited = /* @__PURE__ */ new Set()) {
|
|
1545
|
-
if (!model.extends) {
|
|
1546
|
-
return model;
|
|
1547
|
-
}
|
|
1548
|
-
if (visited.has(model.id)) {
|
|
1549
|
-
throw new Error(`Circular dependency detected for model ${model.id}`);
|
|
1550
|
-
}
|
|
1551
|
-
visited.add(model.id);
|
|
1552
|
-
const baseModel = allModels2[model.extends];
|
|
1553
|
-
if (!baseModel) {
|
|
1554
|
-
throw new Error(`Base model ${model.extends} not found for ${model.id}`);
|
|
1555
|
-
}
|
|
1556
|
-
const resolvedBase = resolveModel(baseModel, allModels2, visited);
|
|
1557
|
-
if (!model.overrides) {
|
|
1558
|
-
return {
|
|
1559
|
-
...resolvedBase,
|
|
1560
|
-
id: model.id,
|
|
1561
|
-
extends: model.extends
|
|
1562
|
-
};
|
|
1563
|
-
}
|
|
1564
|
-
const resolved = {
|
|
1565
|
-
...resolvedBase,
|
|
1566
|
-
...model.overrides,
|
|
1567
|
-
id: model.id,
|
|
1568
|
-
extends: model.extends
|
|
1569
|
-
};
|
|
1570
|
-
if (!resolved.name || !resolved.creator || !resolved.license || !resolved.providers || !resolved.can || !resolved.context) {
|
|
1571
|
-
throw new Error(`Missing required fields in resolved model ${model.id}`);
|
|
1572
|
-
}
|
|
1573
|
-
return resolved;
|
|
1574
|
-
}
|
|
1575
|
-
function buildAllModels() {
|
|
1576
|
-
const allModelData = [
|
|
1577
|
-
openai_models_default,
|
|
1578
|
-
anthropic_models_default,
|
|
1579
|
-
meta_models_default,
|
|
1580
|
-
mistral_models_default,
|
|
1581
|
-
google_models_default,
|
|
1582
|
-
deepseek_models_default,
|
|
1583
|
-
xai_models_default,
|
|
1584
|
-
cohere_models_default
|
|
1585
|
-
];
|
|
1586
|
-
const allModels2 = allModelData.flatMap(
|
|
1587
|
-
(data) => data.models.map((model) => {
|
|
1588
|
-
if (typeof model.id !== "string") {
|
|
1589
|
-
throw new Error(`Model id must be a string`);
|
|
1590
|
-
}
|
|
1591
|
-
if (model.extends !== void 0 && typeof model.extends !== "string") {
|
|
1592
|
-
throw new Error("Model extends must be a string");
|
|
1593
|
-
}
|
|
1594
|
-
if (model.overrides !== void 0 && (typeof model.overrides !== "object" || model.overrides === null)) {
|
|
1595
|
-
throw new Error("Model overrides must be an object");
|
|
1596
|
-
}
|
|
1597
|
-
return {
|
|
1598
|
-
...model,
|
|
1599
|
-
creator: data.creator
|
|
1600
|
-
};
|
|
1601
|
-
})
|
|
1602
|
-
);
|
|
1603
|
-
const modelMap = Object.fromEntries(
|
|
1604
|
-
allModels2.map((model) => [model.id, model])
|
|
1605
|
-
);
|
|
1606
|
-
const resolvedModels = allModels2.map(
|
|
1607
|
-
(model) => resolveModel(model, modelMap)
|
|
1608
|
-
);
|
|
1609
|
-
return resolvedModels.map((model) => validateModel(model));
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
// src/data/providers/openai-provider.json
|
|
1613
|
-
var openai_provider_default = {
|
|
1614
|
-
id: "openai",
|
|
1615
|
-
name: "OpenAI",
|
|
1616
|
-
websiteUrl: "https://openai.com/",
|
|
1617
|
-
apiUrl: "https://api.openai.com/v1",
|
|
1618
|
-
defaultModel: "gpt-4o",
|
|
1619
|
-
models: {
|
|
1620
|
-
"chatgpt-4o-latest": {
|
|
1621
|
-
type: "token",
|
|
1622
|
-
input: 5,
|
|
1623
|
-
output: 15
|
|
1624
|
-
},
|
|
1625
|
-
"gpt-4": {
|
|
1626
|
-
type: "token",
|
|
1627
|
-
input: 30,
|
|
1628
|
-
output: 60
|
|
1629
|
-
},
|
|
1630
|
-
"gpt-4-0613": {
|
|
1631
|
-
type: "token",
|
|
1632
|
-
input: 30,
|
|
1633
|
-
output: 60
|
|
1634
|
-
},
|
|
1635
|
-
"gpt-4-32k": {
|
|
1636
|
-
type: "token",
|
|
1637
|
-
input: 60,
|
|
1638
|
-
output: 120
|
|
1639
|
-
},
|
|
1640
|
-
"gpt-4-turbo": {
|
|
1641
|
-
type: "token",
|
|
1642
|
-
input: 10,
|
|
1643
|
-
output: 30
|
|
1644
|
-
},
|
|
1645
|
-
"gpt-4-turbo-2024-04-09": {
|
|
1646
|
-
type: "token",
|
|
1647
|
-
input: 10,
|
|
1648
|
-
output: 30
|
|
1649
|
-
},
|
|
1650
|
-
"gpt-3.5-turbo": {
|
|
1651
|
-
type: "token",
|
|
1652
|
-
input: 0.5,
|
|
1653
|
-
output: 1.5
|
|
1654
|
-
},
|
|
1655
|
-
"gpt-3.5-turbo-0125": {
|
|
1656
|
-
type: "token",
|
|
1657
|
-
input: 0.5,
|
|
1658
|
-
output: 1.5
|
|
1659
|
-
},
|
|
1660
|
-
"gpt-3.5-turbo-instruct": {
|
|
1661
|
-
type: "token",
|
|
1662
|
-
input: 1.5,
|
|
1663
|
-
output: 2
|
|
1664
|
-
},
|
|
1665
|
-
"gpt-3.5-turbo-16k-0613": {
|
|
1666
|
-
type: "token",
|
|
1667
|
-
input: 3,
|
|
1668
|
-
output: 4
|
|
1669
|
-
},
|
|
1670
|
-
"davinci-002": {
|
|
1671
|
-
type: "token",
|
|
1672
|
-
input: 2,
|
|
1673
|
-
output: 2
|
|
1674
|
-
},
|
|
1675
|
-
"babbage-002": {
|
|
1676
|
-
type: "token",
|
|
1677
|
-
input: 0.4,
|
|
1678
|
-
output: 0.4
|
|
1679
|
-
},
|
|
1680
|
-
"gpt-4o": {
|
|
1681
|
-
type: "token",
|
|
1682
|
-
input: 2.5,
|
|
1683
|
-
input_cached: 1.25,
|
|
1684
|
-
output: 10
|
|
1685
|
-
},
|
|
1686
|
-
"gpt-4o-2024-08-06": {
|
|
1687
|
-
type: "token",
|
|
1688
|
-
input: 2.5,
|
|
1689
|
-
input_cached: 1.25,
|
|
1690
|
-
output: 10
|
|
1691
|
-
},
|
|
1692
|
-
"gpt-4o-audio-preview": {
|
|
1693
|
-
type: "token",
|
|
1694
|
-
input: 2.5,
|
|
1695
|
-
output: 10
|
|
1696
|
-
},
|
|
1697
|
-
"gpt-4o-audio-preview-2024-12-17": {
|
|
1698
|
-
type: "token",
|
|
1699
|
-
input: 2.5,
|
|
1700
|
-
output: 10
|
|
1701
|
-
},
|
|
1702
|
-
"gpt-4o-realtime-preview": {
|
|
1703
|
-
type: "token",
|
|
1704
|
-
input: 5,
|
|
1705
|
-
input_cached: 2.5,
|
|
1706
|
-
output: 20
|
|
1707
|
-
},
|
|
1708
|
-
"gpt-4o-realtime-preview-2024-12-17": {
|
|
1709
|
-
type: "token",
|
|
1710
|
-
input: 5,
|
|
1711
|
-
input_cached: 2.5,
|
|
1712
|
-
output: 20
|
|
1713
|
-
},
|
|
1714
|
-
"gpt-4o-mini": {
|
|
1715
|
-
type: "token",
|
|
1716
|
-
input: 0.15,
|
|
1717
|
-
input_cached: 0.075,
|
|
1718
|
-
output: 0.6
|
|
1719
|
-
},
|
|
1720
|
-
"gpt-4o-mini-2024-07-18": {
|
|
1721
|
-
type: "token",
|
|
1722
|
-
input: 0.15,
|
|
1723
|
-
input_cached: 0.075,
|
|
1724
|
-
output: 0.6
|
|
1725
|
-
},
|
|
1726
|
-
"gpt-4o-mini-audio-preview": {
|
|
1727
|
-
type: "token",
|
|
1728
|
-
input: 0.15,
|
|
1729
|
-
output: 0.6
|
|
1730
|
-
},
|
|
1731
|
-
"gpt-4o-mini-audio-preview-2024-12-17": {
|
|
1732
|
-
type: "token",
|
|
1733
|
-
input: 0.15,
|
|
1734
|
-
output: 0.6
|
|
1735
|
-
},
|
|
1736
|
-
"gpt-4o-mini-realtime-preview": {
|
|
1737
|
-
type: "token",
|
|
1738
|
-
input: 0.6,
|
|
1739
|
-
input_cached: 0.3,
|
|
1740
|
-
output: 2.4
|
|
1741
|
-
},
|
|
1742
|
-
"gpt-4o-mini-realtime-preview-2024-12-17": {
|
|
1743
|
-
type: "token",
|
|
1744
|
-
input: 0.6,
|
|
1745
|
-
input_cached: 0.3,
|
|
1746
|
-
output: 2.4
|
|
1747
|
-
},
|
|
1748
|
-
o1: {
|
|
1749
|
-
type: "token",
|
|
1750
|
-
input: 15,
|
|
1751
|
-
input_cached: 7.5,
|
|
1752
|
-
output: 60
|
|
1753
|
-
},
|
|
1754
|
-
"o1-2024-12-17": {
|
|
1755
|
-
type: "token",
|
|
1756
|
-
input: 15,
|
|
1757
|
-
input_cached: 7.5,
|
|
1758
|
-
output: 60
|
|
1759
|
-
},
|
|
1760
|
-
"o3-mini": {
|
|
1761
|
-
type: "token",
|
|
1762
|
-
input: 1.1,
|
|
1763
|
-
input_cached: 0.55,
|
|
1764
|
-
output: 4.4
|
|
1765
|
-
},
|
|
1766
|
-
"o3-mini-2025-01-31": {
|
|
1767
|
-
type: "token",
|
|
1768
|
-
input: 1.1,
|
|
1769
|
-
input_cached: 0.55,
|
|
1770
|
-
output: 4.4
|
|
1771
|
-
},
|
|
1772
|
-
"o1-mini": {
|
|
1773
|
-
type: "token",
|
|
1774
|
-
input: 1.1,
|
|
1775
|
-
input_cached: 0.55,
|
|
1776
|
-
output: 4.4
|
|
1777
|
-
},
|
|
1778
|
-
"o1-mini-2024-09-12": {
|
|
1779
|
-
type: "token",
|
|
1780
|
-
input: 1.1,
|
|
1781
|
-
input_cached: 0.55,
|
|
1782
|
-
output: 4.4
|
|
1783
|
-
},
|
|
1784
|
-
"whisper-1": {
|
|
1785
|
-
type: "minute",
|
|
1786
|
-
price: 6e-3
|
|
1787
|
-
},
|
|
1788
|
-
"tts-1": {
|
|
1789
|
-
type: "character",
|
|
1790
|
-
price: 15e-6
|
|
1791
|
-
},
|
|
1792
|
-
"tts-1-hd": {
|
|
1793
|
-
type: "character",
|
|
1794
|
-
price: 3e-5
|
|
1795
|
-
},
|
|
1796
|
-
"dall-e-2": {
|
|
1797
|
-
type: "image",
|
|
1798
|
-
price: 0.016,
|
|
1799
|
-
size: "256x256",
|
|
1800
|
-
unit: "per_image"
|
|
1801
|
-
},
|
|
1802
|
-
"dall-e-2-512": {
|
|
1803
|
-
type: "image",
|
|
1804
|
-
price: 0.018,
|
|
1805
|
-
size: "512x512",
|
|
1806
|
-
unit: "per_image"
|
|
1807
|
-
},
|
|
1808
|
-
"dall-e-2-1024": {
|
|
1809
|
-
type: "image",
|
|
1810
|
-
price: 0.02,
|
|
1811
|
-
size: "1024x1024",
|
|
1812
|
-
unit: "per_image"
|
|
1813
|
-
},
|
|
1814
|
-
"dall-e-3": {
|
|
1815
|
-
type: "image",
|
|
1816
|
-
price: 0.04,
|
|
1817
|
-
size: "1024x1024",
|
|
1818
|
-
unit: "per_image"
|
|
1819
|
-
},
|
|
1820
|
-
"dall-e-3-hd": {
|
|
1821
|
-
type: "image",
|
|
1822
|
-
price: 0.08,
|
|
1823
|
-
size: "1024x1024",
|
|
1824
|
-
unit: "per_image"
|
|
1825
|
-
}
|
|
1826
|
-
}
|
|
1827
|
-
};
|
|
1828
|
-
|
|
1829
|
-
// src/data/providers/anthropic-provider.json
|
|
1830
|
-
var anthropic_provider_default = {
|
|
1831
|
-
id: "anthropic",
|
|
1832
|
-
name: "Anthropic",
|
|
1833
|
-
websiteUrl: "https://www.anthropic.com/",
|
|
1834
|
-
apiUrl: "https://api.anthropic.com/v1",
|
|
1835
|
-
defaultModel: "claude-3-5-sonnet-20241022",
|
|
1836
|
-
models: {
|
|
1837
|
-
"claude-3-opus-20240229": {
|
|
1838
|
-
type: "token",
|
|
1839
|
-
input: 15,
|
|
1840
|
-
output: 75
|
|
1841
|
-
},
|
|
1842
|
-
"claude-3-sonnet-20240229": {
|
|
1843
|
-
type: "token",
|
|
1844
|
-
input: 3,
|
|
1845
|
-
output: 15
|
|
1846
|
-
},
|
|
1847
|
-
"claude-3-haiku-20240307": {
|
|
1848
|
-
type: "token",
|
|
1849
|
-
input: 0.25,
|
|
1850
|
-
output: 1.25
|
|
1851
|
-
},
|
|
1852
|
-
"claude-3-5-sonnet-20241022": {
|
|
1853
|
-
type: "token",
|
|
1854
|
-
input: 3,
|
|
1855
|
-
output: 15
|
|
1856
|
-
},
|
|
1857
|
-
"claude-3-5-sonnet-20240620": {
|
|
1858
|
-
type: "token",
|
|
1859
|
-
input: 3,
|
|
1860
|
-
output: 15
|
|
1861
|
-
},
|
|
1862
|
-
"claude-3-5-haiku-20241022": {
|
|
1863
|
-
type: "token",
|
|
1864
|
-
input: 0.8,
|
|
1865
|
-
output: 4
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
};
|
|
1869
|
-
|
|
1870
|
-
// src/data/providers/mistral-provider.json
|
|
1871
|
-
var mistral_provider_default = {
|
|
1872
|
-
id: "mistral",
|
|
1873
|
-
name: "Mistral",
|
|
1874
|
-
websiteUrl: "https://mistral.ai/",
|
|
1875
|
-
apiUrl: "https://api.mistral.ai/v1",
|
|
1876
|
-
defaultModel: "mixtral-8x7b-32768",
|
|
1877
|
-
models: {
|
|
1878
|
-
"mixtral-8x7b-32768": {
|
|
1879
|
-
type: "token",
|
|
1880
|
-
input: 0.7,
|
|
1881
|
-
output: 0.7
|
|
1882
|
-
},
|
|
1883
|
-
"mistral-large-latest": {
|
|
1884
|
-
type: "token",
|
|
1885
|
-
input: 0.7,
|
|
1886
|
-
output: 0.7
|
|
1887
|
-
}
|
|
1888
|
-
}
|
|
1889
|
-
};
|
|
1890
|
-
|
|
1891
|
-
// src/data/providers/cohere-provider.json
|
|
1892
|
-
var cohere_provider_default = {
|
|
1893
|
-
id: "cohere",
|
|
1894
|
-
name: "Cohere",
|
|
1895
|
-
websiteUrl: "https://cohere.com",
|
|
1896
|
-
apiUrl: "https://docs.cohere.com/reference",
|
|
1897
|
-
models: {
|
|
1898
|
-
"command-r7b-12-2024": {
|
|
1899
|
-
type: "token",
|
|
1900
|
-
input: 0.0375,
|
|
1901
|
-
output: 0.15
|
|
1902
|
-
},
|
|
1903
|
-
"command-r-plus-08-2024": {
|
|
1904
|
-
type: "token",
|
|
1905
|
-
input: 2.5,
|
|
1906
|
-
output: 10
|
|
1907
|
-
},
|
|
1908
|
-
"command-r-03-2024": {
|
|
1909
|
-
type: "token",
|
|
1910
|
-
input: 0.15,
|
|
1911
|
-
output: 0.6
|
|
1912
|
-
},
|
|
1913
|
-
command: {
|
|
1914
|
-
type: "token",
|
|
1915
|
-
input: 1500,
|
|
1916
|
-
output: 2e3
|
|
1917
|
-
},
|
|
1918
|
-
"command-light": {
|
|
1919
|
-
type: "token",
|
|
1920
|
-
input: 300,
|
|
1921
|
-
output: 600
|
|
1922
|
-
},
|
|
1923
|
-
"embed-english-v3.0": {
|
|
1924
|
-
type: "token",
|
|
1925
|
-
input: 0.1,
|
|
1926
|
-
output: 0
|
|
1927
|
-
},
|
|
1928
|
-
"embed-english-light-v3.0": {
|
|
1929
|
-
type: "token",
|
|
1930
|
-
input: 30,
|
|
1931
|
-
output: 0
|
|
1932
|
-
},
|
|
1933
|
-
"embed-multilingual-v3.0": {
|
|
1934
|
-
type: "token",
|
|
1935
|
-
input: 100,
|
|
1936
|
-
output: 0
|
|
1937
|
-
},
|
|
1938
|
-
"embed-multilingual-light-v3.0": {
|
|
1939
|
-
type: "token",
|
|
1940
|
-
input: 30,
|
|
1941
|
-
output: 0
|
|
1942
|
-
},
|
|
1943
|
-
"rerank-v3.5": {
|
|
1944
|
-
type: "token",
|
|
1945
|
-
input: 100,
|
|
1946
|
-
output: 0
|
|
1947
|
-
},
|
|
1948
|
-
"rerank-english-v3.0": {
|
|
1949
|
-
type: "token",
|
|
1950
|
-
input: 100,
|
|
1951
|
-
output: 0
|
|
1952
|
-
},
|
|
1953
|
-
"rerank-multilingual-v3.0": {
|
|
1954
|
-
type: "token",
|
|
1955
|
-
input: 100,
|
|
1956
|
-
output: 0
|
|
1957
|
-
}
|
|
1958
|
-
}
|
|
1959
|
-
};
|
|
1960
|
-
|
|
1961
|
-
// src/data/providers/xai-provider.json
|
|
1962
|
-
var xai_provider_default = {
|
|
1963
|
-
id: "xai",
|
|
1964
|
-
name: "X.AI",
|
|
1965
|
-
websiteUrl: "https://x.ai",
|
|
1966
|
-
apiUrl: "https://x.ai/api",
|
|
1967
|
-
models: {
|
|
1968
|
-
"grok-2-vision-1212": {
|
|
1969
|
-
type: "token",
|
|
1970
|
-
input: 2,
|
|
1971
|
-
output: 10
|
|
1972
|
-
},
|
|
1973
|
-
"grok-2-1212": {
|
|
1974
|
-
type: "token",
|
|
1975
|
-
input: 2,
|
|
1976
|
-
output: 10
|
|
1977
|
-
},
|
|
1978
|
-
"grok-vision-beta": {
|
|
1979
|
-
type: "token",
|
|
1980
|
-
input: 5,
|
|
1981
|
-
output: 15
|
|
1982
|
-
},
|
|
1983
|
-
"grok-beta": {
|
|
1984
|
-
type: "token",
|
|
1985
|
-
input: 5,
|
|
1986
|
-
output: 15
|
|
1987
|
-
}
|
|
1988
|
-
}
|
|
1989
|
-
};
|
|
1990
|
-
|
|
1991
|
-
// src/data/providers/google-provider.json
|
|
1992
|
-
var google_provider_default = {
|
|
1993
|
-
id: "google",
|
|
1994
|
-
name: "Google",
|
|
1995
|
-
websiteUrl: "https://ai.google.dev",
|
|
1996
|
-
apiUrl: "https://ai.google.dev/docs",
|
|
1997
|
-
models: {
|
|
1998
|
-
"gemini-2.0-flash": {
|
|
1999
|
-
type: "token",
|
|
2000
|
-
input: 0.1,
|
|
2001
|
-
output: 0.4
|
|
2002
|
-
},
|
|
2003
|
-
"gemini-2.0-flash-lite": {
|
|
2004
|
-
type: "token",
|
|
2005
|
-
input: 0.075,
|
|
2006
|
-
output: 0.3
|
|
2007
|
-
},
|
|
2008
|
-
"gemini-1.5-flash": {
|
|
2009
|
-
type: "token",
|
|
2010
|
-
input: 0.075,
|
|
2011
|
-
output: 0.3
|
|
2012
|
-
},
|
|
2013
|
-
"gemini-1.5-flash-8b": {
|
|
2014
|
-
type: "token",
|
|
2015
|
-
input: 0.0375,
|
|
2016
|
-
output: 0.15
|
|
2017
|
-
},
|
|
2018
|
-
"gemini-1.5-pro": {
|
|
2019
|
-
type: "token",
|
|
2020
|
-
input: 1.25,
|
|
2021
|
-
output: 5
|
|
2022
|
-
},
|
|
2023
|
-
"text-embedding-004": {
|
|
2024
|
-
type: "token",
|
|
2025
|
-
input: 0,
|
|
2026
|
-
output: 0
|
|
2027
|
-
}
|
|
2028
|
-
}
|
|
2029
|
-
};
|
|
2030
|
-
|
|
2031
|
-
// src/data/providers/deepseek-provider.json
|
|
2032
|
-
var deepseek_provider_default = {
|
|
2033
|
-
id: "deepseek",
|
|
2034
|
-
name: "DeepSeek",
|
|
2035
|
-
websiteUrl: "https://deepseek.com/",
|
|
2036
|
-
apiUrl: "https://api.deepseek.com/v1",
|
|
2037
|
-
defaultModel: "deepseek-chat",
|
|
2038
|
-
models: {
|
|
2039
|
-
"deepseek-chat": {
|
|
2040
|
-
type: "token",
|
|
2041
|
-
input: 0.2,
|
|
2042
|
-
output: 0.2
|
|
2043
|
-
},
|
|
2044
|
-
"deepseek-reasoner": {
|
|
2045
|
-
type: "token",
|
|
2046
|
-
input: 0.3,
|
|
2047
|
-
output: 0.3
|
|
2048
|
-
}
|
|
2049
|
-
}
|
|
2050
|
-
};
|
|
2051
|
-
|
|
2052
|
-
// src/data/providers/groq-provider.json
|
|
2053
|
-
var groq_provider_default = {
|
|
2054
|
-
id: "groq",
|
|
2055
|
-
name: "Groq",
|
|
2056
|
-
websiteUrl: "https://groq.com",
|
|
2057
|
-
apiUrl: "https://api.groq.com/openai/v1",
|
|
2058
|
-
defaultModel: "llama3-70b-8192",
|
|
2059
|
-
models: {
|
|
2060
|
-
"llama3-70b-8192": {
|
|
2061
|
-
type: "token",
|
|
2062
|
-
input: 0.7,
|
|
2063
|
-
output: 0.7
|
|
2064
|
-
},
|
|
2065
|
-
"llama3-8b-8192": {
|
|
2066
|
-
type: "token",
|
|
2067
|
-
input: 0.1,
|
|
2068
|
-
output: 0.1
|
|
2069
|
-
},
|
|
2070
|
-
"mixtral-8x7b-32768": {
|
|
2071
|
-
type: "token",
|
|
2072
|
-
input: 0.5,
|
|
2073
|
-
output: 0.5
|
|
2074
|
-
},
|
|
2075
|
-
"gemma2-9b-it": {
|
|
2076
|
-
type: "token",
|
|
2077
|
-
input: 0.2,
|
|
2078
|
-
output: 0.2
|
|
2079
|
-
},
|
|
2080
|
-
"whisper-large-v3": {
|
|
2081
|
-
type: "minute",
|
|
2082
|
-
price: 6e-3
|
|
2083
|
-
},
|
|
2084
|
-
"whisper-large-v3-turbo": {
|
|
2085
|
-
type: "minute",
|
|
2086
|
-
price: 6e-3
|
|
2087
|
-
}
|
|
2088
|
-
}
|
|
2089
|
-
};
|
|
2090
|
-
|
|
2091
|
-
// src/data/providers/azure-provider.json
|
|
2092
|
-
var azure_provider_default = {
|
|
2093
|
-
id: "azure",
|
|
2094
|
-
name: "Azure OpenAI",
|
|
2095
|
-
websiteUrl: "https://azure.microsoft.com/en-us/products/ai-services/openai-service",
|
|
2096
|
-
apiUrl: "https://learn.microsoft.com/en-us/azure/ai-services/openai/reference",
|
|
2097
|
-
defaultModel: "gpt-4",
|
|
2098
|
-
models: {
|
|
2099
|
-
"gpt-4": {
|
|
2100
|
-
type: "token",
|
|
2101
|
-
input: 0,
|
|
2102
|
-
output: 0
|
|
2103
|
-
},
|
|
2104
|
-
"gpt-4-32k": {
|
|
2105
|
-
type: "token",
|
|
2106
|
-
input: 0,
|
|
2107
|
-
output: 0
|
|
2108
|
-
},
|
|
2109
|
-
"gpt-4-vision": {
|
|
2110
|
-
type: "token",
|
|
2111
|
-
input: 0,
|
|
2112
|
-
output: 0
|
|
2113
|
-
},
|
|
2114
|
-
"gpt-4o": {
|
|
2115
|
-
type: "token",
|
|
2116
|
-
input: 0,
|
|
2117
|
-
output: 0
|
|
2118
|
-
},
|
|
2119
|
-
"gpt-3.5-turbo": {
|
|
2120
|
-
type: "token",
|
|
2121
|
-
input: 0,
|
|
2122
|
-
output: 0
|
|
2123
|
-
},
|
|
2124
|
-
"gpt-3.5-turbo-16k": {
|
|
2125
|
-
type: "token",
|
|
2126
|
-
input: 0,
|
|
2127
|
-
output: 0
|
|
2128
|
-
},
|
|
2129
|
-
"text-embedding-ada-002": {
|
|
2130
|
-
type: "token",
|
|
2131
|
-
input: 0,
|
|
2132
|
-
output: 0
|
|
2133
|
-
},
|
|
2134
|
-
whisper: {
|
|
2135
|
-
type: "minute",
|
|
2136
|
-
price: 0
|
|
2137
|
-
},
|
|
2138
|
-
"dall-e-3": {
|
|
2139
|
-
type: "image",
|
|
2140
|
-
price: 0,
|
|
2141
|
-
size: "1024x1024",
|
|
2142
|
-
unit: "per_image"
|
|
2143
|
-
}
|
|
2144
|
-
}
|
|
2145
|
-
};
|
|
2146
|
-
|
|
2147
|
-
// src/builders/providers.ts
|
|
2148
|
-
function isTokenPrice(price) {
|
|
2149
|
-
return typeof price === "object" && price !== null && "type" in price && price.type === "token" && "input" in price && typeof price.input === "number" && "output" in price && typeof price.output === "number";
|
|
2150
|
-
}
|
|
2151
|
-
function isImagePrice(price) {
|
|
2152
|
-
return typeof price === "object" && price !== null && "type" in price && price.type === "image" && "price" in price && typeof price.price === "number" && "size" in price && typeof price.size === "string" && "unit" in price && price.unit === "per_image";
|
|
2153
|
-
}
|
|
2154
|
-
function isCharacterPrice(price) {
|
|
2155
|
-
return typeof price === "object" && price !== null && "type" in price && price.type === "character" && "price" in price && typeof price.price === "number";
|
|
2156
|
-
}
|
|
2157
|
-
function isMinutePrice(price) {
|
|
2158
|
-
return typeof price === "object" && price !== null && "type" in price && price.type === "minute" && "price" in price && typeof price.price === "number";
|
|
2159
|
-
}
|
|
2160
|
-
function isSearchPrice(price) {
|
|
2161
|
-
return typeof price === "object" && price !== null && "type" in price && price.type === "search" && "price" in price && typeof price.price === "number";
|
|
2162
|
-
}
|
|
2163
|
-
function validateProvider(raw) {
|
|
2164
|
-
if (typeof raw !== "object" || raw === null) {
|
|
2165
|
-
throw new Error("Provider data must be an object");
|
|
2166
|
-
}
|
|
2167
|
-
const provider = raw;
|
|
2168
|
-
if (typeof provider.id !== "string") {
|
|
2169
|
-
throw new Error("Provider id must be a string");
|
|
2170
|
-
}
|
|
2171
|
-
if (typeof provider.name !== "string") {
|
|
2172
|
-
throw new Error("Provider name must be a string");
|
|
2173
|
-
}
|
|
2174
|
-
if (typeof provider.websiteUrl !== "string") {
|
|
2175
|
-
throw new Error("Provider websiteUrl must be a string");
|
|
2176
|
-
}
|
|
2177
|
-
if (typeof provider.apiUrl !== "string") {
|
|
2178
|
-
throw new Error("Provider apiUrl must be a string");
|
|
2179
|
-
}
|
|
2180
|
-
if (typeof provider.models !== "object" || provider.models === null) {
|
|
2181
|
-
throw new Error("Provider models must be an object");
|
|
2182
|
-
}
|
|
2183
|
-
const models2 = provider.models;
|
|
2184
|
-
Object.values(models2).forEach((price) => {
|
|
2185
|
-
if (!isTokenPrice(price) && !isImagePrice(price) && !isCharacterPrice(price) && !isMinutePrice(price) && !isSearchPrice(price)) {
|
|
2186
|
-
throw new Error(`Invalid price data: ${JSON.stringify(price)}`);
|
|
2187
|
-
}
|
|
2188
|
-
});
|
|
2189
|
-
return {
|
|
2190
|
-
id: provider.id,
|
|
2191
|
-
name: provider.name,
|
|
2192
|
-
websiteUrl: provider.websiteUrl,
|
|
2193
|
-
apiUrl: provider.apiUrl,
|
|
2194
|
-
models: provider.models
|
|
2195
|
-
};
|
|
2196
|
-
}
|
|
2197
|
-
function buildAllProviders() {
|
|
2198
|
-
return [
|
|
2199
|
-
validateProvider(openai_provider_default),
|
|
2200
|
-
validateProvider(anthropic_provider_default),
|
|
2201
|
-
validateProvider(mistral_provider_default),
|
|
2202
|
-
validateProvider(cohere_provider_default),
|
|
2203
|
-
validateProvider(xai_provider_default),
|
|
2204
|
-
validateProvider(google_provider_default),
|
|
2205
|
-
validateProvider(deepseek_provider_default),
|
|
2206
|
-
validateProvider(groq_provider_default),
|
|
2207
|
-
validateProvider(azure_provider_default)
|
|
2208
|
-
];
|
|
2209
|
-
}
|
|
2210
|
-
function buildProvidersData() {
|
|
2211
|
-
return {
|
|
2212
|
-
providers: buildAllProviders()
|
|
2213
|
-
};
|
|
2214
|
-
}
|
|
2215
|
-
|
|
2216
|
-
// src/data/creators.json
|
|
2217
|
-
var creators_default = {
|
|
2218
|
-
creators: {
|
|
2219
|
-
openai: {
|
|
2220
|
-
name: "OpenAI",
|
|
2221
|
-
website: "https://openai.com"
|
|
2222
|
-
},
|
|
2223
|
-
anthropic: {
|
|
2224
|
-
name: "Anthropic",
|
|
2225
|
-
website: "https://anthropic.com"
|
|
2226
|
-
},
|
|
2227
|
-
meta: {
|
|
2228
|
-
name: "Meta",
|
|
2229
|
-
website: "https://ai.meta.com"
|
|
2230
|
-
},
|
|
2231
|
-
mistral: {
|
|
2232
|
-
name: "Mistral AI",
|
|
2233
|
-
website: "https://mistral.ai"
|
|
2234
|
-
}
|
|
2235
|
-
}
|
|
2236
|
-
};
|
|
2237
|
-
|
|
2238
|
-
// src/index.ts
|
|
2239
|
-
var allModels = buildAllModels();
|
|
2240
|
-
var providersData = buildProvidersData();
|
|
2241
|
-
var AIModels = class _AIModels extends ModelCollection {
|
|
2242
|
-
constructor(models2 = []) {
|
|
2243
|
-
super(models2);
|
|
2244
|
-
Object.setPrototypeOf(this, _AIModels.prototype);
|
|
2245
|
-
}
|
|
2246
|
-
get creators() {
|
|
2247
|
-
return Object.keys(creators_default.creators);
|
|
2248
|
-
}
|
|
2249
|
-
get providers() {
|
|
2250
|
-
return providersData.providers.map((p) => p.id);
|
|
2251
|
-
}
|
|
2252
|
-
getPrice(modelId, provider) {
|
|
2253
|
-
const providerData = providersData.providers.find((p) => p.id === provider);
|
|
2254
|
-
const price = providerData?.models[modelId];
|
|
2255
|
-
return price?.type === "token" ? price : void 0;
|
|
2256
|
-
}
|
|
2257
|
-
/** Get provider information by ID */
|
|
2258
|
-
getProvider(providerId) {
|
|
2259
|
-
return providersData.providers.find((p) => p.id === providerId);
|
|
2260
|
-
}
|
|
2261
|
-
/** Get all providers that can serve a specific model */
|
|
2262
|
-
getProvidersForModel(modelId) {
|
|
2263
|
-
let model = this.id(modelId);
|
|
2264
|
-
if (!model) {
|
|
2265
|
-
model = this.find((m) => m.aliases?.includes(modelId));
|
|
2266
|
-
}
|
|
2267
|
-
if (!model) return [];
|
|
2268
|
-
return providersData.providers.filter(
|
|
2269
|
-
(p) => model.providers.includes(p.id)
|
|
2270
|
-
);
|
|
2271
|
-
}
|
|
2272
|
-
};
|
|
2273
|
-
var models = new AIModels(allModels);
|
|
2274
|
-
export {
|
|
2275
|
-
AIModels,
|
|
2276
|
-
ModelCollection,
|
|
2277
|
-
creators_default as creators,
|
|
2278
|
-
models
|
|
2279
|
-
};
|