From 37047a6fde465160c58e5d5a7bfb6e67739281a9 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 22 May 2025 15:10:08 -0400 Subject: [PATCH] language_models: Update default/recommended Anthropic models to Claude Sonnet 4 (#31209) This PR updates the default/recommended models for the Anthropic and Zed providers to be Claude Sonnet 4. Release Notes: - Updated default/recommended Anthropic models to Claude Sonnet 4. --- crates/anthropic/src/anthropic.rs | 2 +- crates/language_models/src/provider/anthropic.rs | 4 ++-- crates/language_models/src/provider/cloud.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/anthropic/src/anthropic.rs b/crates/anthropic/src/anthropic.rs index 254fed9420..85f50b5633 100644 --- a/crates/anthropic/src/anthropic.rs +++ b/crates/anthropic/src/anthropic.rs @@ -34,7 +34,6 @@ pub enum AnthropicModelMode { pub enum Model { #[serde(rename = "claude-3-5-sonnet", alias = "claude-3-5-sonnet-latest")] Claude3_5Sonnet, - #[default] #[serde(rename = "claude-3-7-sonnet", alias = "claude-3-7-sonnet-latest")] Claude3_7Sonnet, #[serde( @@ -49,6 +48,7 @@ pub enum Model { alias = "claude-opus-4-thinking-latest" )] ClaudeOpus4Thinking, + #[default] #[serde(rename = "claude-sonnet-4", alias = "claude-sonnet-4-latest")] ClaudeSonnet4, #[serde( diff --git a/crates/language_models/src/provider/anthropic.rs b/crates/language_models/src/provider/anthropic.rs index 0f5c2bdbe9..c6a9a808bd 100644 --- a/crates/language_models/src/provider/anthropic.rs +++ b/crates/language_models/src/provider/anthropic.rs @@ -240,8 +240,8 @@ impl LanguageModelProvider for AnthropicLanguageModelProvider { fn recommended_models(&self, _cx: &App) -> Vec> { [ - anthropic::Model::Claude3_7Sonnet, - anthropic::Model::Claude3_7SonnetThinking, + anthropic::Model::ClaudeSonnet4, + anthropic::Model::ClaudeSonnet4Thinking, ] .into_iter() .map(|model| self.create_language_model(model)) diff --git a/crates/language_models/src/provider/cloud.rs b/crates/language_models/src/provider/cloud.rs index 10a32e0fa1..8847423b34 100644 --- a/crates/language_models/src/provider/cloud.rs +++ b/crates/language_models/src/provider/cloud.rs @@ -278,7 +278,7 @@ impl LanguageModelProvider for CloudLanguageModelProvider { fn default_model(&self, cx: &App) -> Option> { let llm_api_token = self.state.read(cx).llm_api_token.clone(); - let model = CloudModel::Anthropic(anthropic::Model::Claude3_7Sonnet); + let model = CloudModel::Anthropic(anthropic::Model::ClaudeSonnet4); Some(self.create_language_model(model, llm_api_token)) } @@ -291,8 +291,8 @@ impl LanguageModelProvider for CloudLanguageModelProvider { fn recommended_models(&self, cx: &App) -> Vec> { let llm_api_token = self.state.read(cx).llm_api_token.clone(); [ - CloudModel::Anthropic(anthropic::Model::Claude3_7Sonnet), - CloudModel::Anthropic(anthropic::Model::Claude3_7SonnetThinking), + CloudModel::Anthropic(anthropic::Model::ClaudeSonnet4), + CloudModel::Anthropic(anthropic::Model::ClaudeSonnet4Thinking), ] .into_iter() .map(|model| self.create_language_model(model, llm_api_token.clone()))