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.mjs
CHANGED
|
@@ -46,7 +46,10 @@ var ModelCollection = class _ModelCollection extends Array {
|
|
|
46
46
|
withMinContext(tokens) {
|
|
47
47
|
return this.filter((model) => {
|
|
48
48
|
const context = model.context;
|
|
49
|
-
if (
|
|
49
|
+
if (context.type !== "token" && context.type !== "character") {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
if (context.total === null) {
|
|
50
53
|
return false;
|
|
51
54
|
}
|
|
52
55
|
return context.total >= tokens;
|
|
@@ -59,61 +62,74 @@ var openai_models_default = {
|
|
|
59
62
|
creator: "openai",
|
|
60
63
|
models: [
|
|
61
64
|
{
|
|
62
|
-
id: "
|
|
63
|
-
name: "
|
|
64
|
-
license: "
|
|
65
|
+
id: "gpt-4",
|
|
66
|
+
name: "GPT-4",
|
|
67
|
+
license: "proprietary",
|
|
65
68
|
providers: [
|
|
66
69
|
"openai",
|
|
67
|
-
"azure"
|
|
68
|
-
"groq"
|
|
70
|
+
"azure"
|
|
69
71
|
],
|
|
70
72
|
can: [
|
|
71
|
-
"
|
|
72
|
-
"text-
|
|
73
|
+
"chat",
|
|
74
|
+
"text-in",
|
|
75
|
+
"text-out",
|
|
76
|
+
"json-out",
|
|
77
|
+
"function-out"
|
|
73
78
|
],
|
|
74
79
|
context: {
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
type: "token",
|
|
81
|
+
total: 8192,
|
|
82
|
+
maxOutput: 4096
|
|
77
83
|
}
|
|
78
84
|
},
|
|
79
85
|
{
|
|
80
|
-
id: "
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"sound-in",
|
|
90
|
-
"text-out"
|
|
91
|
-
],
|
|
92
|
-
context: {
|
|
93
|
-
total: null,
|
|
94
|
-
maxOutput: null
|
|
86
|
+
id: "gpt-4-turbo-preview",
|
|
87
|
+
extends: "gpt-4",
|
|
88
|
+
overrides: {
|
|
89
|
+
name: "GPT-4 Turbo",
|
|
90
|
+
context: {
|
|
91
|
+
type: "token",
|
|
92
|
+
total: 128e3,
|
|
93
|
+
maxOutput: 4096
|
|
94
|
+
}
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
|
-
id: "
|
|
99
|
-
name: "
|
|
98
|
+
id: "gpt-3.5-turbo",
|
|
99
|
+
name: "GPT-3.5 Turbo",
|
|
100
100
|
license: "proprietary",
|
|
101
101
|
providers: [
|
|
102
102
|
"openai",
|
|
103
103
|
"azure"
|
|
104
104
|
],
|
|
105
105
|
can: [
|
|
106
|
+
"chat",
|
|
106
107
|
"text-in",
|
|
107
|
-
"
|
|
108
|
+
"text-out",
|
|
109
|
+
"json-out",
|
|
110
|
+
"function-out"
|
|
108
111
|
],
|
|
109
112
|
context: {
|
|
110
|
-
|
|
111
|
-
|
|
113
|
+
type: "token",
|
|
114
|
+
total: 16385,
|
|
115
|
+
maxOutput: 4096
|
|
112
116
|
}
|
|
113
117
|
},
|
|
114
118
|
{
|
|
115
|
-
id: "
|
|
116
|
-
|
|
119
|
+
id: "gpt-3.5-turbo-16k",
|
|
120
|
+
extends: "gpt-3.5-turbo",
|
|
121
|
+
overrides: {
|
|
122
|
+
name: "GPT-3.5 Turbo 16K",
|
|
123
|
+
context: {
|
|
124
|
+
type: "token",
|
|
125
|
+
total: 16385,
|
|
126
|
+
maxOutput: 4096
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "gpt-3.5-turbo-instruct",
|
|
132
|
+
name: "GPT-3.5 Turbo Instruct",
|
|
117
133
|
license: "proprietary",
|
|
118
134
|
providers: [
|
|
119
135
|
"openai",
|
|
@@ -121,11 +137,12 @@ var openai_models_default = {
|
|
|
121
137
|
],
|
|
122
138
|
can: [
|
|
123
139
|
"text-in",
|
|
124
|
-
"
|
|
140
|
+
"text-out"
|
|
125
141
|
],
|
|
126
142
|
context: {
|
|
127
|
-
|
|
128
|
-
|
|
143
|
+
type: "token",
|
|
144
|
+
total: 4096,
|
|
145
|
+
maxOutput: 4096
|
|
129
146
|
}
|
|
130
147
|
},
|
|
131
148
|
{
|
|
@@ -138,32 +155,184 @@ var openai_models_default = {
|
|
|
138
155
|
],
|
|
139
156
|
can: [
|
|
140
157
|
"chat",
|
|
158
|
+
"text-in",
|
|
159
|
+
"text-out",
|
|
141
160
|
"img-in",
|
|
142
161
|
"json-out",
|
|
143
162
|
"function-out"
|
|
144
163
|
],
|
|
145
164
|
context: {
|
|
165
|
+
type: "token",
|
|
146
166
|
total: 128e3,
|
|
147
167
|
maxOutput: 16384
|
|
148
168
|
}
|
|
149
169
|
},
|
|
170
|
+
{
|
|
171
|
+
id: "chatgpt-4o-latest",
|
|
172
|
+
extends: "gpt-4o",
|
|
173
|
+
overrides: {
|
|
174
|
+
name: "GPT-4o used in ChatGPT"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: "gpt-4o-2024-11-20",
|
|
179
|
+
extends: "gpt-4o",
|
|
180
|
+
overrides: {
|
|
181
|
+
name: "GPT-4o (2024-11-20)"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
id: "gpt-4o-2024-08-06",
|
|
186
|
+
extends: "gpt-4o",
|
|
187
|
+
overrides: {
|
|
188
|
+
name: "GPT-4o (2024-08-06)"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: "gpt-4o-2024-05-13",
|
|
193
|
+
extends: "gpt-4o",
|
|
194
|
+
overrides: {
|
|
195
|
+
name: "GPT-4o (2024-05-13)",
|
|
196
|
+
context: {
|
|
197
|
+
type: "token",
|
|
198
|
+
total: 128e3,
|
|
199
|
+
maxOutput: 4096
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
},
|
|
150
203
|
{
|
|
151
204
|
id: "gpt-4o-mini",
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
205
|
+
extends: "gpt-4o",
|
|
206
|
+
overrides: {
|
|
207
|
+
name: "GPT-4o Mini",
|
|
208
|
+
context: {
|
|
209
|
+
type: "token",
|
|
210
|
+
total: 128e3,
|
|
211
|
+
maxOutput: 16384
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: "gpt-4o-audio-preview",
|
|
217
|
+
extends: "gpt-4o",
|
|
218
|
+
overrides: {
|
|
219
|
+
name: "GPT-4o Audio",
|
|
220
|
+
can: [
|
|
221
|
+
"chat",
|
|
222
|
+
"text-in",
|
|
223
|
+
"text-out",
|
|
224
|
+
"sound-in",
|
|
225
|
+
"json-out",
|
|
226
|
+
"function-out"
|
|
227
|
+
],
|
|
228
|
+
context: {
|
|
229
|
+
type: "token",
|
|
230
|
+
total: 128e3,
|
|
231
|
+
maxOutput: 16384
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
id: "gpt-4o-audio-preview-2024-12-17",
|
|
237
|
+
extends: "gpt-4o-audio-preview",
|
|
238
|
+
overrides: {
|
|
239
|
+
name: "GPT-4o Audio (2024-12-17)"
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
id: "gpt-4o-audio-preview-2024-10-01",
|
|
244
|
+
extends: "gpt-4o-audio-preview",
|
|
245
|
+
overrides: {
|
|
246
|
+
name: "GPT-4o Audio (2024-10-01)"
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
id: "gpt-4o-mini-audio-preview",
|
|
251
|
+
extends: "gpt-4o-mini",
|
|
252
|
+
overrides: {
|
|
253
|
+
name: "GPT-4o Mini Audio",
|
|
254
|
+
can: [
|
|
255
|
+
"chat",
|
|
256
|
+
"text-in",
|
|
257
|
+
"text-out",
|
|
258
|
+
"sound-in",
|
|
259
|
+
"sound-out",
|
|
260
|
+
"json-out",
|
|
261
|
+
"function-out"
|
|
262
|
+
],
|
|
263
|
+
context: {
|
|
264
|
+
type: "token",
|
|
265
|
+
total: 128e3,
|
|
266
|
+
maxOutput: 16384
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
id: "gpt-4o-mini-audio-preview-2024-12-17",
|
|
272
|
+
extends: "gpt-4o-mini-audio-preview",
|
|
273
|
+
overrides: {
|
|
274
|
+
name: "GPT-4o Mini Audio (2024-12-17)"
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
id: "gpt-4o-realtime-preview",
|
|
279
|
+
extends: "gpt-4o",
|
|
280
|
+
overrides: {
|
|
281
|
+
name: "GPT-4o Realtime",
|
|
282
|
+
can: [
|
|
283
|
+
"chat",
|
|
284
|
+
"text-in",
|
|
285
|
+
"text-out",
|
|
286
|
+
"sound-in",
|
|
287
|
+
"json-out",
|
|
288
|
+
"function-out"
|
|
289
|
+
],
|
|
290
|
+
context: {
|
|
291
|
+
type: "token",
|
|
292
|
+
total: 128e3,
|
|
293
|
+
maxOutput: 4096
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
id: "gpt-4o-realtime-preview-2024-12-17",
|
|
299
|
+
extends: "gpt-4o-realtime-preview",
|
|
300
|
+
overrides: {
|
|
301
|
+
name: "GPT-4o Realtime (2024-12-17)"
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
id: "gpt-4o-realtime-preview-2024-10-01",
|
|
306
|
+
extends: "gpt-4o-realtime-preview",
|
|
307
|
+
overrides: {
|
|
308
|
+
name: "GPT-4o Realtime (2024-10-01)"
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
id: "gpt-4o-mini-realtime-preview",
|
|
313
|
+
extends: "gpt-4o-mini",
|
|
314
|
+
overrides: {
|
|
315
|
+
name: "GPT-4o Mini Realtime",
|
|
316
|
+
can: [
|
|
317
|
+
"chat",
|
|
318
|
+
"text-in",
|
|
319
|
+
"text-out",
|
|
320
|
+
"sound-in",
|
|
321
|
+
"json-out",
|
|
322
|
+
"function-out"
|
|
323
|
+
],
|
|
324
|
+
context: {
|
|
325
|
+
type: "token",
|
|
326
|
+
total: 128e3,
|
|
327
|
+
maxOutput: 4096
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
id: "gpt-4o-mini-realtime-preview-2024-12-17",
|
|
333
|
+
extends: "gpt-4o-mini-realtime-preview",
|
|
334
|
+
overrides: {
|
|
335
|
+
name: "GPT-4o Mini Realtime (2024-12-17)"
|
|
167
336
|
}
|
|
168
337
|
},
|
|
169
338
|
{
|
|
@@ -176,19 +345,75 @@ var openai_models_default = {
|
|
|
176
345
|
],
|
|
177
346
|
can: [
|
|
178
347
|
"chat",
|
|
348
|
+
"text-in",
|
|
349
|
+
"text-out",
|
|
179
350
|
"img-in",
|
|
180
351
|
"json-out",
|
|
181
352
|
"function-out",
|
|
182
353
|
"reason"
|
|
183
354
|
],
|
|
184
355
|
context: {
|
|
356
|
+
type: "token",
|
|
185
357
|
total: 2e5,
|
|
186
358
|
maxOutput: 1e5
|
|
187
359
|
}
|
|
188
360
|
},
|
|
361
|
+
{
|
|
362
|
+
id: "o1-2024-12-17",
|
|
363
|
+
extends: "o1",
|
|
364
|
+
overrides: {
|
|
365
|
+
name: "OpenAI O1 (2024-12-17)"
|
|
366
|
+
}
|
|
367
|
+
},
|
|
189
368
|
{
|
|
190
369
|
id: "o1-mini",
|
|
191
|
-
|
|
370
|
+
extends: "o1",
|
|
371
|
+
overrides: {
|
|
372
|
+
name: "OpenAI O1 Mini",
|
|
373
|
+
can: [
|
|
374
|
+
"chat",
|
|
375
|
+
"text-in",
|
|
376
|
+
"text-out",
|
|
377
|
+
"json-out",
|
|
378
|
+
"function-out",
|
|
379
|
+
"reason"
|
|
380
|
+
],
|
|
381
|
+
context: {
|
|
382
|
+
type: "token",
|
|
383
|
+
total: 128e3,
|
|
384
|
+
maxOutput: 65536
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
id: "o1-mini-2024-09-12",
|
|
390
|
+
extends: "o1-mini",
|
|
391
|
+
overrides: {
|
|
392
|
+
name: "OpenAI O1 Mini (2024-09-12)"
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
id: "o1-preview",
|
|
397
|
+
extends: "o1",
|
|
398
|
+
overrides: {
|
|
399
|
+
name: "OpenAI O1 Preview",
|
|
400
|
+
context: {
|
|
401
|
+
type: "token",
|
|
402
|
+
total: 128e3,
|
|
403
|
+
maxOutput: 32768
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
id: "o1-preview-2024-09-12",
|
|
409
|
+
extends: "o1-preview",
|
|
410
|
+
overrides: {
|
|
411
|
+
name: "OpenAI O1 Preview (2024-09-12)"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
id: "o3-mini",
|
|
416
|
+
name: "OpenAI O3 Mini",
|
|
192
417
|
license: "proprietary",
|
|
193
418
|
providers: [
|
|
194
419
|
"openai",
|
|
@@ -196,70 +421,89 @@ var openai_models_default = {
|
|
|
196
421
|
],
|
|
197
422
|
can: [
|
|
198
423
|
"chat",
|
|
424
|
+
"text-in",
|
|
425
|
+
"text-out",
|
|
199
426
|
"json-out",
|
|
200
427
|
"function-out",
|
|
201
428
|
"reason"
|
|
202
429
|
],
|
|
203
430
|
context: {
|
|
204
|
-
|
|
205
|
-
|
|
431
|
+
type: "token",
|
|
432
|
+
total: 2e5,
|
|
433
|
+
maxOutput: 1e5
|
|
206
434
|
}
|
|
207
435
|
},
|
|
208
436
|
{
|
|
209
|
-
id: "o3-mini",
|
|
210
|
-
|
|
437
|
+
id: "o3-mini-2025-01-31",
|
|
438
|
+
extends: "o3-mini",
|
|
439
|
+
overrides: {
|
|
440
|
+
name: "OpenAI O3 Mini (2025-01-31)"
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
id: "whisper-1",
|
|
445
|
+
name: "Whisper",
|
|
211
446
|
license: "proprietary",
|
|
212
447
|
providers: [
|
|
213
448
|
"openai",
|
|
214
449
|
"azure"
|
|
215
450
|
],
|
|
216
451
|
can: [
|
|
217
|
-
"
|
|
218
|
-
"
|
|
219
|
-
"function-out",
|
|
220
|
-
"reason"
|
|
452
|
+
"sound-in",
|
|
453
|
+
"text-out"
|
|
221
454
|
],
|
|
222
455
|
context: {
|
|
223
|
-
|
|
224
|
-
|
|
456
|
+
type: "audio-in",
|
|
457
|
+
total: null,
|
|
458
|
+
maxOutput: null
|
|
225
459
|
}
|
|
226
460
|
},
|
|
227
461
|
{
|
|
228
|
-
id: "
|
|
229
|
-
name: "
|
|
462
|
+
id: "tts-1",
|
|
463
|
+
name: "TTS-1",
|
|
230
464
|
license: "proprietary",
|
|
231
465
|
providers: [
|
|
232
466
|
"openai",
|
|
233
467
|
"azure"
|
|
234
468
|
],
|
|
235
469
|
can: [
|
|
236
|
-
"
|
|
237
|
-
"sound-
|
|
238
|
-
"json-out",
|
|
239
|
-
"function-out"
|
|
470
|
+
"text-in",
|
|
471
|
+
"sound-out"
|
|
240
472
|
],
|
|
241
473
|
context: {
|
|
242
|
-
|
|
243
|
-
|
|
474
|
+
type: "audio-out",
|
|
475
|
+
total: null,
|
|
476
|
+
maxOutput: null
|
|
244
477
|
}
|
|
245
478
|
},
|
|
246
479
|
{
|
|
247
|
-
id: "
|
|
248
|
-
|
|
480
|
+
id: "tts-1-hd",
|
|
481
|
+
extends: "tts-1",
|
|
482
|
+
overrides: {
|
|
483
|
+
name: "TTS-1 HD"
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
id: "dall-e-2",
|
|
488
|
+
name: "DALL-E 2",
|
|
249
489
|
license: "proprietary",
|
|
250
490
|
providers: [
|
|
251
491
|
"openai",
|
|
252
492
|
"azure"
|
|
253
493
|
],
|
|
254
494
|
can: [
|
|
255
|
-
"
|
|
256
|
-
"sound-in",
|
|
257
|
-
"json-out",
|
|
258
|
-
"function-out"
|
|
495
|
+
"img-out"
|
|
259
496
|
],
|
|
260
497
|
context: {
|
|
261
|
-
|
|
262
|
-
|
|
498
|
+
maxOutput: 1,
|
|
499
|
+
sizes: [
|
|
500
|
+
"256x256",
|
|
501
|
+
"512x512",
|
|
502
|
+
"1024x1024"
|
|
503
|
+
],
|
|
504
|
+
qualities: [
|
|
505
|
+
"standard"
|
|
506
|
+
]
|
|
263
507
|
}
|
|
264
508
|
},
|
|
265
509
|
{
|
|
@@ -271,6 +515,7 @@ var openai_models_default = {
|
|
|
271
515
|
"azure"
|
|
272
516
|
],
|
|
273
517
|
can: [
|
|
518
|
+
"text-in",
|
|
274
519
|
"img-out"
|
|
275
520
|
],
|
|
276
521
|
context: {
|
|
@@ -285,6 +530,69 @@ var openai_models_default = {
|
|
|
285
530
|
"hd"
|
|
286
531
|
]
|
|
287
532
|
}
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
id: "text-embedding-ada-002",
|
|
536
|
+
name: "Text Embedding Ada 002",
|
|
537
|
+
license: "proprietary",
|
|
538
|
+
providers: [
|
|
539
|
+
"openai",
|
|
540
|
+
"azure"
|
|
541
|
+
],
|
|
542
|
+
can: [
|
|
543
|
+
"text-in",
|
|
544
|
+
"vectors-out"
|
|
545
|
+
],
|
|
546
|
+
context: {
|
|
547
|
+
type: "embedding",
|
|
548
|
+
total: 8191,
|
|
549
|
+
unit: "tokens",
|
|
550
|
+
dimensions: 1536,
|
|
551
|
+
embeddingType: "text",
|
|
552
|
+
normalized: true
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
id: "text-embedding-3-small",
|
|
557
|
+
name: "Text Embedding 3 Small",
|
|
558
|
+
license: "proprietary",
|
|
559
|
+
providers: [
|
|
560
|
+
"openai",
|
|
561
|
+
"azure"
|
|
562
|
+
],
|
|
563
|
+
can: [
|
|
564
|
+
"text-in",
|
|
565
|
+
"vectors-out"
|
|
566
|
+
],
|
|
567
|
+
context: {
|
|
568
|
+
type: "embedding",
|
|
569
|
+
total: 8191,
|
|
570
|
+
unit: "tokens",
|
|
571
|
+
dimensions: 1536,
|
|
572
|
+
embeddingType: "text",
|
|
573
|
+
normalized: true
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
id: "text-embedding-3-large",
|
|
578
|
+
name: "Text Embedding 3 Large",
|
|
579
|
+
license: "proprietary",
|
|
580
|
+
providers: [
|
|
581
|
+
"openai",
|
|
582
|
+
"azure"
|
|
583
|
+
],
|
|
584
|
+
can: [
|
|
585
|
+
"text-in",
|
|
586
|
+
"vectors-out"
|
|
587
|
+
],
|
|
588
|
+
context: {
|
|
589
|
+
type: "embedding",
|
|
590
|
+
total: 8191,
|
|
591
|
+
unit: "tokens",
|
|
592
|
+
dimensions: 3072,
|
|
593
|
+
embeddingType: "text",
|
|
594
|
+
normalized: true
|
|
595
|
+
}
|
|
288
596
|
}
|
|
289
597
|
]
|
|
290
598
|
};
|
|
@@ -297,11 +605,7 @@ var anthropic_models_default = {
|
|
|
297
605
|
id: "claude-3-opus-20240229",
|
|
298
606
|
name: "Claude 3 Opus",
|
|
299
607
|
license: "proprietary",
|
|
300
|
-
providers: [
|
|
301
|
-
"anthropic",
|
|
302
|
-
"aws",
|
|
303
|
-
"google"
|
|
304
|
-
],
|
|
608
|
+
providers: ["anthropic", "aws", "google"],
|
|
305
609
|
can: [
|
|
306
610
|
"chat",
|
|
307
611
|
"text-in",
|
|
@@ -311,21 +615,18 @@ var anthropic_models_default = {
|
|
|
311
615
|
"function-out"
|
|
312
616
|
],
|
|
313
617
|
context: {
|
|
618
|
+
type: "token",
|
|
314
619
|
total: 2e5,
|
|
315
620
|
maxOutput: 4096,
|
|
316
621
|
outputIsFixed: 1
|
|
317
622
|
},
|
|
318
|
-
aliases: ["claude-3-opus-latest"]
|
|
623
|
+
aliases: ["claude-3-opus-latest", "claude-3-opus"]
|
|
319
624
|
},
|
|
320
625
|
{
|
|
321
|
-
id: "claude-3-
|
|
626
|
+
id: "claude-3-sonnet-20240229",
|
|
322
627
|
name: "Claude 3 Sonnet",
|
|
323
628
|
license: "proprietary",
|
|
324
|
-
providers: [
|
|
325
|
-
"anthropic",
|
|
326
|
-
"aws",
|
|
327
|
-
"google"
|
|
328
|
-
],
|
|
629
|
+
providers: ["anthropic", "aws", "google"],
|
|
329
630
|
can: [
|
|
330
631
|
"chat",
|
|
331
632
|
"text-in",
|
|
@@ -335,21 +636,60 @@ var anthropic_models_default = {
|
|
|
335
636
|
"function-out"
|
|
336
637
|
],
|
|
337
638
|
context: {
|
|
639
|
+
type: "token",
|
|
338
640
|
total: 2e5,
|
|
339
|
-
maxOutput:
|
|
641
|
+
maxOutput: 4096,
|
|
340
642
|
outputIsFixed: 1
|
|
341
643
|
},
|
|
342
|
-
aliases: ["claude-3-sonnet-latest"]
|
|
644
|
+
aliases: ["claude-3-sonnet-latest", "claude-3-sonnet"]
|
|
343
645
|
},
|
|
344
646
|
{
|
|
345
|
-
id: "claude-3-
|
|
647
|
+
id: "claude-3-haiku-20240307",
|
|
346
648
|
name: "Claude 3 Haiku",
|
|
347
649
|
license: "proprietary",
|
|
348
|
-
providers: [
|
|
349
|
-
|
|
350
|
-
"
|
|
351
|
-
"
|
|
650
|
+
providers: ["anthropic", "aws", "google"],
|
|
651
|
+
can: [
|
|
652
|
+
"chat",
|
|
653
|
+
"text-in",
|
|
654
|
+
"text-out",
|
|
655
|
+
"img-in",
|
|
656
|
+
"json-out",
|
|
657
|
+
"function-out"
|
|
658
|
+
],
|
|
659
|
+
context: {
|
|
660
|
+
type: "token",
|
|
661
|
+
total: 2e5,
|
|
662
|
+
maxOutput: 4096,
|
|
663
|
+
outputIsFixed: 1
|
|
664
|
+
},
|
|
665
|
+
aliases: ["claude-3-haiku"]
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
id: "claude-3-5-sonnet-20241022",
|
|
669
|
+
name: "Claude 3.5 Sonnet",
|
|
670
|
+
license: "proprietary",
|
|
671
|
+
providers: ["anthropic", "aws", "google"],
|
|
672
|
+
can: [
|
|
673
|
+
"chat",
|
|
674
|
+
"text-in",
|
|
675
|
+
"text-out",
|
|
676
|
+
"img-in",
|
|
677
|
+
"json-out",
|
|
678
|
+
"function-out"
|
|
352
679
|
],
|
|
680
|
+
context: {
|
|
681
|
+
type: "token",
|
|
682
|
+
total: 2e5,
|
|
683
|
+
maxOutput: 8192,
|
|
684
|
+
outputIsFixed: 1
|
|
685
|
+
},
|
|
686
|
+
aliases: ["claude-3-5-sonnet-latest", "claude-3-5-sonnet"]
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
id: "claude-3-5-sonnet-20240620",
|
|
690
|
+
name: "Claude 3.5 Sonnet (2024-06-20)",
|
|
691
|
+
license: "proprietary",
|
|
692
|
+
providers: ["anthropic", "aws", "google"],
|
|
353
693
|
can: [
|
|
354
694
|
"chat",
|
|
355
695
|
"text-in",
|
|
@@ -359,10 +699,31 @@ var anthropic_models_default = {
|
|
|
359
699
|
"function-out"
|
|
360
700
|
],
|
|
361
701
|
context: {
|
|
702
|
+
type: "token",
|
|
362
703
|
total: 2e5,
|
|
363
704
|
maxOutput: 8192,
|
|
364
705
|
outputIsFixed: 1
|
|
365
706
|
}
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
id: "claude-3-5-haiku-20241022",
|
|
710
|
+
name: "Claude 3.5 Haiku",
|
|
711
|
+
license: "proprietary",
|
|
712
|
+
providers: ["anthropic", "aws", "google"],
|
|
713
|
+
can: [
|
|
714
|
+
"chat",
|
|
715
|
+
"text-in",
|
|
716
|
+
"text-out",
|
|
717
|
+
"json-out",
|
|
718
|
+
"function-out"
|
|
719
|
+
],
|
|
720
|
+
context: {
|
|
721
|
+
type: "token",
|
|
722
|
+
total: 2e5,
|
|
723
|
+
maxOutput: 8192,
|
|
724
|
+
outputIsFixed: 1
|
|
725
|
+
},
|
|
726
|
+
aliases: ["claude-3-5-haiku-latest", "claude-3-5-haiku"]
|
|
366
727
|
}
|
|
367
728
|
]
|
|
368
729
|
};
|
|
@@ -378,6 +739,7 @@ var meta_models_default = {
|
|
|
378
739
|
providers: ["groq"],
|
|
379
740
|
can: ["chat", "text-in", "text-out", "json-out", "function-out"],
|
|
380
741
|
context: {
|
|
742
|
+
type: "token",
|
|
381
743
|
total: 8192,
|
|
382
744
|
maxOutput: 4096
|
|
383
745
|
}
|
|
@@ -389,6 +751,7 @@ var meta_models_default = {
|
|
|
389
751
|
providers: ["groq"],
|
|
390
752
|
can: ["chat", "text-in", "text-out", "json-out", "function-out"],
|
|
391
753
|
context: {
|
|
754
|
+
type: "token",
|
|
392
755
|
total: 8192,
|
|
393
756
|
maxOutput: 4096
|
|
394
757
|
}
|
|
@@ -400,6 +763,7 @@ var meta_models_default = {
|
|
|
400
763
|
providers: ["groq"],
|
|
401
764
|
can: ["chat", "text-in", "text-out", "img-in"],
|
|
402
765
|
context: {
|
|
766
|
+
type: "token",
|
|
403
767
|
total: 4096,
|
|
404
768
|
maxOutput: 4096
|
|
405
769
|
}
|
|
@@ -411,6 +775,7 @@ var meta_models_default = {
|
|
|
411
775
|
providers: ["groq"],
|
|
412
776
|
can: ["chat", "text-in", "text-out", "img-in"],
|
|
413
777
|
context: {
|
|
778
|
+
type: "token",
|
|
414
779
|
total: 4096,
|
|
415
780
|
maxOutput: 4096
|
|
416
781
|
}
|
|
@@ -422,6 +787,7 @@ var meta_models_default = {
|
|
|
422
787
|
providers: ["groq"],
|
|
423
788
|
can: ["chat", "text-in", "text-out"],
|
|
424
789
|
context: {
|
|
790
|
+
type: "token",
|
|
425
791
|
total: 4096,
|
|
426
792
|
maxOutput: 4096
|
|
427
793
|
}
|
|
@@ -446,6 +812,7 @@ var mistral_models_default = {
|
|
|
446
812
|
"function-out"
|
|
447
813
|
],
|
|
448
814
|
context: {
|
|
815
|
+
type: "token",
|
|
449
816
|
total: 32768,
|
|
450
817
|
maxOutput: 4096
|
|
451
818
|
}
|
|
@@ -463,6 +830,7 @@ var mistral_models_default = {
|
|
|
463
830
|
"function-out"
|
|
464
831
|
],
|
|
465
832
|
context: {
|
|
833
|
+
type: "token",
|
|
466
834
|
total: 32768,
|
|
467
835
|
maxOutput: 4096
|
|
468
836
|
}
|
|
@@ -478,6 +846,7 @@ var mistral_models_default = {
|
|
|
478
846
|
"text-out"
|
|
479
847
|
],
|
|
480
848
|
context: {
|
|
849
|
+
type: "token",
|
|
481
850
|
total: 32768,
|
|
482
851
|
maxOutput: 4096
|
|
483
852
|
}
|
|
@@ -493,6 +862,7 @@ var mistral_models_default = {
|
|
|
493
862
|
"text-out"
|
|
494
863
|
],
|
|
495
864
|
context: {
|
|
865
|
+
type: "token",
|
|
496
866
|
total: 32768,
|
|
497
867
|
maxOutput: 4096
|
|
498
868
|
}
|
|
@@ -508,6 +878,7 @@ var mistral_models_default = {
|
|
|
508
878
|
"text-out"
|
|
509
879
|
],
|
|
510
880
|
context: {
|
|
881
|
+
type: "token",
|
|
511
882
|
total: 32768,
|
|
512
883
|
maxOutput: 4096
|
|
513
884
|
}
|
|
@@ -526,6 +897,7 @@ var google_models_default = {
|
|
|
526
897
|
providers: ["google"],
|
|
527
898
|
can: ["chat", "text-in", "text-out", "json-out", "function-out", "img-in", "sound-in", "reason"],
|
|
528
899
|
context: {
|
|
900
|
+
type: "token",
|
|
529
901
|
total: 1048576,
|
|
530
902
|
maxOutput: 8192
|
|
531
903
|
},
|
|
@@ -538,6 +910,7 @@ var google_models_default = {
|
|
|
538
910
|
providers: ["google"],
|
|
539
911
|
can: ["chat", "text-in", "text-out", "json-out", "function-out", "img-in", "sound-in"],
|
|
540
912
|
context: {
|
|
913
|
+
type: "token",
|
|
541
914
|
total: 1048576,
|
|
542
915
|
maxOutput: 8192
|
|
543
916
|
},
|
|
@@ -550,6 +923,7 @@ var google_models_default = {
|
|
|
550
923
|
providers: ["google"],
|
|
551
924
|
can: ["chat", "text-in", "text-out", "json-out", "function-out", "img-in", "sound-in"],
|
|
552
925
|
context: {
|
|
926
|
+
type: "token",
|
|
553
927
|
total: 2097152,
|
|
554
928
|
maxOutput: 8192
|
|
555
929
|
}
|
|
@@ -561,6 +935,7 @@ var google_models_default = {
|
|
|
561
935
|
providers: ["google"],
|
|
562
936
|
can: ["chat", "text-in", "text-out", "json-out", "function-out", "img-in", "sound-in"],
|
|
563
937
|
context: {
|
|
938
|
+
type: "token",
|
|
564
939
|
total: 2097152,
|
|
565
940
|
maxOutput: 8192
|
|
566
941
|
}
|
|
@@ -572,6 +947,7 @@ var google_models_default = {
|
|
|
572
947
|
providers: ["google"],
|
|
573
948
|
can: ["chat", "text-in", "text-out", "json-out", "function-out", "img-in", "sound-in", "reason"],
|
|
574
949
|
context: {
|
|
950
|
+
type: "token",
|
|
575
951
|
total: 2097152,
|
|
576
952
|
maxOutput: 8192
|
|
577
953
|
},
|
|
@@ -584,6 +960,7 @@ var google_models_default = {
|
|
|
584
960
|
providers: ["google"],
|
|
585
961
|
can: ["text-in", "vectors-out"],
|
|
586
962
|
context: {
|
|
963
|
+
type: "token",
|
|
587
964
|
total: 2048,
|
|
588
965
|
maxOutput: 768
|
|
589
966
|
}
|
|
@@ -595,6 +972,7 @@ var google_models_default = {
|
|
|
595
972
|
providers: ["google"],
|
|
596
973
|
can: ["chat", "text-in", "text-out", "json-out", "function-out"],
|
|
597
974
|
context: {
|
|
975
|
+
type: "token",
|
|
598
976
|
total: 8192,
|
|
599
977
|
maxOutput: 4096
|
|
600
978
|
}
|
|
@@ -606,6 +984,7 @@ var google_models_default = {
|
|
|
606
984
|
providers: ["google"],
|
|
607
985
|
can: ["chat", "text-in", "text-out", "json-out", "function-out"],
|
|
608
986
|
context: {
|
|
987
|
+
type: "token",
|
|
609
988
|
total: 8192,
|
|
610
989
|
maxOutput: 4096
|
|
611
990
|
}
|
|
@@ -630,6 +1009,7 @@ var deepseek_models_default = {
|
|
|
630
1009
|
"function-out"
|
|
631
1010
|
],
|
|
632
1011
|
context: {
|
|
1012
|
+
type: "token",
|
|
633
1013
|
total: 131072,
|
|
634
1014
|
maxOutput: 8192
|
|
635
1015
|
}
|
|
@@ -648,6 +1028,7 @@ var deepseek_models_default = {
|
|
|
648
1028
|
"reason"
|
|
649
1029
|
],
|
|
650
1030
|
context: {
|
|
1031
|
+
type: "token",
|
|
651
1032
|
total: 131072,
|
|
652
1033
|
maxOutput: 8192
|
|
653
1034
|
}
|
|
@@ -667,6 +1048,7 @@ var xai_models_default = {
|
|
|
667
1048
|
providers: ["xai"],
|
|
668
1049
|
can: ["chat", "text-in", "text-out", "img-in"],
|
|
669
1050
|
context: {
|
|
1051
|
+
type: "token",
|
|
670
1052
|
total: 32768,
|
|
671
1053
|
maxOutput: 4096
|
|
672
1054
|
},
|
|
@@ -680,6 +1062,7 @@ var xai_models_default = {
|
|
|
680
1062
|
providers: ["xai"],
|
|
681
1063
|
can: ["chat", "text-in", "text-out"],
|
|
682
1064
|
context: {
|
|
1065
|
+
type: "token",
|
|
683
1066
|
total: 131072,
|
|
684
1067
|
maxOutput: 4096
|
|
685
1068
|
},
|
|
@@ -693,6 +1076,7 @@ var xai_models_default = {
|
|
|
693
1076
|
providers: ["xai"],
|
|
694
1077
|
can: ["chat", "text-in", "text-out", "img-in"],
|
|
695
1078
|
context: {
|
|
1079
|
+
type: "token",
|
|
696
1080
|
total: 8192,
|
|
697
1081
|
maxOutput: 4096
|
|
698
1082
|
}
|
|
@@ -705,6 +1089,7 @@ var xai_models_default = {
|
|
|
705
1089
|
providers: ["xai"],
|
|
706
1090
|
can: ["chat", "text-in", "text-out"],
|
|
707
1091
|
context: {
|
|
1092
|
+
type: "token",
|
|
708
1093
|
total: 131072,
|
|
709
1094
|
maxOutput: 4096
|
|
710
1095
|
}
|
|
@@ -724,6 +1109,7 @@ var cohere_models_default = {
|
|
|
724
1109
|
providers: ["cohere"],
|
|
725
1110
|
can: ["chat", "text-in", "text-out", "reason", "function-out"],
|
|
726
1111
|
context: {
|
|
1112
|
+
type: "token",
|
|
727
1113
|
total: 128e3,
|
|
728
1114
|
maxOutput: 4096
|
|
729
1115
|
}
|
|
@@ -736,6 +1122,7 @@ var cohere_models_default = {
|
|
|
736
1122
|
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
737
1123
|
can: ["chat", "text-in", "text-out", "reason", "function-out"],
|
|
738
1124
|
context: {
|
|
1125
|
+
type: "token",
|
|
739
1126
|
total: 128e3,
|
|
740
1127
|
maxOutput: 4096
|
|
741
1128
|
},
|
|
@@ -749,6 +1136,7 @@ var cohere_models_default = {
|
|
|
749
1136
|
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
750
1137
|
can: ["chat", "text-in", "text-out", "reason", "function-out"],
|
|
751
1138
|
context: {
|
|
1139
|
+
type: "token",
|
|
752
1140
|
total: 128e3,
|
|
753
1141
|
maxOutput: 4096
|
|
754
1142
|
},
|
|
@@ -762,6 +1150,7 @@ var cohere_models_default = {
|
|
|
762
1150
|
providers: ["cohere", "bedrock", "oracle"],
|
|
763
1151
|
can: ["chat", "text-in", "text-out"],
|
|
764
1152
|
context: {
|
|
1153
|
+
type: "token",
|
|
765
1154
|
total: 4096,
|
|
766
1155
|
maxOutput: 4096
|
|
767
1156
|
}
|
|
@@ -774,6 +1163,7 @@ var cohere_models_default = {
|
|
|
774
1163
|
providers: ["cohere", "bedrock", "oracle"],
|
|
775
1164
|
can: ["chat", "text-in", "text-out"],
|
|
776
1165
|
context: {
|
|
1166
|
+
type: "token",
|
|
777
1167
|
total: 4096,
|
|
778
1168
|
maxOutput: 4096
|
|
779
1169
|
}
|
|
@@ -786,6 +1176,7 @@ var cohere_models_default = {
|
|
|
786
1176
|
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
787
1177
|
can: ["text-in", "img-in", "vectors-out"],
|
|
788
1178
|
context: {
|
|
1179
|
+
type: "token",
|
|
789
1180
|
total: 512,
|
|
790
1181
|
maxOutput: 1024
|
|
791
1182
|
}
|
|
@@ -798,6 +1189,7 @@ var cohere_models_default = {
|
|
|
798
1189
|
providers: ["cohere", "oracle"],
|
|
799
1190
|
can: ["text-in", "img-in", "vectors-out"],
|
|
800
1191
|
context: {
|
|
1192
|
+
type: "token",
|
|
801
1193
|
total: 512,
|
|
802
1194
|
maxOutput: 384
|
|
803
1195
|
}
|
|
@@ -810,6 +1202,7 @@ var cohere_models_default = {
|
|
|
810
1202
|
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
811
1203
|
can: ["text-in", "img-in", "vectors-out"],
|
|
812
1204
|
context: {
|
|
1205
|
+
type: "token",
|
|
813
1206
|
total: 512,
|
|
814
1207
|
maxOutput: 1024
|
|
815
1208
|
}
|
|
@@ -822,6 +1215,7 @@ var cohere_models_default = {
|
|
|
822
1215
|
providers: ["cohere", "oracle"],
|
|
823
1216
|
can: ["text-in", "img-in", "vectors-out"],
|
|
824
1217
|
context: {
|
|
1218
|
+
type: "token",
|
|
825
1219
|
total: 512,
|
|
826
1220
|
maxOutput: 384
|
|
827
1221
|
}
|
|
@@ -834,6 +1228,7 @@ var cohere_models_default = {
|
|
|
834
1228
|
providers: ["cohere", "bedrock", "azure"],
|
|
835
1229
|
can: ["text-in", "text-out"],
|
|
836
1230
|
context: {
|
|
1231
|
+
type: "token",
|
|
837
1232
|
total: 4096,
|
|
838
1233
|
maxOutput: null
|
|
839
1234
|
}
|
|
@@ -846,6 +1241,7 @@ var cohere_models_default = {
|
|
|
846
1241
|
providers: ["cohere", "azure"],
|
|
847
1242
|
can: ["text-in", "text-out"],
|
|
848
1243
|
context: {
|
|
1244
|
+
type: "token",
|
|
849
1245
|
total: 4096,
|
|
850
1246
|
maxOutput: null
|
|
851
1247
|
}
|
|
@@ -858,6 +1254,7 @@ var cohere_models_default = {
|
|
|
858
1254
|
providers: ["cohere", "azure"],
|
|
859
1255
|
can: ["text-in", "text-out"],
|
|
860
1256
|
context: {
|
|
1257
|
+
type: "token",
|
|
861
1258
|
total: 4096,
|
|
862
1259
|
maxOutput: null
|
|
863
1260
|
}
|
|
@@ -877,6 +1274,19 @@ function validateModel(raw) {
|
|
|
877
1274
|
throw new Error(`Model ${field} must be a string`);
|
|
878
1275
|
}
|
|
879
1276
|
}
|
|
1277
|
+
if (model.extends !== void 0 && typeof model.extends !== "string") {
|
|
1278
|
+
throw new Error("Model extends must be a string");
|
|
1279
|
+
}
|
|
1280
|
+
if (model.overrides !== void 0) {
|
|
1281
|
+
if (typeof model.overrides !== "object" || model.overrides === null) {
|
|
1282
|
+
throw new Error("Model overrides must be an object");
|
|
1283
|
+
}
|
|
1284
|
+
const validOverrideFields = ["name", "creator", "license", "providers", "can", "languages", "aliases", "context"];
|
|
1285
|
+
const invalidFields = Object.keys(model.overrides).filter((field) => !validOverrideFields.includes(field));
|
|
1286
|
+
if (invalidFields.length > 0) {
|
|
1287
|
+
throw new Error(`Invalid override fields: ${invalidFields.join(", ")}`);
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
880
1290
|
if (!Array.isArray(model.providers)) {
|
|
881
1291
|
throw new Error("Model providers must be an array");
|
|
882
1292
|
}
|
|
@@ -918,6 +1328,16 @@ function validateModel(raw) {
|
|
|
918
1328
|
if (typeof context.maxOutput !== "number") {
|
|
919
1329
|
throw new Error("Image model context.maxOutput must be a number");
|
|
920
1330
|
}
|
|
1331
|
+
} else if (context.type === "embedding") {
|
|
1332
|
+
if (typeof context.total !== "number") {
|
|
1333
|
+
throw new Error("Embedding model context.total must be a number");
|
|
1334
|
+
}
|
|
1335
|
+
if (typeof context.unit !== "string") {
|
|
1336
|
+
throw new Error("Embedding model context.unit must be a string");
|
|
1337
|
+
}
|
|
1338
|
+
if (typeof context.dimensions !== "number") {
|
|
1339
|
+
throw new Error("Embedding model context.dimensions must be a number");
|
|
1340
|
+
}
|
|
921
1341
|
} else {
|
|
922
1342
|
if (typeof context.total !== "number" && context.total !== null) {
|
|
923
1343
|
throw new Error("Token model context.total must be a number or null");
|
|
@@ -935,9 +1355,42 @@ function validateModel(raw) {
|
|
|
935
1355
|
can: model.can,
|
|
936
1356
|
context: model.context,
|
|
937
1357
|
...model.languages ? { languages: model.languages } : {},
|
|
938
|
-
...model.aliases ? { aliases: model.aliases } : {}
|
|
1358
|
+
...model.aliases ? { aliases: model.aliases } : {},
|
|
1359
|
+
...model.extends ? { extends: model.extends } : {},
|
|
1360
|
+
...model.overrides ? { overrides: model.overrides } : {}
|
|
939
1361
|
};
|
|
940
1362
|
}
|
|
1363
|
+
function resolveModel(model, allModels2, visited = /* @__PURE__ */ new Set()) {
|
|
1364
|
+
if (!model.extends) {
|
|
1365
|
+
return model;
|
|
1366
|
+
}
|
|
1367
|
+
if (visited.has(model.id)) {
|
|
1368
|
+
throw new Error(`Circular dependency detected for model ${model.id}`);
|
|
1369
|
+
}
|
|
1370
|
+
visited.add(model.id);
|
|
1371
|
+
const baseModel = allModels2[model.extends];
|
|
1372
|
+
if (!baseModel) {
|
|
1373
|
+
throw new Error(`Base model ${model.extends} not found for ${model.id}`);
|
|
1374
|
+
}
|
|
1375
|
+
const resolvedBase = resolveModel(baseModel, allModels2, visited);
|
|
1376
|
+
if (!model.overrides) {
|
|
1377
|
+
return {
|
|
1378
|
+
...resolvedBase,
|
|
1379
|
+
id: model.id,
|
|
1380
|
+
extends: model.extends
|
|
1381
|
+
};
|
|
1382
|
+
}
|
|
1383
|
+
const resolved = {
|
|
1384
|
+
...resolvedBase,
|
|
1385
|
+
...model.overrides,
|
|
1386
|
+
id: model.id,
|
|
1387
|
+
extends: model.extends
|
|
1388
|
+
};
|
|
1389
|
+
if (!resolved.name || !resolved.creator || !resolved.license || !resolved.providers || !resolved.can || !resolved.context) {
|
|
1390
|
+
throw new Error(`Missing required fields in resolved model ${model.id}`);
|
|
1391
|
+
}
|
|
1392
|
+
return resolved;
|
|
1393
|
+
}
|
|
941
1394
|
function buildAllModels() {
|
|
942
1395
|
const allModelData = [
|
|
943
1396
|
openai_models_default,
|
|
@@ -950,12 +1403,29 @@ function buildAllModels() {
|
|
|
950
1403
|
cohere_models_default
|
|
951
1404
|
];
|
|
952
1405
|
const allModels2 = allModelData.flatMap(
|
|
953
|
-
(data) => data.models.map((model) =>
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
1406
|
+
(data) => data.models.map((model) => {
|
|
1407
|
+
if (typeof model.id !== "string") {
|
|
1408
|
+
throw new Error(`Model id must be a string`);
|
|
1409
|
+
}
|
|
1410
|
+
if (model.extends !== void 0 && typeof model.extends !== "string") {
|
|
1411
|
+
throw new Error("Model extends must be a string");
|
|
1412
|
+
}
|
|
1413
|
+
if (model.overrides !== void 0 && (typeof model.overrides !== "object" || model.overrides === null)) {
|
|
1414
|
+
throw new Error("Model overrides must be an object");
|
|
1415
|
+
}
|
|
1416
|
+
return {
|
|
1417
|
+
...model,
|
|
1418
|
+
creator: data.creator
|
|
1419
|
+
};
|
|
1420
|
+
})
|
|
957
1421
|
);
|
|
958
|
-
|
|
1422
|
+
const modelMap = Object.fromEntries(
|
|
1423
|
+
allModels2.map((model) => [model.id, model])
|
|
1424
|
+
);
|
|
1425
|
+
const resolvedModels = allModels2.map(
|
|
1426
|
+
(model) => resolveModel(model, modelMap)
|
|
1427
|
+
);
|
|
1428
|
+
return resolvedModels.map((model) => validateModel(model));
|
|
959
1429
|
}
|
|
960
1430
|
|
|
961
1431
|
// src/data/providers/openai-provider.json
|
|
@@ -966,43 +1436,169 @@ var openai_provider_default = {
|
|
|
966
1436
|
apiUrl: "https://api.openai.com/v1",
|
|
967
1437
|
defaultModel: "gpt-4o",
|
|
968
1438
|
models: {
|
|
969
|
-
"
|
|
1439
|
+
"chatgpt-4o-latest": {
|
|
1440
|
+
type: "token",
|
|
1441
|
+
input: 5,
|
|
1442
|
+
output: 15
|
|
1443
|
+
},
|
|
1444
|
+
"gpt-4": {
|
|
1445
|
+
type: "token",
|
|
1446
|
+
input: 30,
|
|
1447
|
+
output: 60
|
|
1448
|
+
},
|
|
1449
|
+
"gpt-4-0613": {
|
|
1450
|
+
type: "token",
|
|
1451
|
+
input: 30,
|
|
1452
|
+
output: 60
|
|
1453
|
+
},
|
|
1454
|
+
"gpt-4-32k": {
|
|
1455
|
+
type: "token",
|
|
1456
|
+
input: 60,
|
|
1457
|
+
output: 120
|
|
1458
|
+
},
|
|
1459
|
+
"gpt-4-turbo": {
|
|
970
1460
|
type: "token",
|
|
971
|
-
input:
|
|
972
|
-
output:
|
|
1461
|
+
input: 10,
|
|
1462
|
+
output: 30
|
|
1463
|
+
},
|
|
1464
|
+
"gpt-4-turbo-2024-04-09": {
|
|
1465
|
+
type: "token",
|
|
1466
|
+
input: 10,
|
|
1467
|
+
output: 30
|
|
973
1468
|
},
|
|
974
1469
|
"gpt-3.5-turbo": {
|
|
1470
|
+
type: "token",
|
|
1471
|
+
input: 0.5,
|
|
1472
|
+
output: 1.5
|
|
1473
|
+
},
|
|
1474
|
+
"gpt-3.5-turbo-0125": {
|
|
1475
|
+
type: "token",
|
|
1476
|
+
input: 0.5,
|
|
1477
|
+
output: 1.5
|
|
1478
|
+
},
|
|
1479
|
+
"gpt-3.5-turbo-instruct": {
|
|
1480
|
+
type: "token",
|
|
1481
|
+
input: 1.5,
|
|
1482
|
+
output: 2
|
|
1483
|
+
},
|
|
1484
|
+
"gpt-3.5-turbo-16k-0613": {
|
|
1485
|
+
type: "token",
|
|
1486
|
+
input: 3,
|
|
1487
|
+
output: 4
|
|
1488
|
+
},
|
|
1489
|
+
"davinci-002": {
|
|
1490
|
+
type: "token",
|
|
1491
|
+
input: 2,
|
|
1492
|
+
output: 2
|
|
1493
|
+
},
|
|
1494
|
+
"babbage-002": {
|
|
1495
|
+
type: "token",
|
|
1496
|
+
input: 0.4,
|
|
1497
|
+
output: 0.4
|
|
1498
|
+
},
|
|
1499
|
+
"gpt-4o": {
|
|
1500
|
+
type: "token",
|
|
1501
|
+
input: 2.5,
|
|
1502
|
+
input_cached: 1.25,
|
|
1503
|
+
output: 10
|
|
1504
|
+
},
|
|
1505
|
+
"gpt-4o-2024-08-06": {
|
|
1506
|
+
type: "token",
|
|
1507
|
+
input: 2.5,
|
|
1508
|
+
input_cached: 1.25,
|
|
1509
|
+
output: 10
|
|
1510
|
+
},
|
|
1511
|
+
"gpt-4o-audio-preview": {
|
|
1512
|
+
type: "token",
|
|
1513
|
+
input: 2.5,
|
|
1514
|
+
output: 10
|
|
1515
|
+
},
|
|
1516
|
+
"gpt-4o-audio-preview-2024-12-17": {
|
|
1517
|
+
type: "token",
|
|
1518
|
+
input: 2.5,
|
|
1519
|
+
output: 10
|
|
1520
|
+
},
|
|
1521
|
+
"gpt-4o-realtime-preview": {
|
|
975
1522
|
type: "token",
|
|
976
1523
|
input: 5,
|
|
1524
|
+
input_cached: 2.5,
|
|
977
1525
|
output: 20
|
|
978
1526
|
},
|
|
979
|
-
"gpt-4o-
|
|
1527
|
+
"gpt-4o-realtime-preview-2024-12-17": {
|
|
1528
|
+
type: "token",
|
|
1529
|
+
input: 5,
|
|
1530
|
+
input_cached: 2.5,
|
|
1531
|
+
output: 20
|
|
1532
|
+
},
|
|
1533
|
+
"gpt-4o-mini": {
|
|
1534
|
+
type: "token",
|
|
1535
|
+
input: 0.15,
|
|
1536
|
+
input_cached: 0.075,
|
|
1537
|
+
output: 0.6
|
|
1538
|
+
},
|
|
1539
|
+
"gpt-4o-mini-2024-07-18": {
|
|
1540
|
+
type: "token",
|
|
1541
|
+
input: 0.15,
|
|
1542
|
+
input_cached: 0.075,
|
|
1543
|
+
output: 0.6
|
|
1544
|
+
},
|
|
1545
|
+
"gpt-4o-mini-audio-preview": {
|
|
1546
|
+
type: "token",
|
|
1547
|
+
input: 0.15,
|
|
1548
|
+
output: 0.6
|
|
1549
|
+
},
|
|
1550
|
+
"gpt-4o-mini-audio-preview-2024-12-17": {
|
|
1551
|
+
type: "token",
|
|
1552
|
+
input: 0.15,
|
|
1553
|
+
output: 0.6
|
|
1554
|
+
},
|
|
1555
|
+
"gpt-4o-mini-realtime-preview": {
|
|
1556
|
+
type: "token",
|
|
1557
|
+
input: 0.6,
|
|
1558
|
+
input_cached: 0.3,
|
|
1559
|
+
output: 2.4
|
|
1560
|
+
},
|
|
1561
|
+
"gpt-4o-mini-realtime-preview-2024-12-17": {
|
|
1562
|
+
type: "token",
|
|
1563
|
+
input: 0.6,
|
|
1564
|
+
input_cached: 0.3,
|
|
1565
|
+
output: 2.4
|
|
1566
|
+
},
|
|
1567
|
+
o1: {
|
|
980
1568
|
type: "token",
|
|
981
1569
|
input: 15,
|
|
982
1570
|
input_cached: 7.5,
|
|
983
1571
|
output: 60
|
|
984
1572
|
},
|
|
985
|
-
"o1-
|
|
1573
|
+
"o1-2024-12-17": {
|
|
986
1574
|
type: "token",
|
|
987
|
-
input:
|
|
988
|
-
input_cached:
|
|
989
|
-
output:
|
|
1575
|
+
input: 15,
|
|
1576
|
+
input_cached: 7.5,
|
|
1577
|
+
output: 60
|
|
990
1578
|
},
|
|
991
1579
|
"o3-mini": {
|
|
992
1580
|
type: "token",
|
|
993
|
-
input:
|
|
994
|
-
input_cached:
|
|
995
|
-
output:
|
|
1581
|
+
input: 1.1,
|
|
1582
|
+
input_cached: 0.55,
|
|
1583
|
+
output: 4.4
|
|
996
1584
|
},
|
|
997
|
-
"
|
|
1585
|
+
"o3-mini-2025-01-31": {
|
|
1586
|
+
type: "token",
|
|
1587
|
+
input: 1.1,
|
|
1588
|
+
input_cached: 0.55,
|
|
1589
|
+
output: 4.4
|
|
1590
|
+
},
|
|
1591
|
+
"o1-mini": {
|
|
998
1592
|
type: "token",
|
|
999
|
-
input:
|
|
1000
|
-
|
|
1593
|
+
input: 1.1,
|
|
1594
|
+
input_cached: 0.55,
|
|
1595
|
+
output: 4.4
|
|
1001
1596
|
},
|
|
1002
|
-
"
|
|
1597
|
+
"o1-mini-2024-09-12": {
|
|
1003
1598
|
type: "token",
|
|
1004
|
-
input:
|
|
1005
|
-
|
|
1599
|
+
input: 1.1,
|
|
1600
|
+
input_cached: 0.55,
|
|
1601
|
+
output: 4.4
|
|
1006
1602
|
},
|
|
1007
1603
|
"whisper-1": {
|
|
1008
1604
|
type: "minute",
|
|
@@ -1055,22 +1651,37 @@ var anthropic_provider_default = {
|
|
|
1055
1651
|
name: "Anthropic",
|
|
1056
1652
|
websiteUrl: "https://www.anthropic.com/",
|
|
1057
1653
|
apiUrl: "https://api.anthropic.com/v1",
|
|
1058
|
-
defaultModel: "claude-3-sonnet",
|
|
1654
|
+
defaultModel: "claude-3-5-sonnet-20241022",
|
|
1059
1655
|
models: {
|
|
1060
|
-
"claude-3-opus": {
|
|
1656
|
+
"claude-3-opus-20240229": {
|
|
1061
1657
|
type: "token",
|
|
1062
1658
|
input: 15,
|
|
1063
1659
|
output: 75
|
|
1064
1660
|
},
|
|
1065
|
-
"claude-3-sonnet": {
|
|
1661
|
+
"claude-3-sonnet-20240229": {
|
|
1066
1662
|
type: "token",
|
|
1067
1663
|
input: 3,
|
|
1068
1664
|
output: 15
|
|
1069
1665
|
},
|
|
1070
|
-
"claude-3-haiku": {
|
|
1666
|
+
"claude-3-haiku-20240307": {
|
|
1071
1667
|
type: "token",
|
|
1072
|
-
input:
|
|
1073
|
-
output:
|
|
1668
|
+
input: 0.25,
|
|
1669
|
+
output: 1.25
|
|
1670
|
+
},
|
|
1671
|
+
"claude-3-5-sonnet-20241022": {
|
|
1672
|
+
type: "token",
|
|
1673
|
+
input: 3,
|
|
1674
|
+
output: 15
|
|
1675
|
+
},
|
|
1676
|
+
"claude-3-5-sonnet-20240620": {
|
|
1677
|
+
type: "token",
|
|
1678
|
+
input: 3,
|
|
1679
|
+
output: 15
|
|
1680
|
+
},
|
|
1681
|
+
"claude-3-5-haiku-20241022": {
|
|
1682
|
+
type: "token",
|
|
1683
|
+
input: 0.8,
|
|
1684
|
+
output: 4
|
|
1074
1685
|
}
|
|
1075
1686
|
}
|
|
1076
1687
|
};
|
|
@@ -1203,7 +1814,10 @@ var AIModels = class _AIModels extends ModelCollection {
|
|
|
1203
1814
|
}
|
|
1204
1815
|
/** Get all providers that can serve a specific model */
|
|
1205
1816
|
getProvidersForModel(modelId) {
|
|
1206
|
-
|
|
1817
|
+
let model = this.id(modelId);
|
|
1818
|
+
if (!model) {
|
|
1819
|
+
model = this.find((m) => m.aliases?.includes(modelId));
|
|
1820
|
+
}
|
|
1207
1821
|
if (!model) return [];
|
|
1208
1822
|
return providersData.providers.filter(
|
|
1209
1823
|
(p) => model.providers.includes(p.id)
|