fix(pricing): add undated azure aliases for gpt-audio-mini and gpt-realtime-mini - #33291
fix(pricing): add undated azure aliases for gpt-audio-mini and gpt-realtime-mini#33291mihidumh wants to merge 4 commits into
Conversation
Greptile SummaryThis PR fixes a billing bug (issue #33170) where Azure deployments using the undated
Confidence Score: 5/5Safe to merge — the change is additive data only (two new JSON keys) with no modifications to existing entries or runtime logic, and the new test suite guards the critical invariant going forward. Both undated alias entries are confirmed to be byte-for-byte copies of their dated counterparts in both the root and backup JSON files. The test file is mock-only (no network calls), uses the local cost-map fixture correctly, and the new full-equality test closes the gap identified in the prior review round by covering every field including realtime-specific cache and audio cost keys. No files require special attention. The backup drift-sync entries are straightforward catch-up additions that were already present in the root map.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds azure/gpt-audio-mini and azure/gpt-realtime-mini as exact mirrors of their -2025-10-06 dated counterparts; no other changes to the root map. |
| litellm/model_prices_and_context_window_backup.json | Adds the two azure aliases (identical to root), then syncs nine previously missing entries (Gemini image models, vertex_ai aliases, openrouter/zai models, token-limit corrections, snowflake adaptive-thinking flag) from the root map into the backup. Both undated azure entries verified to be field-for-field identical to their dated siblings. |
| tests/test_litellm/test_azure_audio_price_aliases.py | New mock-only test file (uses local cost-map fixture, no network calls). Provides two parametrized tests: COST_FIELDS equality + non-zero guards, and a full dictionary equality check (test_undated_azure_audio_alias_is_exact_mirror) covering every field including realtime-specific cache/audio cost keys. |
Reviews (2): Last reviewed commit: "test(pricing): assert undated azure audi..." | Re-trigger Greptile
|
@greptileai — added a full-entry equality test asserting each undated alias exactly mirrors its dated sibling, covering the realtime-specific cost keys COST_FIELDS missed. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
8966298 to
dc0dbc3
Compare
dc0dbc3 to
483966a
Compare
…altime-mini Azure deployments are commonly created against the undated model name, and the cost-tracking docs say to set base_model to azure/<model> — but only the dated -2025-10-06 entries existed for these two models (the openai provider has undated aliases for both). base_model: azure/gpt-audio-mini therefore resolved to nothing and, depending on the fallback path, text tokens billed at $0 while audio tokens billed fine. Mirror the -2025-10-06 entries as undated aliases, exactly like the undated openai entries mirror their newest dated variant. Fixes BerriAI#33170 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…r dated entries Review follow-up: COST_FIELDS missed realtime-specific cost keys (cache_creation_input_audio_token_cost, cache_read_input_token_cost, input_cost_per_image). Full-entry equality catches drift on every field. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e-mini alias Upstream changed the dated entry's mode from chat to realtime after this branch was cut; the undated alias must stay a byte-for-byte mirror. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
483966a to
d1853ff
Compare
|
Superseded by #37867, which landed your commits with added tests for the root cost map. Thanks for the fix and the report |
Relevant issues
Fixes #33170
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Screenshots / Proof of Fix
Production observation (litellm proxy 1.92.0 on Azure, real Azure
gpt-audio-minideployment, real audio-modality completions): with no undatedazure/gpt-audio-minimap key, spend logs and thex-litellm-response-costheader billed text tokens at $0 while audio tokens billed correctly. We verified by putting the correct prices inlitellm_paramscustom pricing on the deployment row — after which the cost header matched the hand-computed text+audio math exactly ($0.60/M in, $2.40/M out — the same numbers as the datedazure/gpt-audio-mini-2025-10-06entry this PR mirrors).Map state before (base
10d5804b3e):After (
2f906a3415):The new test resolves both undated names through
litellm.get_model_info(local cost map fixture, same pattern astest_cloudflare_workers_ai_model_metadata.py) and asserts every cost field matches the dated entry and is non-zero.Note on the second commit: running the repo's own
ci_cd/check_files_match.pysync tool surfaced pre-existing drift on the daily branch (9 entries in the root map missing from the packaged backup —gemini-3-pro-image,zai/glm-5.1, etc.). That sync is kept as a separatechore:commit so the alias fix itself stays a clean 63-line-per-file addition. Happy to drop that commit if you'd rather take the drift separately.Type
🐛 Bug Fix
Changes
azure/gpt-audio-miniandazure/gpt-realtime-minitomodel_prices_and_context_window.json(and the packaged backup), each an exact mirror of its-2025-10-06dated entry — same relationship as the undated openaigpt-audio-mini/gpt-realtime-minientries.