fix(models): key Azure DeepSeek V4 Flash 0731 by its Foundry catalog id - #39341
Conversation
Greptile SummaryThe PR aligns the Azure DeepSeek V4 Flash 0731 registry key with its exact Foundry catalog identifier in both model-price registries.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Renames the Azure DeepSeek V4 Flash 0731 entry to the case-sensitive Foundry catalog identifier while retaining its pricing, limits, capabilities, and retirement metadata. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the primary registry key change in the packaged backup model map. |
Reviews (3): Last reviewed commit: "Merge branch 'litellm_internal_staging' ..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…nder the catalog id
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a9d3a07. Configure here.
…/litellm into litellm_azure_deepseek_v4_flash_0731 # Conflicts: # litellm/model_prices_and_context_window_backup.json # model_prices_and_context_window.json
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit f38a1ec. Configure here.
TLDR
Problem this solves:
azure_ai/deepseek-v4-flash-0731(added in feat: add Azure AI DeepSeek V4 Flash 0731 pricing #39023, priced in fix(models): registry audit 2026-09-01: openai realtime and long-context tiers, mistral aliases, voyage, xai, fireworks, together, scaleway, azure ai, govcloud, azure gov, cloudflare whisper, deprecation dates #39170) is keyed in lowercase, while Azure's catalog id, and the default name of a Foundry deployment, isDeepSeek-V4-Flash-0731litellm.get_max_tokensmiss deployments routed by the catalog id, so the 2026-12-03 retirement never surfaces for themHow it solves it:
azure_ai/DeepSeek-V4-Flash-0731, the casing the rest of the azure_ai catalog uses (Phi, Llama, MAI, Cohere, FW-*)User Flow
Before: a developer routing
azure_ai/DeepSeek-V4-Flash-0731through the proxy is billed correctly but never sees the model's retirement datemodel: azure_ai/DeepSeek-V4-Flash-0731, their Azure AI Foundry endpoint and key, and restarts the proxy"model": "DeepSeek-V4-Flash-0731"and a one-line prompt, and gets 200 OK with 10 prompt tokens and 2 completion tokensx-litellm-response-cost: 7.04e-06, Azure's 0731 rate, found through the case-insensitive registry lookupkey: azure_ai/deepseek-v4-flash-0731, an id that appears nowhere in the admin's configAfter: the same requests cost the same and the retirement date shows up
model: azure_ai/DeepSeek-V4-Flash-0731, their Azure AI Foundry endpoint and key, and restarts the proxy"model": "DeepSeek-V4-Flash-0731"and a one-line prompt, and gets 200 OK with 10 prompt tokens and 2 completion tokensx-litellm-response-cost: 7.04e-06, unchangedkey: azure_ai/DeepSeek-V4-Flash-0731, the id in the admin's configupcomingwithdeprecation_date: 2026-12-03Relevant issues
Extracted from #38976 (closed). Follows #39023, which added the lowercase entry, and #39170, which priced it from Azure's 0731 meters; this PR only moves the entry to the catalog id
Linear ticket
Part of LIT-6555 (its Kimi-K3 half still needs its own PR)
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Shared setup for both legs: a
DeepSeek-V4-Flash-0731deployment (GlobalStandard, version 2026-07-31) on an Azure AI Foundry resource in eastus, real Azure calls. Each leg is its own worktree and venv, booted withLITELLM_LOCAL_MODEL_COST_MAP=True python litellm/proxy/proxy_cli.py --config config.yaml --port <port> --num_workers 2, two uvicorn workers, no database, same config:Cost arithmetic on both legs: 10 prompt tokens x 4.4e-07 + 2 completion tokens x 1.32e-06 = 7.04e-06. The base already carries the 0731 meters through #39170, so this PR changes the key the values live under, not the values
Before (4049a07)
model info
model deprecations
chat completions cost
responses API cost
messages API cost
tool calling
After (f38a1ec)
model info
model deprecations
chat completions cost
responses API cost
messages API cost
tool calling
Observed on both legs, not caused by this PR: /v1/messages omits the bare
x-litellm-response-costheader and only sends the-original,-input, and-outputvariantsType
🐛 Bug Fix
Caveats (if any)
Low
v1.101.0-dev.1) goes awayget_model_infoand cost tracking resolve either casing, so nothing billed changes for those callerslitellm.get_max_tokens("azure_ai/deepseek-v4-flash-0731")is an exact-key lookup and now raises; the catalog id resolves insteaddeepseek-r1,deepseek-v3-0324,deepseek-v3.1,deepseek-v4-flash) stay lowercase; moving them to catalog ids is out of scope hereFinal 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
f38a1ec passes /live-pr-risk