aimodels 0.3.5 → 0.3.7
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/dist/index.d.mts +55 -5
- package/dist/index.d.ts +55 -5
- package/dist/index.js +740 -126
- package/dist/index.mjs +740 -126
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -75,7 +75,10 @@ var ModelCollection = class _ModelCollection extends Array {
|
|
|
75
75
|
withMinContext(tokens) {
|
|
76
76
|
return this.filter((model) => {
|
|
77
77
|
const context = model.context;
|
|
78
|
-
if (
|
|
78
|
+
if (context.type !== "token" && context.type !== "character") {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if (context.total === null) {
|
|
79
82
|
return false;
|
|
80
83
|
}
|
|
81
84
|
return context.total >= tokens;
|
|
@@ -88,61 +91,74 @@ var openai_models_default = {
|
|
|
88
91
|
creator: "openai",
|
|
89
92
|
models: [
|
|
90
93
|
{
|
|
91
|
-
id: "
|
|
92
|
-
name: "
|
|
93
|
-
license: "
|
|
94
|
+
id: "gpt-4",
|
|
95
|
+
name: "GPT-4",
|
|
96
|
+
license: "proprietary",
|
|
94
97
|
providers: [
|
|
95
98
|
"openai",
|
|
96
|
-
"azure"
|
|
97
|
-
"groq"
|
|
99
|
+
"azure"
|
|
98
100
|
],
|
|
99
101
|
can: [
|
|
100
|
-
"
|
|
101
|
-
"text-
|
|
102
|
+
"chat",
|
|
103
|
+
"text-in",
|
|
104
|
+
"text-out",
|
|
105
|
+
"json-out",
|
|
106
|
+
"function-out"
|
|
102
107
|
],
|
|
103
108
|
context: {
|
|
104
|
-
|
|
105
|
-
|
|
109
|
+
type: "token",
|
|
110
|
+
total: 8192,
|
|
111
|
+
maxOutput: 4096
|
|
106
112
|
}
|
|
107
113
|
},
|
|
108
114
|
{
|
|
109
|
-
id: "
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"sound-in",
|
|
119
|
-
"text-out"
|
|
120
|
-
],
|
|
121
|
-
context: {
|
|
122
|
-
total: null,
|
|
123
|
-
maxOutput: null
|
|
115
|
+
id: "gpt-4-turbo-preview",
|
|
116
|
+
extends: "gpt-4",
|
|
117
|
+
overrides: {
|
|
118
|
+
name: "GPT-4 Turbo",
|
|
119
|
+
context: {
|
|
120
|
+
type: "token",
|
|
121
|
+
total: 128e3,
|
|
122
|
+
maxOutput: 4096
|
|
123
|
+
}
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
|
-
id: "
|
|
128
|
-
name: "
|
|
127
|
+
id: "gpt-3.5-turbo",
|
|
128
|
+
name: "GPT-3.5 Turbo",
|
|
129
129
|
license: "proprietary",
|
|
130
130
|
providers: [
|
|
131
131
|
"openai",
|
|
132
132
|
"azure"
|
|
133
133
|
],
|
|
134
134
|
can: [
|
|
135
|
+
"chat",
|
|
135
136
|
"text-in",
|
|
136
|
-
"
|
|
137
|
+
"text-out",
|
|
138
|
+
"json-out",
|
|
139
|
+
"function-out"
|
|
137
140
|
],
|
|
138
141
|
context: {
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
type: "token",
|
|
143
|
+
total: 16385,
|
|
144
|
+
maxOutput: 4096
|
|
141
145
|
}
|
|
142
146
|
},
|
|
143
147
|
{
|
|
144
|
-
id: "
|
|
145
|
-
|
|
148
|
+
id: "gpt-3.5-turbo-16k",
|
|
149
|
+
extends: "gpt-3.5-turbo",
|
|
150
|
+
overrides: {
|
|
151
|
+
name: "GPT-3.5 Turbo 16K",
|
|
152
|
+
context: {
|
|
153
|
+
type: "token",
|
|
154
|
+
total: 16385,
|
|
155
|
+
maxOutput: 4096
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: "gpt-3.5-turbo-instruct",
|
|
161
|
+
name: "GPT-3.5 Turbo Instruct",
|
|
146
162
|
license: "proprietary",
|
|
147
163
|
providers: [
|
|
148
164
|
"openai",
|
|
@@ -150,11 +166,12 @@ var openai_models_default = {
|
|
|
150
166
|
],
|
|
151
167
|
can: [
|
|
152
168
|
"text-in",
|
|
153
|
-
"
|
|
169
|
+
"text-out"
|
|
154
170
|
],
|
|
155
171
|
context: {
|
|
156
|
-
|
|
157
|
-
|
|
172
|
+
type: "token",
|
|
173
|
+
total: 4096,
|
|
174
|
+
maxOutput: 4096
|
|
158
175
|
}
|
|
159
176
|
},
|
|
160
177
|
{
|
|
@@ -167,32 +184,184 @@ var openai_models_default = {
|
|
|
167
184
|
],
|
|
168
185
|
can: [
|
|
169
186
|
"chat",
|
|
187
|
+
"text-in",
|
|
188
|
+
"text-out",
|
|
170
189
|
"img-in",
|
|
171
190
|
"json-out",
|
|
172
191
|
"function-out"
|
|
173
192
|
],
|
|
174
193
|
context: {
|
|
194
|
+
type: "token",
|
|
175
195
|
total: 128e3,
|
|
176
196
|
maxOutput: 16384
|
|
177
197
|
}
|
|
178
198
|
},
|
|
199
|
+
{
|
|
200
|
+
id: "chatgpt-4o-latest",
|
|
201
|
+
extends: "gpt-4o",
|
|
202
|
+
overrides: {
|
|
203
|
+
name: "GPT-4o used in ChatGPT"
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
id: "gpt-4o-2024-11-20",
|
|
208
|
+
extends: "gpt-4o",
|
|
209
|
+
overrides: {
|
|
210
|
+
name: "GPT-4o (2024-11-20)"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: "gpt-4o-2024-08-06",
|
|
215
|
+
extends: "gpt-4o",
|
|
216
|
+
overrides: {
|
|
217
|
+
name: "GPT-4o (2024-08-06)"
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
id: "gpt-4o-2024-05-13",
|
|
222
|
+
extends: "gpt-4o",
|
|
223
|
+
overrides: {
|
|
224
|
+
name: "GPT-4o (2024-05-13)",
|
|
225
|
+
context: {
|
|
226
|
+
type: "token",
|
|
227
|
+
total: 128e3,
|
|
228
|
+
maxOutput: 4096
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
179
232
|
{
|
|
180
233
|
id: "gpt-4o-mini",
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
234
|
+
extends: "gpt-4o",
|
|
235
|
+
overrides: {
|
|
236
|
+
name: "GPT-4o Mini",
|
|
237
|
+
context: {
|
|
238
|
+
type: "token",
|
|
239
|
+
total: 128e3,
|
|
240
|
+
maxOutput: 16384
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
id: "gpt-4o-audio-preview",
|
|
246
|
+
extends: "gpt-4o",
|
|
247
|
+
overrides: {
|
|
248
|
+
name: "GPT-4o Audio",
|
|
249
|
+
can: [
|
|
250
|
+
"chat",
|
|
251
|
+
"text-in",
|
|
252
|
+
"text-out",
|
|
253
|
+
"sound-in",
|
|
254
|
+
"json-out",
|
|
255
|
+
"function-out"
|
|
256
|
+
],
|
|
257
|
+
context: {
|
|
258
|
+
type: "token",
|
|
259
|
+
total: 128e3,
|
|
260
|
+
maxOutput: 16384
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
id: "gpt-4o-audio-preview-2024-12-17",
|
|
266
|
+
extends: "gpt-4o-audio-preview",
|
|
267
|
+
overrides: {
|
|
268
|
+
name: "GPT-4o Audio (2024-12-17)"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
id: "gpt-4o-audio-preview-2024-10-01",
|
|
273
|
+
extends: "gpt-4o-audio-preview",
|
|
274
|
+
overrides: {
|
|
275
|
+
name: "GPT-4o Audio (2024-10-01)"
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
id: "gpt-4o-mini-audio-preview",
|
|
280
|
+
extends: "gpt-4o-mini",
|
|
281
|
+
overrides: {
|
|
282
|
+
name: "GPT-4o Mini Audio",
|
|
283
|
+
can: [
|
|
284
|
+
"chat",
|
|
285
|
+
"text-in",
|
|
286
|
+
"text-out",
|
|
287
|
+
"sound-in",
|
|
288
|
+
"sound-out",
|
|
289
|
+
"json-out",
|
|
290
|
+
"function-out"
|
|
291
|
+
],
|
|
292
|
+
context: {
|
|
293
|
+
type: "token",
|
|
294
|
+
total: 128e3,
|
|
295
|
+
maxOutput: 16384
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
id: "gpt-4o-mini-audio-preview-2024-12-17",
|
|
301
|
+
extends: "gpt-4o-mini-audio-preview",
|
|
302
|
+
overrides: {
|
|
303
|
+
name: "GPT-4o Mini Audio (2024-12-17)"
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
id: "gpt-4o-realtime-preview",
|
|
308
|
+
extends: "gpt-4o",
|
|
309
|
+
overrides: {
|
|
310
|
+
name: "GPT-4o Realtime",
|
|
311
|
+
can: [
|
|
312
|
+
"chat",
|
|
313
|
+
"text-in",
|
|
314
|
+
"text-out",
|
|
315
|
+
"sound-in",
|
|
316
|
+
"json-out",
|
|
317
|
+
"function-out"
|
|
318
|
+
],
|
|
319
|
+
context: {
|
|
320
|
+
type: "token",
|
|
321
|
+
total: 128e3,
|
|
322
|
+
maxOutput: 4096
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
id: "gpt-4o-realtime-preview-2024-12-17",
|
|
328
|
+
extends: "gpt-4o-realtime-preview",
|
|
329
|
+
overrides: {
|
|
330
|
+
name: "GPT-4o Realtime (2024-12-17)"
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
id: "gpt-4o-realtime-preview-2024-10-01",
|
|
335
|
+
extends: "gpt-4o-realtime-preview",
|
|
336
|
+
overrides: {
|
|
337
|
+
name: "GPT-4o Realtime (2024-10-01)"
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
id: "gpt-4o-mini-realtime-preview",
|
|
342
|
+
extends: "gpt-4o-mini",
|
|
343
|
+
overrides: {
|
|
344
|
+
name: "GPT-4o Mini Realtime",
|
|
345
|
+
can: [
|
|
346
|
+
"chat",
|
|
347
|
+
"text-in",
|
|
348
|
+
"text-out",
|
|
349
|
+
"sound-in",
|
|
350
|
+
"json-out",
|
|
351
|
+
"function-out"
|
|
352
|
+
],
|
|
353
|
+
context: {
|
|
354
|
+
type: "token",
|
|
355
|
+
total: 128e3,
|
|
356
|
+
maxOutput: 4096
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
id: "gpt-4o-mini-realtime-preview-2024-12-17",
|
|
362
|
+
extends: "gpt-4o-mini-realtime-preview",
|
|
363
|
+
overrides: {
|
|
364
|
+
name: "GPT-4o Mini Realtime (2024-12-17)"
|
|
196
365
|
}
|
|
197
366
|
},
|
|
198
367
|
{
|
|
@@ -205,19 +374,75 @@ var openai_models_default = {
|
|
|
205
374
|
],
|
|
206
375
|
can: [
|
|
207
376
|
"chat",
|
|
377
|
+
"text-in",
|
|
378
|
+
"text-out",
|
|
208
379
|
"img-in",
|
|
209
380
|
"json-out",
|
|
210
381
|
"function-out",
|
|
211
382
|
"reason"
|
|
212
383
|
],
|
|
213
384
|
context: {
|
|
385
|
+
type: "token",
|
|
214
386
|
total: 2e5,
|
|
215
387
|
maxOutput: 1e5
|
|
216
388
|
}
|
|
217
389
|
},
|
|
390
|
+
{
|
|
391
|
+
id: "o1-2024-12-17",
|
|
392
|
+
extends: "o1",
|
|
393
|
+
overrides: {
|
|
394
|
+
name: "OpenAI O1 (2024-12-17)"
|
|
395
|
+
}
|
|
396
|
+
},
|
|
218
397
|
{
|
|
219
398
|
id: "o1-mini",
|
|
220
|
-
|
|
399
|
+
extends: "o1",
|
|
400
|
+
overrides: {
|
|
401
|
+
name: "OpenAI O1 Mini",
|
|
402
|
+
can: [
|
|
403
|
+
"chat",
|
|
404
|
+
"text-in",
|
|
405
|
+
"text-out",
|
|
406
|
+
"json-out",
|
|
407
|
+
"function-out",
|
|
408
|
+
"reason"
|
|
409
|
+
],
|
|
410
|
+
context: {
|
|
411
|
+
type: "token",
|
|
412
|
+
total: 128e3,
|
|
413
|
+
maxOutput: 65536
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
id: "o1-mini-2024-09-12",
|
|
419
|
+
extends: "o1-mini",
|
|
420
|
+
overrides: {
|
|
421
|
+
name: "OpenAI O1 Mini (2024-09-12)"
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
id: "o1-preview",
|
|
426
|
+
extends: "o1",
|
|
427
|
+
overrides: {
|
|
428
|
+
name: "OpenAI O1 Preview",
|
|
429
|
+
context: {
|
|
430
|
+
type: "token",
|
|
431
|
+
total: 128e3,
|
|
432
|
+
maxOutput: 32768
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
id: "o1-preview-2024-09-12",
|
|
438
|
+
extends: "o1-preview",
|
|
439
|
+
overrides: {
|
|
440
|
+
name: "OpenAI O1 Preview (2024-09-12)"
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
id: "o3-mini",
|
|
445
|
+
name: "OpenAI O3 Mini",
|
|
221
446
|
license: "proprietary",
|
|
222
447
|
providers: [
|
|
223
448
|
"openai",
|
|
@@ -225,70 +450,89 @@ var openai_models_default = {
|
|
|
225
450
|
],
|
|
226
451
|
can: [
|
|
227
452
|
"chat",
|
|
453
|
+
"text-in",
|
|
454
|
+
"text-out",
|
|
228
455
|
"json-out",
|
|
229
456
|
"function-out",
|
|
230
457
|
"reason"
|
|
231
458
|
],
|
|
232
459
|
context: {
|
|
233
|
-
|
|
234
|
-
|
|
460
|
+
type: "token",
|
|
461
|
+
total: 2e5,
|
|
462
|
+
maxOutput: 1e5
|
|
235
463
|
}
|
|
236
464
|
},
|
|
237
465
|
{
|
|
238
|
-
id: "o3-mini",
|
|
239
|
-
|
|
466
|
+
id: "o3-mini-2025-01-31",
|
|
467
|
+
extends: "o3-mini",
|
|
468
|
+
overrides: {
|
|
469
|
+
name: "OpenAI O3 Mini (2025-01-31)"
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
id: "whisper-1",
|
|
474
|
+
name: "Whisper",
|
|
240
475
|
license: "proprietary",
|
|
241
476
|
providers: [
|
|
242
477
|
"openai",
|
|
243
478
|
"azure"
|
|
244
479
|
],
|
|
245
480
|
can: [
|
|
246
|
-
"
|
|
247
|
-
"
|
|
248
|
-
"function-out",
|
|
249
|
-
"reason"
|
|
481
|
+
"sound-in",
|
|
482
|
+
"text-out"
|
|
250
483
|
],
|
|
251
484
|
context: {
|
|
252
|
-
|
|
253
|
-
|
|
485
|
+
type: "audio-in",
|
|
486
|
+
total: null,
|
|
487
|
+
maxOutput: null
|
|
254
488
|
}
|
|
255
489
|
},
|
|
256
490
|
{
|
|
257
|
-
id: "
|
|
258
|
-
name: "
|
|
491
|
+
id: "tts-1",
|
|
492
|
+
name: "TTS-1",
|
|
259
493
|
license: "proprietary",
|
|
260
494
|
providers: [
|
|
261
495
|
"openai",
|
|
262
496
|
"azure"
|
|
263
497
|
],
|
|
264
498
|
can: [
|
|
265
|
-
"
|
|
266
|
-
"sound-
|
|
267
|
-
"json-out",
|
|
268
|
-
"function-out"
|
|
499
|
+
"text-in",
|
|
500
|
+
"sound-out"
|
|
269
501
|
],
|
|
270
502
|
context: {
|
|
271
|
-
|
|
272
|
-
|
|
503
|
+
type: "audio-out",
|
|
504
|
+
total: null,
|
|
505
|
+
maxOutput: null
|
|
273
506
|
}
|
|
274
507
|
},
|
|
275
508
|
{
|
|
276
|
-
id: "
|
|
277
|
-
|
|
509
|
+
id: "tts-1-hd",
|
|
510
|
+
extends: "tts-1",
|
|
511
|
+
overrides: {
|
|
512
|
+
name: "TTS-1 HD"
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
id: "dall-e-2",
|
|
517
|
+
name: "DALL-E 2",
|
|
278
518
|
license: "proprietary",
|
|
279
519
|
providers: [
|
|
280
520
|
"openai",
|
|
281
521
|
"azure"
|
|
282
522
|
],
|
|
283
523
|
can: [
|
|
284
|
-
"
|
|
285
|
-
"sound-in",
|
|
286
|
-
"json-out",
|
|
287
|
-
"function-out"
|
|
524
|
+
"img-out"
|
|
288
525
|
],
|
|
289
526
|
context: {
|
|
290
|
-
|
|
291
|
-
|
|
527
|
+
maxOutput: 1,
|
|
528
|
+
sizes: [
|
|
529
|
+
"256x256",
|
|
530
|
+
"512x512",
|
|
531
|
+
"1024x1024"
|
|
532
|
+
],
|
|
533
|
+
qualities: [
|
|
534
|
+
"standard"
|
|
535
|
+
]
|
|
292
536
|
}
|
|
293
537
|
},
|
|
294
538
|
{
|
|
@@ -300,6 +544,7 @@ var openai_models_default = {
|
|
|
300
544
|
"azure"
|
|
301
545
|
],
|
|
302
546
|
can: [
|
|
547
|
+
"text-in",
|
|
303
548
|
"img-out"
|
|
304
549
|
],
|
|
305
550
|
context: {
|
|
@@ -314,6 +559,69 @@ var openai_models_default = {
|
|
|
314
559
|
"hd"
|
|
315
560
|
]
|
|
316
561
|
}
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
id: "text-embedding-ada-002",
|
|
565
|
+
name: "Text Embedding Ada 002",
|
|
566
|
+
license: "proprietary",
|
|
567
|
+
providers: [
|
|
568
|
+
"openai",
|
|
569
|
+
"azure"
|
|
570
|
+
],
|
|
571
|
+
can: [
|
|
572
|
+
"text-in",
|
|
573
|
+
"vectors-out"
|
|
574
|
+
],
|
|
575
|
+
context: {
|
|
576
|
+
type: "embedding",
|
|
577
|
+
total: 8191,
|
|
578
|
+
unit: "tokens",
|
|
579
|
+
dimensions: 1536,
|
|
580
|
+
embeddingType: "text",
|
|
581
|
+
normalized: true
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
id: "text-embedding-3-small",
|
|
586
|
+
name: "Text Embedding 3 Small",
|
|
587
|
+
license: "proprietary",
|
|
588
|
+
providers: [
|
|
589
|
+
"openai",
|
|
590
|
+
"azure"
|
|
591
|
+
],
|
|
592
|
+
can: [
|
|
593
|
+
"text-in",
|
|
594
|
+
"vectors-out"
|
|
595
|
+
],
|
|
596
|
+
context: {
|
|
597
|
+
type: "embedding",
|
|
598
|
+
total: 8191,
|
|
599
|
+
unit: "tokens",
|
|
600
|
+
dimensions: 1536,
|
|
601
|
+
embeddingType: "text",
|
|
602
|
+
normalized: true
|
|
603
|
+
}
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
id: "text-embedding-3-large",
|
|
607
|
+
name: "Text Embedding 3 Large",
|
|
608
|
+
license: "proprietary",
|
|
609
|
+
providers: [
|
|
610
|
+
"openai",
|
|
611
|
+
"azure"
|
|
612
|
+
],
|
|
613
|
+
can: [
|
|
614
|
+
"text-in",
|
|
615
|
+
"vectors-out"
|
|
616
|
+
],
|
|
617
|
+
context: {
|
|
618
|
+
type: "embedding",
|
|
619
|
+
total: 8191,
|
|
620
|
+
unit: "tokens",
|
|
621
|
+
dimensions: 3072,
|
|
622
|
+
embeddingType: "text",
|
|
623
|
+
normalized: true
|
|
624
|
+
}
|
|
317
625
|
}
|
|
318
626
|
]
|
|
319
627
|
};
|
|
@@ -326,11 +634,7 @@ var anthropic_models_default = {
|
|
|
326
634
|
id: "claude-3-opus-20240229",
|
|
327
635
|
name: "Claude 3 Opus",
|
|
328
636
|
license: "proprietary",
|
|
329
|
-
providers: [
|
|
330
|
-
"anthropic",
|
|
331
|
-
"aws",
|
|
332
|
-
"google"
|
|
333
|
-
],
|
|
637
|
+
providers: ["anthropic", "aws", "google"],
|
|
334
638
|
can: [
|
|
335
639
|
"chat",
|
|
336
640
|
"text-in",
|
|
@@ -340,21 +644,18 @@ var anthropic_models_default = {
|
|
|
340
644
|
"function-out"
|
|
341
645
|
],
|
|
342
646
|
context: {
|
|
647
|
+
type: "token",
|
|
343
648
|
total: 2e5,
|
|
344
649
|
maxOutput: 4096,
|
|
345
650
|
outputIsFixed: 1
|
|
346
651
|
},
|
|
347
|
-
aliases: ["claude-3-opus-latest"]
|
|
652
|
+
aliases: ["claude-3-opus-latest", "claude-3-opus"]
|
|
348
653
|
},
|
|
349
654
|
{
|
|
350
|
-
id: "claude-3-
|
|
655
|
+
id: "claude-3-sonnet-20240229",
|
|
351
656
|
name: "Claude 3 Sonnet",
|
|
352
657
|
license: "proprietary",
|
|
353
|
-
providers: [
|
|
354
|
-
"anthropic",
|
|
355
|
-
"aws",
|
|
356
|
-
"google"
|
|
357
|
-
],
|
|
658
|
+
providers: ["anthropic", "aws", "google"],
|
|
358
659
|
can: [
|
|
359
660
|
"chat",
|
|
360
661
|
"text-in",
|
|
@@ -364,21 +665,60 @@ var anthropic_models_default = {
|
|
|
364
665
|
"function-out"
|
|
365
666
|
],
|
|
366
667
|
context: {
|
|
668
|
+
type: "token",
|
|
367
669
|
total: 2e5,
|
|
368
|
-
maxOutput:
|
|
670
|
+
maxOutput: 4096,
|
|
369
671
|
outputIsFixed: 1
|
|
370
672
|
},
|
|
371
|
-
aliases: ["claude-3-sonnet-latest"]
|
|
673
|
+
aliases: ["claude-3-sonnet-latest", "claude-3-sonnet"]
|
|
372
674
|
},
|
|
373
675
|
{
|
|
374
|
-
id: "claude-3-
|
|
676
|
+
id: "claude-3-haiku-20240307",
|
|
375
677
|
name: "Claude 3 Haiku",
|
|
376
678
|
license: "proprietary",
|
|
377
|
-
providers: [
|
|
378
|
-
|
|
379
|
-
"
|
|
380
|
-
"
|
|
679
|
+
providers: ["anthropic", "aws", "google"],
|
|
680
|
+
can: [
|
|
681
|
+
"chat",
|
|
682
|
+
"text-in",
|
|
683
|
+
"text-out",
|
|
684
|
+
"img-in",
|
|
685
|
+
"json-out",
|
|
686
|
+
"function-out"
|
|
687
|
+
],
|
|
688
|
+
context: {
|
|
689
|
+
type: "token",
|
|
690
|
+
total: 2e5,
|
|
691
|
+
maxOutput: 4096,
|
|
692
|
+
outputIsFixed: 1
|
|
693
|
+
},
|
|
694
|
+
aliases: ["claude-3-haiku"]
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
id: "claude-3-5-sonnet-20241022",
|
|
698
|
+
name: "Claude 3.5 Sonnet",
|
|
699
|
+
license: "proprietary",
|
|
700
|
+
providers: ["anthropic", "aws", "google"],
|
|
701
|
+
can: [
|
|
702
|
+
"chat",
|
|
703
|
+
"text-in",
|
|
704
|
+
"text-out",
|
|
705
|
+
"img-in",
|
|
706
|
+
"json-out",
|
|
707
|
+
"function-out"
|
|
381
708
|
],
|
|
709
|
+
context: {
|
|
710
|
+
type: "token",
|
|
711
|
+
total: 2e5,
|
|
712
|
+
maxOutput: 8192,
|
|
713
|
+
outputIsFixed: 1
|
|
714
|
+
},
|
|
715
|
+
aliases: ["claude-3-5-sonnet-latest", "claude-3-5-sonnet"]
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
id: "claude-3-5-sonnet-20240620",
|
|
719
|
+
name: "Claude 3.5 Sonnet (2024-06-20)",
|
|
720
|
+
license: "proprietary",
|
|
721
|
+
providers: ["anthropic", "aws", "google"],
|
|
382
722
|
can: [
|
|
383
723
|
"chat",
|
|
384
724
|
"text-in",
|
|
@@ -388,10 +728,31 @@ var anthropic_models_default = {
|
|
|
388
728
|
"function-out"
|
|
389
729
|
],
|
|
390
730
|
context: {
|
|
731
|
+
type: "token",
|
|
391
732
|
total: 2e5,
|
|
392
733
|
maxOutput: 8192,
|
|
393
734
|
outputIsFixed: 1
|
|
394
735
|
}
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
id: "claude-3-5-haiku-20241022",
|
|
739
|
+
name: "Claude 3.5 Haiku",
|
|
740
|
+
license: "proprietary",
|
|
741
|
+
providers: ["anthropic", "aws", "google"],
|
|
742
|
+
can: [
|
|
743
|
+
"chat",
|
|
744
|
+
"text-in",
|
|
745
|
+
"text-out",
|
|
746
|
+
"json-out",
|
|
747
|
+
"function-out"
|
|
748
|
+
],
|
|
749
|
+
context: {
|
|
750
|
+
type: "token",
|
|
751
|
+
total: 2e5,
|
|
752
|
+
maxOutput: 8192,
|
|
753
|
+
outputIsFixed: 1
|
|
754
|
+
},
|
|
755
|
+
aliases: ["claude-3-5-haiku-latest", "claude-3-5-haiku"]
|
|
395
756
|
}
|
|
396
757
|
]
|
|
397
758
|
};
|
|
@@ -407,6 +768,7 @@ var meta_models_default = {
|
|
|
407
768
|
providers: ["groq"],
|
|
408
769
|
can: ["chat", "text-in", "text-out", "json-out", "function-out"],
|
|
409
770
|
context: {
|
|
771
|
+
type: "token",
|
|
410
772
|
total: 8192,
|
|
411
773
|
maxOutput: 4096
|
|
412
774
|
}
|
|
@@ -418,6 +780,7 @@ var meta_models_default = {
|
|
|
418
780
|
providers: ["groq"],
|
|
419
781
|
can: ["chat", "text-in", "text-out", "json-out", "function-out"],
|
|
420
782
|
context: {
|
|
783
|
+
type: "token",
|
|
421
784
|
total: 8192,
|
|
422
785
|
maxOutput: 4096
|
|
423
786
|
}
|
|
@@ -429,6 +792,7 @@ var meta_models_default = {
|
|
|
429
792
|
providers: ["groq"],
|
|
430
793
|
can: ["chat", "text-in", "text-out", "img-in"],
|
|
431
794
|
context: {
|
|
795
|
+
type: "token",
|
|
432
796
|
total: 4096,
|
|
433
797
|
maxOutput: 4096
|
|
434
798
|
}
|
|
@@ -440,6 +804,7 @@ var meta_models_default = {
|
|
|
440
804
|
providers: ["groq"],
|
|
441
805
|
can: ["chat", "text-in", "text-out", "img-in"],
|
|
442
806
|
context: {
|
|
807
|
+
type: "token",
|
|
443
808
|
total: 4096,
|
|
444
809
|
maxOutput: 4096
|
|
445
810
|
}
|
|
@@ -451,6 +816,7 @@ var meta_models_default = {
|
|
|
451
816
|
providers: ["groq"],
|
|
452
817
|
can: ["chat", "text-in", "text-out"],
|
|
453
818
|
context: {
|
|
819
|
+
type: "token",
|
|
454
820
|
total: 4096,
|
|
455
821
|
maxOutput: 4096
|
|
456
822
|
}
|
|
@@ -475,6 +841,7 @@ var mistral_models_default = {
|
|
|
475
841
|
"function-out"
|
|
476
842
|
],
|
|
477
843
|
context: {
|
|
844
|
+
type: "token",
|
|
478
845
|
total: 32768,
|
|
479
846
|
maxOutput: 4096
|
|
480
847
|
}
|
|
@@ -492,6 +859,7 @@ var mistral_models_default = {
|
|
|
492
859
|
"function-out"
|
|
493
860
|
],
|
|
494
861
|
context: {
|
|
862
|
+
type: "token",
|
|
495
863
|
total: 32768,
|
|
496
864
|
maxOutput: 4096
|
|
497
865
|
}
|
|
@@ -507,6 +875,7 @@ var mistral_models_default = {
|
|
|
507
875
|
"text-out"
|
|
508
876
|
],
|
|
509
877
|
context: {
|
|
878
|
+
type: "token",
|
|
510
879
|
total: 32768,
|
|
511
880
|
maxOutput: 4096
|
|
512
881
|
}
|
|
@@ -522,6 +891,7 @@ var mistral_models_default = {
|
|
|
522
891
|
"text-out"
|
|
523
892
|
],
|
|
524
893
|
context: {
|
|
894
|
+
type: "token",
|
|
525
895
|
total: 32768,
|
|
526
896
|
maxOutput: 4096
|
|
527
897
|
}
|
|
@@ -537,6 +907,7 @@ var mistral_models_default = {
|
|
|
537
907
|
"text-out"
|
|
538
908
|
],
|
|
539
909
|
context: {
|
|
910
|
+
type: "token",
|
|
540
911
|
total: 32768,
|
|
541
912
|
maxOutput: 4096
|
|
542
913
|
}
|
|
@@ -555,6 +926,7 @@ var google_models_default = {
|
|
|
555
926
|
providers: ["google"],
|
|
556
927
|
can: ["chat", "text-in", "text-out", "json-out", "function-out", "img-in", "sound-in", "reason"],
|
|
557
928
|
context: {
|
|
929
|
+
type: "token",
|
|
558
930
|
total: 1048576,
|
|
559
931
|
maxOutput: 8192
|
|
560
932
|
},
|
|
@@ -567,6 +939,7 @@ var google_models_default = {
|
|
|
567
939
|
providers: ["google"],
|
|
568
940
|
can: ["chat", "text-in", "text-out", "json-out", "function-out", "img-in", "sound-in"],
|
|
569
941
|
context: {
|
|
942
|
+
type: "token",
|
|
570
943
|
total: 1048576,
|
|
571
944
|
maxOutput: 8192
|
|
572
945
|
},
|
|
@@ -579,6 +952,7 @@ var google_models_default = {
|
|
|
579
952
|
providers: ["google"],
|
|
580
953
|
can: ["chat", "text-in", "text-out", "json-out", "function-out", "img-in", "sound-in"],
|
|
581
954
|
context: {
|
|
955
|
+
type: "token",
|
|
582
956
|
total: 2097152,
|
|
583
957
|
maxOutput: 8192
|
|
584
958
|
}
|
|
@@ -590,6 +964,7 @@ var google_models_default = {
|
|
|
590
964
|
providers: ["google"],
|
|
591
965
|
can: ["chat", "text-in", "text-out", "json-out", "function-out", "img-in", "sound-in"],
|
|
592
966
|
context: {
|
|
967
|
+
type: "token",
|
|
593
968
|
total: 2097152,
|
|
594
969
|
maxOutput: 8192
|
|
595
970
|
}
|
|
@@ -601,6 +976,7 @@ var google_models_default = {
|
|
|
601
976
|
providers: ["google"],
|
|
602
977
|
can: ["chat", "text-in", "text-out", "json-out", "function-out", "img-in", "sound-in", "reason"],
|
|
603
978
|
context: {
|
|
979
|
+
type: "token",
|
|
604
980
|
total: 2097152,
|
|
605
981
|
maxOutput: 8192
|
|
606
982
|
},
|
|
@@ -613,6 +989,7 @@ var google_models_default = {
|
|
|
613
989
|
providers: ["google"],
|
|
614
990
|
can: ["text-in", "vectors-out"],
|
|
615
991
|
context: {
|
|
992
|
+
type: "token",
|
|
616
993
|
total: 2048,
|
|
617
994
|
maxOutput: 768
|
|
618
995
|
}
|
|
@@ -624,6 +1001,7 @@ var google_models_default = {
|
|
|
624
1001
|
providers: ["google"],
|
|
625
1002
|
can: ["chat", "text-in", "text-out", "json-out", "function-out"],
|
|
626
1003
|
context: {
|
|
1004
|
+
type: "token",
|
|
627
1005
|
total: 8192,
|
|
628
1006
|
maxOutput: 4096
|
|
629
1007
|
}
|
|
@@ -635,6 +1013,7 @@ var google_models_default = {
|
|
|
635
1013
|
providers: ["google"],
|
|
636
1014
|
can: ["chat", "text-in", "text-out", "json-out", "function-out"],
|
|
637
1015
|
context: {
|
|
1016
|
+
type: "token",
|
|
638
1017
|
total: 8192,
|
|
639
1018
|
maxOutput: 4096
|
|
640
1019
|
}
|
|
@@ -659,6 +1038,7 @@ var deepseek_models_default = {
|
|
|
659
1038
|
"function-out"
|
|
660
1039
|
],
|
|
661
1040
|
context: {
|
|
1041
|
+
type: "token",
|
|
662
1042
|
total: 131072,
|
|
663
1043
|
maxOutput: 8192
|
|
664
1044
|
}
|
|
@@ -677,6 +1057,7 @@ var deepseek_models_default = {
|
|
|
677
1057
|
"reason"
|
|
678
1058
|
],
|
|
679
1059
|
context: {
|
|
1060
|
+
type: "token",
|
|
680
1061
|
total: 131072,
|
|
681
1062
|
maxOutput: 8192
|
|
682
1063
|
}
|
|
@@ -696,6 +1077,7 @@ var xai_models_default = {
|
|
|
696
1077
|
providers: ["xai"],
|
|
697
1078
|
can: ["chat", "text-in", "text-out", "img-in"],
|
|
698
1079
|
context: {
|
|
1080
|
+
type: "token",
|
|
699
1081
|
total: 32768,
|
|
700
1082
|
maxOutput: 4096
|
|
701
1083
|
},
|
|
@@ -709,6 +1091,7 @@ var xai_models_default = {
|
|
|
709
1091
|
providers: ["xai"],
|
|
710
1092
|
can: ["chat", "text-in", "text-out"],
|
|
711
1093
|
context: {
|
|
1094
|
+
type: "token",
|
|
712
1095
|
total: 131072,
|
|
713
1096
|
maxOutput: 4096
|
|
714
1097
|
},
|
|
@@ -722,6 +1105,7 @@ var xai_models_default = {
|
|
|
722
1105
|
providers: ["xai"],
|
|
723
1106
|
can: ["chat", "text-in", "text-out", "img-in"],
|
|
724
1107
|
context: {
|
|
1108
|
+
type: "token",
|
|
725
1109
|
total: 8192,
|
|
726
1110
|
maxOutput: 4096
|
|
727
1111
|
}
|
|
@@ -734,6 +1118,7 @@ var xai_models_default = {
|
|
|
734
1118
|
providers: ["xai"],
|
|
735
1119
|
can: ["chat", "text-in", "text-out"],
|
|
736
1120
|
context: {
|
|
1121
|
+
type: "token",
|
|
737
1122
|
total: 131072,
|
|
738
1123
|
maxOutput: 4096
|
|
739
1124
|
}
|
|
@@ -753,6 +1138,7 @@ var cohere_models_default = {
|
|
|
753
1138
|
providers: ["cohere"],
|
|
754
1139
|
can: ["chat", "text-in", "text-out", "reason", "function-out"],
|
|
755
1140
|
context: {
|
|
1141
|
+
type: "token",
|
|
756
1142
|
total: 128e3,
|
|
757
1143
|
maxOutput: 4096
|
|
758
1144
|
}
|
|
@@ -765,6 +1151,7 @@ var cohere_models_default = {
|
|
|
765
1151
|
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
766
1152
|
can: ["chat", "text-in", "text-out", "reason", "function-out"],
|
|
767
1153
|
context: {
|
|
1154
|
+
type: "token",
|
|
768
1155
|
total: 128e3,
|
|
769
1156
|
maxOutput: 4096
|
|
770
1157
|
},
|
|
@@ -778,6 +1165,7 @@ var cohere_models_default = {
|
|
|
778
1165
|
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
779
1166
|
can: ["chat", "text-in", "text-out", "reason", "function-out"],
|
|
780
1167
|
context: {
|
|
1168
|
+
type: "token",
|
|
781
1169
|
total: 128e3,
|
|
782
1170
|
maxOutput: 4096
|
|
783
1171
|
},
|
|
@@ -791,6 +1179,7 @@ var cohere_models_default = {
|
|
|
791
1179
|
providers: ["cohere", "bedrock", "oracle"],
|
|
792
1180
|
can: ["chat", "text-in", "text-out"],
|
|
793
1181
|
context: {
|
|
1182
|
+
type: "token",
|
|
794
1183
|
total: 4096,
|
|
795
1184
|
maxOutput: 4096
|
|
796
1185
|
}
|
|
@@ -803,6 +1192,7 @@ var cohere_models_default = {
|
|
|
803
1192
|
providers: ["cohere", "bedrock", "oracle"],
|
|
804
1193
|
can: ["chat", "text-in", "text-out"],
|
|
805
1194
|
context: {
|
|
1195
|
+
type: "token",
|
|
806
1196
|
total: 4096,
|
|
807
1197
|
maxOutput: 4096
|
|
808
1198
|
}
|
|
@@ -815,6 +1205,7 @@ var cohere_models_default = {
|
|
|
815
1205
|
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
816
1206
|
can: ["text-in", "img-in", "vectors-out"],
|
|
817
1207
|
context: {
|
|
1208
|
+
type: "token",
|
|
818
1209
|
total: 512,
|
|
819
1210
|
maxOutput: 1024
|
|
820
1211
|
}
|
|
@@ -827,6 +1218,7 @@ var cohere_models_default = {
|
|
|
827
1218
|
providers: ["cohere", "oracle"],
|
|
828
1219
|
can: ["text-in", "img-in", "vectors-out"],
|
|
829
1220
|
context: {
|
|
1221
|
+
type: "token",
|
|
830
1222
|
total: 512,
|
|
831
1223
|
maxOutput: 384
|
|
832
1224
|
}
|
|
@@ -839,6 +1231,7 @@ var cohere_models_default = {
|
|
|
839
1231
|
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
840
1232
|
can: ["text-in", "img-in", "vectors-out"],
|
|
841
1233
|
context: {
|
|
1234
|
+
type: "token",
|
|
842
1235
|
total: 512,
|
|
843
1236
|
maxOutput: 1024
|
|
844
1237
|
}
|
|
@@ -851,6 +1244,7 @@ var cohere_models_default = {
|
|
|
851
1244
|
providers: ["cohere", "oracle"],
|
|
852
1245
|
can: ["text-in", "img-in", "vectors-out"],
|
|
853
1246
|
context: {
|
|
1247
|
+
type: "token",
|
|
854
1248
|
total: 512,
|
|
855
1249
|
maxOutput: 384
|
|
856
1250
|
}
|
|
@@ -863,6 +1257,7 @@ var cohere_models_default = {
|
|
|
863
1257
|
providers: ["cohere", "bedrock", "azure"],
|
|
864
1258
|
can: ["text-in", "text-out"],
|
|
865
1259
|
context: {
|
|
1260
|
+
type: "token",
|
|
866
1261
|
total: 4096,
|
|
867
1262
|
maxOutput: null
|
|
868
1263
|
}
|
|
@@ -875,6 +1270,7 @@ var cohere_models_default = {
|
|
|
875
1270
|
providers: ["cohere", "azure"],
|
|
876
1271
|
can: ["text-in", "text-out"],
|
|
877
1272
|
context: {
|
|
1273
|
+
type: "token",
|
|
878
1274
|
total: 4096,
|
|
879
1275
|
maxOutput: null
|
|
880
1276
|
}
|
|
@@ -887,6 +1283,7 @@ var cohere_models_default = {
|
|
|
887
1283
|
providers: ["cohere", "azure"],
|
|
888
1284
|
can: ["text-in", "text-out"],
|
|
889
1285
|
context: {
|
|
1286
|
+
type: "token",
|
|
890
1287
|
total: 4096,
|
|
891
1288
|
maxOutput: null
|
|
892
1289
|
}
|
|
@@ -906,6 +1303,19 @@ function validateModel(raw) {
|
|
|
906
1303
|
throw new Error(`Model ${field} must be a string`);
|
|
907
1304
|
}
|
|
908
1305
|
}
|
|
1306
|
+
if (model.extends !== void 0 && typeof model.extends !== "string") {
|
|
1307
|
+
throw new Error("Model extends must be a string");
|
|
1308
|
+
}
|
|
1309
|
+
if (model.overrides !== void 0) {
|
|
1310
|
+
if (typeof model.overrides !== "object" || model.overrides === null) {
|
|
1311
|
+
throw new Error("Model overrides must be an object");
|
|
1312
|
+
}
|
|
1313
|
+
const validOverrideFields = ["name", "creator", "license", "providers", "can", "languages", "aliases", "context"];
|
|
1314
|
+
const invalidFields = Object.keys(model.overrides).filter((field) => !validOverrideFields.includes(field));
|
|
1315
|
+
if (invalidFields.length > 0) {
|
|
1316
|
+
throw new Error(`Invalid override fields: ${invalidFields.join(", ")}`);
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
909
1319
|
if (!Array.isArray(model.providers)) {
|
|
910
1320
|
throw new Error("Model providers must be an array");
|
|
911
1321
|
}
|
|
@@ -947,6 +1357,16 @@ function validateModel(raw) {
|
|
|
947
1357
|
if (typeof context.maxOutput !== "number") {
|
|
948
1358
|
throw new Error("Image model context.maxOutput must be a number");
|
|
949
1359
|
}
|
|
1360
|
+
} else if (context.type === "embedding") {
|
|
1361
|
+
if (typeof context.total !== "number") {
|
|
1362
|
+
throw new Error("Embedding model context.total must be a number");
|
|
1363
|
+
}
|
|
1364
|
+
if (typeof context.unit !== "string") {
|
|
1365
|
+
throw new Error("Embedding model context.unit must be a string");
|
|
1366
|
+
}
|
|
1367
|
+
if (typeof context.dimensions !== "number") {
|
|
1368
|
+
throw new Error("Embedding model context.dimensions must be a number");
|
|
1369
|
+
}
|
|
950
1370
|
} else {
|
|
951
1371
|
if (typeof context.total !== "number" && context.total !== null) {
|
|
952
1372
|
throw new Error("Token model context.total must be a number or null");
|
|
@@ -964,9 +1384,42 @@ function validateModel(raw) {
|
|
|
964
1384
|
can: model.can,
|
|
965
1385
|
context: model.context,
|
|
966
1386
|
...model.languages ? { languages: model.languages } : {},
|
|
967
|
-
...model.aliases ? { aliases: model.aliases } : {}
|
|
1387
|
+
...model.aliases ? { aliases: model.aliases } : {},
|
|
1388
|
+
...model.extends ? { extends: model.extends } : {},
|
|
1389
|
+
...model.overrides ? { overrides: model.overrides } : {}
|
|
968
1390
|
};
|
|
969
1391
|
}
|
|
1392
|
+
function resolveModel(model, allModels2, visited = /* @__PURE__ */ new Set()) {
|
|
1393
|
+
if (!model.extends) {
|
|
1394
|
+
return model;
|
|
1395
|
+
}
|
|
1396
|
+
if (visited.has(model.id)) {
|
|
1397
|
+
throw new Error(`Circular dependency detected for model ${model.id}`);
|
|
1398
|
+
}
|
|
1399
|
+
visited.add(model.id);
|
|
1400
|
+
const baseModel = allModels2[model.extends];
|
|
1401
|
+
if (!baseModel) {
|
|
1402
|
+
throw new Error(`Base model ${model.extends} not found for ${model.id}`);
|
|
1403
|
+
}
|
|
1404
|
+
const resolvedBase = resolveModel(baseModel, allModels2, visited);
|
|
1405
|
+
if (!model.overrides) {
|
|
1406
|
+
return {
|
|
1407
|
+
...resolvedBase,
|
|
1408
|
+
id: model.id,
|
|
1409
|
+
extends: model.extends
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
const resolved = {
|
|
1413
|
+
...resolvedBase,
|
|
1414
|
+
...model.overrides,
|
|
1415
|
+
id: model.id,
|
|
1416
|
+
extends: model.extends
|
|
1417
|
+
};
|
|
1418
|
+
if (!resolved.name || !resolved.creator || !resolved.license || !resolved.providers || !resolved.can || !resolved.context) {
|
|
1419
|
+
throw new Error(`Missing required fields in resolved model ${model.id}`);
|
|
1420
|
+
}
|
|
1421
|
+
return resolved;
|
|
1422
|
+
}
|
|
970
1423
|
function buildAllModels() {
|
|
971
1424
|
const allModelData = [
|
|
972
1425
|
openai_models_default,
|
|
@@ -979,12 +1432,29 @@ function buildAllModels() {
|
|
|
979
1432
|
cohere_models_default
|
|
980
1433
|
];
|
|
981
1434
|
const allModels2 = allModelData.flatMap(
|
|
982
|
-
(data) => data.models.map((model) =>
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
1435
|
+
(data) => data.models.map((model) => {
|
|
1436
|
+
if (typeof model.id !== "string") {
|
|
1437
|
+
throw new Error(`Model id must be a string`);
|
|
1438
|
+
}
|
|
1439
|
+
if (model.extends !== void 0 && typeof model.extends !== "string") {
|
|
1440
|
+
throw new Error("Model extends must be a string");
|
|
1441
|
+
}
|
|
1442
|
+
if (model.overrides !== void 0 && (typeof model.overrides !== "object" || model.overrides === null)) {
|
|
1443
|
+
throw new Error("Model overrides must be an object");
|
|
1444
|
+
}
|
|
1445
|
+
return {
|
|
1446
|
+
...model,
|
|
1447
|
+
creator: data.creator
|
|
1448
|
+
};
|
|
1449
|
+
})
|
|
986
1450
|
);
|
|
987
|
-
|
|
1451
|
+
const modelMap = Object.fromEntries(
|
|
1452
|
+
allModels2.map((model) => [model.id, model])
|
|
1453
|
+
);
|
|
1454
|
+
const resolvedModels = allModels2.map(
|
|
1455
|
+
(model) => resolveModel(model, modelMap)
|
|
1456
|
+
);
|
|
1457
|
+
return resolvedModels.map((model) => validateModel(model));
|
|
988
1458
|
}
|
|
989
1459
|
|
|
990
1460
|
// src/data/providers/openai-provider.json
|
|
@@ -995,43 +1465,169 @@ var openai_provider_default = {
|
|
|
995
1465
|
apiUrl: "https://api.openai.com/v1",
|
|
996
1466
|
defaultModel: "gpt-4o",
|
|
997
1467
|
models: {
|
|
998
|
-
"
|
|
1468
|
+
"chatgpt-4o-latest": {
|
|
1469
|
+
type: "token",
|
|
1470
|
+
input: 5,
|
|
1471
|
+
output: 15
|
|
1472
|
+
},
|
|
1473
|
+
"gpt-4": {
|
|
1474
|
+
type: "token",
|
|
1475
|
+
input: 30,
|
|
1476
|
+
output: 60
|
|
1477
|
+
},
|
|
1478
|
+
"gpt-4-0613": {
|
|
1479
|
+
type: "token",
|
|
1480
|
+
input: 30,
|
|
1481
|
+
output: 60
|
|
1482
|
+
},
|
|
1483
|
+
"gpt-4-32k": {
|
|
1484
|
+
type: "token",
|
|
1485
|
+
input: 60,
|
|
1486
|
+
output: 120
|
|
1487
|
+
},
|
|
1488
|
+
"gpt-4-turbo": {
|
|
999
1489
|
type: "token",
|
|
1000
|
-
input:
|
|
1001
|
-
output:
|
|
1490
|
+
input: 10,
|
|
1491
|
+
output: 30
|
|
1492
|
+
},
|
|
1493
|
+
"gpt-4-turbo-2024-04-09": {
|
|
1494
|
+
type: "token",
|
|
1495
|
+
input: 10,
|
|
1496
|
+
output: 30
|
|
1002
1497
|
},
|
|
1003
1498
|
"gpt-3.5-turbo": {
|
|
1499
|
+
type: "token",
|
|
1500
|
+
input: 0.5,
|
|
1501
|
+
output: 1.5
|
|
1502
|
+
},
|
|
1503
|
+
"gpt-3.5-turbo-0125": {
|
|
1504
|
+
type: "token",
|
|
1505
|
+
input: 0.5,
|
|
1506
|
+
output: 1.5
|
|
1507
|
+
},
|
|
1508
|
+
"gpt-3.5-turbo-instruct": {
|
|
1509
|
+
type: "token",
|
|
1510
|
+
input: 1.5,
|
|
1511
|
+
output: 2
|
|
1512
|
+
},
|
|
1513
|
+
"gpt-3.5-turbo-16k-0613": {
|
|
1514
|
+
type: "token",
|
|
1515
|
+
input: 3,
|
|
1516
|
+
output: 4
|
|
1517
|
+
},
|
|
1518
|
+
"davinci-002": {
|
|
1519
|
+
type: "token",
|
|
1520
|
+
input: 2,
|
|
1521
|
+
output: 2
|
|
1522
|
+
},
|
|
1523
|
+
"babbage-002": {
|
|
1524
|
+
type: "token",
|
|
1525
|
+
input: 0.4,
|
|
1526
|
+
output: 0.4
|
|
1527
|
+
},
|
|
1528
|
+
"gpt-4o": {
|
|
1529
|
+
type: "token",
|
|
1530
|
+
input: 2.5,
|
|
1531
|
+
input_cached: 1.25,
|
|
1532
|
+
output: 10
|
|
1533
|
+
},
|
|
1534
|
+
"gpt-4o-2024-08-06": {
|
|
1535
|
+
type: "token",
|
|
1536
|
+
input: 2.5,
|
|
1537
|
+
input_cached: 1.25,
|
|
1538
|
+
output: 10
|
|
1539
|
+
},
|
|
1540
|
+
"gpt-4o-audio-preview": {
|
|
1541
|
+
type: "token",
|
|
1542
|
+
input: 2.5,
|
|
1543
|
+
output: 10
|
|
1544
|
+
},
|
|
1545
|
+
"gpt-4o-audio-preview-2024-12-17": {
|
|
1546
|
+
type: "token",
|
|
1547
|
+
input: 2.5,
|
|
1548
|
+
output: 10
|
|
1549
|
+
},
|
|
1550
|
+
"gpt-4o-realtime-preview": {
|
|
1004
1551
|
type: "token",
|
|
1005
1552
|
input: 5,
|
|
1553
|
+
input_cached: 2.5,
|
|
1006
1554
|
output: 20
|
|
1007
1555
|
},
|
|
1008
|
-
"gpt-4o-
|
|
1556
|
+
"gpt-4o-realtime-preview-2024-12-17": {
|
|
1557
|
+
type: "token",
|
|
1558
|
+
input: 5,
|
|
1559
|
+
input_cached: 2.5,
|
|
1560
|
+
output: 20
|
|
1561
|
+
},
|
|
1562
|
+
"gpt-4o-mini": {
|
|
1563
|
+
type: "token",
|
|
1564
|
+
input: 0.15,
|
|
1565
|
+
input_cached: 0.075,
|
|
1566
|
+
output: 0.6
|
|
1567
|
+
},
|
|
1568
|
+
"gpt-4o-mini-2024-07-18": {
|
|
1569
|
+
type: "token",
|
|
1570
|
+
input: 0.15,
|
|
1571
|
+
input_cached: 0.075,
|
|
1572
|
+
output: 0.6
|
|
1573
|
+
},
|
|
1574
|
+
"gpt-4o-mini-audio-preview": {
|
|
1575
|
+
type: "token",
|
|
1576
|
+
input: 0.15,
|
|
1577
|
+
output: 0.6
|
|
1578
|
+
},
|
|
1579
|
+
"gpt-4o-mini-audio-preview-2024-12-17": {
|
|
1580
|
+
type: "token",
|
|
1581
|
+
input: 0.15,
|
|
1582
|
+
output: 0.6
|
|
1583
|
+
},
|
|
1584
|
+
"gpt-4o-mini-realtime-preview": {
|
|
1585
|
+
type: "token",
|
|
1586
|
+
input: 0.6,
|
|
1587
|
+
input_cached: 0.3,
|
|
1588
|
+
output: 2.4
|
|
1589
|
+
},
|
|
1590
|
+
"gpt-4o-mini-realtime-preview-2024-12-17": {
|
|
1591
|
+
type: "token",
|
|
1592
|
+
input: 0.6,
|
|
1593
|
+
input_cached: 0.3,
|
|
1594
|
+
output: 2.4
|
|
1595
|
+
},
|
|
1596
|
+
o1: {
|
|
1009
1597
|
type: "token",
|
|
1010
1598
|
input: 15,
|
|
1011
1599
|
input_cached: 7.5,
|
|
1012
1600
|
output: 60
|
|
1013
1601
|
},
|
|
1014
|
-
"o1-
|
|
1602
|
+
"o1-2024-12-17": {
|
|
1015
1603
|
type: "token",
|
|
1016
|
-
input:
|
|
1017
|
-
input_cached:
|
|
1018
|
-
output:
|
|
1604
|
+
input: 15,
|
|
1605
|
+
input_cached: 7.5,
|
|
1606
|
+
output: 60
|
|
1019
1607
|
},
|
|
1020
1608
|
"o3-mini": {
|
|
1021
1609
|
type: "token",
|
|
1022
|
-
input:
|
|
1023
|
-
input_cached:
|
|
1024
|
-
output:
|
|
1610
|
+
input: 1.1,
|
|
1611
|
+
input_cached: 0.55,
|
|
1612
|
+
output: 4.4
|
|
1025
1613
|
},
|
|
1026
|
-
"
|
|
1614
|
+
"o3-mini-2025-01-31": {
|
|
1615
|
+
type: "token",
|
|
1616
|
+
input: 1.1,
|
|
1617
|
+
input_cached: 0.55,
|
|
1618
|
+
output: 4.4
|
|
1619
|
+
},
|
|
1620
|
+
"o1-mini": {
|
|
1027
1621
|
type: "token",
|
|
1028
|
-
input:
|
|
1029
|
-
|
|
1622
|
+
input: 1.1,
|
|
1623
|
+
input_cached: 0.55,
|
|
1624
|
+
output: 4.4
|
|
1030
1625
|
},
|
|
1031
|
-
"
|
|
1626
|
+
"o1-mini-2024-09-12": {
|
|
1032
1627
|
type: "token",
|
|
1033
|
-
input:
|
|
1034
|
-
|
|
1628
|
+
input: 1.1,
|
|
1629
|
+
input_cached: 0.55,
|
|
1630
|
+
output: 4.4
|
|
1035
1631
|
},
|
|
1036
1632
|
"whisper-1": {
|
|
1037
1633
|
type: "minute",
|
|
@@ -1084,22 +1680,37 @@ var anthropic_provider_default = {
|
|
|
1084
1680
|
name: "Anthropic",
|
|
1085
1681
|
websiteUrl: "https://www.anthropic.com/",
|
|
1086
1682
|
apiUrl: "https://api.anthropic.com/v1",
|
|
1087
|
-
defaultModel: "claude-3-sonnet",
|
|
1683
|
+
defaultModel: "claude-3-5-sonnet-20241022",
|
|
1088
1684
|
models: {
|
|
1089
|
-
"claude-3-opus": {
|
|
1685
|
+
"claude-3-opus-20240229": {
|
|
1090
1686
|
type: "token",
|
|
1091
1687
|
input: 15,
|
|
1092
1688
|
output: 75
|
|
1093
1689
|
},
|
|
1094
|
-
"claude-3-sonnet": {
|
|
1690
|
+
"claude-3-sonnet-20240229": {
|
|
1095
1691
|
type: "token",
|
|
1096
1692
|
input: 3,
|
|
1097
1693
|
output: 15
|
|
1098
1694
|
},
|
|
1099
|
-
"claude-3-haiku": {
|
|
1695
|
+
"claude-3-haiku-20240307": {
|
|
1100
1696
|
type: "token",
|
|
1101
|
-
input:
|
|
1102
|
-
output:
|
|
1697
|
+
input: 0.25,
|
|
1698
|
+
output: 1.25
|
|
1699
|
+
},
|
|
1700
|
+
"claude-3-5-sonnet-20241022": {
|
|
1701
|
+
type: "token",
|
|
1702
|
+
input: 3,
|
|
1703
|
+
output: 15
|
|
1704
|
+
},
|
|
1705
|
+
"claude-3-5-sonnet-20240620": {
|
|
1706
|
+
type: "token",
|
|
1707
|
+
input: 3,
|
|
1708
|
+
output: 15
|
|
1709
|
+
},
|
|
1710
|
+
"claude-3-5-haiku-20241022": {
|
|
1711
|
+
type: "token",
|
|
1712
|
+
input: 0.8,
|
|
1713
|
+
output: 4
|
|
1103
1714
|
}
|
|
1104
1715
|
}
|
|
1105
1716
|
};
|
|
@@ -1232,7 +1843,10 @@ var AIModels = class _AIModels extends ModelCollection {
|
|
|
1232
1843
|
}
|
|
1233
1844
|
/** Get all providers that can serve a specific model */
|
|
1234
1845
|
getProvidersForModel(modelId) {
|
|
1235
|
-
|
|
1846
|
+
let model = this.id(modelId);
|
|
1847
|
+
if (!model) {
|
|
1848
|
+
model = this.find((m) => m.aliases?.includes(modelId));
|
|
1849
|
+
}
|
|
1236
1850
|
if (!model) return [];
|
|
1237
1851
|
return providersData.providers.filter(
|
|
1238
1852
|
(p) => model.providers.includes(p.id)
|