fix(azure_ai): advertise 1M context window for Claude Opus 4.6+ on Foundry - #34556
Conversation
…undry Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Greptile SummaryUpdates Azure AI metadata to advertise a 1M-token input context for Claude Opus 4.6, 4.7, and 4.8.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains, and the previous root-map coverage gap is fully addressed by independently testing both shipped maps.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Raises the three Azure AI Opus context-window values from 200k to 1M in the root runtime map. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the same context-window updates in the independently loaded bundled fallback map. |
| tests/test_litellm/litellm_core_utils/test_get_model_cost_map.py | Checks the complete Foundry Claude context-window matrix independently against both the root and bundled maps. |
| tests/test_litellm/test_claude_opus_4_6_config.py | Updates the Opus 4.6 Azure AI capability expectation to the corrected 1M-token limit. |
| tests/test_litellm/test_claude_opus_4_8_config.py | Updates the Opus 4.8 Azure AI capability expectation and removes the obsolete 200k-cap claim. |
Reviews (2): Last reviewed commit: "test(cost_map): cover root map in the Fo..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
@greptile review again |
mateo-berri
left a comment
There was a problem hiding this comment.
Tested a >200k query and it works. LGTM
TLDR
Problem this solves:
How it solves it:
max_input_tokensto 1000000 for thoseazure_aientriesRelevant issues
Linear ticket
Resolves LIT-4406
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@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
Anthropic's docs state that Opus 4.6, Opus 4.7, Opus 4.8, Sonnet 5 and Sonnet 4.6 all serve a 1M-token context window on the Claude API, Amazon Bedrock, Google Cloud and Microsoft Foundry, with 1M as the default and no beta header needed, so the
azure_aientries were the outliers; Sonnet 5 and Sonnet 4.6 were already correct on our sideProxy config used for both runs (three Foundry Opus deployments;
/model/infois metadata-only, so no provider call is made):Before, at
593b12dc56~1:After, at
593b12dc56:Live proof that Foundry actually serves >200k, captured at head
e6b5511dcfThe runs above only prove the metadata change, so this run pays real money to answer the question that matters: do live Foundry deployments accept prompts past the old 200k advertisement with no
anthropic-betaheader? Proxy at this PR's head, config pointing at two real Foundry resources with noextra_headersanywhere:Each request puts a needle in the first line, pads the prompt well past 200k tokens with filler, and asks for the needle back:
All three deployments, spanning two independent Foundry resources, accept 230k to 413k input tokens with no beta header, retrieve the needle placed at position zero, and finish with
stop. The tracked cost matches the flat rate exactly (for Opus 4.6, 230445 input tokens at $5/M plus 11 output tokens at $25/M comes to $1.1525), so there is no hidden long-context pricing tier to model. One earlier attempt that padded with a single sentence repeated thousands of times tripped the provider content filter onclaude-opus-4-8(finish_reason: content_filter); even that request was accepted and metered at 499,254 input tokens, so no context-window rejection occurred at any size sentType
🐛 Bug Fix
Changes
azure_ai/claude-opus-4-6,azure_ai/claude-opus-4-7andazure_ai/claude-opus-4-8move frommax_input_tokens: 200000to1000000in both the root cost map and the bundled backup. Two existing tests deliberately pinned the 200k value (one with a comment claiming Foundry caps Opus 4.8 at 200k), so those assertions are corrected, andtests/test_litellm/litellm_core_utils/test_get_model_cost_map.pygains a test that pins the full Foundry Claude split: 1M for Opus 4.6+/Opus 5/Sonnet 5/Sonnet 4.6, still 200k for Opus 4.1, Opus 4.5, Sonnet 4.5 and Haiku 4.5Final Attestation
Link to Devin session: https://app.devin.ai/sessions/8ff9f37120754d5299837b9815ed3d5e
Requested by: @shivamrawat1