feat(models): add Claude Fable 5 (#4921)

* feat(models): add Claude Fable 5

* docs(anthropic): note Fable 5 in buildThinkingConfig docblock
This commit is contained in:
Waleed
2026-06-09 10:30:11 -07:00
committed by GitHub
parent f7811f8acc
commit b12b0f1da7
2 changed files with 21 additions and 1 deletions
+3 -1
View File
@@ -82,6 +82,7 @@ const THINKING_BUDGET_TOKENS: Record<string, number> = {
/**
* Checks if a model supports adaptive thinking (thinking.type: "adaptive").
* Fable 5 supports ONLY adaptive thinking (always on; type: "disabled" is rejected).
* Opus 4.8 and Opus 4.7 support ONLY adaptive thinking (no extended thinking / budget_tokens).
* Opus 4.6 and Sonnet 4.6 support both extended and adaptive thinking — use adaptive.
* Opus 4.5 supports effort but NOT adaptive thinking — it uses budget_tokens with type: "enabled".
@@ -89,6 +90,7 @@ const THINKING_BUDGET_TOKENS: Record<string, number> = {
function supportsAdaptiveThinking(modelId: string): boolean {
const normalizedModel = modelId.toLowerCase()
return (
normalizedModel.includes('fable-5') ||
normalizedModel.includes('opus-4-8') ||
normalizedModel.includes('opus-4.8') ||
normalizedModel.includes('opus-4-7') ||
@@ -103,7 +105,7 @@ function supportsAdaptiveThinking(modelId: string): boolean {
/**
* Builds the thinking configuration for the Anthropic API based on model capabilities and level.
*
* - Opus 4.8, Opus 4.7: Uses adaptive thinking only (no extended thinking support)
* - Fable 5, Opus 4.8, Opus 4.7: Uses adaptive thinking only (no extended thinking support)
* - Opus 4.6, Sonnet 4.6: Uses adaptive thinking with effort parameter
* - Other models: Uses budget_tokens-based extended thinking
*
+18
View File
@@ -631,6 +631,24 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
toolUsageControl: true,
},
models: [
{
id: 'claude-fable-5',
pricing: {
input: 10.0,
cachedInput: 1.0,
output: 50.0,
updatedAt: '2026-06-09',
},
capabilities: {
maxOutputTokens: 128000,
thinking: {
levels: ['low', 'medium', 'high', 'xhigh', 'max'],
default: 'high',
},
},
contextWindow: 1000000,
releaseDate: '2026-06-09',
},
{
id: 'claude-opus-4-8',
pricing: {