Skip to content

feat(azure_ai): add Grok 4.20 model metadata - #27059

Closed
emerzon wants to merge 2 commits into
BerriAI:mainfrom
emerzon:egomes/azure-grok-4-20
Closed

feat(azure_ai): add Grok 4.20 model metadata#27059
emerzon wants to merge 2 commits into
BerriAI:mainfrom
emerzon:egomes/azure-grok-4-20

Conversation

@emerzon

@emerzon emerzon commented May 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add Azure AI Foundry pricing metadata for azure_ai/grok-4-20-reasoning and azure_ai/grok-4-20-non-reasoning
  • include Grok 4.20 Azure capability metadata for multimodal input, vision, tool calling, and the reasoning split
  • add focused Azure AI tests for model info and cost calculation

Pricing / sources

Testing

  • 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

Copilot AI review requested due to automatic review settings May 2, 2026 19:29
@codspeed-hq

codspeed-hq Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing emerzon:egomes/azure-grok-4-20 (8b48cb0) with main (934ecdc)

Open in CodSpeed

@greptile-apps

greptile-apps Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds model metadata entries for azure_ai/grok-4-20-reasoning and azure_ai/grok-4-20-non-reasoning to both JSON price files, along with a focused mock-only test suite. The entries are well-formed, pricing ($2/$6 per M tokens) matches the referenced Azure announcement, capability flags are consistent with existing azure_ai grok siblings, and the previously flagged supports_response_schema omission has been addressed in the latest commit.

Confidence Score: 5/5

Safe 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.

Important Files Changed

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

codecov Bot commented May 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread model_prices_and_context_window.json
Comment thread litellm/model_prices_and_context_window_backup.json

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-reasoning and azure_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 AI cost_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.

Bojun-Vvibe added a commit to Bojun-Vvibe/oss-contributions that referenced this pull request May 2, 2026
- 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
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the stale label Aug 1, 2026
@github-actions github-actions Bot closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants