@contractspec/lib.ai-providers 1.57.0 → 1.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/models.js CHANGED
@@ -1,300 +1,249 @@
1
- //#region src/models.ts
2
- /**
3
- * Default models per provider
4
- */
5
- const DEFAULT_MODELS = {
6
- ollama: "llama3.2",
7
- openai: "gpt-4o",
8
- anthropic: "claude-sonnet-4-20250514",
9
- mistral: "mistral-large-latest",
10
- gemini: "gemini-2.0-flash"
1
+ // @bun
2
+ // src/models.ts
3
+ var DEFAULT_MODELS = {
4
+ ollama: "llama3.2",
5
+ openai: "gpt-4o",
6
+ anthropic: "claude-sonnet-4-20250514",
7
+ mistral: "mistral-large-latest",
8
+ gemini: "gemini-2.0-flash"
11
9
  };
12
- /**
13
- * All recommended models with metadata
14
- */
15
- const MODELS = [
16
- {
17
- id: "llama3.2",
18
- name: "Llama 3.2",
19
- provider: "ollama",
20
- contextWindow: 128e3,
21
- capabilities: {
22
- vision: false,
23
- tools: true,
24
- reasoning: false,
25
- streaming: true
26
- }
27
- },
28
- {
29
- id: "codellama",
30
- name: "Code Llama",
31
- provider: "ollama",
32
- contextWindow: 16e3,
33
- capabilities: {
34
- vision: false,
35
- tools: false,
36
- reasoning: false,
37
- streaming: true
38
- }
39
- },
40
- {
41
- id: "deepseek-coder",
42
- name: "DeepSeek Coder",
43
- provider: "ollama",
44
- contextWindow: 16e3,
45
- capabilities: {
46
- vision: false,
47
- tools: false,
48
- reasoning: false,
49
- streaming: true
50
- }
51
- },
52
- {
53
- id: "mistral",
54
- name: "Mistral 7B",
55
- provider: "ollama",
56
- contextWindow: 32e3,
57
- capabilities: {
58
- vision: false,
59
- tools: false,
60
- reasoning: false,
61
- streaming: true
62
- }
63
- },
64
- {
65
- id: "gpt-4o",
66
- name: "GPT-4o",
67
- provider: "openai",
68
- contextWindow: 128e3,
69
- capabilities: {
70
- vision: true,
71
- tools: true,
72
- reasoning: false,
73
- streaming: true
74
- },
75
- costPerMillion: {
76
- input: 2.5,
77
- output: 10
78
- }
79
- },
80
- {
81
- id: "gpt-4o-mini",
82
- name: "GPT-4o Mini",
83
- provider: "openai",
84
- contextWindow: 128e3,
85
- capabilities: {
86
- vision: true,
87
- tools: true,
88
- reasoning: false,
89
- streaming: true
90
- },
91
- costPerMillion: {
92
- input: .15,
93
- output: .6
94
- }
95
- },
96
- {
97
- id: "o1",
98
- name: "o1",
99
- provider: "openai",
100
- contextWindow: 2e5,
101
- capabilities: {
102
- vision: true,
103
- tools: true,
104
- reasoning: true,
105
- streaming: true
106
- },
107
- costPerMillion: {
108
- input: 15,
109
- output: 60
110
- }
111
- },
112
- {
113
- id: "o1-mini",
114
- name: "o1 Mini",
115
- provider: "openai",
116
- contextWindow: 128e3,
117
- capabilities: {
118
- vision: false,
119
- tools: true,
120
- reasoning: true,
121
- streaming: true
122
- },
123
- costPerMillion: {
124
- input: 3,
125
- output: 12
126
- }
127
- },
128
- {
129
- id: "claude-sonnet-4-20250514",
130
- name: "Claude Sonnet 4",
131
- provider: "anthropic",
132
- contextWindow: 2e5,
133
- capabilities: {
134
- vision: true,
135
- tools: true,
136
- reasoning: true,
137
- streaming: true
138
- },
139
- costPerMillion: {
140
- input: 3,
141
- output: 15
142
- }
143
- },
144
- {
145
- id: "claude-3-5-sonnet-20241022",
146
- name: "Claude 3.5 Sonnet",
147
- provider: "anthropic",
148
- contextWindow: 2e5,
149
- capabilities: {
150
- vision: true,
151
- tools: true,
152
- reasoning: false,
153
- streaming: true
154
- },
155
- costPerMillion: {
156
- input: 3,
157
- output: 15
158
- }
159
- },
160
- {
161
- id: "claude-3-5-haiku-20241022",
162
- name: "Claude 3.5 Haiku",
163
- provider: "anthropic",
164
- contextWindow: 2e5,
165
- capabilities: {
166
- vision: true,
167
- tools: true,
168
- reasoning: false,
169
- streaming: true
170
- },
171
- costPerMillion: {
172
- input: .8,
173
- output: 4
174
- }
175
- },
176
- {
177
- id: "mistral-large-latest",
178
- name: "Mistral Large",
179
- provider: "mistral",
180
- contextWindow: 128e3,
181
- capabilities: {
182
- vision: false,
183
- tools: true,
184
- reasoning: false,
185
- streaming: true
186
- },
187
- costPerMillion: {
188
- input: 2,
189
- output: 6
190
- }
191
- },
192
- {
193
- id: "codestral-latest",
194
- name: "Codestral",
195
- provider: "mistral",
196
- contextWindow: 32e3,
197
- capabilities: {
198
- vision: false,
199
- tools: true,
200
- reasoning: false,
201
- streaming: true
202
- },
203
- costPerMillion: {
204
- input: .2,
205
- output: .6
206
- }
207
- },
208
- {
209
- id: "mistral-small-latest",
210
- name: "Mistral Small",
211
- provider: "mistral",
212
- contextWindow: 32e3,
213
- capabilities: {
214
- vision: false,
215
- tools: true,
216
- reasoning: false,
217
- streaming: true
218
- },
219
- costPerMillion: {
220
- input: .2,
221
- output: .6
222
- }
223
- },
224
- {
225
- id: "gemini-2.0-flash",
226
- name: "Gemini 2.0 Flash",
227
- provider: "gemini",
228
- contextWindow: 1e6,
229
- capabilities: {
230
- vision: true,
231
- tools: true,
232
- reasoning: false,
233
- streaming: true
234
- },
235
- costPerMillion: {
236
- input: .075,
237
- output: .3
238
- }
239
- },
240
- {
241
- id: "gemini-2.5-pro-preview-06-05",
242
- name: "Gemini 2.5 Pro",
243
- provider: "gemini",
244
- contextWindow: 1e6,
245
- capabilities: {
246
- vision: true,
247
- tools: true,
248
- reasoning: true,
249
- streaming: true
250
- },
251
- costPerMillion: {
252
- input: 1.25,
253
- output: 10
254
- }
255
- },
256
- {
257
- id: "gemini-2.5-flash-preview-05-20",
258
- name: "Gemini 2.5 Flash",
259
- provider: "gemini",
260
- contextWindow: 1e6,
261
- capabilities: {
262
- vision: true,
263
- tools: true,
264
- reasoning: true,
265
- streaming: true
266
- },
267
- costPerMillion: {
268
- input: .15,
269
- output: .6
270
- }
271
- }
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-4o",
61
+ name: "GPT-4o",
62
+ provider: "openai",
63
+ contextWindow: 128000,
64
+ capabilities: {
65
+ vision: true,
66
+ tools: true,
67
+ reasoning: false,
68
+ streaming: true
69
+ },
70
+ costPerMillion: { input: 2.5, output: 10 }
71
+ },
72
+ {
73
+ id: "gpt-4o-mini",
74
+ name: "GPT-4o Mini",
75
+ provider: "openai",
76
+ contextWindow: 128000,
77
+ capabilities: {
78
+ vision: true,
79
+ tools: true,
80
+ reasoning: false,
81
+ streaming: true
82
+ },
83
+ costPerMillion: { input: 0.15, output: 0.6 }
84
+ },
85
+ {
86
+ id: "o1",
87
+ name: "o1",
88
+ provider: "openai",
89
+ contextWindow: 200000,
90
+ capabilities: {
91
+ vision: true,
92
+ tools: true,
93
+ reasoning: true,
94
+ streaming: true
95
+ },
96
+ costPerMillion: { input: 15, output: 60 }
97
+ },
98
+ {
99
+ id: "o1-mini",
100
+ name: "o1 Mini",
101
+ provider: "openai",
102
+ contextWindow: 128000,
103
+ capabilities: {
104
+ vision: false,
105
+ tools: true,
106
+ reasoning: true,
107
+ streaming: true
108
+ },
109
+ costPerMillion: { input: 3, output: 12 }
110
+ },
111
+ {
112
+ id: "claude-sonnet-4-20250514",
113
+ name: "Claude Sonnet 4",
114
+ provider: "anthropic",
115
+ contextWindow: 200000,
116
+ capabilities: {
117
+ vision: true,
118
+ tools: true,
119
+ reasoning: true,
120
+ streaming: true
121
+ },
122
+ costPerMillion: { input: 3, output: 15 }
123
+ },
124
+ {
125
+ id: "claude-3-5-sonnet-20241022",
126
+ name: "Claude 3.5 Sonnet",
127
+ provider: "anthropic",
128
+ contextWindow: 200000,
129
+ capabilities: {
130
+ vision: true,
131
+ tools: true,
132
+ reasoning: false,
133
+ streaming: true
134
+ },
135
+ costPerMillion: { input: 3, output: 15 }
136
+ },
137
+ {
138
+ id: "claude-3-5-haiku-20241022",
139
+ name: "Claude 3.5 Haiku",
140
+ provider: "anthropic",
141
+ contextWindow: 200000,
142
+ capabilities: {
143
+ vision: true,
144
+ tools: true,
145
+ reasoning: false,
146
+ streaming: true
147
+ },
148
+ costPerMillion: { input: 0.8, output: 4 }
149
+ },
150
+ {
151
+ id: "mistral-large-latest",
152
+ name: "Mistral Large",
153
+ provider: "mistral",
154
+ contextWindow: 128000,
155
+ capabilities: {
156
+ vision: false,
157
+ tools: true,
158
+ reasoning: false,
159
+ streaming: true
160
+ },
161
+ costPerMillion: { input: 2, output: 6 }
162
+ },
163
+ {
164
+ id: "codestral-latest",
165
+ name: "Codestral",
166
+ provider: "mistral",
167
+ contextWindow: 32000,
168
+ capabilities: {
169
+ vision: false,
170
+ tools: true,
171
+ reasoning: false,
172
+ streaming: true
173
+ },
174
+ costPerMillion: { input: 0.2, output: 0.6 }
175
+ },
176
+ {
177
+ id: "mistral-small-latest",
178
+ name: "Mistral Small",
179
+ provider: "mistral",
180
+ contextWindow: 32000,
181
+ capabilities: {
182
+ vision: false,
183
+ tools: true,
184
+ reasoning: false,
185
+ streaming: true
186
+ },
187
+ costPerMillion: { input: 0.2, output: 0.6 }
188
+ },
189
+ {
190
+ id: "gemini-2.0-flash",
191
+ name: "Gemini 2.0 Flash",
192
+ provider: "gemini",
193
+ contextWindow: 1e6,
194
+ capabilities: {
195
+ vision: true,
196
+ tools: true,
197
+ reasoning: false,
198
+ streaming: true
199
+ },
200
+ costPerMillion: { input: 0.075, output: 0.3 }
201
+ },
202
+ {
203
+ id: "gemini-2.5-pro-preview-06-05",
204
+ name: "Gemini 2.5 Pro",
205
+ provider: "gemini",
206
+ contextWindow: 1e6,
207
+ capabilities: {
208
+ vision: true,
209
+ tools: true,
210
+ reasoning: true,
211
+ streaming: true
212
+ },
213
+ costPerMillion: { input: 1.25, output: 10 }
214
+ },
215
+ {
216
+ id: "gemini-2.5-flash-preview-05-20",
217
+ name: "Gemini 2.5 Flash",
218
+ provider: "gemini",
219
+ contextWindow: 1e6,
220
+ capabilities: {
221
+ vision: true,
222
+ tools: true,
223
+ reasoning: true,
224
+ streaming: true
225
+ },
226
+ costPerMillion: { input: 0.15, output: 0.6 }
227
+ }
272
228
  ];
273
- /**
274
- * Get models for a specific provider
275
- */
276
229
  function getModelsForProvider(provider) {
277
- return MODELS.filter((m) => m.provider === provider);
230
+ return MODELS.filter((m) => m.provider === provider);
278
231
  }
279
- /**
280
- * Get model info by ID
281
- */
282
232
  function getModelInfo(modelId) {
283
- return MODELS.find((m) => m.id === modelId);
233
+ return MODELS.find((m) => m.id === modelId);
284
234
  }
285
- /**
286
- * Get recommended models for a provider (legacy format)
287
- */
288
235
  function getRecommendedModels(provider) {
289
- return getModelsForProvider(provider === "claude" ? "anthropic" : provider === "custom" ? "openai" : provider).map((m) => m.id);
236
+ const normalizedProvider = provider === "claude" ? "anthropic" : provider === "custom" ? "openai" : provider;
237
+ return getModelsForProvider(normalizedProvider).map((m) => m.id);
290
238
  }
291
- /**
292
- * Get default model for a provider
293
- */
294
239
  function getDefaultModel(provider) {
295
- return DEFAULT_MODELS[provider];
240
+ return DEFAULT_MODELS[provider];
296
241
  }
297
-
298
- //#endregion
299
- export { DEFAULT_MODELS, MODELS, getDefaultModel, getModelInfo, getModelsForProvider, getRecommendedModels };
300
- //# sourceMappingURL=models.js.map
242
+ export {
243
+ getRecommendedModels,
244
+ getModelsForProvider,
245
+ getModelInfo,
246
+ getDefaultModel,
247
+ MODELS,
248
+ DEFAULT_MODELS
249
+ };