fix(pricing): correct gpt-5.6 prices in cost map (hotfix of #35270 to main) - #35323
fix(pricing): correct gpt-5.6 prices in cost map (hotfix of #35270 to main)#35323mateo-berri wants to merge 1 commit into
Conversation
Greptile SummaryCorrects GPT-5.6 pricing metadata across the canonical and backup maps.
Confidence Score: 4/5The PR should not merge until long-context flex rates are wired into runtime model information and existing GPT-5.6 pricing expectations are updated. Flex requests above 272K tokens currently lose the newly added tier-specific rates and fall back to non-flex pricing, while multiple existing tests still assert the replaced Terra, Luna, and Bedrock Mantle values. Files Needing Attention: model_prices_and_context_window.json, litellm/model_prices_and_context_window_backup.json, model_prices_and_context_window.schema.json
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Updates canonical GPT-5.6 prices, but the new combined flex fields are dropped at runtime and existing pricing tests retain old expectations. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the canonical pricing changes exactly, including the currently unwired combined flex fields. |
| model_prices_and_context_window.schema.json | Validly permits four new nonnegative combined long-context flex pricing fields, but schema acceptance does not provide runtime ModelInfo wiring. |
Reviews (1): Last reviewed commit: "fix(pricing): correct gpt-5.6 prices in ..." | Re-trigger Greptile
| "gpt-5.6": { | ||
| "cache_creation_input_token_cost": 6.25e-06, | ||
| "cache_creation_input_token_cost_above_272k_tokens": 1.25e-05, | ||
| "cache_creation_input_token_cost_above_272k_tokens_flex": 6.25e-06, |
There was a problem hiding this comment.
Long-context flex rates are dropped
When a GPT-5.6-family flex request exceeds 272,000 prompt tokens, get_model_info drops the new fields because its generic matcher only retains names ending in _tokens; cost calculation then falls back to the non-flex long-context rates, causing input, output, and cache spend to be recorded at approximately twice the intended cost.
Knowledge Base Used: Cost Tracking and Budget Enforcement
| "cache_read_input_token_cost_above_272k_tokens_flex": 2e-07, | ||
| "cache_read_input_token_cost_flex": 1e-07, | ||
| "cache_read_input_token_cost_priority": 4e-07, | ||
| "input_cost_per_token": 2e-06, |
There was a problem hiding this comment.
Pricing expectations remain stale
When the GPT-5.6 metadata, cost-calculation, or Bedrock Mantle pricing tests run, they compare the corrected Terra and Luna values with unchanged hard-coded former rates, causing the test workflow to fail.
Knowledge Base Used: Cost Tracking and Budget Enforcement
| "cache_read_input_token_cost_above_272k_tokens_flex": 2e-08, | ||
| "cache_read_input_token_cost_flex": 1e-08, | ||
| "cache_read_input_token_cost_priority": 4e-08, | ||
| "input_cost_per_token": 2e-07, |
There was a problem hiding this comment.
High: Luna and Terra usage is undercharged
This sets Luna input and output pricing to one fifth of OpenAI's published $1/M and $6/M rates; the Terra block is 20% low, and the corresponding Bedrock entries at lines 45259–45291 are also below AWS's published rates. Since the proxy uses this map for both reservation and final spend, an authenticated caller can select Luna and consume five times their configured budget before enforcement stops them. Restore the published standard, cache, batch/flex, priority, and long-context rates in both cost-map files. (developers.openai.com)
PR overviewThis hotfix updates GPT-5.6 pricing entries in the model cost map used for usage reservation and final spend calculations, including provider-specific records. One pricing issue remains open, and none have yet been addressed. Several model rates are still understated, allowing an authenticated caller to consume up to five times their configured budget before enforcement stops further usage. Correct rates are needed across the affected cost-map entries to restore accurate budget enforcement. Open issues (1)
Fixed/addressed: 0 · PR risk: 6/10 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Superseded: staging was promoted to main, which carries these pricing fixes plus the flex wiring and test updates from #35270 |
TLDR
Hotfix to
maincarrying only the pricing-JSON changes from #35270 (merged tolitellm_internal_staging), so the remote cost map atraw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.jsonserves the corrected GPT-5.6 prices. Deployed proxies pick the fix up immediately viaPOST /reload/model_cost_map, the scheduled cost-map reload, or the import-time fetch, without waiting for the next releaseType
🐛 Bug Fix
Changes
Ports the six changed entries (
gpt-5.6,gpt-5.6-sol,gpt-5.6-terra,gpt-5.6-luna,bedrock_mantle/openai.gpt-5.6-terra,bedrock_mantle/openai.gpt-5.6-luna) from #35270 intomodel_prices_and_context_window.json, the backup copy, and the schema. The entries are byte-identical to the merged staging versions; see #35270 for the full pricing rationaleThe
get_model_infowiring for the new*_above_272k_tokens_flexfields is deliberately not ported. Reloading only transports JSON, so released versions run their existing code either way; they silently drop the unknown fields and still get the base-price corrections (the OpenAI Terra/Luna cut and the bedrock_mantle re-derivation, which was overcharging Luna 5x). The flex long-context fix needs the code wiring and ships with the next release from stagingNo new tests; the change is covered by the existing schema validation (
tests/test_litellm/test_model_prices_schema.py, 17 passed locally) and the behavioral tests merged with #35270 on staging