Skip to content

fix(pricing): map Azure GPT-5.6 Luna snapshot - #35783

Open
Linxiushen wants to merge 1 commit into
BerriAI:litellm_internal_stagingfrom
Linxiushen:fix-azure-luna-cost-snapshot
Open

fix(pricing): map Azure GPT-5.6 Luna snapshot#35783
Linxiushen wants to merge 1 commit into
BerriAI:litellm_internal_stagingfrom
Linxiushen:fix-azure-luna-cost-snapshot

Conversation

@Linxiushen

Copy link
Copy Markdown

TLDR

Problem this solves:

  • Azure returns an unmapped dated GPT-5.6 Luna model
  • Successful completions fail during automatic cost calculation

How it solves it:

  • Maps the dated snapshot to canonical Luna pricing
  • Covers online and bundled offline cost maps
  • Adds a full completion-cost regression test

Relevant issues

Fixes #35762

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review

Screenshots / Proof of Fix

No credentials or mocks are required; this exercises the public completion_cost() path from the issue reproduction.

Before (956d5177d):

commit=956d5177d
dated_key_present=False
error=Exception: This model isn't mapped yet. model=gpt-5.6-luna-2026-07-09, custom_llm_provider=azure.

After (891c167a4):

commit=891c167a4
dated_key_present=True
cost=0.00040000

Type

Bug Fix
Test

Changes

  • Added azure/gpt-5.6-luna-2026-07-09 as a canonical pricing alias.
  • Kept the remote and packaged fallback cost maps in sync.
  • Added a regression using Azure response metadata and exact token costs.

Verification

1 passed in 62.67s
12 passed in 62.92s
19 passed in 93.89s
All checks passed! (Ruff lint)
1 file already formatted (Ruff format)
pre_commit_lint.sh: passed

make pre-commit could not finish its bootstrap on Windows because the local machine lacks MSVC link.exe; the staged-file lint script itself passed when run directly against the provisioned environment.

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR maps Azure’s dated GPT-5.6 Luna snapshot to the canonical Luna pricing entry so automatic completion-cost calculation can resolve it.

  • Adds the alias to the remote pricing map and packaged fallback map.
  • Adds an offline regression test covering Azure response metadata and exact token cost.

Confidence Score: 5/5

The PR appears safe to merge; the dated snapshot resolves correctly through both pricing-map sources and the regression test exercises the reported failure path.

Both pricing artifacts contain the same fully qualified alias, the shared loader expands it to canonical Luna pricing, and the test validates the exact Azure response metadata and token-cost calculation while forcing local-only loading.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds the dated Azure GPT-5.6 Luna alias to the canonical remote pricing entry; alias expansion resolves it to the existing pricing data.
litellm/model_prices_and_context_window_backup.json Mirrors the alias in the bundled fallback map, preserving offline and remote-map fallback behavior.
tests/test_litellm/llms/azure/test_azure_gpt56_cost_calculation.py Adds a local-only end-to-end regression test that verifies alias availability and the expected completion cost without leaking global state.

Reviews (1): Last reviewed commit: "fix(pricing): map Azure GPT-5.6 Luna sna..." | Re-trigger Greptile

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed-hq

codspeed-hq Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing Linxiushen:fix-azure-luna-cost-snapshot (891c167) with litellm_internal_staging (956d517)

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.

[Bug]: Azure gpt-5.6-luna dated snapshot gpt-5.6-luna-2026-07-09 missing from cost map

2 participants