feat(azure_ai): add Grok 4.20 model metadata - #27059
Conversation
Greptile SummaryThis PR adds model metadata entries for Confidence Score: 5/5Safe to merge — pure metadata addition with no logic changes and full test coverage. All three files are clean: JSON entries are well-formed and in sync, pricing and capability flags are consistent with existing azure_ai grok entries, and the new tests are mock-only with no real network calls. No P0 or P1 findings. No files require special attention.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds two new azure_ai/grok-4-20 model entries with correct pricing ($2/6 per M tokens), context window (256k), capability flags including supports_response_schema, supports_vision, supports_reasoning (reasoning variant only), consistent with existing azure_ai grok sibling entries. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the same two grok-4-20 entries from the primary JSON; both files are in sync including the supports_response_schema: true field. |
| tests/test_litellm/llms/azure_ai/test_azure_ai_grok_420_metadata.py | New test file with three well-structured mock-only test functions covering model info, raw cost entry, and cost-per-token calculation; correctly uses the backup JSON via LITELLM_LOCAL_MODEL_COST_MAP with no real network calls, complying with the mock-only test rule. |
Reviews (2): Last reviewed commit: "Add response schema support for Azure AI..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Adds Azure AI Foundry metadata and pricing for the new Grok 4.20 model variants, and validates the metadata + cost calculation behavior via targeted tests.
Changes:
- Added pricing/context window entries for
azure_ai/grok-4-20-reasoningandazure_ai/grok-4-20-non-reasoning(including multimodal + capability flags). - Updated the packaged backup cost map to include the same Grok 4.20 entries.
- Introduced focused pytest coverage for
get_model_info()metadata and Azure AIcost_per_token()calculations for Grok 4.20.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/test_litellm/llms/azure_ai/test_azure_ai_grok_420_metadata.py |
New tests asserting Grok 4.20 Azure AI model metadata and verifying cost calculations against the added pricing. |
model_prices_and_context_window.json |
Adds Grok 4.20 Azure AI entries to the main (repo) model cost map. |
litellm/model_prices_and_context_window_backup.json |
Adds Grok 4.20 Azure AI entries to the bundled local backup cost map used for local/forced pricing lookups and tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- BerriAI/litellm#27059 (Grok 4.20 azure_ai metadata) merge-after-nits - QwenLM/qwen-code#3743 (path-vs-slash-command classifier) merge-after-nits - QwenLM/qwen-code#3767 (capture actual wire request in OpenAI logger) merge-after-nits - google-gemini/gemini-cli#26306 (bound retry fallback to prevent infinite loop) merge-after-nits - google-gemini/gemini-cli#26305 (/mcp remove slash command) merge-after-nits
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Summary
azure_ai/grok-4-20-reasoningandazure_ai/grok-4-20-non-reasoningPricing / sources
grok-4-20-reasoningandgrok-4-20-non-reasoningTesting
conda run -n litellm pytest tests/test_litellm/llms/azure_ai/test_azure_ai_cost_calculator.py tests/test_litellm/llms/azure_ai/test_azure_ai_grok_420_metadata.py -q