Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
13 changes: 13 additions & 0 deletions packages/types/src/providers/anthropic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,19 @@ export const anthropicModels = {
cacheWritesPrice: 0.3,
cacheReadsPrice: 0.03,
},
"claude-haiku-4-5-20251001": {
maxTokens: 64_000,
contextWindow: 200_000,
supportsImages: true,
supportsPromptCache: true,
inputPrice: 1.0,
outputPrice: 5.0,
cacheWritesPrice: 1.25,
cacheReadsPrice: 0.1,
supportsReasoningBudget: true,
description:
"Claude Haiku 4.5 delivers near-frontier intelligence at lightning speeds with extended thinking, vision, and multilingual support.",
},
} as const satisfies Record<string, ModelInfo>

export const ANTHROPIC_DEFAULT_MAX_TOKENS = 8192
14 changes: 14 additions & 0 deletions packages/types/src/providers/bedrock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,20 @@ export const bedrockModels = {
maxCachePoints: 4,
cachableFields: ["system", "messages", "tools"],
},
"anthropic.claude-haiku-4-5-20251001-v1:0": {
maxTokens: 8192,
contextWindow: 200_000,
supportsImages: true,
supportsPromptCache: true,
supportsReasoningBudget: true,
inputPrice: 1.0,
outputPrice: 5.0,
cacheWritesPrice: 1.25, // 5m cache writes
cacheReadsPrice: 0.1, // cache hits / refreshes
minTokensPerCachePoint: 2048,
maxCachePoints: 4,
cachableFields: ["system", "messages", "tools"],
},
"anthropic.claude-3-5-sonnet-20240620-v1:0": {
maxTokens: 8192,
contextWindow: 200_000,
Expand Down
8 changes: 8 additions & 0 deletions packages/types/src/providers/claude-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,12 @@ export const claudeCodeModels = {
supportsReasoningBudget: false,
requiredReasoningBudget: false,
},
"claude-haiku-4-5-20251001": {
...anthropicModels["claude-haiku-4-5-20251001"],
supportsImages: false,
supportsPromptCache: true, // Claude Code does report cache tokens
supportsReasoningEffort: false,
supportsReasoningBudget: false,
requiredReasoningBudget: false,
},
} as const satisfies Record<string, ModelInfo>
1 change: 1 addition & 0 deletions packages/types/src/providers/openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const OPEN_ROUTER_REASONING_BUDGET_MODELS = new Set([
"anthropic/claude-opus-4.1",
"anthropic/claude-sonnet-4",
"anthropic/claude-sonnet-4.5",
"anthropic/claude-haiku-4.5",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The model anthropic/claude-haiku-4.5 should also be added to the OPEN_ROUTER_PROMPT_CACHING_MODELS set (around line 22-53). Since this model supports prompt caching (as indicated in the Anthropic model definition and the PR description), it should be included alongside other Haiku models like anthropic/claude-3.5-haiku and anthropic/claude-3.5-haiku-20241022.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good catch?

"google/gemini-2.5-pro-preview",
"google/gemini-2.5-pro",
"google/gemini-2.5-flash-preview-05-20",
Expand Down
11 changes: 11 additions & 0 deletions packages/types/src/providers/vertex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,17 @@ export const vertexModels = {
cacheReadsPrice: 0.3,
supportsReasoningBudget: true,
},
"claude-haiku-4-5@20251001": {
maxTokens: 8192,
contextWindow: 200_000,
supportsImages: true,
supportsPromptCache: true,
inputPrice: 1.0,
outputPrice: 5.0,
cacheWritesPrice: 1.25,
cacheReadsPrice: 0.1,
supportsReasoningBudget: true,
},
"claude-opus-4-1@20250805": {
maxTokens: 8192,
contextWindow: 200_000,
Expand Down
2 changes: 2 additions & 0 deletions src/api/providers/anthropic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
case "claude-3-5-sonnet-20241022":
case "claude-3-5-haiku-20241022":
case "claude-3-opus-20240229":
case "claude-haiku-4-5-20251001":
case "claude-3-haiku-20240307": {
/**
* The latest message will be the new user message, one before
Expand Down Expand Up @@ -122,6 +123,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
case "claude-3-5-sonnet-20241022":
case "claude-3-5-haiku-20241022":
case "claude-3-opus-20240229":
case "claude-haiku-4-5-20251001":
case "claude-3-haiku-20240307":
betas.push("prompt-caching-2024-07-31")
return { headers: { "anthropic-beta": betas.join(",") } }
Expand Down
7 changes: 7 additions & 0 deletions src/api/providers/fetchers/openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,13 @@ export const parseOpenRouterModel = ({
modelInfo.maxTokens = anthropicModels["claude-opus-4-1-20250805"].maxTokens
}

// Ensure correct reasoning handling for Claude Haiku 4.5 on OpenRouter
// Use budget control and disable effort-based reasoning fallback
if (id === "anthropic/claude-haiku-4.5") {
modelInfo.supportsReasoningBudget = true
modelInfo.supportsReasoningEffort = false
}

// Set horizon-alpha model to 32k max tokens
if (id === "openrouter/horizon-alpha") {
modelInfo.maxTokens = 32768
Expand Down
Loading