@just-every/ensemble 0.1.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.
Files changed (127) hide show
  1. package/README.md +245 -0
  2. package/dist/cost_tracker.d.ts +2 -0
  3. package/dist/cost_tracker.d.ts.map +1 -0
  4. package/dist/cost_tracker.js +2 -0
  5. package/dist/cost_tracker.js.map +1 -0
  6. package/dist/errors.d.ts +55 -0
  7. package/dist/errors.d.ts.map +1 -0
  8. package/dist/errors.js +134 -0
  9. package/dist/errors.js.map +1 -0
  10. package/dist/external_models.d.ts +10 -0
  11. package/dist/external_models.d.ts.map +1 -0
  12. package/dist/external_models.js +36 -0
  13. package/dist/external_models.js.map +1 -0
  14. package/dist/index.d.ts +31 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +47 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/model_data.d.ts +63 -0
  19. package/dist/model_data.d.ts.map +1 -0
  20. package/dist/model_data.js +1070 -0
  21. package/dist/model_data.js.map +1 -0
  22. package/dist/model_providers/base_provider.d.ts +37 -0
  23. package/dist/model_providers/base_provider.d.ts.map +1 -0
  24. package/dist/model_providers/base_provider.js +146 -0
  25. package/dist/model_providers/base_provider.js.map +1 -0
  26. package/dist/model_providers/claude.d.ts +11 -0
  27. package/dist/model_providers/claude.d.ts.map +1 -0
  28. package/dist/model_providers/claude.js +788 -0
  29. package/dist/model_providers/claude.js.map +1 -0
  30. package/dist/model_providers/deepseek.d.ts +8 -0
  31. package/dist/model_providers/deepseek.d.ts.map +1 -0
  32. package/dist/model_providers/deepseek.js +136 -0
  33. package/dist/model_providers/deepseek.js.map +1 -0
  34. package/dist/model_providers/gemini.d.ts +11 -0
  35. package/dist/model_providers/gemini.d.ts.map +1 -0
  36. package/dist/model_providers/gemini.js +711 -0
  37. package/dist/model_providers/gemini.js.map +1 -0
  38. package/dist/model_providers/grok.d.ts +8 -0
  39. package/dist/model_providers/grok.d.ts.map +1 -0
  40. package/dist/model_providers/grok.js +22 -0
  41. package/dist/model_providers/grok.js.map +1 -0
  42. package/dist/model_providers/model_provider.d.ts +11 -0
  43. package/dist/model_providers/model_provider.d.ts.map +1 -0
  44. package/dist/model_providers/model_provider.js +170 -0
  45. package/dist/model_providers/model_provider.js.map +1 -0
  46. package/dist/model_providers/openai.d.ts +13 -0
  47. package/dist/model_providers/openai.d.ts.map +1 -0
  48. package/dist/model_providers/openai.js +822 -0
  49. package/dist/model_providers/openai.js.map +1 -0
  50. package/dist/model_providers/openai_chat.d.ts +14 -0
  51. package/dist/model_providers/openai_chat.d.ts.map +1 -0
  52. package/dist/model_providers/openai_chat.js +719 -0
  53. package/dist/model_providers/openai_chat.js.map +1 -0
  54. package/dist/model_providers/openrouter.d.ts +6 -0
  55. package/dist/model_providers/openrouter.d.ts.map +1 -0
  56. package/dist/model_providers/openrouter.js +18 -0
  57. package/dist/model_providers/openrouter.js.map +1 -0
  58. package/dist/model_providers/refactored_openai.d.ts +22 -0
  59. package/dist/model_providers/refactored_openai.d.ts.map +1 -0
  60. package/dist/model_providers/refactored_openai.js +310 -0
  61. package/dist/model_providers/refactored_openai.js.map +1 -0
  62. package/dist/model_providers/test_provider.d.ts +27 -0
  63. package/dist/model_providers/test_provider.d.ts.map +1 -0
  64. package/dist/model_providers/test_provider.js +185 -0
  65. package/dist/model_providers/test_provider.js.map +1 -0
  66. package/dist/tsconfig.tsbuildinfo +1 -0
  67. package/dist/types/api_types.d.ts +249 -0
  68. package/dist/types/api_types.d.ts.map +1 -0
  69. package/dist/types/api_types.js +2 -0
  70. package/dist/types/api_types.js.map +1 -0
  71. package/dist/types/extended_types.d.ts +43 -0
  72. package/dist/types/extended_types.d.ts.map +1 -0
  73. package/dist/types/extended_types.js +2 -0
  74. package/dist/types/extended_types.js.map +1 -0
  75. package/dist/types.d.ts +301 -0
  76. package/dist/types.d.ts.map +1 -0
  77. package/dist/types.js +2 -0
  78. package/dist/types.js.map +1 -0
  79. package/dist/utils/async_queue.d.ts +14 -0
  80. package/dist/utils/async_queue.d.ts.map +1 -0
  81. package/dist/utils/async_queue.js +68 -0
  82. package/dist/utils/async_queue.js.map +1 -0
  83. package/dist/utils/cache.d.ts +60 -0
  84. package/dist/utils/cache.d.ts.map +1 -0
  85. package/dist/utils/cache.js +205 -0
  86. package/dist/utils/cache.js.map +1 -0
  87. package/dist/utils/communication.d.ts +3 -0
  88. package/dist/utils/communication.d.ts.map +1 -0
  89. package/dist/utils/communication.js +8 -0
  90. package/dist/utils/communication.js.map +1 -0
  91. package/dist/utils/cost_tracker.d.ts +26 -0
  92. package/dist/utils/cost_tracker.d.ts.map +1 -0
  93. package/dist/utils/cost_tracker.js +177 -0
  94. package/dist/utils/cost_tracker.js.map +1 -0
  95. package/dist/utils/delta_buffer.d.ts +14 -0
  96. package/dist/utils/delta_buffer.d.ts.map +1 -0
  97. package/dist/utils/delta_buffer.js +60 -0
  98. package/dist/utils/delta_buffer.js.map +1 -0
  99. package/dist/utils/image_to_text.d.ts +3 -0
  100. package/dist/utils/image_to_text.d.ts.map +1 -0
  101. package/dist/utils/image_to_text.js +81 -0
  102. package/dist/utils/image_to_text.js.map +1 -0
  103. package/dist/utils/image_utils.d.ts +18 -0
  104. package/dist/utils/image_utils.d.ts.map +1 -0
  105. package/dist/utils/image_utils.js +132 -0
  106. package/dist/utils/image_utils.js.map +1 -0
  107. package/dist/utils/llm_logger.d.ts +8 -0
  108. package/dist/utils/llm_logger.d.ts.map +1 -0
  109. package/dist/utils/llm_logger.js +24 -0
  110. package/dist/utils/llm_logger.js.map +1 -0
  111. package/dist/utils/quota_tracker.d.ts +22 -0
  112. package/dist/utils/quota_tracker.d.ts.map +1 -0
  113. package/dist/utils/quota_tracker.js +338 -0
  114. package/dist/utils/quota_tracker.js.map +1 -0
  115. package/dist/utils/stream_converter.d.ts +19 -0
  116. package/dist/utils/stream_converter.d.ts.map +1 -0
  117. package/dist/utils/stream_converter.js +172 -0
  118. package/dist/utils/stream_converter.js.map +1 -0
  119. package/dist/validation.d.ts +1789 -0
  120. package/dist/validation.d.ts.map +1 -0
  121. package/dist/validation.js +289 -0
  122. package/dist/validation.js.map +1 -0
  123. package/dist/vitest.config.d.ts +3 -0
  124. package/dist/vitest.config.d.ts.map +1 -0
  125. package/dist/vitest.config.js +34 -0
  126. package/dist/vitest.config.js.map +1 -0
  127. package/package.json +86 -0
@@ -0,0 +1,1070 @@
1
+ import { getExternalModel } from './external_models.js';
2
+ export const MODEL_CLASSES = {
3
+ standard: {
4
+ models: [
5
+ 'gpt-4.1',
6
+ 'gemini-2.5-flash-preview-05-20-low',
7
+ 'claude-3-5-haiku-latest',
8
+ 'grok-3-mini-fast',
9
+ 'deepseek-chat',
10
+ ],
11
+ random: true,
12
+ },
13
+ mini: {
14
+ models: [
15
+ 'gpt-4.1-nano',
16
+ 'claude-3-5-haiku-latest',
17
+ 'gemini-2.0-flash-lite',
18
+ 'grok-3-mini',
19
+ 'meta-llama/llama-4-scout',
20
+ 'mistral/ministral-8b',
21
+ ],
22
+ random: true,
23
+ },
24
+ reasoning: {
25
+ models: [
26
+ 'gemini-2.5-pro-preview-05-06',
27
+ 'gemini-2.5-flash-preview-05-20-max',
28
+ 'o4-mini-high',
29
+ 'o3-high',
30
+ 'claude-3-7-sonnet-latest',
31
+ ],
32
+ random: true,
33
+ },
34
+ reasoning_mini: {
35
+ models: [
36
+ 'gemini-2.5-flash-preview-05-20-medium',
37
+ 'grok-3-mini-fast',
38
+ ],
39
+ random: true,
40
+ },
41
+ monologue: {
42
+ models: [
43
+ 'gemini-2.5-pro-preview-05-06',
44
+ 'gemini-2.5-flash-preview-05-20-medium',
45
+ 'o4-mini-low',
46
+ 'o3-low',
47
+ 'claude-3-7-sonnet-latest',
48
+ 'grok-3-mini-fast',
49
+ ],
50
+ random: true,
51
+ },
52
+ metacognition: {
53
+ models: [
54
+ 'gemini-2.5-pro-preview-05-06',
55
+ 'gemini-2.5-flash-preview-05-20-high',
56
+ 'o3-medium',
57
+ 'claude-3-7-sonnet-latest',
58
+ 'grok-3-mini-fast',
59
+ ],
60
+ random: true,
61
+ },
62
+ code: {
63
+ models: [
64
+ 'claude-3-7-sonnet-latest',
65
+ 'gpt-4.1',
66
+ 'gemini-2.5-flash-preview-05-20-medium',
67
+ ],
68
+ random: true,
69
+ },
70
+ writing: {
71
+ models: [
72
+ 'gemini-2.5-flash-preview-05-20-low',
73
+ 'gpt-4.1-mini',
74
+ ],
75
+ random: true,
76
+ },
77
+ summary: {
78
+ models: [
79
+ 'gemini-2.5-flash-preview-05-20-low',
80
+ 'gpt-4.1-mini',
81
+ ],
82
+ random: true,
83
+ },
84
+ vision: {
85
+ models: [
86
+ 'o4-mini-medium',
87
+ 'o3-low',
88
+ 'gemini-2.5-flash-preview-05-20-max',
89
+ 'gemini-2.5-pro-preview-05-06',
90
+ 'claude-3-7-sonnet-latest',
91
+ ],
92
+ random: true,
93
+ },
94
+ vision_mini: {
95
+ models: [
96
+ 'gpt-4.1-mini',
97
+ 'gemini-2.5-flash-preview-05-20-low',
98
+ ],
99
+ random: true,
100
+ },
101
+ search: {
102
+ models: [
103
+ 'gpt-4.1',
104
+ 'deepseek-reasoner',
105
+ 'gemini-2.5-flash-preview-05-20',
106
+ 'perplexity/sonar-deep-research',
107
+ ],
108
+ random: true,
109
+ },
110
+ image_generation: {
111
+ models: ['gpt-image-1'],
112
+ },
113
+ embedding: {
114
+ models: [
115
+ 'gemini-embedding-exp-03-07',
116
+ 'text-embedding-3-small',
117
+ ],
118
+ description: 'Vector embedding models for semantic search and RAG',
119
+ },
120
+ };
121
+ export const EMBEDDING_DIMENSIONS = {
122
+ 'text-embedding-3-small': 1536,
123
+ 'text-embedding-3-large': 3072,
124
+ 'gemini-embedding-exp-03-07': 768,
125
+ };
126
+ export const MODEL_REGISTRY = [
127
+ {
128
+ id: 'text-embedding-3-small',
129
+ provider: 'openai',
130
+ cost: {
131
+ input_per_million: 0.02,
132
+ output_per_million: 0,
133
+ },
134
+ features: {
135
+ input_modality: ['text'],
136
+ output_modality: ['embedding'],
137
+ },
138
+ embedding: true,
139
+ dim: 1536,
140
+ class: 'embedding',
141
+ description: "OpenAI's small embedding model, good balance of performance and cost",
142
+ },
143
+ {
144
+ id: 'text-embedding-3-large',
145
+ provider: 'openai',
146
+ cost: {
147
+ input_per_million: 0.13,
148
+ output_per_million: 0,
149
+ },
150
+ features: {
151
+ input_modality: ['text'],
152
+ output_modality: ['embedding'],
153
+ },
154
+ embedding: true,
155
+ dim: 3072,
156
+ class: 'embedding',
157
+ description: "OpenAI's large embedding model, good balance of performance and cost",
158
+ },
159
+ {
160
+ id: 'gemini-embedding-exp-03-07',
161
+ provider: 'google',
162
+ cost: {
163
+ input_per_million: 0,
164
+ output_per_million: 0,
165
+ },
166
+ features: {
167
+ input_modality: ['text'],
168
+ output_modality: ['embedding'],
169
+ },
170
+ embedding: true,
171
+ dim: 768,
172
+ class: 'embedding',
173
+ description: "Google's experimental embedding model optimized for semantic similarity",
174
+ },
175
+ {
176
+ id: 'meta-llama/llama-4-maverick',
177
+ provider: 'openrouter',
178
+ cost: {
179
+ input_per_million: 0.18,
180
+ output_per_million: 0.6,
181
+ },
182
+ features: {
183
+ context_length: 1048576,
184
+ input_modality: ['text', 'image'],
185
+ output_modality: ['text'],
186
+ tool_use: true,
187
+ streaming: true,
188
+ json_output: true,
189
+ },
190
+ class: 'standard',
191
+ score: 78,
192
+ scores: {
193
+ monologue: 72,
194
+ code: 64,
195
+ reasoning: 56,
196
+ },
197
+ description: 'Llama 4 Maverick 17B Instruct (128E) is a high-capacity multimodal language model from Meta, built on a mixture-of-experts (MoE) architecture with 128 experts and 17 billion active parameters per forward pass (400B total).',
198
+ },
199
+ {
200
+ id: 'meta-llama/llama-4-scout',
201
+ provider: 'openrouter',
202
+ cost: {
203
+ input_per_million: 0.08,
204
+ output_per_million: 0.3,
205
+ },
206
+ features: {
207
+ context_length: 327680,
208
+ input_modality: ['text'],
209
+ output_modality: ['text'],
210
+ tool_use: true,
211
+ streaming: true,
212
+ json_output: true,
213
+ },
214
+ class: 'mini',
215
+ score: 65,
216
+ description: 'Llama 4 Scout 17B Instruct (16E) is a mixture-of-experts (MoE) language model developed by Meta, activating 17 billion parameters out of a total of 109B.',
217
+ },
218
+ {
219
+ id: 'qwen/qwen3-235b-a22b',
220
+ aliases: [
221
+ 'qwen/qwen3-235b-a22b-low',
222
+ 'qwen/qwen3-235b-a22b-medium',
223
+ 'qwen/qwen3-235b-a22b-high',
224
+ ],
225
+ provider: 'openrouter',
226
+ cost: {
227
+ input_per_million: 0.1,
228
+ output_per_million: 0.1,
229
+ },
230
+ features: {
231
+ context_length: 40960,
232
+ input_modality: ['text'],
233
+ output_modality: ['text'],
234
+ tool_use: true,
235
+ streaming: true,
236
+ json_output: true,
237
+ },
238
+ class: 'reasoning',
239
+ score: 83,
240
+ scores: {
241
+ monologue: 73,
242
+ code: 62,
243
+ reasoning: 57,
244
+ },
245
+ description: 'Qwen3-235B-A22B is a 235B parameter mixture-of-experts (MoE) model developed by Qwen, activating 22B parameters per forward pass.',
246
+ },
247
+ {
248
+ id: 'qwen/qwen-max',
249
+ provider: 'openrouter',
250
+ cost: {
251
+ input_per_million: 1.6,
252
+ output_per_million: 6.4,
253
+ },
254
+ features: {
255
+ context_length: 131072,
256
+ input_modality: ['text', 'image'],
257
+ output_modality: ['text'],
258
+ tool_use: true,
259
+ streaming: true,
260
+ json_output: true,
261
+ },
262
+ class: 'reasoning',
263
+ score: 80,
264
+ scores: {
265
+ monologue: 73,
266
+ code: 61,
267
+ reasoning: 57,
268
+ },
269
+ description: 'Qwen-Max, based on Qwen2.5, provides the best inference performance among Qwen models, especially for complex multi-step tasks.',
270
+ },
271
+ {
272
+ id: 'mistral/ministral-8b',
273
+ provider: 'openrouter',
274
+ cost: {
275
+ input_per_million: 0.1,
276
+ output_per_million: 0.1,
277
+ },
278
+ features: {
279
+ context_length: 131072,
280
+ input_modality: ['text'],
281
+ output_modality: ['text'],
282
+ tool_use: true,
283
+ streaming: true,
284
+ json_output: true,
285
+ },
286
+ class: 'standard',
287
+ score: 55,
288
+ description: 'Ministral 8B is a state-of-the-art language model optimized for on-device and edge computing. Designed for efficiency in knowledge-intensive tasks, commonsense reasoning, and function-calling.',
289
+ },
290
+ {
291
+ id: 'grok-3',
292
+ aliases: ['grok-3-2025-02-11'],
293
+ provider: 'xai',
294
+ cost: {
295
+ input_per_million: 3.0,
296
+ output_per_million: 15.0,
297
+ },
298
+ features: {
299
+ context_length: 131_072,
300
+ input_modality: ['text', 'image'],
301
+ output_modality: ['text'],
302
+ tool_use: true,
303
+ streaming: true,
304
+ json_output: true,
305
+ },
306
+ class: 'standard',
307
+ score: 78,
308
+ scores: {
309
+ monologue: 80,
310
+ code: 70,
311
+ reasoning: 65,
312
+ },
313
+ description: 'Flagship Grok-3 model for complex reasoning and generation',
314
+ },
315
+ {
316
+ id: 'grok-3-fast',
317
+ aliases: ['grok-3-fast-2025-04-11'],
318
+ provider: 'xai',
319
+ cost: {
320
+ input_per_million: 5.0,
321
+ output_per_million: 25.0,
322
+ },
323
+ features: {
324
+ context_length: 131_072,
325
+ input_modality: ['text', 'image'],
326
+ output_modality: ['text'],
327
+ tool_use: true,
328
+ streaming: true,
329
+ json_output: true,
330
+ },
331
+ class: 'standard',
332
+ score: 78,
333
+ scores: {
334
+ monologue: 80,
335
+ code: 70,
336
+ reasoning: 65,
337
+ },
338
+ description: 'Same Grok-3 weights on premium infra for lower latency',
339
+ },
340
+ {
341
+ id: 'grok-3-mini',
342
+ aliases: ['grok-3-mini-2025-04-11'],
343
+ provider: 'xai',
344
+ cost: {
345
+ input_per_million: 0.3,
346
+ output_per_million: 0.5,
347
+ },
348
+ features: {
349
+ context_length: 131_072,
350
+ input_modality: ['text', 'image'],
351
+ output_modality: ['text'],
352
+ tool_use: true,
353
+ streaming: true,
354
+ json_output: true,
355
+ },
356
+ class: 'mini',
357
+ score: 60,
358
+ scores: {
359
+ monologue: 62,
360
+ code: 55,
361
+ reasoning: 50,
362
+ },
363
+ description: 'Lightweight Grok-3 Mini—budget model for logic tasks',
364
+ },
365
+ {
366
+ id: 'grok-3-mini-fast',
367
+ aliases: ['grok-3-mini-fast-2025-04-11'],
368
+ provider: 'xai',
369
+ cost: {
370
+ input_per_million: 0.6,
371
+ output_per_million: 4.0,
372
+ },
373
+ features: {
374
+ context_length: 131_072,
375
+ input_modality: ['text', 'image'],
376
+ output_modality: ['text'],
377
+ tool_use: true,
378
+ streaming: true,
379
+ json_output: true,
380
+ },
381
+ class: 'mini',
382
+ score: 60,
383
+ scores: {
384
+ monologue: 62,
385
+ code: 55,
386
+ reasoning: 50,
387
+ },
388
+ description: 'Grok-3 Mini on accelerated hardware for latency-critical use',
389
+ },
390
+ {
391
+ id: 'gpt-4.1',
392
+ aliases: ['gpt-4.1-2025-04-14'],
393
+ provider: 'openai',
394
+ cost: {
395
+ input_per_million: 2.0,
396
+ cached_input_per_million: 0.5,
397
+ output_per_million: 8.0,
398
+ },
399
+ features: {
400
+ context_length: 1048576,
401
+ input_modality: ['text', 'image'],
402
+ output_modality: ['text'],
403
+ tool_use: true,
404
+ streaming: true,
405
+ json_output: true,
406
+ },
407
+ class: 'standard',
408
+ score: 82,
409
+ scores: {
410
+ monologue: 86,
411
+ code: 83,
412
+ reasoning: 71,
413
+ },
414
+ description: 'Flagship GPT model for complex tasks',
415
+ },
416
+ {
417
+ id: 'gpt-4.1-mini',
418
+ aliases: ['gpt-4.1-mini-2025-04-14'],
419
+ provider: 'openai',
420
+ cost: {
421
+ input_per_million: 0.4,
422
+ cached_input_per_million: 0.1,
423
+ output_per_million: 1.6,
424
+ },
425
+ features: {
426
+ context_length: 1048576,
427
+ input_modality: ['text', 'image'],
428
+ output_modality: ['text'],
429
+ tool_use: true,
430
+ streaming: true,
431
+ json_output: true,
432
+ },
433
+ class: 'mini',
434
+ score: 75,
435
+ description: 'Balanced for intelligence, speed, and cost',
436
+ },
437
+ {
438
+ id: 'gpt-4.1-nano',
439
+ aliases: ['gpt-4.1-nano-2025-04-14'],
440
+ provider: 'openai',
441
+ cost: {
442
+ input_per_million: 0.1,
443
+ cached_input_per_million: 0.025,
444
+ output_per_million: 0.4,
445
+ },
446
+ features: {
447
+ context_length: 1048576,
448
+ input_modality: ['text', 'image'],
449
+ output_modality: ['text'],
450
+ tool_use: true,
451
+ streaming: true,
452
+ json_output: true,
453
+ },
454
+ class: 'mini',
455
+ score: 60,
456
+ description: 'Fastest, most cost-effective GPT-4.1 model',
457
+ },
458
+ {
459
+ id: 'gpt-4.5-preview',
460
+ aliases: ['gpt-4.5-preview-2025-02-27'],
461
+ provider: 'openai',
462
+ cost: {
463
+ input_per_million: 75.0,
464
+ cached_input_per_million: 37.5,
465
+ output_per_million: 150.0,
466
+ },
467
+ features: {
468
+ context_length: 128000,
469
+ input_modality: ['text', 'image'],
470
+ output_modality: ['text'],
471
+ tool_use: true,
472
+ streaming: true,
473
+ json_output: true,
474
+ },
475
+ class: 'standard',
476
+ description: 'Latest premium GPT model from OpenAI',
477
+ },
478
+ {
479
+ id: 'gpt-4o',
480
+ aliases: ['gpt-4o-2024-08-06'],
481
+ provider: 'openai',
482
+ cost: {
483
+ input_per_million: 2.5,
484
+ cached_input_per_million: 1.25,
485
+ output_per_million: 10.0,
486
+ },
487
+ features: {
488
+ context_length: 128000,
489
+ input_modality: ['text', 'image', 'audio'],
490
+ output_modality: ['text', 'audio'],
491
+ tool_use: true,
492
+ streaming: true,
493
+ json_output: true,
494
+ },
495
+ class: 'standard',
496
+ score: 80,
497
+ description: 'OpenAI standard model with multimodal capabilities',
498
+ },
499
+ {
500
+ id: 'gpt-4o-mini',
501
+ aliases: ['gpt-4o-mini-2024-07-18'],
502
+ provider: 'openai',
503
+ cost: {
504
+ input_per_million: 0.15,
505
+ cached_input_per_million: 0.075,
506
+ output_per_million: 0.6,
507
+ },
508
+ features: {
509
+ context_length: 128000,
510
+ input_modality: ['text', 'image', 'audio'],
511
+ output_modality: ['text', 'audio'],
512
+ tool_use: true,
513
+ streaming: true,
514
+ json_output: true,
515
+ },
516
+ class: 'mini',
517
+ score: 65,
518
+ scores: {
519
+ monologue: 70,
520
+ code: 63,
521
+ reasoning: 60,
522
+ },
523
+ description: 'Smaller, faster version of GPT-4o',
524
+ },
525
+ {
526
+ id: 'gpt-4o-search-preview',
527
+ aliases: ['gpt-4o-search-preview-2025-03-11'],
528
+ provider: 'openai',
529
+ cost: {
530
+ input_per_million: 2.5,
531
+ output_per_million: 10.0,
532
+ },
533
+ features: {
534
+ context_length: 128000,
535
+ input_modality: ['text', 'image'],
536
+ output_modality: ['text'],
537
+ tool_use: true,
538
+ streaming: true,
539
+ json_output: true,
540
+ },
541
+ class: 'search',
542
+ description: 'GPT-4o with built-in search capabilities',
543
+ },
544
+ {
545
+ id: 'gpt-4o-mini-search-preview',
546
+ aliases: ['gpt-4o-mini-search-preview-2025-03-11'],
547
+ provider: 'openai',
548
+ cost: {
549
+ input_per_million: 0.15,
550
+ output_per_million: 0.6,
551
+ },
552
+ features: {
553
+ context_length: 128000,
554
+ input_modality: ['text', 'image'],
555
+ output_modality: ['text'],
556
+ tool_use: true,
557
+ streaming: true,
558
+ json_output: true,
559
+ },
560
+ class: 'search',
561
+ description: 'Smaller GPT-4o with built-in search capabilities',
562
+ },
563
+ {
564
+ id: 'o4-mini',
565
+ aliases: [
566
+ 'o4-mini-2025-04-16',
567
+ 'o4-mini-low',
568
+ 'o4-mini-medium',
569
+ 'o4-mini-high',
570
+ ],
571
+ provider: 'openai',
572
+ cost: {
573
+ input_per_million: 1.1,
574
+ cached_input_per_million: 0.275,
575
+ output_per_million: 4.4,
576
+ },
577
+ features: {
578
+ context_length: 200000,
579
+ input_modality: ['text', 'image'],
580
+ output_modality: ['text'],
581
+ tool_use: true,
582
+ streaming: true,
583
+ json_output: true,
584
+ },
585
+ class: 'reasoning',
586
+ score: 80,
587
+ scores: {
588
+ monologue: 85,
589
+ code: 82,
590
+ reasoning: 76,
591
+ },
592
+ description: 'Faster, more affordable reasoning model',
593
+ },
594
+ {
595
+ id: 'o3',
596
+ aliases: ['o3-2025-04-16', 'o3-low', 'o3-medium', 'o3-high'],
597
+ provider: 'openai',
598
+ cost: {
599
+ input_per_million: 10,
600
+ cached_input_per_million: 2.5,
601
+ output_per_million: 40,
602
+ },
603
+ features: {
604
+ context_length: 200000,
605
+ input_modality: ['text', 'image'],
606
+ output_modality: ['text'],
607
+ tool_use: true,
608
+ streaming: true,
609
+ json_output: true,
610
+ },
611
+ class: 'reasoning',
612
+ score: 85,
613
+ scores: {
614
+ monologue: 87,
615
+ code: 84,
616
+ reasoning: 79,
617
+ },
618
+ description: 'Powerful reasoning model (superseded by o1-pro)',
619
+ },
620
+ {
621
+ id: 'o1',
622
+ aliases: ['o1-2024-12-17'],
623
+ provider: 'openai',
624
+ cost: {
625
+ input_per_million: 15.0,
626
+ cached_input_per_million: 7.5,
627
+ output_per_million: 60.0,
628
+ },
629
+ features: {
630
+ context_length: 200000,
631
+ input_modality: ['text', 'image'],
632
+ output_modality: ['text'],
633
+ tool_use: true,
634
+ streaming: true,
635
+ json_output: true,
636
+ },
637
+ class: 'reasoning',
638
+ description: 'Advanced reasoning model from OpenAI',
639
+ },
640
+ {
641
+ id: 'o1-pro',
642
+ aliases: ['o1-pro-2025-03-19'],
643
+ provider: 'openai',
644
+ cost: {
645
+ input_per_million: 150.0,
646
+ output_per_million: 600.0,
647
+ },
648
+ features: {
649
+ context_length: 200000,
650
+ input_modality: ['text', 'image'],
651
+ output_modality: ['text'],
652
+ tool_use: true,
653
+ streaming: false,
654
+ json_output: true,
655
+ },
656
+ class: 'reasoning',
657
+ score: 90,
658
+ description: 'Premium O-series model from OpenAI, highest reasoning capability',
659
+ },
660
+ {
661
+ id: 'o3-mini',
662
+ aliases: ['o3-mini-2025-01-31', 'o1-mini', 'o1-mini-2024-09-12'],
663
+ provider: 'openai',
664
+ cost: {
665
+ input_per_million: 1.1,
666
+ cached_input_per_million: 0.55,
667
+ output_per_million: 4.4,
668
+ },
669
+ features: {
670
+ context_length: 200000,
671
+ input_modality: ['text', 'image'],
672
+ output_modality: ['text'],
673
+ tool_use: true,
674
+ streaming: true,
675
+ json_output: true,
676
+ },
677
+ class: 'reasoning',
678
+ score: 70,
679
+ description: 'Smaller O-series model with reasoning capabilities',
680
+ },
681
+ {
682
+ id: 'computer-use-preview',
683
+ aliases: ['computer-use-preview-2025-03-11'],
684
+ provider: 'openai',
685
+ cost: {
686
+ input_per_million: 3.0,
687
+ output_per_million: 12.0,
688
+ },
689
+ features: {
690
+ input_modality: ['text', 'image'],
691
+ output_modality: ['text'],
692
+ tool_use: true,
693
+ streaming: true,
694
+ json_output: true,
695
+ },
696
+ class: 'vision',
697
+ description: 'Model that can understand and control computer interfaces',
698
+ },
699
+ {
700
+ id: 'claude-3-7-sonnet-latest',
701
+ aliases: ['claude-3-7-sonnet'],
702
+ provider: 'anthropic',
703
+ cost: {
704
+ input_per_million: 3.0,
705
+ output_per_million: 15.0,
706
+ cached_input_per_million: 0.3,
707
+ },
708
+ features: {
709
+ context_length: 200000,
710
+ input_modality: ['text', 'image'],
711
+ output_modality: ['text'],
712
+ tool_use: true,
713
+ streaming: true,
714
+ json_output: true,
715
+ max_output_tokens: 64000,
716
+ },
717
+ class: 'reasoning',
718
+ score: 85,
719
+ scores: {
720
+ monologue: 83,
721
+ code: 77,
722
+ reasoning: 69,
723
+ },
724
+ description: 'Latest Claude model with strong reasoning capabilities (extended thinking internal)',
725
+ },
726
+ {
727
+ id: 'claude-3-5-haiku-latest',
728
+ aliases: ['claude-3-5-haiku'],
729
+ provider: 'anthropic',
730
+ cost: {
731
+ input_per_million: 0.8,
732
+ output_per_million: 4.0,
733
+ cached_input_per_million: 0.08,
734
+ },
735
+ features: {
736
+ context_length: 200000,
737
+ input_modality: ['text', 'image'],
738
+ output_modality: ['text'],
739
+ tool_use: true,
740
+ streaming: true,
741
+ json_output: true,
742
+ max_output_tokens: 8192,
743
+ },
744
+ class: 'mini',
745
+ score: 70,
746
+ scores: {
747
+ monologue: 66,
748
+ code: 63,
749
+ reasoning: 55,
750
+ },
751
+ description: 'Fast, cost-effective Claude model',
752
+ },
753
+ {
754
+ id: 'claude-cli',
755
+ provider: 'anthropic',
756
+ cost: {
757
+ input_per_million: 3.0,
758
+ output_per_million: 15.0,
759
+ cached_input_per_million: 0.3,
760
+ },
761
+ features: {
762
+ context_length: 200000,
763
+ input_modality: ['text', 'image'],
764
+ output_modality: ['text'],
765
+ tool_use: true,
766
+ streaming: true,
767
+ json_output: true,
768
+ },
769
+ class: 'reasoning',
770
+ description: 'Claude accessed via CLI (likely uses latest Sonnet or Haiku model)',
771
+ },
772
+ {
773
+ id: 'gemini-2.5-pro-exp-03-25',
774
+ provider: 'google',
775
+ cost: {
776
+ input_per_million: 0,
777
+ output_per_million: 0,
778
+ cached_input_per_million: 0,
779
+ },
780
+ features: {
781
+ context_length: 1048576,
782
+ input_modality: ['text', 'image', 'video', 'audio'],
783
+ output_modality: ['text'],
784
+ tool_use: true,
785
+ streaming: true,
786
+ json_output: true,
787
+ max_output_tokens: 65536,
788
+ },
789
+ rate_limit_fallback: 'gemini-2.5-pro-preview-05-06',
790
+ class: 'reasoning',
791
+ score: 85,
792
+ scores: {
793
+ monologue: 78,
794
+ code: 70,
795
+ reasoning: 66,
796
+ },
797
+ description: 'Free experimental version of Gemini 2.5 Pro. Excels at coding & complex reasoning.',
798
+ },
799
+ {
800
+ id: 'gemini-2.5-pro-preview-05-06',
801
+ aliases: ['gemini-2.5-pro'],
802
+ provider: 'google',
803
+ cost: {
804
+ input_per_million: {
805
+ threshold_tokens: 200000,
806
+ price_below_threshold_per_million: 1.25,
807
+ price_above_threshold_per_million: 2.5,
808
+ },
809
+ output_per_million: {
810
+ threshold_tokens: 200000,
811
+ price_below_threshold_per_million: 10.0,
812
+ price_above_threshold_per_million: 15.0,
813
+ },
814
+ },
815
+ features: {
816
+ context_length: 1048576,
817
+ input_modality: ['text', 'image', 'video', 'audio'],
818
+ output_modality: ['text'],
819
+ tool_use: true,
820
+ streaming: true,
821
+ json_output: true,
822
+ max_output_tokens: 65536,
823
+ },
824
+ class: 'reasoning',
825
+ score: 80,
826
+ description: 'Paid preview of Gemini 2.5 Pro. State-of-the-art multipurpose model.',
827
+ },
828
+ {
829
+ id: 'gemini-2.5-flash-preview-05-20',
830
+ aliases: [
831
+ 'gemini-2.5-flash',
832
+ 'gemini-2.5-flash-preview-04-17',
833
+ 'gemini-2.5-flash-preview-05-20-low',
834
+ 'gemini-2.5-flash-preview-05-20-medium',
835
+ 'gemini-2.5-flash-preview-05-20-high',
836
+ 'gemini-2.5-flash-preview-05-20-max',
837
+ ],
838
+ provider: 'google',
839
+ cost: {
840
+ input_per_million: 0.15,
841
+ output_per_million: 3.5,
842
+ },
843
+ features: {
844
+ context_length: 1048576,
845
+ input_modality: ['text', 'image', 'video', 'audio'],
846
+ output_modality: ['text'],
847
+ tool_use: true,
848
+ streaming: true,
849
+ json_output: true,
850
+ max_output_tokens: 65536,
851
+ },
852
+ class: 'reasoning',
853
+ score: 75,
854
+ scores: {
855
+ monologue: 12,
856
+ code: 63,
857
+ reasoning: 78,
858
+ },
859
+ description: 'Balanced multimodal model with large context, built for Agents.',
860
+ },
861
+ {
862
+ id: 'gemini-2.0-flash-lite',
863
+ provider: 'google',
864
+ cost: {
865
+ input_per_million: 0.075,
866
+ output_per_million: 0.3,
867
+ },
868
+ features: {
869
+ context_length: 1048576,
870
+ input_modality: ['text', 'image', 'video', 'audio'],
871
+ output_modality: ['text'],
872
+ tool_use: true,
873
+ streaming: true,
874
+ json_output: true,
875
+ max_output_tokens: 8192,
876
+ },
877
+ class: 'standard',
878
+ score: 75,
879
+ scores: {
880
+ monologue: 70,
881
+ code: 55,
882
+ reasoning: 56,
883
+ },
884
+ description: 'Lite multimodal model with large context, built for Agents.',
885
+ },
886
+ {
887
+ id: 'gemini-2.0-flash',
888
+ provider: 'google',
889
+ cost: {
890
+ input_per_million: 0.1,
891
+ output_per_million: 0.4,
892
+ cached_input_per_million: 0.025,
893
+ },
894
+ features: {
895
+ context_length: 1048576,
896
+ input_modality: ['text', 'image', 'video', 'audio'],
897
+ output_modality: ['text'],
898
+ tool_use: true,
899
+ streaming: true,
900
+ json_output: true,
901
+ max_output_tokens: 8192,
902
+ },
903
+ class: 'standard',
904
+ score: 75,
905
+ scores: {
906
+ monologue: 70,
907
+ code: 55,
908
+ reasoning: 56,
909
+ },
910
+ description: 'Balanced multimodal model with large context, built for Agents.',
911
+ },
912
+ {
913
+ id: 'gpt-image-1',
914
+ provider: 'openai',
915
+ cost: {
916
+ per_image: 0.042,
917
+ },
918
+ features: {
919
+ input_modality: ['text', 'image'],
920
+ output_modality: ['image'],
921
+ streaming: false,
922
+ },
923
+ class: 'image_generation',
924
+ description: "OpenAI's GPT-Image-1 model for text-to-image generation. Supports quality levels (low: $0.011-0.016, medium: $0.042-0.063, high: $0.167-0.25) and sizes (1024x1024, 1024x1536, 1536x1024).",
925
+ },
926
+ {
927
+ id: 'codex-mini-latest',
928
+ provider: 'openai',
929
+ cost: {
930
+ input_per_million: 1.5,
931
+ cached_input_per_million: 0.375,
932
+ output_per_million: 6.0,
933
+ },
934
+ features: {
935
+ context_length: 200000,
936
+ max_output_tokens: 100000,
937
+ input_modality: ['text', 'image'],
938
+ output_modality: ['text'],
939
+ tool_use: false,
940
+ streaming: true,
941
+ json_output: true,
942
+ reasoning_output: true,
943
+ },
944
+ class: 'code',
945
+ description: 'Fine-tuned o4-mini model for Codex CLI with reasoning token support',
946
+ },
947
+ {
948
+ id: 'perplexity/sonar',
949
+ provider: 'openrouter',
950
+ cost: {
951
+ input_per_million: 1.0,
952
+ output_per_million: 1.0,
953
+ },
954
+ features: {
955
+ context_length: 32768,
956
+ input_modality: ['text'],
957
+ output_modality: ['text'],
958
+ tool_use: true,
959
+ streaming: true,
960
+ json_output: true,
961
+ },
962
+ class: 'search',
963
+ description: 'Lightweight, cost-effective search model designed for quick, grounded answers.',
964
+ },
965
+ {
966
+ id: 'perplexity/sonar-pro',
967
+ provider: 'openrouter',
968
+ cost: {
969
+ input_per_million: 3.0,
970
+ output_per_million: 15.0,
971
+ },
972
+ features: {
973
+ context_length: 32768,
974
+ input_modality: ['text'],
975
+ output_modality: ['text'],
976
+ tool_use: true,
977
+ streaming: true,
978
+ json_output: true,
979
+ },
980
+ class: 'search',
981
+ description: 'Advanced search model optimized for complex queries and deeper content understanding.',
982
+ },
983
+ {
984
+ id: 'perplexity/sonar-reasoning',
985
+ provider: 'openrouter',
986
+ cost: {
987
+ input_per_million: 1.0,
988
+ output_per_million: 5.0,
989
+ },
990
+ features: {
991
+ context_length: 32768,
992
+ input_modality: ['text'],
993
+ output_modality: ['text'],
994
+ tool_use: true,
995
+ streaming: true,
996
+ json_output: true,
997
+ },
998
+ class: 'reasoning_mini',
999
+ description: 'Quick problem-solving and reasoning model, ideal for evaluating complex queries.',
1000
+ },
1001
+ {
1002
+ id: 'perplexity/sonar-reasoning-pro',
1003
+ provider: 'openrouter',
1004
+ cost: {
1005
+ input_per_million: 2.0,
1006
+ output_per_million: 8.0,
1007
+ },
1008
+ features: {
1009
+ context_length: 32768,
1010
+ input_modality: ['text'],
1011
+ output_modality: ['text'],
1012
+ tool_use: true,
1013
+ streaming: true,
1014
+ json_output: true,
1015
+ },
1016
+ class: 'reasoning',
1017
+ description: 'Enhanced reasoning model with multi-step problem-solving capabilities and real-time search.',
1018
+ },
1019
+ {
1020
+ id: 'perplexity/sonar-deep-research',
1021
+ provider: 'openrouter',
1022
+ cost: {
1023
+ input_per_million: 2.0,
1024
+ output_per_million: 8.0,
1025
+ },
1026
+ features: {
1027
+ context_length: 32768,
1028
+ input_modality: ['text'],
1029
+ output_modality: ['text'],
1030
+ tool_use: true,
1031
+ streaming: true,
1032
+ json_output: true,
1033
+ },
1034
+ class: 'search',
1035
+ description: 'Best suited for exhaustive research, generating detailed reports and in-depth insights.',
1036
+ },
1037
+ {
1038
+ id: 'test-model',
1039
+ provider: 'test',
1040
+ cost: {
1041
+ input_per_million: 0,
1042
+ output_per_million: 0,
1043
+ },
1044
+ features: {
1045
+ context_length: 8192,
1046
+ input_modality: ['text'],
1047
+ output_modality: ['text'],
1048
+ tool_use: true,
1049
+ streaming: true,
1050
+ json_output: true,
1051
+ },
1052
+ class: 'standard',
1053
+ scores: {
1054
+ monologue: 50,
1055
+ code: 50,
1056
+ reasoning: 50,
1057
+ },
1058
+ description: 'Test model for unit testing purposes',
1059
+ },
1060
+ ];
1061
+ export function findModel(modelId) {
1062
+ const externalModel = getExternalModel(modelId);
1063
+ if (externalModel)
1064
+ return externalModel;
1065
+ const directMatch = MODEL_REGISTRY.find(model => model.id === modelId);
1066
+ if (directMatch)
1067
+ return directMatch;
1068
+ return MODEL_REGISTRY.find(model => model.aliases?.includes(modelId));
1069
+ }
1070
+ //# sourceMappingURL=model_data.js.map