@ai-sdk/anthropic 4.0.106 → 4.0.108
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/CHANGELOG.md +14 -0
- package/dist/index.d.ts +386 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +636 -197
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +386 -9
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +635 -196
- package/dist/internal/index.js.map +1 -1
- package/package.json +4 -4
- package/src/anthropic-model-catalog.ts +628 -228
- package/src/tool/bash_20241022.ts +6 -1
- package/src/tool/bash_20250124.ts +6 -1
|
@@ -88,284 +88,541 @@ export type AnthropicLanguageModelEntry = ModelEntry<{
|
|
|
88
88
|
requestConfig: { language: AnthropicLanguageRequestConfig };
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
// Conditional support, used as a cell value in the matrix below.
|
|
92
|
+
const onlyWithoutThinking = {
|
|
93
|
+
condition: 'Only supported when thinking is disabled.',
|
|
94
|
+
} as const;
|
|
95
|
+
|
|
96
|
+
type AnthropicThinkingMode = 'adaptive' | 'budget' | 'between-tools';
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* One row of the language model matrix. Every capability that differs between
|
|
100
|
+
* models is its own column, and every listed model fills in every column.
|
|
101
|
+
* Nothing is derived from the model ID or from another column. Facts that
|
|
102
|
+
* depend on each other share one column, so a row cannot contradict itself.
|
|
103
|
+
*/
|
|
104
|
+
export type AnthropicLanguageModelRow = {
|
|
105
|
+
/**
|
|
106
|
+
* `false` keeps a known model ID out of the exported catalog and the
|
|
107
|
+
* generated documentation. Its inputs, object generation, tools, and provider
|
|
108
|
+
* options are then reported as `'unknown'`.
|
|
109
|
+
*/
|
|
110
|
+
documented: boolean;
|
|
111
|
+
/** Default maximum output tokens. */
|
|
92
112
|
maxOutputTokens: number;
|
|
113
|
+
/** Whether the model ID belongs to a known model family. */
|
|
114
|
+
knownModel: boolean;
|
|
93
115
|
nativeStructuredOutput: boolean;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Extended thinking. `false` means the model does not think. Otherwise the
|
|
118
|
+
* cell lists the thinking modes the model accepts (at least one) and when
|
|
119
|
+
* thinking can be turned off: never (`false`), only at efforts up to `high`,
|
|
120
|
+
* or always.
|
|
121
|
+
*/
|
|
122
|
+
thinking:
|
|
123
|
+
| false
|
|
124
|
+
| {
|
|
125
|
+
modes: readonly [AnthropicThinkingMode, ...AnthropicThinkingMode[]];
|
|
126
|
+
canBeDisabled: false | 'up-to-high-effort' | 'always';
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Declared reasoning efforts. `undefined` means no exhaustive list. `xhigh`
|
|
130
|
+
* is supported only when it is listed here.
|
|
131
|
+
*/
|
|
132
|
+
reasoningEfforts: readonly string[] | undefined;
|
|
133
|
+
/** Temperature, topP, and topK support. */
|
|
134
|
+
sampling: ModelCapability;
|
|
100
135
|
forcedToolUse: boolean;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
effort: boolean;
|
|
136
|
+
toolSearch: ModelCapability;
|
|
137
|
+
compaction: ModelCapability;
|
|
138
|
+
/** `effort` provider option. It was introduced with claude-opus-4-5. */
|
|
139
|
+
effort: ModelCapability;
|
|
140
|
+
/** `speed` provider option (fast mode). */
|
|
141
|
+
speed: ModelCapability;
|
|
142
|
+
/** `taskBudget` provider option. */
|
|
143
|
+
taskBudget: ModelCapability;
|
|
110
144
|
};
|
|
111
145
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
146
|
+
/**
|
|
147
|
+
* Language model matrix: model IDs by capability. To add a model, add a row and
|
|
148
|
+
* fill in every column.
|
|
149
|
+
*/
|
|
150
|
+
const languageModelDefinitions = {
|
|
151
|
+
'claude-opus-5-5': {
|
|
152
|
+
documented: true,
|
|
153
|
+
maxOutputTokens: 128000,
|
|
154
|
+
knownModel: true,
|
|
155
|
+
nativeStructuredOutput: true,
|
|
156
|
+
thinking: { modes: ['adaptive'], canBeDisabled: false },
|
|
157
|
+
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
158
|
+
sampling: onlyWithoutThinking,
|
|
159
|
+
forcedToolUse: false,
|
|
160
|
+
toolSearch: true,
|
|
161
|
+
compaction: true,
|
|
162
|
+
effort: true,
|
|
163
|
+
speed: false,
|
|
164
|
+
taskBudget: 'unknown',
|
|
165
|
+
},
|
|
166
|
+
'claude-opus-5': {
|
|
167
|
+
documented: true,
|
|
168
|
+
maxOutputTokens: 128000,
|
|
169
|
+
knownModel: true,
|
|
170
|
+
nativeStructuredOutput: true,
|
|
171
|
+
thinking: {
|
|
172
|
+
modes: ['adaptive', 'budget'],
|
|
173
|
+
canBeDisabled: 'up-to-high-effort',
|
|
174
|
+
},
|
|
175
|
+
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
176
|
+
sampling: onlyWithoutThinking,
|
|
136
177
|
forcedToolUse: true,
|
|
137
|
-
|
|
178
|
+
toolSearch: true,
|
|
179
|
+
compaction: true,
|
|
180
|
+
effort: true,
|
|
181
|
+
speed: false,
|
|
182
|
+
taskBudget: 'unknown',
|
|
183
|
+
},
|
|
184
|
+
'claude-sonnet-5-5': {
|
|
185
|
+
documented: true,
|
|
186
|
+
maxOutputTokens: 128000,
|
|
138
187
|
knownModel: true,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
definition: defineRuntime({
|
|
150
|
-
...currentClaudeWithoutSampling,
|
|
151
|
-
thinkingCanBeDisabledAboveHighEffort: false,
|
|
152
|
-
thinkingCanBeDisabled: false,
|
|
153
|
-
budgetThinking: false,
|
|
154
|
-
forcedToolUse: false,
|
|
155
|
-
betweenToolsThinking: true,
|
|
156
|
-
}),
|
|
188
|
+
nativeStructuredOutput: true,
|
|
189
|
+
thinking: { modes: ['adaptive', 'between-tools'], canBeDisabled: false },
|
|
190
|
+
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
191
|
+
sampling: onlyWithoutThinking,
|
|
192
|
+
forcedToolUse: false,
|
|
193
|
+
toolSearch: true,
|
|
194
|
+
compaction: true,
|
|
195
|
+
effort: true,
|
|
196
|
+
speed: false,
|
|
197
|
+
taskBudget: 'unknown',
|
|
157
198
|
},
|
|
158
|
-
{
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
199
|
+
'claude-sonnet-5': {
|
|
200
|
+
documented: true,
|
|
201
|
+
maxOutputTokens: 128000,
|
|
202
|
+
knownModel: true,
|
|
203
|
+
nativeStructuredOutput: true,
|
|
204
|
+
thinking: { modes: ['adaptive', 'budget'], canBeDisabled: 'always' },
|
|
205
|
+
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
206
|
+
sampling: onlyWithoutThinking,
|
|
207
|
+
forcedToolUse: true,
|
|
208
|
+
toolSearch: true,
|
|
209
|
+
compaction: true,
|
|
210
|
+
effort: true,
|
|
211
|
+
speed: false,
|
|
212
|
+
taskBudget: 'unknown',
|
|
167
213
|
},
|
|
168
|
-
{
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
214
|
+
'claude-haiku-5-5': {
|
|
215
|
+
documented: true,
|
|
216
|
+
maxOutputTokens: 128000,
|
|
217
|
+
knownModel: true,
|
|
218
|
+
nativeStructuredOutput: true,
|
|
219
|
+
thinking: { modes: ['adaptive'], canBeDisabled: 'up-to-high-effort' },
|
|
220
|
+
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
221
|
+
sampling: onlyWithoutThinking,
|
|
222
|
+
forcedToolUse: true,
|
|
223
|
+
toolSearch: true,
|
|
224
|
+
compaction: true,
|
|
225
|
+
effort: true,
|
|
226
|
+
speed: false,
|
|
227
|
+
taskBudget: 'unknown',
|
|
175
228
|
},
|
|
176
|
-
{
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
229
|
+
'claude-fable-5-2': {
|
|
230
|
+
documented: true,
|
|
231
|
+
maxOutputTokens: 128000,
|
|
232
|
+
knownModel: true,
|
|
233
|
+
nativeStructuredOutput: true,
|
|
234
|
+
thinking: { modes: ['adaptive'], canBeDisabled: false },
|
|
235
|
+
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
236
|
+
sampling: onlyWithoutThinking,
|
|
237
|
+
forcedToolUse: false,
|
|
238
|
+
toolSearch: true,
|
|
239
|
+
compaction: true,
|
|
240
|
+
effort: true,
|
|
241
|
+
speed: false,
|
|
242
|
+
taskBudget: 'unknown',
|
|
182
243
|
},
|
|
183
|
-
{
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
244
|
+
'claude-fable-5-1': {
|
|
245
|
+
documented: true,
|
|
246
|
+
maxOutputTokens: 128000,
|
|
247
|
+
knownModel: true,
|
|
248
|
+
nativeStructuredOutput: true,
|
|
249
|
+
thinking: { modes: ['adaptive'], canBeDisabled: false },
|
|
250
|
+
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
251
|
+
sampling: onlyWithoutThinking,
|
|
252
|
+
forcedToolUse: false,
|
|
253
|
+
toolSearch: true,
|
|
254
|
+
compaction: true,
|
|
255
|
+
effort: true,
|
|
256
|
+
speed: false,
|
|
257
|
+
taskBudget: 'unknown',
|
|
193
258
|
},
|
|
194
|
-
{
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
259
|
+
'claude-fable-5': {
|
|
260
|
+
documented: true,
|
|
261
|
+
maxOutputTokens: 128000,
|
|
262
|
+
knownModel: true,
|
|
263
|
+
nativeStructuredOutput: true,
|
|
264
|
+
thinking: { modes: ['adaptive'], canBeDisabled: false },
|
|
265
|
+
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
266
|
+
sampling: onlyWithoutThinking,
|
|
267
|
+
forcedToolUse: true,
|
|
268
|
+
toolSearch: true,
|
|
269
|
+
compaction: true,
|
|
270
|
+
effort: true,
|
|
271
|
+
speed: false,
|
|
272
|
+
taskBudget: 'unknown',
|
|
201
273
|
},
|
|
202
|
-
{
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
274
|
+
'claude-opus-4-8': {
|
|
275
|
+
documented: true,
|
|
276
|
+
maxOutputTokens: 128000,
|
|
277
|
+
knownModel: true,
|
|
278
|
+
nativeStructuredOutput: true,
|
|
279
|
+
thinking: { modes: ['adaptive', 'budget'], canBeDisabled: 'always' },
|
|
280
|
+
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
281
|
+
sampling: onlyWithoutThinking,
|
|
282
|
+
forcedToolUse: true,
|
|
283
|
+
toolSearch: true,
|
|
284
|
+
compaction: true,
|
|
285
|
+
effort: true,
|
|
286
|
+
speed: false,
|
|
287
|
+
taskBudget: 'unknown',
|
|
208
288
|
},
|
|
209
|
-
{
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
289
|
+
'claude-opus-4-7': {
|
|
290
|
+
documented: true,
|
|
291
|
+
maxOutputTokens: 128000,
|
|
292
|
+
knownModel: true,
|
|
293
|
+
nativeStructuredOutput: true,
|
|
294
|
+
thinking: { modes: ['adaptive', 'budget'], canBeDisabled: 'always' },
|
|
295
|
+
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
296
|
+
sampling: onlyWithoutThinking,
|
|
297
|
+
forcedToolUse: true,
|
|
298
|
+
toolSearch: true,
|
|
299
|
+
compaction: true,
|
|
300
|
+
effort: true,
|
|
301
|
+
speed: false,
|
|
302
|
+
taskBudget: true,
|
|
214
303
|
},
|
|
215
|
-
{
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
304
|
+
'claude-opus-4-6': {
|
|
305
|
+
documented: true,
|
|
306
|
+
maxOutputTokens: 128000,
|
|
307
|
+
knownModel: true,
|
|
308
|
+
nativeStructuredOutput: true,
|
|
309
|
+
thinking: { modes: ['adaptive', 'budget'], canBeDisabled: 'always' },
|
|
310
|
+
reasoningEfforts: undefined,
|
|
311
|
+
sampling: true,
|
|
312
|
+
forcedToolUse: true,
|
|
313
|
+
toolSearch: true,
|
|
314
|
+
compaction: true,
|
|
315
|
+
effort: true,
|
|
316
|
+
speed: true,
|
|
317
|
+
taskBudget: 'unknown',
|
|
224
318
|
},
|
|
225
|
-
{
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
319
|
+
'claude-sonnet-4-6': {
|
|
320
|
+
documented: true,
|
|
321
|
+
maxOutputTokens: 128000,
|
|
322
|
+
knownModel: true,
|
|
323
|
+
nativeStructuredOutput: true,
|
|
324
|
+
thinking: { modes: ['adaptive', 'budget'], canBeDisabled: 'always' },
|
|
325
|
+
reasoningEfforts: undefined,
|
|
326
|
+
sampling: true,
|
|
327
|
+
forcedToolUse: true,
|
|
328
|
+
toolSearch: true,
|
|
329
|
+
compaction: true,
|
|
330
|
+
effort: true,
|
|
331
|
+
speed: false,
|
|
332
|
+
taskBudget: 'unknown',
|
|
231
333
|
},
|
|
232
|
-
{
|
|
233
|
-
|
|
234
|
-
|
|
334
|
+
'claude-opus-4-5': {
|
|
335
|
+
documented: true,
|
|
336
|
+
maxOutputTokens: 64000,
|
|
337
|
+
knownModel: true,
|
|
338
|
+
nativeStructuredOutput: true,
|
|
339
|
+
thinking: { modes: ['budget'], canBeDisabled: 'always' },
|
|
340
|
+
reasoningEfforts: undefined,
|
|
341
|
+
sampling: true,
|
|
342
|
+
forcedToolUse: true,
|
|
343
|
+
toolSearch: true,
|
|
344
|
+
compaction: false,
|
|
345
|
+
effort: true,
|
|
346
|
+
speed: false,
|
|
347
|
+
taskBudget: 'unknown',
|
|
235
348
|
},
|
|
236
|
-
{
|
|
237
|
-
|
|
238
|
-
|
|
349
|
+
'claude-haiku-4-5': {
|
|
350
|
+
documented: true,
|
|
351
|
+
maxOutputTokens: 64000,
|
|
352
|
+
knownModel: true,
|
|
353
|
+
nativeStructuredOutput: true,
|
|
354
|
+
thinking: { modes: ['budget'], canBeDisabled: 'always' },
|
|
355
|
+
reasoningEfforts: undefined,
|
|
356
|
+
sampling: true,
|
|
357
|
+
forcedToolUse: true,
|
|
358
|
+
toolSearch: true,
|
|
359
|
+
compaction: false,
|
|
360
|
+
effort: false,
|
|
361
|
+
speed: false,
|
|
362
|
+
taskBudget: 'unknown',
|
|
239
363
|
},
|
|
240
|
-
{
|
|
241
|
-
|
|
242
|
-
|
|
364
|
+
'claude-sonnet-4-5': {
|
|
365
|
+
documented: true,
|
|
366
|
+
maxOutputTokens: 64000,
|
|
367
|
+
knownModel: true,
|
|
368
|
+
nativeStructuredOutput: true,
|
|
369
|
+
thinking: { modes: ['budget'], canBeDisabled: 'always' },
|
|
370
|
+
reasoningEfforts: undefined,
|
|
371
|
+
sampling: true,
|
|
372
|
+
forcedToolUse: true,
|
|
373
|
+
toolSearch: true,
|
|
374
|
+
compaction: false,
|
|
375
|
+
effort: false,
|
|
376
|
+
speed: false,
|
|
377
|
+
taskBudget: 'unknown',
|
|
243
378
|
},
|
|
244
|
-
{
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
379
|
+
'claude-opus-4-1': {
|
|
380
|
+
documented: true,
|
|
381
|
+
maxOutputTokens: 32000,
|
|
382
|
+
knownModel: true,
|
|
383
|
+
nativeStructuredOutput: true,
|
|
384
|
+
thinking: { modes: ['budget'], canBeDisabled: 'always' },
|
|
385
|
+
reasoningEfforts: undefined,
|
|
386
|
+
sampling: true,
|
|
387
|
+
forcedToolUse: true,
|
|
388
|
+
toolSearch: false,
|
|
389
|
+
compaction: false,
|
|
390
|
+
effort: false,
|
|
391
|
+
speed: false,
|
|
392
|
+
taskBudget: 'unknown',
|
|
248
393
|
},
|
|
249
|
-
|
|
394
|
+
'claude-opus-4-0': {
|
|
395
|
+
documented: true,
|
|
396
|
+
maxOutputTokens: 32000,
|
|
397
|
+
knownModel: true,
|
|
398
|
+
nativeStructuredOutput: false,
|
|
399
|
+
thinking: { modes: ['budget'], canBeDisabled: 'always' },
|
|
400
|
+
reasoningEfforts: undefined,
|
|
401
|
+
sampling: true,
|
|
402
|
+
forcedToolUse: true,
|
|
403
|
+
toolSearch: false,
|
|
404
|
+
compaction: false,
|
|
405
|
+
effort: false,
|
|
406
|
+
speed: false,
|
|
407
|
+
taskBudget: 'unknown',
|
|
408
|
+
},
|
|
409
|
+
'claude-sonnet-4-0': {
|
|
410
|
+
documented: true,
|
|
411
|
+
maxOutputTokens: 64000,
|
|
412
|
+
knownModel: true,
|
|
413
|
+
nativeStructuredOutput: false,
|
|
414
|
+
thinking: { modes: ['budget'], canBeDisabled: 'always' },
|
|
415
|
+
reasoningEfforts: undefined,
|
|
416
|
+
sampling: true,
|
|
417
|
+
forcedToolUse: true,
|
|
418
|
+
toolSearch: false,
|
|
419
|
+
compaction: false,
|
|
420
|
+
effort: false,
|
|
421
|
+
speed: false,
|
|
422
|
+
taskBudget: 'unknown',
|
|
423
|
+
},
|
|
424
|
+
'claude-3-haiku-20240307': {
|
|
425
|
+
documented: false,
|
|
426
|
+
maxOutputTokens: 4096,
|
|
427
|
+
knownModel: true,
|
|
428
|
+
nativeStructuredOutput: false,
|
|
429
|
+
thinking: { modes: ['budget'], canBeDisabled: 'always' },
|
|
430
|
+
reasoningEfforts: undefined,
|
|
431
|
+
sampling: true,
|
|
432
|
+
forcedToolUse: true,
|
|
433
|
+
toolSearch: 'unknown',
|
|
434
|
+
compaction: 'unknown',
|
|
435
|
+
effort: 'unknown',
|
|
436
|
+
speed: 'unknown',
|
|
437
|
+
taskBudget: 'unknown',
|
|
438
|
+
},
|
|
439
|
+
'claude-haiku-4-5-20251001': {
|
|
440
|
+
documented: false,
|
|
441
|
+
maxOutputTokens: 64000,
|
|
442
|
+
knownModel: true,
|
|
443
|
+
nativeStructuredOutput: true,
|
|
444
|
+
thinking: { modes: ['budget'], canBeDisabled: 'always' },
|
|
445
|
+
reasoningEfforts: undefined,
|
|
446
|
+
sampling: true,
|
|
447
|
+
forcedToolUse: true,
|
|
448
|
+
toolSearch: 'unknown',
|
|
449
|
+
compaction: 'unknown',
|
|
450
|
+
effort: 'unknown',
|
|
451
|
+
speed: 'unknown',
|
|
452
|
+
taskBudget: 'unknown',
|
|
453
|
+
},
|
|
454
|
+
'claude-opus-4-1-20250805': {
|
|
455
|
+
documented: false,
|
|
456
|
+
maxOutputTokens: 32000,
|
|
457
|
+
knownModel: true,
|
|
458
|
+
nativeStructuredOutput: true,
|
|
459
|
+
thinking: { modes: ['budget'], canBeDisabled: 'always' },
|
|
460
|
+
reasoningEfforts: undefined,
|
|
461
|
+
sampling: true,
|
|
462
|
+
forcedToolUse: true,
|
|
463
|
+
toolSearch: 'unknown',
|
|
464
|
+
compaction: 'unknown',
|
|
465
|
+
effort: 'unknown',
|
|
466
|
+
speed: 'unknown',
|
|
467
|
+
taskBudget: 'unknown',
|
|
468
|
+
},
|
|
469
|
+
'claude-opus-4-20250514': {
|
|
470
|
+
documented: false,
|
|
471
|
+
maxOutputTokens: 32000,
|
|
472
|
+
knownModel: true,
|
|
473
|
+
nativeStructuredOutput: false,
|
|
474
|
+
thinking: { modes: ['budget'], canBeDisabled: 'always' },
|
|
475
|
+
reasoningEfforts: undefined,
|
|
476
|
+
sampling: true,
|
|
477
|
+
forcedToolUse: true,
|
|
478
|
+
toolSearch: 'unknown',
|
|
479
|
+
compaction: 'unknown',
|
|
480
|
+
effort: 'unknown',
|
|
481
|
+
speed: 'unknown',
|
|
482
|
+
taskBudget: 'unknown',
|
|
483
|
+
},
|
|
484
|
+
'claude-opus-4-5-20251101': {
|
|
485
|
+
documented: false,
|
|
486
|
+
maxOutputTokens: 64000,
|
|
487
|
+
knownModel: true,
|
|
488
|
+
nativeStructuredOutput: true,
|
|
489
|
+
thinking: { modes: ['budget'], canBeDisabled: 'always' },
|
|
490
|
+
reasoningEfforts: undefined,
|
|
491
|
+
sampling: true,
|
|
492
|
+
forcedToolUse: true,
|
|
493
|
+
toolSearch: 'unknown',
|
|
494
|
+
compaction: 'unknown',
|
|
495
|
+
effort: 'unknown',
|
|
496
|
+
speed: 'unknown',
|
|
497
|
+
taskBudget: 'unknown',
|
|
498
|
+
},
|
|
499
|
+
'claude-sonnet-4-20250514': {
|
|
500
|
+
documented: false,
|
|
501
|
+
maxOutputTokens: 64000,
|
|
502
|
+
knownModel: true,
|
|
503
|
+
nativeStructuredOutput: false,
|
|
504
|
+
thinking: { modes: ['budget'], canBeDisabled: 'always' },
|
|
505
|
+
reasoningEfforts: undefined,
|
|
506
|
+
sampling: true,
|
|
507
|
+
forcedToolUse: true,
|
|
508
|
+
toolSearch: 'unknown',
|
|
509
|
+
compaction: 'unknown',
|
|
510
|
+
effort: 'unknown',
|
|
511
|
+
speed: 'unknown',
|
|
512
|
+
taskBudget: 'unknown',
|
|
513
|
+
},
|
|
514
|
+
'claude-sonnet-4-5-20250929': {
|
|
515
|
+
documented: false,
|
|
516
|
+
maxOutputTokens: 64000,
|
|
517
|
+
knownModel: true,
|
|
518
|
+
nativeStructuredOutput: true,
|
|
519
|
+
thinking: { modes: ['budget'], canBeDisabled: 'always' },
|
|
520
|
+
reasoningEfforts: undefined,
|
|
521
|
+
sampling: true,
|
|
522
|
+
forcedToolUse: true,
|
|
523
|
+
toolSearch: 'unknown',
|
|
524
|
+
compaction: 'unknown',
|
|
525
|
+
effort: 'unknown',
|
|
526
|
+
speed: 'unknown',
|
|
527
|
+
taskBudget: 'unknown',
|
|
528
|
+
},
|
|
529
|
+
} satisfies Readonly<Record<string, AnthropicLanguageModelRow>>;
|
|
250
530
|
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
'claude-opus-4-5': { toolSearch: true, compaction: false, effort: true },
|
|
265
|
-
'claude-haiku-4-5': { toolSearch: true, compaction: false, effort: false },
|
|
266
|
-
'claude-sonnet-4-5': { toolSearch: true, compaction: false, effort: false },
|
|
267
|
-
'claude-opus-4-1': { toolSearch: false, compaction: false, effort: false },
|
|
268
|
-
'claude-opus-4-0': { toolSearch: false, compaction: false, effort: false },
|
|
269
|
-
'claude-sonnet-4-0': { toolSearch: false, compaction: false, effort: false },
|
|
270
|
-
// Known IDs without declared capabilities retain the custom-model fallback.
|
|
271
|
-
'claude-3-haiku-20240307': undefined,
|
|
272
|
-
'claude-haiku-4-5-20251001': undefined,
|
|
273
|
-
'claude-opus-4-1-20250805': undefined,
|
|
274
|
-
'claude-opus-4-20250514': undefined,
|
|
275
|
-
'claude-opus-4-5-20251101': undefined,
|
|
276
|
-
'claude-sonnet-4-20250514': undefined,
|
|
277
|
-
'claude-sonnet-4-5-20250929': undefined,
|
|
278
|
-
} satisfies Readonly<Record<string, DocumentedCapabilities | undefined>>;
|
|
531
|
+
const languageModelRows = Object.entries<AnthropicLanguageModelRow>(
|
|
532
|
+
languageModelDefinitions,
|
|
533
|
+
);
|
|
534
|
+
|
|
535
|
+
/** Entries for every listed model ID, documented or not. */
|
|
536
|
+
const listedLanguageModelEntries: Readonly<
|
|
537
|
+
Record<string, AnthropicLanguageModelEntry>
|
|
538
|
+
> = Object.fromEntries(
|
|
539
|
+
languageModelRows.map(([modelId, row]) => [
|
|
540
|
+
modelId,
|
|
541
|
+
createAnthropicLanguageModelEntry(row),
|
|
542
|
+
]),
|
|
543
|
+
);
|
|
279
544
|
|
|
280
545
|
export const anthropicModelCatalog: Readonly<
|
|
281
546
|
Record<string, AnthropicLanguageModelEntry>
|
|
282
547
|
> = Object.fromEntries(
|
|
283
|
-
|
|
284
|
-
.filter(([,
|
|
285
|
-
.map(([modelId
|
|
286
|
-
modelId,
|
|
287
|
-
createAnthropicLanguageModelEntry(modelId, capabilities),
|
|
288
|
-
]),
|
|
548
|
+
languageModelRows
|
|
549
|
+
.filter(([, row]) => row.documented)
|
|
550
|
+
.map(([modelId]) => [modelId, listedLanguageModelEntries[modelId]]),
|
|
289
551
|
);
|
|
290
552
|
|
|
291
553
|
export function getAnthropicLanguageModelEntry(
|
|
292
554
|
modelId: string,
|
|
293
555
|
): AnthropicLanguageModelEntry {
|
|
294
|
-
return Object.prototype.hasOwnProperty.call(
|
|
295
|
-
|
|
296
|
-
|
|
556
|
+
return Object.prototype.hasOwnProperty.call(
|
|
557
|
+
listedLanguageModelEntries,
|
|
558
|
+
modelId,
|
|
559
|
+
)
|
|
560
|
+
? listedLanguageModelEntries[modelId]
|
|
561
|
+
: createAnthropicLanguageModelEntry(getUnlistedModelRow(modelId));
|
|
297
562
|
}
|
|
298
563
|
|
|
299
564
|
function createAnthropicLanguageModelEntry(
|
|
300
|
-
|
|
301
|
-
documented?: DocumentedCapabilities,
|
|
565
|
+
row: AnthropicLanguageModelRow,
|
|
302
566
|
): AnthropicLanguageModelEntry {
|
|
303
|
-
const
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
const reasoningSupport = runtime.adaptiveThinking || runtime.budgetThinking;
|
|
567
|
+
const documentedSupport: ModelCapability = row.documented ? true : 'unknown';
|
|
568
|
+
const thinkingModes: readonly AnthropicThinkingMode[] =
|
|
569
|
+
row.thinking === false ? [] : row.thinking.modes;
|
|
570
|
+
const thinkingCanBeDisabled =
|
|
571
|
+
row.thinking === false ? false : row.thinking.canBeDisabled;
|
|
309
572
|
|
|
310
573
|
return {
|
|
311
574
|
capabilities: {
|
|
312
575
|
language: {
|
|
313
576
|
inputs: {
|
|
314
|
-
image:
|
|
315
|
-
audio:
|
|
577
|
+
image: documentedSupport,
|
|
578
|
+
audio: row.documented ? false : 'unknown',
|
|
316
579
|
},
|
|
317
|
-
objectGeneration:
|
|
580
|
+
objectGeneration: documentedSupport,
|
|
318
581
|
tools: {
|
|
319
|
-
usage:
|
|
320
|
-
streaming:
|
|
321
|
-
forcedChoice:
|
|
322
|
-
computerUse:
|
|
323
|
-
webSearch:
|
|
324
|
-
toolSearch:
|
|
582
|
+
usage: documentedSupport,
|
|
583
|
+
streaming: documentedSupport,
|
|
584
|
+
forcedChoice: row.forcedToolUse,
|
|
585
|
+
computerUse: documentedSupport,
|
|
586
|
+
webSearch: documentedSupport,
|
|
587
|
+
toolSearch: row.toolSearch,
|
|
325
588
|
},
|
|
326
589
|
reasoning: {
|
|
327
|
-
support:
|
|
328
|
-
efforts:
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
runtime.thinkingCanBeDisabledAboveHighEffort,
|
|
336
|
-
supportsXhighEffort: runtime.xhighEffort,
|
|
337
|
-
betweenTools: runtime.betweenToolsThinking,
|
|
590
|
+
support: row.thinking !== false,
|
|
591
|
+
efforts: row.reasoningEfforts,
|
|
592
|
+
adaptive: thinkingModes.includes('adaptive'),
|
|
593
|
+
budget: thinkingModes.includes('budget'),
|
|
594
|
+
canDisable: thinkingCanBeDisabled !== false,
|
|
595
|
+
canDisableAboveHighEffort: thinkingCanBeDisabled === 'always',
|
|
596
|
+
supportsXhighEffort: row.reasoningEfforts?.includes('xhigh') ?? false,
|
|
597
|
+
betweenTools: thinkingModes.includes('between-tools'),
|
|
338
598
|
},
|
|
339
599
|
sampling: {
|
|
340
|
-
temperature:
|
|
341
|
-
topP:
|
|
342
|
-
topK:
|
|
600
|
+
temperature: row.sampling,
|
|
601
|
+
topP: row.sampling,
|
|
602
|
+
topK: row.sampling,
|
|
343
603
|
logprobs: false,
|
|
344
604
|
},
|
|
345
|
-
structuredOutput: { native:
|
|
346
|
-
compaction:
|
|
605
|
+
structuredOutput: { native: row.nativeStructuredOutput },
|
|
606
|
+
compaction: row.compaction,
|
|
347
607
|
},
|
|
348
608
|
},
|
|
349
609
|
providerOptions: {
|
|
350
610
|
language: declareProviderOptions(
|
|
351
611
|
anthropicProviderOptions.language,
|
|
352
|
-
|
|
612
|
+
documentedSupport,
|
|
353
613
|
{
|
|
354
614
|
includePings: true,
|
|
355
|
-
thinking:
|
|
356
|
-
effort:
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
// Task budgets are documented for claude-opus-4-7; other models are
|
|
360
|
-
// not documented either way.
|
|
361
|
-
taskBudget: modelId === 'claude-opus-4-7' ? true : 'unknown',
|
|
615
|
+
thinking: row.thinking !== false,
|
|
616
|
+
effort: row.effort,
|
|
617
|
+
speed: row.speed,
|
|
618
|
+
taskBudget: row.taskBudget,
|
|
362
619
|
},
|
|
363
620
|
),
|
|
364
621
|
},
|
|
365
622
|
requestConfig: {
|
|
366
623
|
language: {
|
|
367
|
-
maxOutputTokens:
|
|
368
|
-
knownModel:
|
|
624
|
+
maxOutputTokens: row.maxOutputTokens,
|
|
625
|
+
knownModel: row.knownModel,
|
|
369
626
|
},
|
|
370
627
|
},
|
|
371
628
|
};
|
|
@@ -385,17 +642,160 @@ function declareProviderOptions<Option extends string>(
|
|
|
385
642
|
) as Record<Option, ModelCapability>;
|
|
386
643
|
}
|
|
387
644
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
645
|
+
/**
|
|
646
|
+
* Generic rows for model IDs that are not in the matrix and match no listed
|
|
647
|
+
* model family.
|
|
648
|
+
*/
|
|
649
|
+
const unknownClaudeModel: AnthropicLanguageModelRow = {
|
|
650
|
+
documented: false,
|
|
651
|
+
maxOutputTokens: 128000,
|
|
652
|
+
knownModel: false,
|
|
653
|
+
nativeStructuredOutput: true,
|
|
654
|
+
thinking: {
|
|
655
|
+
modes: ['adaptive', 'budget'],
|
|
656
|
+
canBeDisabled: 'up-to-high-effort',
|
|
657
|
+
},
|
|
658
|
+
reasoningEfforts: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
659
|
+
sampling: onlyWithoutThinking,
|
|
660
|
+
forcedToolUse: true,
|
|
661
|
+
toolSearch: 'unknown',
|
|
662
|
+
compaction: 'unknown',
|
|
663
|
+
effort: 'unknown',
|
|
664
|
+
speed: 'unknown',
|
|
665
|
+
taskBudget: 'unknown',
|
|
666
|
+
};
|
|
391
667
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
668
|
+
/** Legacy Claude models (Claude Instant, 2, and 3) and non-Claude model IDs. */
|
|
669
|
+
const unknownLegacyModel: AnthropicLanguageModelRow = {
|
|
670
|
+
documented: false,
|
|
671
|
+
maxOutputTokens: 4096,
|
|
672
|
+
knownModel: false,
|
|
673
|
+
nativeStructuredOutput: false,
|
|
674
|
+
thinking: { modes: ['budget'], canBeDisabled: 'always' },
|
|
675
|
+
reasoningEfforts: undefined,
|
|
676
|
+
sampling: true,
|
|
677
|
+
forcedToolUse: true,
|
|
678
|
+
toolSearch: 'unknown',
|
|
679
|
+
compaction: 'unknown',
|
|
680
|
+
effort: 'unknown',
|
|
681
|
+
speed: 'unknown',
|
|
682
|
+
taskBudget: 'unknown',
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Family rules, used only for model IDs that are not listed in the matrix,
|
|
687
|
+
* such as provider-prefixed, regional, or versioned IDs. The first match
|
|
688
|
+
* decides which listed row's request behavior the model ID uses.
|
|
689
|
+
*/
|
|
690
|
+
const unlistedModelFamilies: readonly {
|
|
691
|
+
matches: (modelId: string) => boolean;
|
|
692
|
+
row: AnthropicLanguageModelRow;
|
|
693
|
+
}[] = [
|
|
694
|
+
{
|
|
695
|
+
matches: modelId => modelId.includes('claude-sonnet-5-5'),
|
|
696
|
+
row: languageModelDefinitions['claude-sonnet-5-5'],
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
matches: modelId => modelId.includes('claude-opus-5-5'),
|
|
700
|
+
row: languageModelDefinitions['claude-opus-5-5'],
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
matches: modelId => modelId.includes('claude-haiku-5-5'),
|
|
704
|
+
row: languageModelDefinitions['claude-haiku-5-5'],
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
matches: modelId => modelId.includes('claude-opus-5'),
|
|
708
|
+
row: languageModelDefinitions['claude-opus-5'],
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
matches: modelId => modelId.includes('claude-fable-5-2'),
|
|
712
|
+
row: languageModelDefinitions['claude-fable-5-2'],
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
matches: modelId => modelId.includes('claude-fable-5-1'),
|
|
716
|
+
row: languageModelDefinitions['claude-fable-5-1'],
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
matches: modelId => modelId.includes('claude-fable-5'),
|
|
720
|
+
row: languageModelDefinitions['claude-fable-5'],
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
matches: modelId => modelId.includes('claude-opus-4-8'),
|
|
724
|
+
row: languageModelDefinitions['claude-opus-4-8'],
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
matches: modelId => modelId.includes('claude-opus-4-7'),
|
|
728
|
+
row: languageModelDefinitions['claude-opus-4-7'],
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
matches: modelId => modelId.includes('claude-sonnet-5'),
|
|
732
|
+
row: languageModelDefinitions['claude-sonnet-5'],
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
matches: modelId => modelId.includes('claude-sonnet-4-6'),
|
|
736
|
+
row: languageModelDefinitions['claude-sonnet-4-6'],
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
matches: modelId => modelId.includes('claude-opus-4-6'),
|
|
740
|
+
row: languageModelDefinitions['claude-opus-4-6'],
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
matches: modelId => modelId.includes('claude-sonnet-4-5'),
|
|
744
|
+
row: languageModelDefinitions['claude-sonnet-4-5'],
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
matches: modelId => modelId.includes('claude-opus-4-5'),
|
|
748
|
+
row: languageModelDefinitions['claude-opus-4-5'],
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
matches: modelId => modelId.includes('claude-haiku-4-5'),
|
|
752
|
+
row: languageModelDefinitions['claude-haiku-4-5'],
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
matches: modelId => modelId.includes('claude-opus-4-1'),
|
|
756
|
+
row: languageModelDefinitions['claude-opus-4-1'],
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
matches: modelId => /claude-sonnet-4(?:-|@)/.test(modelId),
|
|
760
|
+
row: languageModelDefinitions['claude-sonnet-4-0'],
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
matches: modelId => /claude-opus-4(?:-|@)/.test(modelId),
|
|
764
|
+
row: languageModelDefinitions['claude-opus-4-0'],
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
matches: modelId => modelId.includes('claude-3-haiku'),
|
|
768
|
+
row: languageModelDefinitions['claude-3-haiku-20240307'],
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
matches: modelId =>
|
|
772
|
+
/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId),
|
|
773
|
+
row: unknownLegacyModel,
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
matches: modelId => modelId.includes('claude-'),
|
|
777
|
+
row: unknownClaudeModel,
|
|
778
|
+
},
|
|
779
|
+
];
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Resolves an unlisted model ID to a row. A family match keeps that family's
|
|
783
|
+
* request behavior, but nothing is documented for the unlisted ID itself.
|
|
784
|
+
*/
|
|
785
|
+
function getUnlistedModelRow(modelId: string): AnthropicLanguageModelRow {
|
|
786
|
+
const row =
|
|
787
|
+
unlistedModelFamilies.find(family => family.matches(modelId))?.row ??
|
|
788
|
+
unknownLegacyModel;
|
|
789
|
+
|
|
790
|
+
return {
|
|
791
|
+
...row,
|
|
792
|
+
documented: false,
|
|
793
|
+
toolSearch: 'unknown',
|
|
794
|
+
compaction: 'unknown',
|
|
795
|
+
effort: 'unknown',
|
|
796
|
+
speed: 'unknown',
|
|
797
|
+
taskBudget: 'unknown',
|
|
798
|
+
};
|
|
399
799
|
}
|
|
400
800
|
|
|
401
801
|
/** Compatibility projection for the provider's existing request preparation. */
|