Skip to content

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

Closed
Linxiushen wants to merge 3 commits into
BerriAI:mainfrom
Linxiushen:fix-azure-luna-cost-snapshot
Closed

Linxiushen wants to merge 3 commits into
BerriAI:mainfrom
Linxiushen:fix-azure-luna-cost-snapshot

Conversation

@Linxiushen

@Linxiushen Linxiushen commented Aug 4, 2026 •

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
  • Declares the existing model alias field in both schema validators
  • Adds cost and schema regression coverage

Relevant issues

Fixes #35762

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests
  • My PR passes all CI/CD checks
  • 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 (rebased head 5c322d1cde):

commit=5c322d1cde
dated_key_present=True
cost=0.00008000

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
  • Declared aliases as a unique string array in the generated and compatibility schemas
  • Added regressions that derive the expected snapshot cost from canonical pricing and reject duplicate aliases

Verification

Rebased onto bbc6e3feea and verified at head 5c322d1cde:

20 passed in 5.49s

Focused Ruff checks passed for the Azure and schema tests. The 20 focused tests cover the completion-cost regression, committed schema generation and validation, malformed schema cases, and the compatibility price-map validator.

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

AI assistance was used for implementation and test drafting; the diff and verification results were reviewed before submission

@CLAassistant

CLAassistant commented Aug 4, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@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

codspeed 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 (5c322d1) with litellm_internal_staging (31a86da)1

Open in CodSpeed

Footnotes

  1. No successful run was found on litellm_internal_staging (bbc6e3f) during the generation of this report, so 31a86da was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@Linxiushen
Linxiushen force-pushed the fix-azure-luna-cost-snapshot branch from c9f2b16 to 758223e Compare August 4, 2026 23:04
# Conflicts:
#	litellm/model_prices_and_context_window_backup.json
#	model_prices_and_context_window.json
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Base switched to main. The fork branch is not pushable from here, so the rebased commits with conflicts resolved are in #41433

@mateo-berri

Copy link
Copy Markdown
Contributor

Closing as superseded by #41423, merged into main, which strips any trailing dated snapshot suffix instead of aliasing one model

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

4 participants