Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/sync-models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@tanstack/ai-anthropic': patch
'@tanstack/ai-gemini': patch
'@tanstack/ai-llmgateway': patch
'@tanstack/ai-neon': patch
'@tanstack/ai-openrouter': patch
'@tanstack/ai-vercel-gateway': patch
---

Update model metadata from OpenRouter API
55 changes: 55 additions & 0 deletions packages/ai-anthropic/src/model-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,49 @@ const CLAUDE_HAIKU_5_5 = {
AnthropicMaxTokensOptions
>

const CLAUDE_FABLE_5_2 = {
name: 'claude-fable-5-2',
id: 'claude-fable-5-2',
context_window: 1_000_000,
max_output_tokens: 128_000,
supports: {
input: ['text', 'image', 'document'],
extended_thinking: false,
adaptive_thinking: true,
priority_tier: true,
tools: [
'web_search',
'web_fetch',
'code_execution',
'computer',
'computer_toolset',
'bash',
'text_editor',
'memory',
],
},
pricing: {
input: {
normal: 8,
cached: 0.2,
},
output: {
normal: 40,
},
},
} as const satisfies ModelMeta<
AnthropicCacheControlOptions &
AnthropicContainerOptions &
AnthropicContextManagementOptions &
AnthropicMCPOptions &
AnthropicServiceTierOptions &
AnthropicStopSequencesOptions &
AnthropicToolChoiceOptions &
AnthropicMaxTokensOptions
>

export const ANTHROPIC_MODELS = [
CLAUDE_FABLE_5_2.id,
CLAUDE_HAIKU_5_5.id,
CLAUDE_SONNET_5_5.id,
CLAUDE_OPUS_5_5.id,
Expand Down Expand Up @@ -837,6 +879,7 @@ const ANTHROPIC_MODEL_MAX_OUTPUT_TOKENS: Record<string, number> = {
[CLAUDE_OPUS_5_5.id]: CLAUDE_OPUS_5_5.max_output_tokens,
[CLAUDE_SONNET_5_5.id]: CLAUDE_SONNET_5_5.max_output_tokens,
[CLAUDE_HAIKU_5_5.id]: CLAUDE_HAIKU_5_5.max_output_tokens,
[CLAUDE_FABLE_5_2.id]: CLAUDE_FABLE_5_2.max_output_tokens,
}

/**
Expand Down Expand Up @@ -885,6 +928,7 @@ export function getAnthropicDefaultMaxTokens(
* in `structuredOutput`.
*/
export const ANTHROPIC_COMBINED_TOOLS_AND_SCHEMA_MODELS = new Set<string>([
CLAUDE_FABLE_5_2.id,
CLAUDE_HAIKU_5_5.id,
CLAUDE_SONNET_5_5.id,
CLAUDE_OPUS_4_5.id,
Expand Down Expand Up @@ -1059,6 +1103,14 @@ export type AnthropicChatModelProviderOptionsByName = {
AnthropicStopSequencesOptions &
AnthropicToolChoiceOptions &
AnthropicMaxTokensOptions
[CLAUDE_FABLE_5_2.id]: AnthropicCacheControlOptions &
AnthropicContainerOptions &
AnthropicContextManagementOptions &
AnthropicMCPOptions &
AnthropicServiceTierOptions &
AnthropicStopSequencesOptions &
AnthropicToolChoiceOptions &
AnthropicMaxTokensOptions
}

export type AnthropicChatModelToolCapabilitiesByName = {
Expand All @@ -1076,6 +1128,7 @@ export type AnthropicChatModelToolCapabilitiesByName = {
[CLAUDE_OPUS_5_5.id]: typeof CLAUDE_OPUS_5_5.supports.tools
[CLAUDE_SONNET_5_5.id]: typeof CLAUDE_SONNET_5_5.supports.tools
[CLAUDE_HAIKU_5_5.id]: typeof CLAUDE_HAIKU_5_5.supports.tools
[CLAUDE_FABLE_5_2.id]: typeof CLAUDE_FABLE_5_2.supports.tools
}

/**
Expand Down Expand Up @@ -1128,6 +1181,7 @@ export type AnthropicModelInputModalitiesByName = {
[CLAUDE_OPUS_5_5.id]: typeof CLAUDE_OPUS_5_5.supports.input
[CLAUDE_SONNET_5_5.id]: typeof CLAUDE_SONNET_5_5.supports.input
[CLAUDE_HAIKU_5_5.id]: typeof CLAUDE_HAIKU_5_5.supports.input
[CLAUDE_FABLE_5_2.id]: typeof CLAUDE_FABLE_5_2.supports.input
}

/**
Expand All @@ -1152,6 +1206,7 @@ export const ANTHROPIC_MODEL_INPUT_MODALITIES: Readonly<
[CLAUDE_OPUS_5_5.id]: CLAUDE_OPUS_5_5.supports.input,
[CLAUDE_SONNET_5_5.id]: CLAUDE_SONNET_5_5.supports.input,
[CLAUDE_HAIKU_5_5.id]: CLAUDE_HAIKU_5_5.supports.input,
[CLAUDE_FABLE_5_2.id]: CLAUDE_FABLE_5_2.supports.input,
} satisfies AnthropicModelInputModalitiesByName

/**
Expand Down
72 changes: 72 additions & 0 deletions packages/ai-gemini/src/model-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,63 @@ const GEMINI_4_ARGON = {
GeminiStructuredOutputOptions
>

const GEMINI_4_CARBON = {
name: 'gemini-4-carbon',
max_input_tokens: 1_048_576,
max_output_tokens: 943_718,
supports: {
input: ['audio', 'document', 'image', 'text', 'video'],
output: ['text'],
capabilities: ['function_calling', 'structured_output', 'thinking'],
tools: ['code_execution', 'file_search', 'google_search', 'url_context'],
},
pricing: {
input: {
normal: 2,
cached: 0.1,
},
output: {
normal: 10,
},
},
} as const satisfies ModelMeta<
GeminiToolConfigOptions &
GeminiSafetyOptions &
GeminiCommonConfigOptions &
GeminiCachedContentOptions &
GeminiStructuredOutputOptions
>

const GEMINI_4_HYDROGEN = {
name: 'gemini-4-hydrogen',
max_input_tokens: 1_048_576,
max_output_tokens: 943_718,
supports: {
input: ['audio', 'document', 'image', 'text', 'video'],
output: ['text'],
capabilities: ['function_calling', 'structured_output', 'thinking'],
tools: ['code_execution', 'file_search', 'google_search', 'url_context'],
},
pricing: {
input: {
normal: 1.5,
cached: 0.075,
},
output: {
normal: 7.5,
},
},
} as const satisfies ModelMeta<
GeminiToolConfigOptions &
GeminiSafetyOptions &
GeminiCommonConfigOptions &
GeminiCachedContentOptions &
GeminiStructuredOutputOptions
>

export const GEMINI_MODELS = [
GEMINI_4_CARBON.name,
GEMINI_4_HYDROGEN.name,
GEMINI_4_ARGON.name,
GEMINI_3_8_FLASH.name,
GEMINI_3_7_FLASH.name,
Expand Down Expand Up @@ -1209,6 +1265,16 @@ export type GeminiChatModelProviderOptionsByName = {
GeminiCommonConfigOptions &
GeminiCachedContentOptions &
GeminiStructuredOutputOptions
[GEMINI_4_CARBON.name]: GeminiToolConfigOptions &
GeminiSafetyOptions &
GeminiCommonConfigOptions &
GeminiCachedContentOptions &
GeminiStructuredOutputOptions
[GEMINI_4_HYDROGEN.name]: GeminiToolConfigOptions &
GeminiSafetyOptions &
GeminiCommonConfigOptions &
GeminiCachedContentOptions &
GeminiStructuredOutputOptions
}

/**
Expand All @@ -1229,6 +1295,8 @@ export type GeminiChatModelToolCapabilitiesByName = {
[GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.tools
[GEMINI_2_5_FLASH_LITE.name]: typeof GEMINI_2_5_FLASH_LITE.supports.tools
[GEMINI_4_ARGON.name]: typeof GEMINI_4_ARGON.supports.tools
[GEMINI_4_CARBON.name]: typeof GEMINI_4_CARBON.supports.tools
[GEMINI_4_HYDROGEN.name]: typeof GEMINI_4_HYDROGEN.supports.tools
}

/**
Expand Down Expand Up @@ -1261,6 +1329,8 @@ export type GeminiModelInputModalitiesByName = {
// Models with text, image, audio, video (no document)
[GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.input
[GEMINI_4_ARGON.name]: typeof GEMINI_4_ARGON.supports.input
[GEMINI_4_CARBON.name]: typeof GEMINI_4_CARBON.supports.input
[GEMINI_4_HYDROGEN.name]: typeof GEMINI_4_HYDROGEN.supports.input
}

/**
Expand All @@ -1285,6 +1355,8 @@ export const GEMINI_MODEL_INPUT_MODALITIES: Readonly<
[GEMINI_2_5_FLASH_LITE.name]: GEMINI_2_5_FLASH_LITE.supports.input,
[GEMINI_2_5_FLASH.name]: GEMINI_2_5_FLASH.supports.input,
[GEMINI_4_ARGON.name]: GEMINI_4_ARGON.supports.input,
[GEMINI_4_CARBON.name]: GEMINI_4_CARBON.supports.input,
[GEMINI_4_HYDROGEN.name]: GEMINI_4_HYDROGEN.supports.input,
} satisfies GeminiModelInputModalitiesByName

// Reasoning
Expand Down
Loading