Skip to content

Commit a51dfd9

Browse files
CreatmanCEOclaude
andcommitted
fix: correct OpenRouter model IDs — claude-haiku-4.5, claude-sonnet-4.5
OpenRouter uses short names (anthropic/claude-haiku-4.5) not dated IDs (anthropic/claude-haiku-4-5-20251001). Fixed across all files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 25ff4c1 commit a51dfd9

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

backend/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ class Settings(BaseSettings):
1212
openrouter_api_key: SecretStr = SecretStr("")
1313

1414
# Model routing — Pool A (simple/medium)
15-
model_pool_a_primary: str = "openrouter/anthropic/claude-haiku-4-5-20251001"
15+
model_pool_a_primary: str = "openrouter/anthropic/claude-haiku-4.5"
1616
model_pool_a_fallback: str = "gemini/gemini-2.5-flash"
1717

1818
# Model routing — Pool B (complex tasks)
19-
model_pool_b_default: str = "openrouter/anthropic/claude-haiku-4-5-20251001"
20-
model_pool_b_complex: str = "openrouter/anthropic/claude-sonnet-4-5-20250514"
19+
model_pool_b_default: str = "openrouter/anthropic/claude-haiku-4.5"
20+
model_pool_b_complex: str = "openrouter/anthropic/claude-sonnet-4.5"
2121

2222
llm_temperature: float = 0.1
2323

backend/eval/batch_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ def estimate_cost(model: str, tokens_in: int, tokens_out: int, response=None) ->
177177

178178
# Fallback: manual approximate pricing (USD per 1M tokens)
179179
pricing = {
180-
"openrouter/anthropic/claude-haiku-4-5-20251001": {"input": 0.80, "output": 4.00},
181-
"openrouter/anthropic/claude-sonnet-4-5-20250514": {"input": 3.00, "output": 15.00},
180+
"openrouter/anthropic/claude-haiku-4.5": {"input": 0.80, "output": 4.00},
181+
"openrouter/anthropic/claude-sonnet-4.5": {"input": 3.00, "output": 15.00},
182182
"gemini/gemini-2.5-flash": {"input": 0.15, "output": 0.60},
183183
}
184184

backend/eval/metrics_api.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
# Sample metrics for demo (used when no eval has been run yet)
1212
SAMPLE_METRICS = {
13-
"openrouter/anthropic/claude-haiku-4-5-20251001": {
14-
"model": "openrouter/anthropic/claude-haiku-4-5-20251001",
13+
"openrouter/anthropic/claude-haiku-4.5": {
14+
"model": "openrouter/anthropic/claude-haiku-4.5",
1515
"pool": "pool-a + pool-b",
1616
"total_cases": 48,
1717
"accuracy": 0.938,
@@ -34,8 +34,8 @@
3434
"avg_tokens_per_request": 850,
3535
"error_rate": 0.021,
3636
},
37-
"openrouter/anthropic/claude-sonnet-4-5-20250514": {
38-
"model": "openrouter/anthropic/claude-sonnet-4-5-20250514",
37+
"openrouter/anthropic/claude-sonnet-4.5": {
38+
"model": "openrouter/anthropic/claude-sonnet-4.5",
3939
"pool": "pool-b-upgrade",
4040
"total_cases": 48,
4141
"accuracy": 0.958,
@@ -50,9 +50,9 @@
5050

5151

5252
POOL_MAP = {
53-
"openrouter/anthropic/claude-haiku-4-5-20251001": "pool-a + pool-b",
53+
"openrouter/anthropic/claude-haiku-4.5": "pool-a + pool-b",
5454
"gemini/gemini-2.5-flash": "fallback",
55-
"openrouter/anthropic/claude-sonnet-4-5-20250514": "pool-b-upgrade",
55+
"openrouter/anthropic/claude-sonnet-4.5": "pool-b-upgrade",
5656
}
5757

5858

@@ -95,12 +95,12 @@ async def list_models():
9595
},
9696
"pool-b": {
9797
"description": "Complex tasks — reasoning required",
98-
"models": ["anthropic/claude-haiku-4-5-20251001"],
98+
"models": ["anthropic/claude-haiku-4.5"],
9999
"tasks": ["detect_anomalies", "interpret_anomaly", "general_question"],
100100
},
101101
"pool-b-upgrade": {
102102
"description": "Deep reasoning — comprehensive analysis",
103-
"models": ["anthropic/claude-sonnet-4-5-20250514"],
103+
"models": ["anthropic/claude-sonnet-4.5"],
104104
"tasks": ["calibration_advice"],
105105
},
106106
}

backend/services/llm_router.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def create_router() -> Router:
3030
model_list = [
3131
# Pool A — simple/medium tasks
3232
{"model_name": "pool-a", "litellm_params": {
33-
"model": "openrouter/anthropic/claude-haiku-4-5-20251001",
33+
"model": "openrouter/anthropic/claude-haiku-4.5",
3434
"api_key": or_key,
3535
}},
3636
{"model_name": "pool-a", "litellm_params": {
@@ -40,7 +40,7 @@ def create_router() -> Router:
4040

4141
# Pool B — complex tasks
4242
{"model_name": "pool-b", "litellm_params": {
43-
"model": "openrouter/anthropic/claude-haiku-4-5-20251001",
43+
"model": "openrouter/anthropic/claude-haiku-4.5",
4444
"api_key": or_key,
4545
}},
4646
{"model_name": "pool-b", "litellm_params": {
@@ -50,11 +50,11 @@ def create_router() -> Router:
5050

5151
# Pool B upgrade — deep reasoning
5252
{"model_name": "pool-b-upgrade", "litellm_params": {
53-
"model": "openrouter/anthropic/claude-sonnet-4-5-20250514",
53+
"model": "openrouter/anthropic/claude-sonnet-4.5",
5454
"api_key": or_key,
5555
}},
5656
{"model_name": "pool-b-upgrade", "litellm_params": {
57-
"model": "openrouter/anthropic/claude-haiku-4-5-20251001",
57+
"model": "openrouter/anthropic/claude-haiku-4.5",
5858
"api_key": or_key,
5959
}},
6060
]

backend/tests/test_eval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,5 @@ def test_gemini_flash_cost(self):
173173

174174
def test_sonnet_more_expensive(self):
175175
flash_cost = estimate_cost("gemini/gemini-2.5-flash", 1000, 500)
176-
sonnet_cost = estimate_cost("anthropic/claude-sonnet-4-5-20250514", 1000, 500)
176+
sonnet_cost = estimate_cost("anthropic/claude-sonnet-4.5", 1000, 500)
177177
assert sonnet_cost > flash_cost

0 commit comments

Comments
 (0)