diff --git a/backend/llm.py b/backend/llm.py index b4a35e9a8..3a1b7c384 100644 --- a/backend/llm.py +++ b/backend/llm.py @@ -18,7 +18,7 @@ class Llm(Enum): CLAUDE_3_5_SONNET_2024_06_20 = "claude-3-5-sonnet-20240620" CLAUDE_3_5_SONNET_2024_10_22 = "claude-3-5-sonnet-20241022" CLAUDE_3_7_SONNET_2025_02_19 = "claude-3-7-sonnet-20250219" - CLAUDE_4_SONNET_2025_05_14 = "claude-sonnet-4-20250514" + CLAUDE_4_5_SONNET_2025_09_29 = "claude-sonnet-4-5-20250929" CLAUDE_4_OPUS_2025_05_14 = "claude-opus-4-20250514" GEMINI_2_0_FLASH_EXP = "gemini-2.0-flash-exp" GEMINI_2_0_FLASH = "gemini-2.0-flash" @@ -57,7 +57,7 @@ class Completion(TypedDict): Llm.CLAUDE_3_5_SONNET_2024_06_20: "anthropic", Llm.CLAUDE_3_5_SONNET_2024_10_22: "anthropic", Llm.CLAUDE_3_7_SONNET_2025_02_19: "anthropic", - Llm.CLAUDE_4_SONNET_2025_05_14: "anthropic", + Llm.CLAUDE_4_5_SONNET_2025_09_29: "anthropic", Llm.CLAUDE_4_OPUS_2025_05_14: "anthropic", # Gemini models Llm.GEMINI_2_0_FLASH_EXP: "gemini", diff --git a/backend/models/claude.py b/backend/models/claude.py index 6b087a0c5..3732508c9 100644 --- a/backend/models/claude.py +++ b/backend/models/claude.py @@ -81,7 +81,7 @@ async def stream_claude_response( response = "" if ( - model_name == Llm.CLAUDE_4_SONNET_2025_05_14.value + model_name == Llm.CLAUDE_4_5_SONNET_2025_09_29.value or model_name == Llm.CLAUDE_4_OPUS_2025_05_14.value ): print(f"Using {model_name} with thinking") diff --git a/backend/routes/generate_code.py b/backend/routes/generate_code.py index 146c059e0..4a7b8437e 100644 --- a/backend/routes/generate_code.py +++ b/backend/routes/generate_code.py @@ -359,13 +359,12 @@ def _get_variant_models( gemini_api_key: str | None, ) -> List[Llm]: """Simple model cycling that scales with num_variants""" + claude_model = Llm.CLAUDE_4_5_SONNET_2025_09_29 - claude_model = Llm.CLAUDE_3_7_SONNET_2025_02_19 - - # For text input mode, use Claude 4 Sonnet as third option + # For text input mode, use Claude 3.7 Sonnet as third option # For other input modes (image/video), use Gemini as third option if input_mode == "text": - third_model = Llm.CLAUDE_4_SONNET_2025_05_14 + third_model = Llm.CLAUDE_3_7_SONNET_2025_02_19 else: # Gemini only works for create right now if generation_type == "create": @@ -617,12 +616,11 @@ def _create_generation_tasks( if self.anthropic_api_key is None: raise Exception("Anthropic API key is missing.") - # For creation, use Claude Sonnet 3.7 - # For updates, we use Claude Sonnet 3.5 until we have tested Claude Sonnet 3.7 + # Use Sonnet 4.5 for both create and update tasks if params["generationType"] == "create": - claude_model = Llm.CLAUDE_3_7_SONNET_2025_02_19 + claude_model = Llm.CLAUDE_4_5_SONNET_2025_09_29 else: - claude_model = Llm.CLAUDE_3_5_SONNET_2024_06_20 + claude_model = Llm.CLAUDE_4_5_SONNET_2025_09_29 tasks.append( stream_claude_response( @@ -956,4 +954,4 @@ async def stream_code(websocket: WebSocket): pipeline.use(PostProcessingMiddleware()) # Execute the pipeline - await pipeline.execute(websocket) + await pipeline.execute(websocket) \ No newline at end of file