Repository navigation
feat(azure_ai): add Foundry gpt-6.2, gpt-image-2.5, and MAI cost rows - #53783
Bytechoreographer wants to merge 3 commits into
Conversation
Add explicit azure_ai rows for gpt-6.2-astra, gpt-6.2-sol, gpt-image-2.5-flare, and gpt-image-2.5-sunburst, priced like their azure twins. The lookup previously fell back to the bare OpenAI rows, so model info reported the OpenAI key and provider and dropped the Foundry retirement metadata. Co-Authored-By: AaronHowell <111272993+AaronHowell@users.noreply.github.com>
Add azure_ai rows for the MAI-Image-2.7 pair and MAI-Code-2-Flash, using the eastus Foundry retail prices and the catalog context windows. Co-Authored-By: AaronHowell <111272993+AaronHowell@users.noreply.github.com>
79013e9 to
076701f
Compare
|
The two MAI-Image-2.7 rows from this PR are now in #53569. The GPT-6.2, GPT Image 2.5 and MAI-Code-2-Flash rates are not yet verifiable, so this stays open |
|
bugbot run |
[Medium impact] The changes affect model lookups and cost estimates for seven Azure AI model names. The required live billing proof must be supplied before merging. Findings
|
| "input_cost_per_image_token": 8e-06, | ||
| "input_cost_per_token": 5e-06, | ||
| "litellm_provider": "azure_ai", | ||
| "max_input_tokens": 32000, | ||
| "mode": "image_generation", | ||
| "output_cost_per_image_token": 3.4e-05, |
There was a problem hiding this comment.
These rows add billable rates, but proof at 076701f850a458cb9c5d88a049448e1b6ffd3335 checks only lookups. AGENTS.md requires provider-backed before/after billing checks before merging.
Context Used: AGENTS.md (source)
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!
|
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 a5d765b. Configure here.
|
Superseded by the rolling registry PR #53569, which absorbed the four Foundry rows verified against Azure's pricing and Foundry docs. The unverified MAI limits, flags and retirement fields were dropped, see that PR's description. |
[insert handwritten description here]
Details
TLDR
Problem this solves:
How it solves it:
azure_ai/rows priced from the Foundry retail price sheetUser Flow
Before: model lookups for these Foundry deployments return the wrong row or nothing
azure_ai/gpt-6.2-solrowGET http://localhost:4000/utils/model_info?model=azure_ai/gpt-6.2-solreturns keygpt-6.2-soland provideropenaiGET http://localhost:4000/utils/model_info?model=azure_ai/MAI-Image-2.7returns 404not in the model cost mapAfter: the same lookups return the azure_ai rows
GET http://localhost:4000/utils/model_info?model=azure_ai/gpt-6.2-solreturns keyazure_ai/gpt-6.2-sol, providerazure_ai, successorazure_ai/gpt-6.1-sol, deprecation2027-11-17GET http://localhost:4000/utils/model_info?model=azure_ai/MAI-Image-2.7returns keyazure_ai/MAI-Image-2.7with image token ratesPre-Submission checklist
uv run pytest tests/unit/<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 moreScreenshots / Proof of Fix
The models are not deployable in my Foundry subscription, so there is no live generation call. The changed surface is the cost map lookup itself, exercised through a local proxy on port 4000.
Shared setup (server, proxy start, curl loop)
Before (f409bfd)
gpt-6.2 and gpt-image-2.5 resolve to the bare OpenAI rows
MAI-Image-2.7 and MAI-Code-2-Flash are not in the cost map
After (076701f)
gpt-6.2 and gpt-image-2.5 resolve to their azure_ai rows
MAI-Image-2.7 and MAI-Code-2-Flash resolve to their new rows
Prices for the gpt rows are unchanged between the legs because the azure twins carry the same rates Foundry bills today; the explicit rows keep the provider, key, and retirement metadata
MAI-Code-2-Flash billing correction (a5d765b)
The Global inference meters list $0.05 per million uncached input tokens, $0.005 per million cached input tokens and $0.25 per million output tokens. Both cost maps use the matching per-token rates. Azure retail meters
With one million input and one million output tokens, the billing regression on 076701f returned $50 input and $250 output, or $10 input when fully cached. At a5d765b it returns $0.05 input and $0.25 output, or $0.005 input when fully cached. A live
GET /utils/model_info?model=azure_ai/MAI-Code-2-Flashat this tip returned HTTP 200 withinput_cost_per_token=5e-08,cache_read_input_token_cost=5e-09andoutput_cost_per_token=2.5e-07. Both regression cases failed on the original rates. All 16 focused tests passed after the correction.python -m pytest tests/unit/test_model_prices_and_context_window.py -q -k 'mai_code_flash or azure_ai_mai_rows or azure_ai_rows_price'Type
Infrastructure
Caveats (if any)
Low
Note
Low Risk
Data-only cost-map and test updates; no runtime routing or auth changes, though incorrect rates would affect billing accuracy for these models.
Overview
Adds seven explicit
azure_ai/entries to bothmodel_prices_and_context_window.jsonand its backup so Foundry deployments resolve with the correct provider, pricing, and lifecycle metadata instead of falling through to bare OpenAI keys or 404.Chat / image twins:
gpt-6.2-astra,gpt-6.2-sol,gpt-image-2.5-flare, andgpt-image-2.5-sunburstmirror their existingazure/rate fields and add Foundry-specific details (e.g.successor_model,deprecation_date, capability flags).MAI models: New rows for
MAI-Image-2.7,MAI-Image-2.7-Flash, andMAI-Code-2-Flashwith image- or chat-mode token rates sourced from Azure retail meters.Tests: Unit coverage asserts
azure_aipricing matchesazuretwins for the GPT rows, MAI rows have positive mode-appropriate costs, andMAI-Code-2-Flashbills $0.05/$0.005 per million uncached/cached input and $0.25 per million output viacost_per_token.Reviewed by Cursor Bugbot for commit a5d765b. Bugbot is set up for automated code reviews on this repo. Configure here.