Skip to content

Commit 1127e2a

Browse files
committed
Add Claude 3.7 Sonnet
1 parent 25ea46a commit 1127e2a

File tree

8 files changed

+57
-28
lines changed

8 files changed

+57
-28
lines changed

src/api/providers/anthropic.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export class AnthropicHandler implements ApiHandler {
2424
const modelId = model.id
2525
switch (modelId) {
2626
// 'latest' alias does not support cache_control
27+
case "claude-3-7-sonnet-20250219":
2728
case "claude-3-5-sonnet-20241022":
2829
case "claude-3-5-haiku-20241022":
2930
case "claude-3-opus-20240229":
@@ -88,6 +89,7 @@ export class AnthropicHandler implements ApiHandler {
8889
// https://github.com/anthropics/anthropic-sdk-typescript?tab=readme-ov-file#default-headers
8990
// https://github.com/anthropics/anthropic-sdk-typescript/commit/c920b77fc67bd839bfeb6716ceab9d7c9bbe7393
9091
switch (modelId) {
92+
case "claude-3-7-sonnet-20250219":
9193
case "claude-3-5-sonnet-20241022":
9294
case "claude-3-5-haiku-20241022":
9395
case "claude-3-opus-20240229":

src/api/providers/openrouter.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export class OpenRouterHandler implements ApiHandler {
3838
// prompt caching: https://openrouter.ai/docs/prompt-caching
3939
// this is specifically for claude models (some models may 'support prompt caching' automatically without this)
4040
switch (model.id) {
41+
case "anthropic/claude-3-7-sonnet":
42+
case "anthropic/claude-3-7-sonnet:beta":
4143
case "anthropic/claude-3.5-sonnet":
4244
case "anthropic/claude-3.5-sonnet:beta":
4345
case "anthropic/claude-3.5-sonnet-20240620":
@@ -89,6 +91,8 @@ export class OpenRouterHandler implements ApiHandler {
8991
// (models usually default to max tokens allowed)
9092
let maxTokens: number | undefined
9193
switch (model.id) {
94+
case "anthropic/claude-3-7-sonnet":
95+
case "anthropic/claude-3-7-sonnet:beta":
9296
case "anthropic/claude-3.5-sonnet":
9397
case "anthropic/claude-3.5-sonnet:beta":
9498
case "anthropic/claude-3.5-sonnet-20240620":

src/core/webview/ClineProvider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,8 @@ Here is the project's README to help you get started:\n\n${mcpDetails.readmeCont
14071407
}
14081408

14091409
switch (rawModel.id) {
1410+
case "anthropic/claude-3-7-sonnet":
1411+
case "anthropic/claude-3-7-sonnet:beta":
14101412
case "anthropic/claude-3.5-sonnet":
14111413
case "anthropic/claude-3.5-sonnet:beta":
14121414
// NOTE: this needs to be synced with api.ts/openrouter default model info

src/shared/api.ts

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,19 @@ export interface ModelInfo {
8080
// Anthropic
8181
// https://docs.anthropic.com/en/docs/about-claude/models // prices updated 2025-01-02
8282
export type AnthropicModelId = keyof typeof anthropicModels
83-
export const anthropicDefaultModelId: AnthropicModelId = "claude-3-5-sonnet-20241022"
83+
export const anthropicDefaultModelId: AnthropicModelId = "claude-3-7-sonnet-20250219"
8484
export const anthropicModels = {
85+
"claude-3-7-sonnet-20250219": {
86+
maxTokens: 8192,
87+
contextWindow: 200_000,
88+
supportsImages: true,
89+
supportsComputerUse: true,
90+
supportsPromptCache: true,
91+
inputPrice: 3.0,
92+
outputPrice: 15.0,
93+
cacheWritesPrice: 3.75,
94+
cacheReadsPrice: 0.3,
95+
},
8596
"claude-3-5-sonnet-20241022": {
8697
maxTokens: 8192,
8798
contextWindow: 200_000,
@@ -130,6 +141,17 @@ export const anthropicModels = {
130141
export type BedrockModelId = keyof typeof bedrockModels
131142
export const bedrockDefaultModelId: BedrockModelId = "anthropic.claude-3-5-sonnet-20241022-v2:0"
132143
export const bedrockModels = {
144+
"anthropic.claude-3-7-sonnet-20250219-v1:0": {
145+
maxTokens: 8192,
146+
contextWindow: 200_000,
147+
supportsImages: true,
148+
supportsComputerUse: true,
149+
supportsPromptCache: true,
150+
inputPrice: 3.0,
151+
outputPrice: 15.0,
152+
cacheWritesPrice: 3.75,
153+
cacheReadsPrice: 0.3,
154+
},
133155
"anthropic.claude-3-5-sonnet-20241022-v2:0": {
134156
maxTokens: 8192,
135157
contextWindow: 200_000,
@@ -183,7 +205,7 @@ export const bedrockModels = {
183205

184206
// OpenRouter
185207
// https://openrouter.ai/models?order=newest&supported_parameters=tools
186-
export const openRouterDefaultModelId = "anthropic/claude-3.5-sonnet" // will always exist in openRouterModels
208+
export const openRouterDefaultModelId = "anthropic/claude-3-7-sonnet" // will always exist in openRouterModels
187209
export const openRouterDefaultModelInfo: ModelInfo = {
188210
maxTokens: 8192,
189211
contextWindow: 200_000,
@@ -195,14 +217,23 @@ export const openRouterDefaultModelInfo: ModelInfo = {
195217
cacheWritesPrice: 3.75,
196218
cacheReadsPrice: 0.3,
197219
description:
198-
"The new Claude 3.5 Sonnet delivers better-than-Opus capabilities, faster-than-Sonnet speeds, at the same Sonnet prices. Sonnet is particularly good at:\n\n- Coding: New Sonnet scores ~49% on SWE-Bench Verified, higher than the last best score, and without any fancy prompt scaffolding\n- Data science: Augments human data science expertise; navigates unstructured data while using multiple tools for insights\n- Visual processing: excelling at interpreting charts, graphs, and images, accurately transcribing text to derive insights beyond just the text alone\n- Agentic tasks: exceptional tool use, making it great at agentic tasks (i.e. complex, multi-step problem solving tasks that require engaging with other systems)\n\n#multimodal",
220+
"Claude 3.7 Sonnet is an advanced large language model with improved reasoning, coding, and problem-solving capabilities. It introduces a hybrid reasoning approach, allowing users to choose between rapid responses and extended, step-by-step processing for complex tasks. The model demonstrates notable improvements in coding, particularly in front-end development and full-stack updates, and excels in agentic workflows, where it can autonomously navigate multi-step processes. \n\nClaude 3.7 Sonnet maintains performance parity with its predecessor in standard mode while offering an extended reasoning mode for enhanced accuracy in math, coding, and instruction-following tasks.\n\nRead more at the [blog post here](https://www.anthropic.com/news/claude-3-7-sonnet)",
199221
}
200222

201223
// Vertex AI
202224
// https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-claude
203225
export type VertexModelId = keyof typeof vertexModels
204226
export const vertexDefaultModelId: VertexModelId = "claude-3-5-sonnet-v2@20241022"
205227
export const vertexModels = {
228+
"claude-3-7-sonnet@20250219": {
229+
maxTokens: 8192,
230+
contextWindow: 200_000,
231+
supportsImages: true,
232+
supportsComputerUse: true,
233+
supportsPromptCache: false,
234+
inputPrice: 3.0,
235+
outputPrice: 15.0,
236+
},
206237
"claude-3-5-sonnet-v2@20241022": {
207238
maxTokens: 8192,
208239
contextWindow: 200_000,

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -793,16 +793,11 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
793793
<div style={{ padding: "0 20px", flexShrink: 0 }}>
794794
<h2>What can I do for you?</h2>
795795
<p>
796-
Thanks to{" "}
797-
<VSCodeLink
798-
href="https://www-cdn.anthropic.com/fed9cc193a14b84131812372d8d5857f8f304c52/Model_Card_Claude_3_Addendum.pdf"
799-
style={{ display: "inline" }}>
800-
Claude 3.5 Sonnet's agentic coding capabilities,
801-
</VSCodeLink>{" "}
802-
I can handle complex software development tasks step-by-step. With tools that let me create & edit
803-
files, explore complex projects, use the browser, and execute terminal commands (after you grant
804-
permission), I can assist you in ways that go beyond code completion or tech support. I can even use
805-
MCP to create new tools and extend my own capabilities.
796+
Thanks to Claude 3.7 Sonnet's agentic coding capabilities, I can handle complex software development
797+
tasks step-by-step. With tools that let me create & edit files, explore complex projects, use the
798+
browser, and execute terminal commands (after you grant permission), I can assist you in ways that go
799+
beyond code completion or tech support. I can even use MCP to create new tools and extend my own
800+
capabilities.
806801
</p>
807802
</div>
808803
{taskHistory.length > 0 && <HistoryPreview showHistoryView={showHistoryView} />}

webview-ui/src/components/settings/ApiOptions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is
938938
}}>
939939
The VS Code Language Model API allows you to run models provided by other VS Code extensions
940940
(including but not limited to GitHub Copilot). The easiest way to get started is to install the
941-
Copilot extension from the VS Marketplace and enabling Claude 3.5 Sonnet.
941+
Copilot extension from the VS Marketplace and enabling Claude 3.7 Sonnet.
942942
</p>
943943
)}
944944

webview-ui/src/components/settings/OpenRouterModelPicker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ const OpenRouterModelPicker: React.FC<OpenRouterModelPickerProps> = ({ isPopup }
228228
If you're unsure which model to choose, Cline works best with{" "}
229229
<VSCodeLink
230230
style={{ display: "inline", fontSize: "inherit" }}
231-
onClick={() => handleModelChange("anthropic/claude-3.5-sonnet")}>
232-
anthropic/claude-3.5-sonnet.
231+
onClick={() => handleModelChange("anthropic/claude-3-7-sonnet")}>
232+
anthropic/claude-3-7-sonnet.
233233
</VSCodeLink>
234234
You can also try searching "free" for no-cost options currently available.
235235
</>

webview-ui/src/components/welcome/WelcomeView.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { VSCodeButton, VSCodeLink, VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
2-
import { useEffect, useState, useCallback } from "react"
1+
import { VSCodeButton, VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
2+
import { useCallback, useEffect, useState } from "react"
3+
import { useEvent } from "react-use"
4+
import { ExtensionMessage } from "../../../../src/shared/ExtensionMessage"
35
import { useExtensionState } from "../../context/ExtensionStateContext"
46
import { validateApiConfiguration } from "../../utils/validate"
57
import { vscode } from "../../utils/vscode"
68
import ApiOptions from "../settings/ApiOptions"
7-
import { useEvent } from "react-use"
8-
import { ExtensionMessage } from "../../../../src/shared/ExtensionMessage"
99

1010
const WelcomeView = () => {
1111
const { apiConfiguration } = useExtensionState()
@@ -58,18 +58,13 @@ const WelcomeView = () => {
5858
}}>
5959
<h2>Hi, I'm Cline</h2>
6060
<p>
61-
I can do all kinds of tasks thanks to the latest breakthroughs in{" "}
62-
<VSCodeLink
63-
href="https://www-cdn.anthropic.com/fed9cc193a14b84131812372d8d5857f8f304c52/Model_Card_Claude_3_Addendum.pdf"
64-
style={{ display: "inline" }}>
65-
Claude 3.5 Sonnet's agentic coding capabilities
66-
</VSCodeLink>{" "}
67-
and access to tools that let me create & edit files, explore complex projects, use the browser, and execute
61+
I can do all kinds of tasks thanks to breakthroughs in Claude 3.7 Sonnet's agentic coding capabilities and
62+
access to tools that let me create & edit files, explore complex projects, use the browser, and execute
6863
terminal commands (with your permission, of course). I can even use MCP to create new tools and extend my own
6964
capabilities.
7065
</p>
7166

72-
<b>To get started, this extension needs an API provider for Claude 3.5 Sonnet.</b>
67+
<b>To get started, this extension needs an API provider for Claude 3.7 Sonnet.</b>
7368

7469
<div
7570
style={{

0 commit comments

Comments
 (0)