Add 1-hour cache write pricing for us-gov Haiku 4.5#28574
Conversation
Greptile SummaryAdds the missing
Confidence Score: 5/5Pure data addition to two pricing JSON fields; no logic paths are altered and both files remain consistent with each other. The change is isolated to four JSON lines adding a single well-defined pricing field. The value is mathematically correct (1.2× global, 1.6× existing 5m rate), both files are updated in lock-step, and the new tests exercise the changed entries without touching any shared infrastructure. No files require special attention.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds cache_creation_input_token_cost_above_1hr: 2.4e-06 to both us-gov-east-1 and us-gov-west-1 Haiku 4.5 entries; value is correctly 1.2× the global $2.00/MTok rate and 1.6× the existing 5m rate. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the same two-line addition to the backup JSON, keeping root and backup in sync. |
| tests/test_litellm/test_bedrock_usgov_haiku_1hr_cache.py | New parametrized test covering both us-gov regions; validates the 5m rate, the new 1h rate, and the 1.6× ratio invariant using only local JSON file reads (no network calls). |
Reviews (3): Last reviewed commit: "chore: trigger shin-agent re-eval on ret..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
🤖 litellm-agent: This PR is currently BLOCKED from merge. Score: 3/5 ❌ Why blocked:
Details: Score docked for: 1 PR-related CI failure (This PR will be auto-closed as it lacks a screenshot for proof of fix. Please include one in the PR description. Add the Fix the issues above and push an update — the bot will re-review automatically.
|
…riAI#28598) Squash-merged by litellm-agent from Terrajlz's PR.
Squash-merged by litellm-agent from devauxbr's PR.
Proof of fixThis is a pure data / pricing-JSON change with no visible runtime output — adding the JSON validity is also enforced by the existing Requesting |
AWS Bedrock GovCloud applies a +20% premium over global Anthropic rates. Global Haiku 4.5 5m/1h cache write is $1.25 / $2.00 per MTok; us-gov is therefore $1.50 / $2.40 per MTok (the 5m rate was already correct in litellm; the 1h field was missing). Adds `cache_creation_input_token_cost_above_1hr: 2.4e-06` to the two us-gov Haiku 4.5 entries in both pricing JSON files: - bedrock/us-gov-east-1/anthropic.claude-haiku-4-5-20251001-v1:0 - bedrock/us-gov-west-1/anthropic.claude-haiku-4-5-20251001-v1:0 New parametrized regression test tests/test_litellm/test_bedrock_usgov_haiku_1hr_cache.py pins both entries and enforces the 1.6x 5m-to-1h ratio invariant matching the pattern used by the existing Bedrock and Vertex 1h-cache tests. Companion to the us-gov Sonnet 4.5 pricing fix.
bccd17c to
104a78f
Compare
0ed9f60 to
de7e420
Compare
|
@greptileai please review commit |
Relevant issues
Related to the us-gov pricing audit that surfaced #27120 — Haiku 4.5's us-gov entries had correct 5m rates but were missing the 1-hour cache field. Companion to the parallel Sonnet 4.5 fix PR.
Pre-Submission checklist
Type
🐛 Bug Fix
Changes
AWS Bedrock GovCloud applies a +20% premium over global Anthropic rates. For Haiku 4.5:
The 5-minute rate was already at the correct +20% premium. Only the `cache_creation_input_token_cost_above_1hr` field was missing.
Adds `cache_creation_input_token_cost_above_1hr: 2.4e-06` to:
…in both `model_prices_and_context_window.json` and `litellm/model_prices_and_context_window_backup.json`.
Adds `tests/test_litellm/test_bedrock_usgov_haiku_1hr_cache.py` with two parametrized cases plus the 1.6× 5m-to-1h ratio invariant check.
Test plan
```sh
$ python -m pytest tests/test_litellm/test_bedrock_usgov_haiku_1hr_cache.py -v
...
============================== 2 passed in 0.10s ===============================
```
Black + ruff clean. Diff: 4 lines in JSON files (2 each) + 50 lines of new test = 54 insertions total.