Skip to content

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Python

Remove legacy GPT-4 vision/turbo/4o models

Abi Raja2c60379b90e2
diff --git a/backend/evals/runner.py b/backend/evals/runner.py
index d3080ad7..3ea542e5 100644
--- a/backend/evals/runner.py
+++ b/backend/evals/runner.py
@@ -94,7 +94,7 @@ async def run_image_evals(
data_url = await image_to_data_url(filepath)
for n_idx in range(n):
current_model_for_task = (
- selected_model if n_idx == 0 else Llm.GPT_4O_2024_05_13
+ selected_model if n_idx == 0 else Llm.GPT_4_1_2025_04_14
)
coro = generate_code_and_time(
image_url=data_url,
diff --git a/backend/llm.py b/backend/llm.py
index c6364e7b..09e4638b 100644
--- a/backend/llm.py
+++ b/backend/llm.py
@@ -4,11 +4,6 @@ from typing import TypedDict
# Actual model versions that are passed to the LLMs and stored in our logs
class Llm(Enum):
- GPT_4_VISION = "gpt-4-vision-preview"
- GPT_4_TURBO_2024_04_09 = "gpt-4-turbo-2024-04-09"
- GPT_4O_2024_05_13 = "gpt-4o-2024-05-13"
- GPT_4O_2024_08_06 = "gpt-4o-2024-08-06"
- GPT_4O_2024_11_20 = "gpt-4o-2024-11-20"
GPT_4_1_2025_04_14 = "gpt-4.1-2025-04-14"
GPT_4_1_MINI_2025_04_14 = "gpt-4.1-mini-2025-04-14"
GPT_4_1_NANO_2025_04_14 = "gpt-4.1-nano-2025-04-14"
@@ -37,11 +32,6 @@ class Completion(TypedDict):
# models elsewhere in the codebase.
MODEL_PROVIDER: dict[Llm, str] = {
# OpenAI models
- Llm.GPT_4_VISION: "openai",
- Llm.GPT_4_TURBO_2024_04_09: "openai",
- Llm.GPT_4O_2024_05_13: "openai",
- Llm.GPT_4O_2024_08_06: "openai",
- Llm.GPT_4O_2024_11_20: "openai",
Llm.GPT_4_1_2025_04_14: "openai",
Llm.GPT_4_1_MINI_2025_04_14: "openai",
Llm.GPT_4_1_NANO_2025_04_14: "openai",
diff --git a/backend/models/openai_client.py b/backend/models/openai_client.py
index 8def6cd4..1acbfd8b 100644
--- a/backend/models/openai_client.py
+++ b/backend/models/openai_client.py
@@ -37,12 +37,6 @@ async def stream_openai_response(
params["stream"] = True
params["max_tokens"] = 20000
- if model_name == "gpt-4o-2024-05-13":
- params["max_tokens"] = 4096
-
- if model_name == "gpt-4o-2024-11-20":
- params["max_tokens"] = 16384
-
if model_name == "o1-2024-12-17":
params["max_completion_tokens"] = 20000
diff --git a/backend/routes/evals.py b/backend/routes/evals.py
index a2f13ba3..e7523af0 100644
--- a/backend/routes/evals.py
+++ b/backend/routes/evals.py
@@ -195,12 +195,7 @@ async def run_evals(request: RunEvalsRequest) -> List[str]:
@router.get("/models", response_model=Dict[str, List[str]])
async def get_models():
- current_models = [
- model.value
- for model in Llm
- if model != Llm.GPT_4_TURBO_2024_04_09
- and model != Llm.GPT_4_VISION
- ]
+ current_models = [model.value for model in Llm]
# Import Stack type from prompts.types and get all literal values
available_stacks = list(Stack.__args__)
diff --git a/backend/routes/generate_code.py b/backend/routes/generate_code.py
index 25ccc27e..6bfb2405 100644
--- a/backend/routes/generate_code.py
+++ b/backend/routes/generate_code.py
@@ -400,7 +400,7 @@ class ModelSelectionStage:
elif anthropic_api_key:
models = [Llm.CLAUDE_4_5_SONNET_2025_09_29, Llm.CLAUDE_4_5_OPUS_2025_11_01]
elif openai_api_key:
- models = [Llm.GPT_4_1_2025_04_14, Llm.GPT_4O_2024_11_20]
+ models = [Llm.GPT_4_1_2025_04_14]
else:
raise Exception("No OpenAI or Anthropic key")
diff --git a/backend/run_evals.py b/backend/run_evals.py
index 5a5918e7..8b5d7102 100644
--- a/backend/run_evals.py
+++ b/backend/run_evals.py
@@ -33,7 +33,7 @@ async def main():
# )
# else:
# task = generate_code_for_text(
-# text=prompt, stack=STACK, model=Llm.GPT_4O_2024_05_13
+# text=prompt, stack=STACK, model=Llm.GPT_4_1_2025_04_14
# )
# tasks.append(task)
diff --git a/backend/tests/test_model_selection.py b/backend/tests/test_model_selection.py
index 292355bc..a6b33900 100644
--- a/backend/tests/test_model_selection.py
+++ b/backend/tests/test_model_selection.py
@@ -117,7 +117,7 @@ class TestModelSelectionOpenAIOnly:
@pytest.mark.asyncio
async def test_openai_only(self):
- """OpenAI only: GPT-4.1, GPT-4o, cycling"""
+ """OpenAI only: GPT-4.1 only"""
models = await self.model_selector.select_models(
generation_type="create",
input_mode="text",
@@ -128,9 +128,8 @@ class TestModelSelectionOpenAIOnly:
expected = [
Llm.GPT_4_1_2025_04_14,
- Llm.GPT_4O_2024_11_20,
Llm.GPT_4_1_2025_04_14,
- Llm.GPT_4O_2024_11_20,
+ Llm.GPT_4_1_2025_04_14,
]
assert models == expected
diff --git a/frontend/src/lib/models.ts b/frontend/src/lib/models.ts
index c6f978e8..29a1293e 100644
--- a/frontend/src/lib/models.ts
+++ b/frontend/src/lib/models.ts
@@ -2,17 +2,11 @@
// Order here matches dropdown order
export enum CodeGenerationModel {
CLAUDE_4_5_SONNET_2025_09_29 = "claude-sonnet-4-5-20250929",
- GPT_4O_2024_05_13 = "gpt-4o-2024-05-13",
- GPT_4_TURBO_2024_04_09 = "gpt-4-turbo-2024-04-09",
- GPT_4_VISION = "gpt_4_vision",
}
// Will generate a static error if a model in the enum above is not in the descriptions
export const CODE_GENERATION_MODEL_DESCRIPTIONS: {
[key in CodeGenerationModel]: { name: string; inBeta: boolean };
} = {
- "gpt-4o-2024-05-13": { name: "GPT-4o", inBeta: false },
"claude-sonnet-4-5-20250929": { name: "Claude Sonnet 4.5", inBeta: false },
- "gpt-4-turbo-2024-04-09": { name: "GPT-4 Turbo (deprecated)", inBeta: false },
- gpt_4_vision: { name: "GPT-4 Vision (deprecated)", inBeta: false },
};
diff --git a/frontend/src/tests/qa.test.ts b/frontend/src/tests/qa.test.ts
index 336db573..88910d72 100644
--- a/frontend/src/tests/qa.test.ts
+++ b/frontend/src/tests/qa.test.ts
@@ -21,10 +21,7 @@ describe.skip("e2e tests", () => {
const stacks = Object.values(Stack).slice(0, DEBUG ? 1 : undefined);
const models = DEBUG
- ? [
- CodeGenerationModel.GPT_4O_2024_05_13,
- // CodeGenerationModel.CLAUDE_4_5_SONNET_2025_09_29,
- ]
+ ? [CodeGenerationModel.CLAUDE_4_5_SONNET_2025_09_29]
: Object.values(CodeGenerationModel);
beforeAll(async () => {