Repository navigation
feat(bedrock): add 17 aws-bedrock cost map rows from provider sync - #42852
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
bugbot run |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…caching Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
bugbot run |
…mantle fallback get_model_info checks the bare split_model before bedrock_mantle/<model>, so the new bare key made bedrock_mantle/us-east-2/openai.gpt-5.6-sol resolve to the bedrock_converse row instead of falling back to bedrock_mantle/openai.gpt-5.6-sol Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…k_mantle rows Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
bugbot run |
There was a problem hiding this comment.
✅ 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 79a30d0. Configure here.
TLDR
Problem this solves:
How it solves it:
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Screenshots / Proof of Fix
Data-only cost map sync, no completion call is made. Rows are added on the strength of the AWS list API and the AWS price list API, with limits from the quoted AWS model cards. Both files verified identical after the edit and
python3 -m pytest tests/test_litellm/test_model_prices_schema.py tests/test_litellm/test_cost_map_guard.py -qpasses, plus tests/test_litellm/test_utils.py bedrock_mantle lookups, 89 testsRows, kind api (15)
Every price field is written exactly as
npm run providers -- prices aws-bedrock --region <region>returned it from https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json, which is thesourceon each row. Per 1M USD in the API, divided by 1e6. Context window and capability flags come from the named sibling row because the list API only returns id and lifecycle statusThe Mythos 5 and 5.1 rows take their context from the AWS model cards, which both state "Context window: 1M tokens" and "Max output tokens: 128K" (https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-anthropic-claude-mythos-5-1.md and model-card-anthropic-claude-mythos-5.md), matching us.anthropic.claude-fable-5. The three mythos-preview rows use
litellm_provider: bedrock_converselike every other regional anthropic key, while the existing base anthropic.claude-mythos-preview row stays onbedrockwith zero cost.search_context_cost_per_queryis not copied from the siblings because the price API does not return it. The three mythos-preview rows carry the API cache prices, sosupports_prompt_cachingis true on them, unlike the zero-cost base rowBare OpenAI and xAI ids, resolved as a naming mismatch (5)
The list API emits openai.gpt-6-astra, openai.gpt-5.6-sol, openai.gpt-5.6-terra, openai.gpt-5.6-luna and xai.grok-4.6 as bare ids. The catalog already carries each of them as
bedrock_mantle/<id>with the same In-Region prices the AWS model cards state, andget_model_inforesolves a bare key before thebedrock_mantle/fallback, so a bare row would shadow the mantle row forbedrock_mantle/<region>/<id>lookups (CI testtest_get_model_info_bedrock_mantle_region_prefix_falls_back_to_the_mantle_rowcaught this for -sol). No bare rows are added for these fiveRows, kind inherited (2)
The AWS model cards for these two only say "For pricing information, see the Amazon Bedrock Pricing page", and that page renders its numbers from an opaque metered unit map, so no raw source states a plain price for the bare id. Both rows copy the
us.sibling, the closest sibling under another region prefixId mapping
The list API emits bare ids while the price API keys Anthropic models as regional inference profiles and the catalog keys OpenAI and xAI models under
bedrock_mantle/. Ids were mapped to those existing key forms. Nothing was treated as a delisting because of a naming differenceChanged pages
The three pages the dispatcher flagged (the metered unit map, the model card index and the price list index) were fetched raw. The price list index is the API the 15 api rows come from and it agrees with every existing aws-bedrock row it covers, so no existing row changed
Delisted by the provider
No deprecation date is stated in the list metadata or on the model cards for these, so nothing was removed or given a
deprecation_date. A human decides: ai21.j2-mid-v1, ai21.j2-ultra-v1, amazon.titan-text-express-v1, amazon.titan-text-lite-v1, anthropic.claude-instant-v1, anthropic.claude-mythos-preview, anthropic.claude-v1, cohere.command-light-text-v14, cohere.command-text-v14, meta.llama2-13b-chat-v1, meta.llama2-70b-chat-v1, us.deepseek.v3.2. Regional only: deepseek.v3.2, eu.anthropic.claude-fable-5, eu.anthropic.claude-fable-5-1, eu.deepseek.v3.2, mistral.mistral-large-3-675b-instruct, moonshot.kimi-k2-thinking, moonshotai.kimi-k2.5, qwen.qwen3-coder-next, writer.palmyra-vision-7b, zai.glm-4.7, zai.glm-5 (eu-west-1), jp.anthropic.claude-opus-5, jp.anthropic.claude-sonnet-5 (ap-northeast-1). Coverage gap, not delistings: amazon.titan-image-generator-v1, amazon.titan-image-generator-v2, amazon.titan-embed-g1-text-02, amazon.titan-embed-text-v1, amazon.titan-embed-image-v1 are image and embedding models the text list does not returnType
🆕 New Feature
Caveats (if any)
Medium
Low
Final Attestation
Link to Devin session: https://app.devin.ai/sessions/c01328421b45481b8d52b619adb26863
Open in Devin Desktop: https://app.devin.ai/desktop/session/c01328421b45481b8d52b619adb26863?variant=devin
Requested by: @kerry-berri
Note
Low Risk
Data-only cost map additions with no runtime logic changes; incorrect prices or flags would affect billing estimates and feature detection for the new model ids only.
Overview
Adds 17 new model rows to
model_prices_and_context_window.jsonand the identical backup file so LiteLLM can price and route AWS Bedrock ids that were missing from the catalog.The new entries are mostly regional Anthropic inference profiles (Mythos 5/5.1, Fable 5, Opus 4.7–5.5, Sonnet 4.6/5, Mythos preview in
us/apac/au/global) with token costs from the AWS price list API and capability/context fields aligned with existing sibling rows. Two base ids (deepseek.r1-v1:0,mistral.pixtral-large-2502-v1:0) are added by inheritingus.*pricing with output limits taken from AWS model cards.The diff also closes the JSON object for
vertex_ai/gemini-2.5-pro-ttsbefore appending the new keys. No existing keys are modified or removed; bare OpenAI/xAI list ids are intentionally omitted to avoid shadowing existingbedrock_mantle/rows.Reviewed by Cursor Bugbot for commit 79a30d0. Bugbot is set up for automated code reviews on this repo. Configure here.