Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions backend/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion backend/models/claude.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
16 changes: 7 additions & 9 deletions backend/routes/generate_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -956,4 +954,4 @@ async def stream_code(websocket: WebSocket):
pipeline.use(PostProcessingMiddleware())

# Execute the pipeline
await pipeline.execute(websocket)
await pipeline.execute(websocket)