Skip to content

fix(bedrock): add missing AWS GovCloud prices and correct drifted GovCloud rows - #50077

Closed
kerry-berri wants to merge 2 commits into
mainfrom
litellm_bedrock_govcloud_rows
Closed

kerry-berri wants to merge 2 commits into
mainfrom
litellm_bedrock_govcloud_rows

Conversation

@kerry-berri

@kerry-berri kerry-berri commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Handwritten 1-3 sentence description

Add some govcloud prices

Details

TLDR

Problem this solves:

  • GovCloud Kimi K3, Nemotron, Claude 3.5/3.7 Sonnet billed at commercial prices
  • Three us-gov-west-1 Mantle OpenAI rows priced about 2% high
  • us-gov-east-1 Titan Embed v2 priced at 0.20 instead of 0.03

How it solves it:

  • 14 new rows, 7 per GovCloud region, priced from AWS offer files
  • 4 existing rows corrected to AWS standard prices

User Flow

Before: a GovCloud user calling Kimi K3 through Bedrock Mantle sees spend about 17% below their AWS bill

  1. They send POST https://litellm-domain/v1/chat/completions with model: bedrock_mantle/us-gov-east-1/moonshotai.kimi-k3
  2. The request succeeds and the spend log shows $3.30 per 1M input tokens and $16.50 per 1M output tokens
  3. Their AWS bill for the same tokens is $3.96 input and $19.80 output per 1M

After: the same request is logged at the price AWS charges in GovCloud

  1. They send the same POST https://litellm-domain/v1/chat/completions
  2. The spend log shows $3.96 per 1M input tokens and $19.80 per 1M output tokens, matching AWS

Pre-Submission checklist

  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v
  • My PR's scope is as isolated as possible; it only solves 1 specific problem

Screenshots / Proof of Fix

Prices come from https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrock/current/us-gov-west-1/index.json, the matching us-gov-east-1 file, and the AmazonBedrockFoundationModels files for Claude, read on 2026-11-04. Each new and fixed row was compared against the standard tier in those files

No GovCloud AWS credentials were available, so the proof is the cost lookup a request goes through, run at the merge base and the tip with litellm.cost_per_token for 1M input and 1M output tokens

Before (df78b16)

bedrock_mantle/us-gov-east-1/moonshotai.kimi-k3 input=$3.3000 output=$16.5000
bedrock_mantle/us-gov-west-1/nvidia.nemotron-super-3-120b input=$0.1500 output=$0.6500
bedrock/us-gov-west-1/anthropic.claude-3-7-sonnet-20250219-v1:0 input=$3.0000 output=$15.0000
bedrock_mantle/us-gov-west-1/openai.gpt-5.4 input=$3.3750 output=$20.2500
bedrock/us-gov-east-1/amazon.titan-embed-text-v2:0 input=$0.2000 output=$0.0000

After (5ec4c43)

bedrock_mantle/us-gov-east-1/moonshotai.kimi-k3 input=$3.9600 output=$19.8000
bedrock_mantle/us-gov-west-1/nvidia.nemotron-super-3-120b input=$0.1800 output=$0.7800
bedrock/us-gov-west-1/anthropic.claude-3-7-sonnet-20250219-v1:0 input=$3.6000 output=$18.0000
bedrock_mantle/us-gov-west-1/openai.gpt-5.4 input=$3.3000 output=$19.8000
bedrock/us-gov-east-1/amazon.titan-embed-text-v2:0 input=$0.0300 output=$0.0000

tests/unit/test_cost_map_guard.py and tests/unit/test_utils.py::test_aaamodel_prices_and_context_window_json_is_valid pass (66 passed). Both JSON files are byte-identical

Type

🐛 Bug Fix

Caveats (if any)

Medium

  • No live GovCloud call was made, only cost lookups
  • No bedrock_mantle/us-gov-*/xai.grok-4.7 rows. The AWS Grok 4.7 model card lists it only on bedrock-runtime through us.xai.grok-4.7 and global.xai.grok-4.7, even though the price file names the usage type -mantle-
    • GovCloud calls through us.xai.grok-4.7 are not priced at the GovCloud rate ($2.64 / $7.92) by this PR
  • Capabilities copied from sibling rows, not checked against GovCloud model cards
    • Mantle Nemotron and Kimi K3 rows assume /v1/chat/completions like other Mantle rows

Low

  • Claude 3 Haiku skipped, AWS lists GovCloud EOL as September 10, 2026
  • Flex, priority and batch tiers added only where AWS lists them

Link to Devin session: https://app.devin.ai/sessions/070329effd864e6b902131183ea41afb
Open in Devin Desktop: https://app.devin.ai/desktop/session/070329effd864e6b902131183ea41afb?variant=devin
Requested by: @kerry-berri

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@kerry-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@kerry-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 1f77174. Configure here.

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect cost estimates for a defined set of Bedrock models in two GovCloud regions.

Fix the Grok route lookup and provide the required live billing proof before merging

Findings

  1. P1 Grok uses the wrong path ▶
  2. P2 Live billing proof is missing ▶

Summary

Adds 16 GovCloud model rows and corrects four existing price rows in both catalog copies

  • Claude Sonnet calls in GovCloud now have region-specific prices.
  • More Bedrock Mantle models now have prices in GovCloud.
  • Several existing GovCloud Bedrock prices now use updated rates.

kerry-berri lists copied capabilities and assumed Mantle chat support as caveats. These remain unverified, not confirmed capability defects. kerry-berri intentionally skips Claude 3 Haiku because its stated GovCloud end date has passed

Reviews (1) · Last reviewed commit: "Add missing AWS GovCloud Bedrock prices ..." · Reviewed by Greptile

Comment thread model_prices_and_context_window.json Outdated
"cache_read_input_token_cost_priority": 1.155e-06,
"input_cost_per_token_batches": 1.32e-06,
"output_cost_per_token_batches": 3.96e-06,
"use_openai_responses_path": true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Grok uses the wrong path

The new regional Grok rows declare use_openai_responses_path, but mantle_base_segment and mantle_supports_responses read only the missing bedrock_mantle/xai.grok-4.7 row. Default calls therefore use /v1 instead of /openai/v1, and Responses calls use chat emulation. Make the helpers read regional rows or add the shared row they require

Knowledge Base Used: Provider adapters and capabilities

Comment on lines +69981 to +69982
"input_cost_per_token": 3.96e-06,
"output_cost_per_token": 1.98e-05,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Live billing proof is missing

These rows change billing, so AGENTS.md requires live before-and-after requests through a proxy. The description reports only direct cost lookups. Before merging, add proxy requests and spend results at the base and 1f771743e56336f828e8bbbb6f30960e8584f9b7

Context Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@codspeed

codspeed Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

1 warning

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 43 untouched benchmarks


Comparing litellm_bedrock_govcloud_rows (5ec4c43) with main (b662f3f)

Open in CodSpeed

@devin-ai-integration devin-ai-integration Bot changed the title Add missing AWS GovCloud Bedrock prices and fix drifted GovCloud rows fix(bedrock): add missing AWS GovCloud prices and correct drifted GovCloud rows Nov 4, 2026
@codecov

codecov Bot commented Nov 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mateo-berri mateo-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stamped

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Rolled into #50082 after re-checking each value against the official provider source. Closing this one as superseded, thanks for the work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants