@contractspec/lib.ai-providers 3.7.12 → 3.7.14

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/models.js CHANGED
@@ -1,449 +1,2 @@
1
1
  // @bun
2
- // src/models.ts
3
- var DEFAULT_MODELS = {
4
- ollama: "llama3.2",
5
- openai: "gpt-5.4",
6
- anthropic: "claude-sonnet-4-6",
7
- mistral: "mistral-large-latest",
8
- gemini: "gemini-2.5-flash"
9
- };
10
- var MODELS = [
11
- {
12
- id: "llama3.2",
13
- name: "Llama 3.2",
14
- provider: "ollama",
15
- contextWindow: 128000,
16
- capabilities: {
17
- vision: false,
18
- tools: true,
19
- reasoning: false,
20
- streaming: true
21
- }
22
- },
23
- {
24
- id: "codellama",
25
- name: "Code Llama",
26
- provider: "ollama",
27
- contextWindow: 16000,
28
- capabilities: {
29
- vision: false,
30
- tools: false,
31
- reasoning: false,
32
- streaming: true
33
- }
34
- },
35
- {
36
- id: "deepseek-coder",
37
- name: "DeepSeek Coder",
38
- provider: "ollama",
39
- contextWindow: 16000,
40
- capabilities: {
41
- vision: false,
42
- tools: false,
43
- reasoning: false,
44
- streaming: true
45
- }
46
- },
47
- {
48
- id: "mistral",
49
- name: "Mistral 7B",
50
- provider: "ollama",
51
- contextWindow: 32000,
52
- capabilities: {
53
- vision: false,
54
- tools: false,
55
- reasoning: false,
56
- streaming: true
57
- }
58
- },
59
- {
60
- id: "gpt-5.4",
61
- name: "GPT-5.4",
62
- provider: "openai",
63
- contextWindow: 1e6,
64
- capabilities: {
65
- vision: true,
66
- tools: true,
67
- reasoning: true,
68
- streaming: true
69
- },
70
- costPerMillion: { input: 2.5, output: 15 }
71
- },
72
- {
73
- id: "gpt-4o",
74
- name: "GPT-4o",
75
- provider: "openai",
76
- contextWindow: 128000,
77
- capabilities: {
78
- vision: true,
79
- tools: true,
80
- reasoning: false,
81
- streaming: true
82
- },
83
- costPerMillion: { input: 2.5, output: 10 }
84
- },
85
- {
86
- id: "gpt-4o-mini",
87
- name: "GPT-4o Mini",
88
- provider: "openai",
89
- contextWindow: 128000,
90
- capabilities: {
91
- vision: true,
92
- tools: true,
93
- reasoning: false,
94
- streaming: true
95
- },
96
- costPerMillion: { input: 0.15, output: 0.6 }
97
- },
98
- {
99
- id: "o1",
100
- name: "o1",
101
- provider: "openai",
102
- contextWindow: 200000,
103
- capabilities: {
104
- vision: true,
105
- tools: true,
106
- reasoning: true,
107
- streaming: true
108
- },
109
- costPerMillion: { input: 15, output: 60 }
110
- },
111
- {
112
- id: "o1-mini",
113
- name: "o1 Mini",
114
- provider: "openai",
115
- contextWindow: 128000,
116
- capabilities: {
117
- vision: false,
118
- tools: true,
119
- reasoning: true,
120
- streaming: true
121
- },
122
- costPerMillion: { input: 3, output: 12 }
123
- },
124
- {
125
- id: "gpt-5-mini",
126
- name: "GPT-5 Mini",
127
- provider: "openai",
128
- contextWindow: 400000,
129
- capabilities: {
130
- vision: true,
131
- tools: true,
132
- reasoning: false,
133
- streaming: true
134
- },
135
- costPerMillion: { input: 0.25, output: 2 }
136
- },
137
- {
138
- id: "claude-opus-4-6",
139
- name: "Claude Opus 4.6",
140
- provider: "anthropic",
141
- contextWindow: 200000,
142
- capabilities: {
143
- vision: true,
144
- tools: true,
145
- reasoning: true,
146
- streaming: true
147
- },
148
- costPerMillion: { input: 5, output: 25 }
149
- },
150
- {
151
- id: "claude-sonnet-4-6",
152
- name: "Claude Sonnet 4.6",
153
- provider: "anthropic",
154
- contextWindow: 200000,
155
- capabilities: {
156
- vision: true,
157
- tools: true,
158
- reasoning: true,
159
- streaming: true
160
- },
161
- costPerMillion: { input: 3, output: 15 }
162
- },
163
- {
164
- id: "claude-haiku-4-5",
165
- name: "Claude Haiku 4.5",
166
- provider: "anthropic",
167
- contextWindow: 200000,
168
- capabilities: {
169
- vision: true,
170
- tools: true,
171
- reasoning: false,
172
- streaming: true
173
- },
174
- costPerMillion: { input: 1, output: 5 }
175
- },
176
- {
177
- id: "claude-sonnet-4-20250514",
178
- name: "Claude Sonnet 4",
179
- provider: "anthropic",
180
- contextWindow: 200000,
181
- capabilities: {
182
- vision: true,
183
- tools: true,
184
- reasoning: true,
185
- streaming: true
186
- },
187
- costPerMillion: { input: 3, output: 15 }
188
- },
189
- {
190
- id: "claude-3-5-sonnet-20241022",
191
- name: "Claude 3.5 Sonnet",
192
- provider: "anthropic",
193
- contextWindow: 200000,
194
- capabilities: {
195
- vision: true,
196
- tools: true,
197
- reasoning: false,
198
- streaming: true
199
- },
200
- costPerMillion: { input: 3, output: 15 }
201
- },
202
- {
203
- id: "claude-3-5-haiku-20241022",
204
- name: "Claude 3.5 Haiku",
205
- provider: "anthropic",
206
- contextWindow: 200000,
207
- capabilities: {
208
- vision: true,
209
- tools: true,
210
- reasoning: false,
211
- streaming: true
212
- },
213
- costPerMillion: { input: 0.8, output: 4 }
214
- },
215
- {
216
- id: "mistral-large-2512",
217
- name: "Mistral Large 3",
218
- provider: "mistral",
219
- contextWindow: 256000,
220
- capabilities: {
221
- vision: true,
222
- tools: true,
223
- reasoning: false,
224
- streaming: true
225
- },
226
- costPerMillion: { input: 0.5, output: 1.5 }
227
- },
228
- {
229
- id: "devstral-2512",
230
- name: "Devstral 2",
231
- provider: "mistral",
232
- contextWindow: 256000,
233
- capabilities: {
234
- vision: false,
235
- tools: true,
236
- reasoning: true,
237
- streaming: true
238
- },
239
- costPerMillion: { input: 0.4, output: 2 }
240
- },
241
- {
242
- id: "mistral-medium-2508",
243
- name: "Mistral Medium 3.1",
244
- provider: "mistral",
245
- contextWindow: 128000,
246
- capabilities: {
247
- vision: true,
248
- tools: true,
249
- reasoning: false,
250
- streaming: true
251
- },
252
- costPerMillion: { input: 0.4, output: 2 }
253
- },
254
- {
255
- id: "mistral-small-2506",
256
- name: "Mistral Small 3.2",
257
- provider: "mistral",
258
- contextWindow: 128000,
259
- capabilities: {
260
- vision: false,
261
- tools: true,
262
- reasoning: false,
263
- streaming: true
264
- }
265
- },
266
- {
267
- id: "mistral-large-latest",
268
- name: "Mistral Large",
269
- provider: "mistral",
270
- contextWindow: 128000,
271
- capabilities: {
272
- vision: false,
273
- tools: true,
274
- reasoning: false,
275
- streaming: true
276
- },
277
- costPerMillion: { input: 2, output: 6 }
278
- },
279
- {
280
- id: "mistral-medium-latest",
281
- name: "Mistral Medium",
282
- provider: "mistral",
283
- contextWindow: 128000,
284
- capabilities: {
285
- vision: false,
286
- tools: true,
287
- reasoning: false,
288
- streaming: true
289
- }
290
- },
291
- {
292
- id: "codestral-latest",
293
- name: "Codestral",
294
- provider: "mistral",
295
- contextWindow: 256000,
296
- capabilities: {
297
- vision: false,
298
- tools: true,
299
- reasoning: false,
300
- streaming: true
301
- },
302
- costPerMillion: { input: 0.2, output: 0.6 }
303
- },
304
- {
305
- id: "devstral-small-latest",
306
- name: "Devstral Small",
307
- provider: "mistral",
308
- contextWindow: 128000,
309
- capabilities: {
310
- vision: false,
311
- tools: true,
312
- reasoning: true,
313
- streaming: true
314
- }
315
- },
316
- {
317
- id: "magistral-medium-latest",
318
- name: "Magistral Medium",
319
- provider: "mistral",
320
- contextWindow: 128000,
321
- capabilities: {
322
- vision: false,
323
- tools: true,
324
- reasoning: true,
325
- streaming: true
326
- }
327
- },
328
- {
329
- id: "pixtral-large-latest",
330
- name: "Pixtral Large",
331
- provider: "mistral",
332
- contextWindow: 128000,
333
- capabilities: {
334
- vision: true,
335
- tools: true,
336
- reasoning: false,
337
- streaming: true
338
- }
339
- },
340
- {
341
- id: "mistral-small-latest",
342
- name: "Mistral Small",
343
- provider: "mistral",
344
- contextWindow: 32000,
345
- capabilities: {
346
- vision: false,
347
- tools: true,
348
- reasoning: false,
349
- streaming: true
350
- },
351
- costPerMillion: { input: 0.2, output: 0.6 }
352
- },
353
- {
354
- id: "gemini-2.0-flash",
355
- name: "Gemini 2.0 Flash",
356
- provider: "gemini",
357
- contextWindow: 1e6,
358
- capabilities: {
359
- vision: true,
360
- tools: true,
361
- reasoning: false,
362
- streaming: true
363
- },
364
- costPerMillion: { input: 0.075, output: 0.3 }
365
- },
366
- {
367
- id: "gemini-2.5-pro-preview-06-05",
368
- name: "Gemini 2.5 Pro",
369
- provider: "gemini",
370
- contextWindow: 1e6,
371
- capabilities: {
372
- vision: true,
373
- tools: true,
374
- reasoning: true,
375
- streaming: true
376
- },
377
- costPerMillion: { input: 1.25, output: 10 }
378
- },
379
- {
380
- id: "gemini-2.5-flash-preview-05-20",
381
- name: "Gemini 2.5 Flash",
382
- provider: "gemini",
383
- contextWindow: 1e6,
384
- capabilities: {
385
- vision: true,
386
- tools: true,
387
- reasoning: true,
388
- streaming: true
389
- },
390
- costPerMillion: { input: 0.15, output: 0.6 }
391
- },
392
- {
393
- id: "gemini-3.1-pro-preview",
394
- name: "Gemini 3.1 Pro",
395
- provider: "gemini",
396
- contextWindow: 1e6,
397
- capabilities: {
398
- vision: true,
399
- tools: true,
400
- reasoning: true,
401
- streaming: true
402
- }
403
- },
404
- {
405
- id: "gemini-3.1-flash-lite-preview",
406
- name: "Gemini 3.1 Flash-Lite",
407
- provider: "gemini",
408
- contextWindow: 1e6,
409
- capabilities: {
410
- vision: true,
411
- tools: true,
412
- reasoning: true,
413
- streaming: true
414
- }
415
- },
416
- {
417
- id: "gemini-3-flash-preview",
418
- name: "Gemini 3 Flash",
419
- provider: "gemini",
420
- contextWindow: 1e6,
421
- capabilities: {
422
- vision: true,
423
- tools: true,
424
- reasoning: false,
425
- streaming: true
426
- }
427
- }
428
- ];
429
- function getModelsForProvider(provider) {
430
- return MODELS.filter((m) => m.provider === provider);
431
- }
432
- function getModelInfo(modelId) {
433
- return MODELS.find((m) => m.id === modelId);
434
- }
435
- function getRecommendedModels(provider) {
436
- const normalizedProvider = provider === "claude" ? "anthropic" : provider === "custom" ? "openai" : provider;
437
- return getModelsForProvider(normalizedProvider).map((m) => m.id);
438
- }
439
- function getDefaultModel(provider) {
440
- return DEFAULT_MODELS[provider];
441
- }
442
- export {
443
- getRecommendedModels,
444
- getModelsForProvider,
445
- getModelInfo,
446
- getDefaultModel,
447
- MODELS,
448
- DEFAULT_MODELS
449
- };
2
+ var k={ollama:"llama3.2",openai:"gpt-5.4",anthropic:"claude-sonnet-4-6",mistral:"mistral-large-latest",gemini:"gemini-2.5-flash"},h=[{id:"llama3.2",name:"Llama 3.2",provider:"ollama",contextWindow:128000,capabilities:{vision:!1,tools:!0,reasoning:!1,streaming:!0}},{id:"codellama",name:"Code Llama",provider:"ollama",contextWindow:16000,capabilities:{vision:!1,tools:!1,reasoning:!1,streaming:!0}},{id:"deepseek-coder",name:"DeepSeek Coder",provider:"ollama",contextWindow:16000,capabilities:{vision:!1,tools:!1,reasoning:!1,streaming:!0}},{id:"mistral",name:"Mistral 7B",provider:"ollama",contextWindow:32000,capabilities:{vision:!1,tools:!1,reasoning:!1,streaming:!0}},{id:"gpt-5.4",name:"GPT-5.4",provider:"openai",contextWindow:1e6,capabilities:{vision:!0,tools:!0,reasoning:!0,streaming:!0},costPerMillion:{input:2.5,output:15}},{id:"gpt-4o",name:"GPT-4o",provider:"openai",contextWindow:128000,capabilities:{vision:!0,tools:!0,reasoning:!1,streaming:!0},costPerMillion:{input:2.5,output:10}},{id:"gpt-4o-mini",name:"GPT-4o Mini",provider:"openai",contextWindow:128000,capabilities:{vision:!0,tools:!0,reasoning:!1,streaming:!0},costPerMillion:{input:0.15,output:0.6}},{id:"o1",name:"o1",provider:"openai",contextWindow:200000,capabilities:{vision:!0,tools:!0,reasoning:!0,streaming:!0},costPerMillion:{input:15,output:60}},{id:"o1-mini",name:"o1 Mini",provider:"openai",contextWindow:128000,capabilities:{vision:!1,tools:!0,reasoning:!0,streaming:!0},costPerMillion:{input:3,output:12}},{id:"gpt-5-mini",name:"GPT-5 Mini",provider:"openai",contextWindow:400000,capabilities:{vision:!0,tools:!0,reasoning:!1,streaming:!0},costPerMillion:{input:0.25,output:2}},{id:"claude-opus-4-6",name:"Claude Opus 4.6",provider:"anthropic",contextWindow:200000,capabilities:{vision:!0,tools:!0,reasoning:!0,streaming:!0},costPerMillion:{input:5,output:25}},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",provider:"anthropic",contextWindow:200000,capabilities:{vision:!0,tools:!0,reasoning:!0,streaming:!0},costPerMillion:{input:3,output:15}},{id:"claude-haiku-4-5",name:"Claude Haiku 4.5",provider:"anthropic",contextWindow:200000,capabilities:{vision:!0,tools:!0,reasoning:!1,streaming:!0},costPerMillion:{input:1,output:5}},{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4",provider:"anthropic",contextWindow:200000,capabilities:{vision:!0,tools:!0,reasoning:!0,streaming:!0},costPerMillion:{input:3,output:15}},{id:"claude-3-5-sonnet-20241022",name:"Claude 3.5 Sonnet",provider:"anthropic",contextWindow:200000,capabilities:{vision:!0,tools:!0,reasoning:!1,streaming:!0},costPerMillion:{input:3,output:15}},{id:"claude-3-5-haiku-20241022",name:"Claude 3.5 Haiku",provider:"anthropic",contextWindow:200000,capabilities:{vision:!0,tools:!0,reasoning:!1,streaming:!0},costPerMillion:{input:0.8,output:4}},{id:"mistral-large-2512",name:"Mistral Large 3",provider:"mistral",contextWindow:256000,capabilities:{vision:!0,tools:!0,reasoning:!1,streaming:!0},costPerMillion:{input:0.5,output:1.5}},{id:"devstral-2512",name:"Devstral 2",provider:"mistral",contextWindow:256000,capabilities:{vision:!1,tools:!0,reasoning:!0,streaming:!0},costPerMillion:{input:0.4,output:2}},{id:"mistral-medium-2508",name:"Mistral Medium 3.1",provider:"mistral",contextWindow:128000,capabilities:{vision:!0,tools:!0,reasoning:!1,streaming:!0},costPerMillion:{input:0.4,output:2}},{id:"mistral-small-2506",name:"Mistral Small 3.2",provider:"mistral",contextWindow:128000,capabilities:{vision:!1,tools:!0,reasoning:!1,streaming:!0}},{id:"mistral-large-latest",name:"Mistral Large",provider:"mistral",contextWindow:128000,capabilities:{vision:!1,tools:!0,reasoning:!1,streaming:!0},costPerMillion:{input:2,output:6}},{id:"mistral-medium-latest",name:"Mistral Medium",provider:"mistral",contextWindow:128000,capabilities:{vision:!1,tools:!0,reasoning:!1,streaming:!0}},{id:"codestral-latest",name:"Codestral",provider:"mistral",contextWindow:256000,capabilities:{vision:!1,tools:!0,reasoning:!1,streaming:!0},costPerMillion:{input:0.2,output:0.6}},{id:"devstral-small-latest",name:"Devstral Small",provider:"mistral",contextWindow:128000,capabilities:{vision:!1,tools:!0,reasoning:!0,streaming:!0}},{id:"magistral-medium-latest",name:"Magistral Medium",provider:"mistral",contextWindow:128000,capabilities:{vision:!1,tools:!0,reasoning:!0,streaming:!0}},{id:"pixtral-large-latest",name:"Pixtral Large",provider:"mistral",contextWindow:128000,capabilities:{vision:!0,tools:!0,reasoning:!1,streaming:!0}},{id:"mistral-small-latest",name:"Mistral Small",provider:"mistral",contextWindow:32000,capabilities:{vision:!1,tools:!0,reasoning:!1,streaming:!0},costPerMillion:{input:0.2,output:0.6}},{id:"gemini-2.0-flash",name:"Gemini 2.0 Flash",provider:"gemini",contextWindow:1e6,capabilities:{vision:!0,tools:!0,reasoning:!1,streaming:!0},costPerMillion:{input:0.075,output:0.3}},{id:"gemini-2.5-pro-preview-06-05",name:"Gemini 2.5 Pro",provider:"gemini",contextWindow:1e6,capabilities:{vision:!0,tools:!0,reasoning:!0,streaming:!0},costPerMillion:{input:1.25,output:10}},{id:"gemini-2.5-flash-preview-05-20",name:"Gemini 2.5 Flash",provider:"gemini",contextWindow:1e6,capabilities:{vision:!0,tools:!0,reasoning:!0,streaming:!0},costPerMillion:{input:0.15,output:0.6}},{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro",provider:"gemini",contextWindow:1e6,capabilities:{vision:!0,tools:!0,reasoning:!0,streaming:!0}},{id:"gemini-3.1-flash-lite-preview",name:"Gemini 3.1 Flash-Lite",provider:"gemini",contextWindow:1e6,capabilities:{vision:!0,tools:!0,reasoning:!0,streaming:!0}},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash",provider:"gemini",contextWindow:1e6,capabilities:{vision:!0,tools:!0,reasoning:!1,streaming:!0}}];function n(b){return h.filter((c)=>c.provider===b)}function q(b){return h.find((c)=>c.id===b)}function w(b){return n(b==="claude"?"anthropic":b==="custom"?"openai":b).map((j)=>j.id)}function x(b){return k[b]}export{w as getRecommendedModels,n as getModelsForProvider,q as getModelInfo,x as getDefaultModel,h as MODELS,k as DEFAULT_MODELS};
@@ -0,0 +1 @@
1
+ import{defineFeature as g}from"@contractspec/lib.contracts-spec/features";var j=g({meta:{key:"libs.ai-providers",version:"1.0.0",title:"Ai Providers",description:"Unified AI provider abstraction layer",domain:"ai-providers",owners:["@contractspec-core"],tags:["package","libs","ai-providers"],stability:"experimental"}});export{j as AiProvidersFeature};