Repository navigation
fix(prices): add estimated Bedrock prices for GPT-6 Sol and GPT-6 Luna - #42728
marianobilli wants to merge 3 commits into
Conversation
AWS has not published Bedrock prices for these models yet. Uses the OpenAI API rate plus the 10% fee AWS applies to US Geo and In-Region OpenAI models, so spend is tracked instead of logged as $0 until official prices land.
|
Mariano Billinghurst seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
| # In-Region rates for OpenAI models are the OpenAI API rate plus a 10% fee, | ||
| # so these entries are the OpenAI rate for the same model times 1.1. | ||
| US_UPLIFT = 1.1 |
There was a problem hiding this comment.
Uncited vendor pricing assumption
This hardcodes AWS's 10% uplift without a source and verification date, violating a repository requirement that must be satisfied before merging
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!
|
|
||
|
|
||
| def _load(path): | ||
| with open(path) as f: |
There was a problem hiding this comment.
The helper and parametrized tests omit parameter and return types, violating the fully typed Python requirement that must be satisfied before merging
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!
| # AWS has not published Bedrock prices for these yet. Bedrock US Geo and | ||
| # In-Region rates for OpenAI models are the OpenAI API rate plus a 10% fee, | ||
| # so these entries are the OpenAI rate for the same model times 1.1. |
There was a problem hiding this comment.
Disallowed explanatory comment
This comment only restates straightforward pricing logic, violating the source-comment policy that must be satisfied before merging
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!
| @@ -0,0 +1,67 @@ | |||
| import json | |||
There was a problem hiding this comment.
This bug fix creates a separate test file instead of extending mapped Bedrock cost coverage, violating a requirement that must be satisfied before merging
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!
| PRICE_KEYS = ( | ||
| "input_cost_per_token", | ||
| "input_cost_per_token_above_272k_tokens", | ||
| "cache_creation_input_token_cost", | ||
| "cache_read_input_token_cost", | ||
| "output_cost_per_token", | ||
| "output_cost_per_token_above_272k_tokens", | ||
| ) |
There was a problem hiding this comment.
Long-context cache rates untested
These keys omit both above-272K cache rates, allowing incorrect long-context cache pricing to pass the new uplift test
| PRICE_KEYS = ( | |
| "input_cost_per_token", | |
| "input_cost_per_token_above_272k_tokens", | |
| "cache_creation_input_token_cost", | |
| "cache_read_input_token_cost", | |
| "output_cost_per_token", | |
| "output_cost_per_token_above_272k_tokens", | |
| ) | |
| PRICE_KEYS = ( | |
| "input_cost_per_token", | |
| "input_cost_per_token_above_272k_tokens", | |
| "cache_creation_input_token_cost", | |
| "cache_creation_input_token_cost_above_272k_tokens", | |
| "cache_read_input_token_cost", | |
| "cache_read_input_token_cost_above_272k_tokens", | |
| "output_cost_per_token", | |
| "output_cost_per_token_above_272k_tokens", | |
| ) |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@marianobilli while you are at it, can you also add the same ones for |
…rock prices Global cross-Region inference for OpenAI models on Bedrock is priced at the OpenAI API rate with no regional fee, so these use the OpenAI rate as is.
|
@msvechla done, added They use the plain OpenAI API rate with no 10% fee, since that's how AWS prices Global cross-Region for OpenAI models:
Same caveat as the rest of the PR: these are estimates until AWS publishes the Sol / Luna model cards. The test now checks the ×1.0 Global and ×1.1 US multipliers and links the two model cards above. |
|
Closing: these rows already landed on main with the same prices, and the rolling registry PR #42951 tracks the remaining unverified fields. Thanks! |
TLDR
Problem this solves:
How it solves it:
Why the estimate should be close
us.,bedrock_mantle/andglobal.) follow the same pattern.gpt-6-solandgpt-6-lunaentries in this file (source: https://developers.openai.com/api/docs/pricing).Where AWS stands today (checked 2026-09-23)
model-card-openai-gpt-6-sol.htmlandmodel-card-openai-gpt-6-luna.htmlredirect to the Bedrock overview page.AmazonBedrock,AmazonBedrockFoundationModels) has no GPT-6 Sol or Luna usage types yet.us.openai.gpt-6-sol,us.openai.gpt-6-luna,global.openai.gpt-6-solandglobal.openai.gpt-6-lunaare listed as ACTIVE inference profiles inus-east-1, andopenai.gpt-6-sol/openai.gpt-6-lunaare returned by the Bedrock Mantle/v1/modelsendpoint.Entries added
USD per 1M tokens, prompts up to 272K tokens. Above 272K tokens the same multiplier (1.1× for US, 1.0× for Global) is applied to OpenAI's long-context rates.
us.openai.gpt-6-solbedrock_mantle/openai.gpt-6-solglobal.openai.gpt-6-solus.openai.gpt-6-lunabedrock_mantle/openai.gpt-6-lunaglobal.openai.gpt-6-lunaContext limits and capability flags are copied from the matching GPT-5.6 Sol / Luna Bedrock entries (
us.openai.gpt-5.6-*,bedrock_mantle/openai.gpt-5.6-*andglobal.openai.gpt-5.6-*).sourcepoints to the OpenAI pricing page, since no AWS page lists these prices yet.Relevant issues
Related: #42727 (missing
bedrock_mantleprices for DeepSeek, Kimi and Qwen)Affected release
Linear ticket
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)Tests run locally:
tests/test_litellm/test_bedrock_gpt_6_sol_luna_model_metadata.py(new): checks main and backup match, each price is the OpenAI rate × 1.1 (US) or × 1.0 (Global), andcost_per_tokenreturns a non-zero costtests/test_litellm/test_model_prices_schema.pyandtests/test_litellm/test_cost_map_guard.py: passing (103 passed in total)Screenshots / Proof of Fix
Shared setup:
LITELLM_LOCAL_MODEL_COST_MAP=True, thenlitellm.cost_per_token(model=..., prompt_tokens=100_000, completion_tokens=100_000)for each model.Before (860bc78)
us.openai.gpt-6-sol→BadRequestError: LLM Provider NOT providedbedrock_mantle/openai.gpt-6-sol→ModelNotMappedError: This model isn't mapped yet.us.openai.gpt-6-luna→BadRequestError: LLM Provider NOT providedbedrock_mantle/openai.gpt-6-luna→ModelNotMappedError: This model isn't mapped yet.global.openai.gpt-6-sol→BadRequestError: LLM Provider NOT providedglobal.openai.gpt-6-luna→BadRequestError: LLM Provider NOT providedAfter (f10291e)
us.openai.gpt-6-sol→(0.22, 1.10)bedrock_mantle/openai.gpt-6-sol→(0.22, 1.10)us.openai.gpt-6-luna→(0.011, 0.055)bedrock_mantle/openai.gpt-6-luna→(0.011, 0.055)global.openai.gpt-6-sol→(0.20, 1.00)global.openai.gpt-6-luna→(0.010, 0.050)Type
🐛 Bug Fix
Caveats (if any)