Repository navigation
feat(cost-map): sync azure models, add MAI-Image-2.6, deepseek-v4.1-flash, muse-spark-1.3 - #42970
Conversation
…lash, muse-spark-1.3 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
|
|
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 34ba508. Configure here.
|
| "input_cost_per_token": 5e-06, | ||
| "litellm_provider": "azure_ai", | ||
| "mode": "image_generation", | ||
| "output_cost_per_image_token": 3.8e-05, |
There was a problem hiding this comment.
Image costs are under-reserved For a prompt-based image request, admission estimates the text input but cannot use this output image-token rate. The completed image is charged for output tokens, so concurrent requests can exceed the budget before their actual costs are recorded. The Flash row has the same issue.
Knowledge Base Used: Spend, budgets, and rate limits
There was a problem hiding this comment.
Azure publishes only token meters for MAI-Image-2.6, no per-image price, so a flat output_cost_per_image would be invented rather than sourced
There was a problem hiding this comment.
That’s fair. A flat output_cost_per_image would be fabricated here, and the token-meter fields correctly represent Azure’s published pricing. The output image-token rate is still used when the provider returns output-token usage; my earlier concern was limited to speculative pre-admission budgeting, not the correctness of this cost-map row. I’m withdrawing that finding as non-blocking.
| "supports_reasoning": true, | ||
| "supports_tool_choice": true, | ||
| "deprecation_date": "2026-12-15", | ||
| "source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'" |
There was a problem hiding this comment.
Inherited prices lack clear provenance These Azure rows use rates inherited from other offerings, but no Azure-direct meter is identified. Mark them as estimates so operators do not mistake the rates used for spend tracking for published Azure prices.
Knowledge Base Used: Spend, budgets, and rate limits
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
The cost map has no estimate flag; the PR body records inherited_from for both rows and the source URLs point at the sibling meters
There was a problem hiding this comment.
That’s fair. Since the cost-map schema has no established estimate field, adding one would be inconsistent with the existing model metadata. The inherited pricing is documented via inherited_from and the referenced sibling-meter sources, so I’m withdrawing this suggestion; no change is needed for this comment.
| "supports_tool_choice": true, | ||
| "supports_vision": true | ||
| }, | ||
| "azure_ai/MAI-Image-2.6": { |
There was a problem hiding this comment.
New image pricing lacks tests The new image rows have no tests for billing or budget reservation. Schema checks cannot catch failures in either path. The repository requires meaningful feature tests, so add them before merging.
Context Used: AGENTS.md (source)
There was a problem hiding this comment.
Data-only rows: the schema and cost-map guard tests validate them, and pinning vendor prices in tests is disallowed by AGENTS.md
There was a problem hiding this comment.
That’s fair. Schema and cost-map guard coverage is appropriate for data-only rows, so I’m withdrawing the request for vendor-price-specific billing tests
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…lash, muse-spark-1.3 (#42970) Co-authored-by: kerry <kerry@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
TLDR
Problem this solves:
How it solves it:
User Flow
Before: a proxy admin routing to Azure Foundry's newer models sees zero spend for them
"model": "azure_ai/deepseek-v4.1-flash"(orazure_ai/muse-spark-1.3)"model": "azure_ai/MAI-Image-2.6"is likewise logged at $0After: the same requests are priced
"model": "azure_ai/deepseek-v4.1-flash"GET /model/inforeports the model's 1M context, 384K max output and deprecation dateEvidence per row
Fresh outputs from
npm run providers -- list azure(420 ARM models, eastus2) andnpm run providers -- prices azure(198 priced records from the Azure Retail Prices API, Foundry Models, eastus). All 190 catalog rows the prices command covers already match, so no existing price changedazure_ai/MAI-Image-2.6(kind api). Raw retail meters, per 1M tokens, Global: "Image 2.6 Text Input Glbl 1M Tokens | 5.0", "Image 2.6 Image Input Glbl 1M Tokens | 8.0", "Image 2.6 Image Output Glbl 1M Tokens | 38.0". Divided by 1e6 gives 5e-6, 8e-6, 3.8e-5. Fields follow the existingazure_ai/MAI-Image-2.5-Flashrow shape. No per-image flat price is published, sooutput_cost_per_imageis omitted. The Learn model page lists "MAI-Image-2.6 Preview | Image-to-Image and Text-to-Image ... Output: One image ... Context length : 32,000 tokens"azure_ai/MAI-Image-2.6-Flash(kind api). Raw retail meters, per 1M tokens, Global: "Img 2.6 Flash Text In Glbl 1M Tokens | 1.75", "Image 2.6 Flash Image Input Glbl 1M Tokens | 2.5", "Image 2.6 Flash Image Output Glbl 1M Tokens | 19.0", giving 1.75e-6, 2.5e-6, 1.9e-5azure_ai/deepseek-v4.1-flash(kind inherited, inherited_from: azure_ai/FW-DeepSeek-V4.1-Flash). ARM listsDeepSeek.DeepSeek-V4.1-Flash.2026-09-10with lifecycleStatusPreviewand inference deprecation2026-12-15T00:00:00Z, which becomesdeprecation_date: 2026-12-15. The retail API only carries the Fireworks-hosted meters for this model ("FW DS-V4.1-Flash Gl Inp | 0.000375 per 1K", "FW DS-V4.1-Flash Gl Opt | 0.0015 per 1K"), so the Azure-direct row inherits the FW sibling's prices and limits. Not published DeepSeek-direct pricingazure_ai/muse-spark-1.3(kind inherited, inherited_from: meta/muse-spark-1.3). ARM listsMeta.muse-spark-1.3.1(Preview, no retirement). The retail API has no meter for it and Meta's pricing page at https://ai.developer.meta.com/docs/pricing-rate-limits renders client side, so no raw quote could be captured; the row inherits the first-party Meta row's prices and limits. Not published Azure pricingazure_ai/Cohere-command-a-plus-05-2026deprecation_date 2026-10-16 (kind page). Model retirement schedule row: "Cohere-command-a-plus-05-2026 | 1 | Preview | 2026-10-16"azure_ai/FW-GPT-OSS-120Bdeprecation_date 2027-07-01 (kind page). Model retirement schedule row: "FW-GPT-OSS-120B | 1 | GA | 2027-07-01"Source for the page rows: https://learn.microsoft.com/en-us/azure/foundry/openai/concepts/model-retirement-schedule fetched raw with a cache buster
Priced by the API but deliberately not added
The prices command emits eight keys absent from the catalog:
azure_ai/deepseek-r1,deepseek-v3-0324,deepseek-v3.1,grok-3,grok-3-mini,grok-4-fast-non-reasoning,grok-4-fast-reasoning,MAI-Image-2e. The retirement schedule marks every one of them Retired ("DeepSeek-R1 | 1 | Retired | 2026-08-13", "DeepSeek-V3-0324 | 1 | Retired | 2026-07-13", "DeepSeek-V3.1 | 1 | Retired | 2026-07-13", "grok-3 | 1 | Retired | 2026-05-01", "grok-3-mini | 1 | Retired | 2026-05-01", "grok-4-fast-non-reasoning | 1 | Retired | 2026-05-01", "grok-4-fast-reasoning | 1 | Retired | 2026-05-01", "MAI-Image-2e | 2026-04-09 | Retired | 2026-08-15") and #42435 removed them for exactly that reason, so stale meters do not re-add themNaming mismatches, not delistings
ARM emits
Publisher.model.version(for exampleOpenAI.gpt-4o.2024-08-06,Fireworks.FW-Qwen3.5-27B.1); 174 of the unique ARM models map to existingazure_ai/rows once the publisher and version suffix are dropped. The remaining Fireworks IDs (FW-GLM-4.7, FW-Kimi-K2-Thinking, FW-Qwen3.x sizes and others) andOpenAI-OSS.gpt-oss-20b,Alibaba.qwen3-32bhave no retail token meter in eastus (only hosting or fine-tuning meters, for example "Qwen3 32B FT | 0.3 per hour"), so they stay unpriced until Azure publishes consumption meters. The Learn Claude page changed but publishes no numbers, so no Claude row changedPre-Submission checklist
uv run pytest tests/test_litellm/test_model_prices_schema.py tests/test_litellm/test_cost_map_guard.py(85 passed)Screenshots / Proof of Fix
Cost-map-only change, no provider call needed. Each run loads the local map with
LITELLM_LOCAL_MODEL_COST_MAP=Trueand callslitellm.get_model_infofor the three new chat/image keysBefore (e135a19)
LITELLM_LOCAL_MODEL_COST_MAP=True python /tmp/proof.pyazure_ai/deepseek-v4.1-flash ModelNotMappedError This model isn't mapped yet, same forazure_ai/muse-spark-1.3andazure_ai/MAI-Image-2.6After (34ba508)
LITELLM_LOCAL_MODEL_COST_MAP=True python /tmp/proof.pyazure_ai/deepseek-v4.1-flash {'input_cost_per_token': 3.75e-07, 'output_cost_per_token': 1.5e-06, 'max_input_tokens': 1000000},azure_ai/muse-spark-1.3 {'input_cost_per_token': 1.25e-06, 'output_cost_per_token': 4.25e-06, 'max_input_tokens': 1048576},azure_ai/MAI-Image-2.6 {'input_cost_per_token': 5e-06, ...}Type
🆕 New Feature
Caveats (if any)
Medium
Low
azure/keys absent from the eastus2 ARM list are left untouchedFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/c307d9e25dea4d69a6ef90d367f42953
Open in Devin Desktop: https://app.devin.ai/desktop/session/c307d9e25dea4d69a6ef90d367f42953?variant=devin
Requested by: @kerry-berri
Note
Low Risk
Data-only cost-map JSON updates with no runtime logic changes; main caveat is inherited pricing for two chat models until Azure publishes meters.
Overview
Extends the LiteLLM Azure AI cost map so newer Foundry models get non-zero spend in logs and
/model/info, and retirement dates surface for models Microsoft has scheduled.Adds four
azure_ai/entries in bothmodel_prices_and_context_window.jsonand the backup copy: chat modelsdeepseek-v4.1-flash(withdeprecation_date2026-12-15) andmuse-spark-1.3, plus image-generationMAI-Image-2.6andMAI-Image-2.6-Flashwith token/image-token pricing and image API endpoints.FW-GPT-OSS-120BandCohere-command-a-plus-05-2026gaindeprecation_datefields (2027-07-01 and 2026-10-16). Existing retail prices for other rows are unchanged; some new rows use inherited or Meta-sourced pricing where Azure meters are missing.Reviewed by Cursor Bugbot for commit 34ba508. Bugbot is set up for automated code reviews on this repo. Configure here.