Skip to content

fix(pricing): correct gpt-5.6 prices in cost map (hotfix of #35270 to main) - #35323

Closed
mateo-berri wants to merge 1 commit into
mainfrom
litellm_hotfix_gpt56_cost_map
Closed

fix(pricing): correct gpt-5.6 prices in cost map (hotfix of #35270 to main)#35323
mateo-berri wants to merge 1 commit into
mainfrom
litellm_hotfix_gpt56_cost_map

Conversation

@mateo-berri

Copy link
Copy Markdown
Contributor

TLDR

Hotfix to main carrying only the pricing-JSON changes from #35270 (merged to litellm_internal_staging), so the remote cost map at raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json serves the corrected GPT-5.6 prices. Deployed proxies pick the fix up immediately via POST /reload/model_cost_map, the scheduled cost-map reload, or the import-time fetch, without waiting for the next release

Type

🐛 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 into model_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 rationale

The get_model_info wiring for the new *_above_272k_tokens_flex fields 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 staging

No 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

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Corrects GPT-5.6 pricing metadata across the canonical and backup maps.

  • Revises OpenAI Terra and Luna base, cache, long-context, batch, flex, and priority rates.
  • Re-derives Bedrock Mantle Terra and Luna rates.
  • Adds schema support and map values for combined flex-tier and above-272K-token pricing fields.

Confidence Score: 4/5

The 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

Important Files Changed

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,

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 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,

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 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,

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.

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)

@veria-ai

veria-ai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

PR overview

This 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

codecov Bot commented Jul 31, 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

Copy link
Copy Markdown
Contributor Author

Superseded: staging was promoted to main, which carries these pricing fixes plus the flex wiring and test updates from #35270

@mateo-berri
mateo-berri deleted the litellm_hotfix_gpt56_cost_map branch July 31, 2026 05:28
@codspeed-hq

codspeed-hq Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_hotfix_gpt56_cost_map (22f0e72) with main (122f935)

Open in CodSpeed

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