Add 1m context window model variant for claude sonnet 4 (#5526)

* Add 1m context window model variant for claude sonnet 4

* Fix cost calculation for 1m tier

* Add new 1m context window announcement

* Create beige-bobcats-watch.md

* Add bedrock support for 1m context
This commit is contained in:
Saoud Rizwan authored and GitHub committed 2025-08-13 12:53:23 -07:00
1 parent 94acfec39f
commit 79bda976cb
11 files changed
+114 -54

No files matched your search

+42 -1
View File
@@ -200,11 +200,40 @@ export interface OpenAiCompatibleModelInfo extends ModelInfo {
isR1FormatRequired?: boolean
}
export const CLAUDE_SONNET_4_1M_SUFFIX = ":1m"
export const CLAUDE_SONNET_4_1M_TIERS = [
{
contextWindow: 200000,
inputPrice: 3.0,
outputPrice: 15,
cacheWritesPrice: 3.75,
cacheReadsPrice: 0.3,
},
{
contextWindow: Number.MAX_SAFE_INTEGER, // storing infinity in vs storage is not possible, it converts to 'null', which causes crash in webview ModelInfoView
inputPrice: 6,
outputPrice: 22.5,
cacheWritesPrice: 7.5,
cacheReadsPrice: 0.6,
},
]
// Anthropic
// https://docs.anthropic.com/en/docs/about-claude/models // prices updated 2025-01-02
export type AnthropicModelId = keyof typeof anthropicModels
export const anthropicDefaultModelId: AnthropicModelId = "claude-sonnet-4-20250514"
export const anthropicModels = {
"claude-sonnet-4-20250514:1m": {
maxTokens: 8192,
contextWindow: 1_000_000,
supportsImages: true,
supportsPromptCache: true,
inputPrice: 3.0,
outputPrice: 15.0,
cacheWritesPrice: 3.75,
cacheReadsPrice: 0.3,
tiers: CLAUDE_SONNET_4_1M_TIERS,
},
"claude-sonnet-4-20250514": {
maxTokens: 8192,
contextWindow: 200_000,
@@ -331,6 +360,17 @@ export const claudeCodeModels = {
export type BedrockModelId = keyof typeof bedrockModels
export const bedrockDefaultModelId: BedrockModelId = "anthropic.claude-sonnet-4-20250514-v1:0"
export const bedrockModels = {
"anthropic.claude-sonnet-4-20250514-v1:0:1m": {
maxTokens: 8192,
contextWindow: 1_000_000,
supportsImages: true,
supportsPromptCache: true,
inputPrice: 3.0,
outputPrice: 15.0,
cacheWritesPrice: 3.75,
cacheReadsPrice: 0.3,
tiers: CLAUDE_SONNET_4_1M_TIERS,
},
"anthropic.claude-sonnet-4-20250514-v1:0": {
maxTokens: 8192,
contextWindow: 200_000,
@@ -482,7 +522,7 @@ export const bedrockModels = {
export const openRouterDefaultModelId = "anthropic/claude-sonnet-4" // will always exist in openRouterModels
export const openRouterDefaultModelInfo: ModelInfo = {
maxTokens: 8192,
contextWindow: 200_000,
contextWindow: 1_000_000,
supportsImages: true,
supportsPromptCache: true,
@@ -490,6 +530,7 @@ export const openRouterDefaultModelInfo: ModelInfo = {
outputPrice: 15.0,
cacheWritesPrice: 3.75,
cacheReadsPrice: 0.3,
tiers: CLAUDE_SONNET_4_1M_TIERS,
description:
"Claude Sonnet 4 delivers superior intelligence across coding, agentic search, and AI agent capabilities. It's a powerful choice for agentic coding, and can complete tasks across the entire software development lifecycle—from initial planning to bug fixes, maintenance to large refactors. It offers strong performance in both planning and solving for complex coding tasks, making it an ideal choice to power end-to-end software development processes.\n\nRead more in the [blog post here](https://www.anthropic.com/claude/sonnet)",
}