Repository navigation
fix(cost-map): bedrock reasoning effort flags, registry audit fixes for vertex/openai/together/openrouter, absorb cerebras and inception rows - #40740
Conversation
…nai gpt rows Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Greptile SummaryUpdates LiteLLM’s model registry and corresponding tests to align model pricing, capabilities, context limits, and Bedrock reasoning-effort metadata with provider behavior.
Confidence Score: 5/5The PR appears safe to merge; the registry changes and revised reasoning-effort tests are internally consistent, with no outstanding actionable findings. The changed Bedrock flags resolve to the intended advertised ladders, the registry copies remain synchronized, and no new correctness or rule violations were established. The earlier untyped-fixture thread was manually resolved without explanation and therefore does not remain outstanding; the plain-dict concern was explicitly withdrawn after confirming the local convention.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Updates the primary registry with corrected prices, new model rows, and measured Bedrock reasoning-effort flags. |
| litellm/model_prices_and_context_window_backup.json | Keeps the backup registry synchronized with the primary model registry. |
| tests/test_litellm/test_model_prices_schema.py | Pins the measured Bedrock reasoning ladders and broadly verifies xhigh support across matching Bedrock GPT rows. |
| tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py | Updates cost assertions to reflect removal of unpublished cached-input prices. |
| tests/test_litellm/llms/cerebras/test_cerebras_chat_transformation.py | Verifies cost calculation for the newly registered Cerebras model. |
| tests/test_litellm/llms/inception/test_inception_chat_transformation.py | Verifies Inception model discovery, transformation behavior, and Mercury 2.5 cost calculation. |
Reviews (5): Last reviewed commit: "fix(cost-map): keep minimal withheld on ..." | Re-trigger Greptile
|
bugbot run |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…pt rows Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
|
|
bugbot run |
…itellm_bedrock_openai_xhigh_flags
…ogether/openrouter pricing Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…n registry tests Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
bugbot run |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
bugbot run |
Live calls to Bedrock Mantle and Converse on 2026-09-11: the gpt-5.6 luna, sol, and terra rows and gpt-6-astra return 200 on reasoning_effort=max, gpt-6-astra returns 400 on none, and Mantle gpt-5.4 and gpt-5.5 return 200 on minimal. The commercial Bedrock rows now carry exactly those flags, and the schema test asserts the measured ladder per row instead of a blanket mirror of the direct OpenAI rows
LiteLLM sends the Bedrock Mantle GPT rows through Bedrock's Responses endpoint, which refuses minimal on gpt-5.4 and gpt-5.5 like every other Bedrock GPT row. The earlier commit measured the raw chat endpoint, which accepts it, and dropped the flag by mistake. The ladder test now matches what the proxy path returns
|
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 71f4568. Configure here.
f90b5ca
into
litellm_internal_staging
TLDR
Problem this solves:
xhighreasoning effort, nor themaxlevel Bedrock accepts on gpt-5.6 and gpt-6-astraHow it solves it:
supports_xhigh_reasoning_effort: trueto the 19 Bedrock and Bedrock Mantle GPT rows andsupports_max_reasoning_effort: trueto the 12 gpt-5.6 and gpt-6-astra rows Bedrock accepts max on, and withholdsminimalon every row andnoneon gpt-6-astra, each level measured through the proxy against BedrocksourceUser Flow
Before: an operator serving GPT-5.6 through Bedrock Mantle cannot see or pick
xhigh, a Vertex Mistral Small deployment is billed at 10x, and new Qwen, Cerebras and Together deployments log $0bedrock_mantle/openai.gpt-5.6-sol,vertex_ai/mistral-small-2503andopenrouter/qwen/qwen3.8-max-0902deployments and start the proxysupported_reasoning_efforts: nullinput_cost_per_token: 1e-06, 10x the price Google charges, and the Qwen row, likecerebras/qwen-3.8-27bandtogether_ai/moonshotai/Kimi-K2.6, shows0costs and null token limitsopenrouter/qwen/qwen3.8-max-0902: the response carries nox-litellm-response-costheader and https://litellm-domain/ui/?page=logs shows Cost-for that requestAfter: the Bedrock deployment reports the reasoning ladder Bedrock accepts, and spend tracks published prices
supported_reasoning_effortsasnone, low, medium, high, xhigh, max, and a request to that deployment withreasoning_effort: maxreturns 200input_cost_per_token: 1e-07, matching the Vertex pricing page, and the Qwen, Cerebras and Together rows carry their published costs and token limitsx-litellm-response-cost: 0.00031and https://litellm-domain/ui/?page=logs shows $0.000310 for itRelevant issues
Reported by a customer in Pylon #8505
Supersedes #40744 (cerebras/qwen-3.8-27b) and #40747 (inception/mercury-2.5)
Linear ticket
Resolves LIT-7575
Registry changes by provider
Every value below was read from the raw official page or the provider's official model API. Full field-level old/new table: see the commit
4ffd4eccdiff (Bedrock flags:dbc57c13d4and71f45683d7); each changed row also carries thesourceURLBedrock (original scope of this PR)
supports_xhigh_reasoning_effort: trueon all 19bedrockandbedrock_mantleGPT-5.4/5.5/5.6/6-astra rows. The rest of each row's ladder was measured through the proxy on 2026-09-11, one real request per level per row (matrix in the proof below), and Bedrock does not mirror the direct OpenAI rows: gpt-5.6 luna/sol/terra and gpt-6-astra answer 200 tomaxon Bedrock Mantle and on theus.andglobal.Converse profiles, while OpenAI's own chat completions API refusesmaxon gpt-5.6, so those 12 rows getsupports_max_reasoning_effort: true. gpt-6-astra refusesnone, so its three rows getsupports_none_reasoning_effort: false.minimalis refused on every Bedrock GPT row, sosupports_minimal_reasoning_effort: falsestays on all of them, gpt-5.4 and gpt-5.5 included: Bedrock Mantle's raw chat completions endpoint accepts minimal on those two, but LiteLLM sends the Mantle rows over Bedrock's Responses endpoint, which refuses it, and the proxy path is what the flag describes. Bedrock's own rejection text is not reliable either: itsminimalrejection on gpt-5.4 namesmaxas supported, and amaxrequest is then refused with a list that ends atxhigh, so every flag follows the status code and not the message. The GovCloud rows and gpt-5.6-cyber cannot be called from our account (see Checked, not changed) and keep the family's xhigh flag with nomax. Regression test in tests/test_litellm/test_model_prices_schema.py pins the measured ladder per row and asserts every Bedrock GPT row advertises xhighOpenAI (https://platform.openai.com/docs/pricing)
Removed
cache_read_input_token_costandcache_read_input_token_cost_above_272k_tokensfromgpt-5.4-pro,gpt-5.4-pro-2026-03-05,gpt-5.5-pro,gpt-5.5-pro-2026-04-23. The pricing rows aregpt-5.4-pro (<272K context length) | $30.00 | - | - | $180.00 | $60.00 | - | - | $270.00and the same shape for gpt-5.5-pro: no cached-input price is published, same as gpt-5-pro, o1-pro and o3-pro which already have none.test_generic_cost_per_token_gpt55_proasserted the old $3/1M cached rate and now asserts the key is absentCerebras (absorbed from #40744, https://api.cerebras.ai/public/v1/models/qwen-3.8-27b)
New
cerebras/qwen-3.8-27b: $0.99 / $1.49 per 1M, context 65536, max output 32768, function calling, parallel tools, tool choice, structured outputs, reasoning, vision. All values match the official model API response. Test added in tests/test_litellm/llms/cerebras/test_cerebras_chat_transformation.pyInception (absorbed from #40747, corrected, https://docs.inceptionlabs.ai/get-started/models)
New
inception/mercury-2.5: $0.20 / $0.75 per 1M, context 260000, max output 65536, tool calling, structured outputs. Changes from the source PR: the docs give max output tokens 65,536 (the PR had 260,000), and the docs do not document prompt caching or parallel tool calls, socache_read_input_token_cost,supports_prompt_cachingandsupports_parallel_function_callingwere dropped. Theopenrouter/inception/mercury-2.5-previewalias from that PR was not added: OpenRouter's model API lists the id asinception/mercury-2.5and currently shows a launch discount, so there is no stable price to record. Test added in tests/test_litellm/llms/inception/test_inception_chat_transformation.pyVertex AI (https://cloud.google.com/vertex-ai/generative-ai/pricing)
vertex_ai/mistral-small-2503andvertex_ai/mistral-small-2503@001: $1.00 / $3.00 -> $0.10 / $0.30 (rowMistral Small 3.1 (25.03) | Input $0.10 | Output $0.30).vertex_ai/openai/gpt-oss-20b-maas: $0.075 / $0.30 -> $0.07 / $0.25, cache hit $0.007 added (rowgpt-oss-20b | Input $0.07 | Output $0.25 | Cache Hit $0.007); itssourcepointed at the gpt-oss-120b model garden page and now points at the pricing pageTogether AI (https://api.together.xyz/v1/models, official model API with
pricingandcontext_length)Four rows that had no price at all now carry the API's published rate and context:
Qwen/Qwen2.5-72B-Instruct-Turbo$1.20 / $1.20,Qwen/Qwen2.5-7B-Instruct-Turbo$0.30 / $0.30,mistralai/Mistral-7B-Instruct-v0.1$0.20 / $0.20,mistralai/Mistral-Small-24B-Instruct-2501$0.10 / $0.30Thirteen new
together_ai/rows for serverless chat models the API prices: moonshotai/Kimi-K2.6 ($1.20 / $4.50, cache $0.20), moonshotai/Kimi-K2.5-fp4 ($0.50 / $2.80), MiniMaxAI/MiniMax-M2.7 ($0.30 / $1.20, cache $0.06), zai-org/GLM-5 ($1.00 / $3.20), zai-org/GLM-5.1 ($1.40 / $4.40, cache $0.26), deepseek-ai/DeepSeek-R1-0528 ($3 / $7), Qwen/Qwen3-Coder-Next-FP8 ($0.50 / $1.20), Qwen/Qwen3-VL-32B-Instruct ($0.50 / $1.50), Qwen/Qwen3-VL-8B-Instruct ($0.18 / $0.68), mistralai/Ministral-3-14B-Instruct-2512 ($0.20 / $0.20), nvidia/NVIDIA-Nemotron-Nano-9B-v2 ($0.06 / $0.25), mistralai/Mistral-7B-Instruct-v0.3 ($0.20 / $0.20), Qwen/QwQ-32B ($1.20 / $1.20). The API publishes no capability flags, so none were set. The remaining ~200 ids the API lists are $0 (dedicated-only) or non-chat and were left outOpenRouter (https://openrouter.ai/api/v1/models, per-row
sourcehttps://openrouter.ai/)Prices re-read from the official model API for 16 existing rows: moonshotai/kimi-k3 ($3 / $15 -> $2.10 / $10.53), z-ai/glm-5.2 ($0.966 / $3.036 -> $0.60 / $2.00), z-ai/glm-5.3-flash ($0.075 / $0.25 -> $0.15 / $0.50), z-ai/glm-4.6 ($0.55 / $2.20 -> $0.43 / $1.75), deepseek/deepseek-v4-pro ($1.32 / $3.96 -> $0.86 / $1.72), deepseek/deepseek-v4-pro-0813 ($1.32 / $3.96 -> $0.58 / $1.74), deepseek/deepseek-v4-flash, deepseek/deepseek-chat-v3.1 ($0.20 / $0.80 -> $0.25 / $0.95), qwen/qwen3-235b-a22b-2507 ($0.0875 / $0.35 -> $0.22 / $0.88), qwen/qwen3-30b-a3b-instruct-2507, qwen/qwen3-14b ($0.12 / $0.24 -> $0.2275 / $0.91), qwen/qwen3.5-35b-a3b, qwen/qwen3.5-122b-a10b, qwen/qwen3-next-80b-a3b-instruct, moonshotai/kimi-k2.7-code, google/gemma-4-26b-a4b-it ($0.07 / $0.34 -> $0.042 / $0.22). Cache-read prices added where the API publishes one
Seven new rows: deepseek/deepseek-v4.1-flash ($0.15 / $0.60, cache $0.003, 1M context, 384K output; the API's time-of-day overrides were not modeled, the base rate is recorded), openai/gpt-5.6-luna-pro, openai/gpt-5.6-sol-pro, openai/gpt-5.6-terra-pro, openai/gpt-6-astra-pro (each with the >272K tier and cache read/write from the API), openai/gpt-chat-latest ($5 / $30, cache $0.50), qwen/qwen3.8-max-0902 ($2 / $6, cache read $0.25, write $2.50). Capability flags derived from
supported_parametersandarchitecture.input_modalitiesEach OpenRouter row records the rate the models API returned for the model's top provider at capture on 2026-09-11, since that is what OpenRouter's default routing bills. The alternative was the first-party rate (Moonshot lists kimi-k3 at $3 / $15, the old row), which stays stable but is not what an OpenRouter user pays. The top-provider rate floats as providers change price and ordering, so a row can drift within hours of capture; see the Caveats section
Checked, not changed
pgsgroveprovider that has no provider implementation in this repo, so it is a provider PR, not a registry-only change. Left alonesupports_web_search: the pricing page prices web search at $10 per 1,000 searches but does not list per-model support, so no flags were setembed-multilingual-light-v3.0at $100 per 1M looks wrong but Cohere's pricing page could not be read raw; not changedbedrock_mantle/us-gov-west-1/openai.gpt-5.4,.../openai.gpt-5.6-luna,.../openai.gpt-5.6-terra,bedrock_mantle/us-gov-east-1/openai.gpt-5.4): our account has no GovCloud API access, so their ladders could not be measured. They keep the family's xhigh flag andminimal: falseand get nomaxbedrock_mantle/openai.gpt-5.6-cyber: Bedrock Mantle returns 404 for it in us-east-1, us-west-2, eu-west-1 and ap-northeast-1 on our account, so its ladder could not be measured. Same treatment as the GovCloud rowsPre-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)Scope note: this is the single rolling registry PR (standing instruction: one open model-pricing PR at a time), so it bundles the xhigh flags with this run's audit fixes
Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Both legs share one config of 21 deployments, each named after its registry row:
vertex_ai/mistral-small-2503,together_ai/moonshotai/Kimi-K2.6,cerebras/qwen-3.8-27bandinception/mercury-2.5with placeholder keys,gpt-5.4-pro,openrouter/moonshotai/kimi-k3andopenrouter/qwen/qwen3.8-max-0902with keys from.env, and the 14 commercial Bedrock GPT rows (bedrock_mantle/openai.gpt-5.4,gpt-5.5,gpt-5.6-luna,gpt-5.6-solandgpt-5.6-terrain us-east-1,bedrock_mantle/openai.gpt-6-astrain us-west-2, andbedrock/us.openai.*plusbedrock/global.openai.*for gpt-5.6-luna/sol/terra and gpt-6-astra in us-east-1) withAWS_BEARER_TOKEN_BEDROCKfrom.env, plusgeneral_settings.proxy_batch_write_at: 5. Each leg boots from its own worktree and.venvwithLITELLM_LOCAL_MODEL_COST_MAP=True,--num_workers 2and its own Postgres database: base 95b4380 on port 31655, head 71f4568 on port 57922. Below,$Bis the leg's base URL,$HisAuthorization: Bearer sk-qa-1234, and the Admin UI login isadminwith the master key as the password. The rows with placeholder keys are checked on/model/infoonlyBefore (95b4380)
Registry costs on /model/info
Live spend on /v1/chat/completions
x-litellm-response-costheader and the usageLive spend on /v1/responses
Live spend on /v1/messages
Spend rows on /spend/logs
Bedrock reasoning ladder
Logs page
adminwith the master keyresp_piPLJLuA...row foropenrouter/qwen/qwen3.8-max-0902(98 tokens, the/v1/responsescall above) shows Cost-, while the chat and messages rows next to it carry the cost OpenRouter reportedAfter (71f4568)
Registry costs on /model/info
Live spend on /v1/chat/completions
x-litellm-response-costheader and the usageLive spend on /v1/responses
Live spend on /v1/messages
Spend rows on /spend/logs
Bedrock reasoning ladder
Logs page
adminwith the master keyresp_asuKAlIC...row foropenrouter/qwen/qwen3.8-max-0902(97 tokens, the/v1/responsescall above) shows $0.000310Observations from the run:
/v1/responseslogs $0 spend for the missing row/model/infoonly/model/infoonly, serverless access missingmax_output_tokensdrift on nine OpenRouter rows predates this PRType
🆕 New Feature
🐛 Bug Fix
Caveats (if any)
Low
max, since our account cannot call themopenrouter/deepseek/deepseek-v4.1-flashrecords the base rate, not OpenRouter's time-of-day overrides: the registry has no time-of-day price field, so modeling them is a schema change, not a row editopenrouter/moonshotai/kimi-k3records the top-provider rate at capture ($2.10 / $10.53); the models API read $1.7955 / $9.006 later the same day. Chat and Messages log OpenRouter's billed cost regardless, so only/v1/responsesand/model/inforead the row. Left as is: re-snapshotting chases a value that floats by the hour/model/infoonly: no Cerebras or Inception key, the Vertex project lacks Mistral access, and the Together account serves these models on dedicated endpoints onlyFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/71decefd2273494d8c905706e17994ea
Open in Devin Desktop: https://app.devin.ai/desktop/session/71decefd2273494d8c905706e17994ea?variant=devin
Requested by: @mateo-berri
Note
Medium Risk
Changes affect spend calculation and
/model_group/inforeasoning options across many deployments; incorrect registry values would misbill or hide valid effort levels, though runtime routing logic is unchanged.Overview
Updates
model_prices_and_context_window.json(and backup) so LiteLLM’s registry matches published provider pricing and advertises the reasoning levels Bedrock actually accepts.Bedrock-hosted OpenAI GPT rows gain
supports_xhigh_reasoning_effort(andsupports_max_reasoning_efforton gpt-5.6 luna/sol/terra and gpt-6-astra where measured), withsupports_minimal_reasoning_effort: falsebroadly andsupports_none_reasoning_effort: falseon gpt-6-astra. New schema tests pin each row’s resolved ladder viaresolve_supported_reasoning_efforts.Pricing and metadata fixes include removing unpublished
cache_read_input_token_costfromgpt-5.4-pro/gpt-5.5-prodated variants, correcting Vertex Mistral Small (10× overcharge) and gpt-oss-20b-maas, refreshing many OpenRouter rates and cache fields, and filling in Together AI costs for previously $0 rows plus 13 new serverless models.New model entries:
cerebras/qwen-3.8-27b,inception/mercury-2.5, and numerous OpenRouter variants (e.g. deepseek-v4.1-flash, gpt-5.6-*-pro, gpt-chat-latest). Tests cover Cerebras/Inceptioncost_per_token/ limits and the gpt-5.5-pro cache assertion change.Reviewed by Cursor Bugbot for commit 71f4568. Bugbot is set up for automated code reviews on this repo. Configure here.
/model/info,/model_group/info, cost on all three unified endpoints, the dashboardsupported_reasoning_effortsconsumers, wheremaxalready appears in 100 base rows) A/B'd above with no regression; no legacy suite asserts a changed value, so norun-cilabel