Fix us-gov-{east,west}-1 Bedrock Sonnet 4.5 pricing#28573
Conversation
Greptile SummaryThis PR corrects the AWS GovCloud (us-gov-east-1, us-gov-west-1) Bedrock pricing for Claude Sonnet 4.5 from the commercial-US +10% premium to the correct GovCloud +20% premium over global Anthropic rates, and adds a 1-hour cache write tier that was previously absent. All five affected entries have been verified as exactly 1.2× the global rates.
Confidence Score: 5/5Safe to merge — purely a JSON pricing data correction with no logic changes and a comprehensive new test suite that locks in the correct values. All updated pricing values verify exactly as 1.2× the global rates. The new tests cover every field that was previously wrong, including the _above_200k_tokens tier on the cross-region profile that was flagged in the prior review round. Both JSON files are kept in sync. No code paths are modified. No files require special attention.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Corrects 5 us-gov Sonnet 4.5 entries to the +20% GovCloud premium; all updated values verify as exactly 1.2× the global rates |
| litellm/model_prices_and_context_window_backup.json | 1:1 mirror of main JSON — same 5 entries corrected with identical values |
| tests/test_litellm/test_bedrock_usgov_pricing.py | New regression tests covering all 5 us-gov model keys, base pricing fields, 200k-tier fields on the cross-region profile, and the 1.2× ratio invariant |
Reviews (4): Last reviewed commit: "Apply us-gov 200k-tier GovCloud premium ..." | 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: 2/5 ❌ Why blocked:
Details: Score docked for: 1 PR-related CI failure (Greptile gate: score 3/5 below required 4/5 — request a Greptile review ( 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 GovCloud Bedrock pricing carries a +20% premium over the global Anthropic rates, not the +10% premium that applies to commercial US regions. Litellm's five us-gov Claude Sonnet 4.5 entries mirror the commercial-US prices (3.3e-06 input, 1.65e-05 output, 4.125e-06 cache write), undercharging customers by ~9%. Corrects all five affected entries in both model_prices_and_context_window.json and the bundled model_prices_and_context_window_backup.json to match AWS's published GovCloud rates (per https://aws.amazon.com/bedrock/pricing/): - input_cost_per_token 3.3e-06 -> 3.6e-06 ($3.60/MTok) - output_cost_per_token 1.65e-05 -> 1.8e-05 ($18.00/MTok) - cache_creation_input_token_cost 4.125e-06 -> 4.5e-06 ($4.50/MTok) - cache_read_input_token_cost 3.3e-07 -> 3.6e-07 ($0.36/MTok) - cache_creation_input_token_cost_above_1hr (added) ($7.20/MTok) Affected entries: - bedrock/us-gov-east-1/anthropic.claude-sonnet-4-5-20250929-v1:0 - bedrock/us-gov-west-1/anthropic.claude-sonnet-4-5-20250929-v1:0 - bedrock/us-gov-east-1/claude-sonnet-4-5-20250929-v1:0 - bedrock/us-gov-west-1/claude-sonnet-4-5-20250929-v1:0 - us-gov.anthropic.claude-sonnet-4-5-20250929-v1:0 New regression test tests/test_litellm/test_bedrock_usgov_pricing.py pins the corrected rates across all five entries and asserts the 1.2x global-to-us-gov ratio invariant, matching the pattern used by the existing Vertex and EU/AU/JP Bedrock pricing tests.
ff3ed48 to
6cc1dad
Compare
| {{- end }} | ||
| {{- with .Values.podAnnotations }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- tpl (toYaml .) $ | nindent 8 }} |
There was a problem hiding this comment.
Medium: Helm annotation templates can expose render-time data
tpl evaluates annotation values as Helm templates, so a user who can set podAnnotations can add expressions like {{ .Values.postgresql.auth.password }} or {{ lookup "v1" "Secret" "ns" "name" }} and have Helm write the result into Deployment/Pod metadata. Keep annotations as literal values, or move templated annotations behind a separate opt-in value with a clear warning that it executes templates with Helm's rendering privileges.
| {{- tpl (toYaml .) $ | nindent 8 }} | |
| {{- toYaml . | nindent 8 }} |
PR overviewOne security issue remains open in the Helm deployment template: annotation values are evaluated as templates. A user who can control Open issues (1)
Fixed/addressed: 0 · PR risk: 7/10 |
|
@greptileai please review commit |
The us-gov.anthropic.claude-sonnet-4-5-20250929-v1:0 cross-region inference profile carried _above_200k_tokens fields at the +10% commercial-US rate while the base tier was correctly at +20%. AWS GovCloud pricing applies the same +20% uplift across all tiers, so long-context requests through this profile were undercharging by ~9%. Updates four existing fields (input/output/cache_creation/cache_read _above_200k_tokens) and adds cache_creation_input_token_cost_above_1hr _above_200k_tokens for parity with the us. cross-region entry. Extends test_bedrock_usgov_pricing.py with five parametrized field assertions plus a 1.2x ratio invariant across all 200k-tier fields, so any future regression on either dimension is caught.
e1c947a to
7a255ba
Compare
|
@greptileai please review commit |
Relevant issues
Fixes #27120.
Pre-Submission checklist
Type
🐛 Bug Fix
Changes
AWS GovCloud Bedrock pricing carries a +20% premium over the global Anthropic rates, not the +10% premium that applies to commercial US regions. Litellm's five us-gov Claude Sonnet 4.5 entries mirror the commercial-US prices, undercharging customers by ~9%.
Per the AWS Bedrock pricing page:
Files
Entries corrected
Test plan
```sh
$ python -m pytest tests/test_litellm/test_bedrock_usgov_pricing.py -v
...
============================== 6 passed in 0.32s ===============================
```
Black + ruff clean. Diff is +50 lines, -40 lines (each corrected entry has one fewer line because the 1-hour cache field is now inserted but the 5m field already had a trailing comma — net is balanced; the 10 added lines are the 1-hour field across the 5 entries × 2 files).
Note on scope
The same +10% / +20% confusion likely affects us-gov entries for Haiku 4.5 and other Bedrock-hosted Anthropic models in the GovCloud regions. I limited this PR to the model specifically named in #27120 to keep scope tight; happy to extend coverage in a follow-up.