Skip to content

Commit a17496c

Browse files
committed
Fix Claude gateway 400 + add Gemini/GPT price tracking
- Claude gateway models (Opus 4.8/4.7, Sonnet 5) run with extended thinking enabled, which requires temperature unset (or 1.0). The model blocks set temperature: 0.2, causing every request to fail with HTTP 400. Remove model_kwargs/temperature and raise max_tokens 4096 -> 16384. Verified against the anthropic-passthrough endpoint with the full agent request shape (system + tools + cache_control): now returns 200 / tool_use. - Register litellm prices for gemini-3-5-flash-fair and gpt-5-5-genai-responses (from reveng's model_prices.json) so their cost is tracked instead of ignored. Claude self-computes cost from its cost: block (verified against reveng: opus/sonnet numbers match). - Remove robotrumble_llama.yaml (stale env-indirection config reintroduced by a merge).
1 parent 4c66dde commit a17496c

5 files changed

Lines changed: 35 additions & 170 deletions

File tree

configs/ablations/ladder/robotrumble_llama.yaml

Lines changed: 0 additions & 161 deletions
This file was deleted.

configs/mini/litellm_custom_model_config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,28 @@
4747
]
4848
}
4949
]
50+
},
51+
"gemini-3-5-flash-fair": {
52+
"litellm_provider": "openai",
53+
"mode": "chat",
54+
"max_input_tokens": 1048576,
55+
"max_output_tokens": 65535,
56+
"max_tokens": 65535,
57+
"input_cost_per_token": 1.5e-06,
58+
"output_cost_per_token": 9e-06,
59+
"output_cost_per_reasoning_token": 9e-06,
60+
"cache_read_input_token_cost": 1.5e-07,
61+
"source": "reveng model_prices.json (gemini-3-5-flash-genai tier)"
62+
},
63+
"gpt-5-5-genai-responses": {
64+
"litellm_provider": "openai",
65+
"mode": "responses",
66+
"max_input_tokens": 1050000,
67+
"max_output_tokens": 128000,
68+
"max_tokens": 128000,
69+
"input_cost_per_token": 5e-06,
70+
"output_cost_per_token": 3e-05,
71+
"cache_read_input_token_cost": 5e-07,
72+
"source": "reveng model_prices.json"
5073
}
5174
}

configs/mini/models/llama_opus_4_7.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ model_name: aws-claude-4-7-opus-fair
33
model_class: codeclash.agents.mini_anthropic_model.AnthropicModel
44
api_key_env: LLAMA_API_KEY
55
base_url: https://api.llama.com/experimental/passthrough/anthropic
6-
max_tokens: 4096
7-
model_kwargs:
8-
temperature: 0.2
6+
max_tokens: 16384
7+
# NOTE: these gateway Claude models run with extended thinking enabled, which requires
8+
# temperature to be unset (or 1.0). Setting temperature (e.g. 0.2) returns HTTP 400 — so no
9+
# model_kwargs/temperature here.
910
cost:
1011
input: 5.0e-06
1112
output: 2.5e-05

configs/mini/models/llama_opus_4_8.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ model_name: claude-4-8-opus-vertex-genai
55
model_class: codeclash.agents.mini_anthropic_model.AnthropicModel
66
api_key_env: LLAMA_API_KEY
77
base_url: https://api.llama.com/experimental/passthrough/anthropic
8-
max_tokens: 4096
9-
model_kwargs:
10-
temperature: 0.2
8+
max_tokens: 16384
9+
# NOTE: these gateway Claude models run with extended thinking enabled, which requires
10+
# temperature to be unset (or 1.0). Setting temperature (e.g. 0.2) returns HTTP 400 — so no
11+
# model_kwargs/temperature here.
1112
cost:
1213
input: 5.0e-06
1314
output: 2.5e-05

configs/mini/models/llama_sonnet_5.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ model_name: claude-5-sonnet-genai
44
model_class: codeclash.agents.mini_anthropic_model.AnthropicModel
55
api_key_env: LLAMA_API_KEY
66
base_url: https://api.llama.com/experimental/passthrough/anthropic
7-
max_tokens: 4096
8-
model_kwargs:
9-
temperature: 0.2
7+
max_tokens: 16384
8+
# NOTE: these gateway Claude models run with extended thinking enabled, which requires
9+
# temperature to be unset (or 1.0). Setting temperature (e.g. 0.2) returns HTTP 400 — so no
10+
# model_kwargs/temperature here.
1011
cost:
1112
input: 3.0e-06
1213
output: 1.5e-05

0 commit comments

Comments
 (0)