Skip to content

add azure ai grok 4 20 models#25582

Open
emerzon wants to merge 2 commits intoBerriAI:mainfrom
emerzon:add-azure-ai-grok-4-20-models
Open

add azure ai grok 4 20 models#25582
emerzon wants to merge 2 commits intoBerriAI:mainfrom
emerzon:add-azure-ai-grok-4-20-models

Conversation

@emerzon
Copy link
Copy Markdown
Contributor

@emerzon emerzon commented Apr 12, 2026

Add support for Grok 4.20 models in Azure AI Foundry

Copilot AI review requested due to automatic review settings April 12, 2026 01:11
@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq bot commented Apr 12, 2026

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing emerzon:add-azure-ai-grok-4-20-models (2565f8e) with main (f74d626)

Open in CodSpeed

@emerzon emerzon closed this Apr 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 pricing/capability metadata entries for the Grok 4.20 model variants so LiteLLM can resolve context limits, pricing, and feature flags for these model IDs.

Changes:

  • Add azure_ai/grok-4-20-reasoning model entry (pricing, 256K context, reasoning/tooling flags, source link).
  • Add azure_ai/grok-4-20-non-reasoning model entry (pricing, 256K context, tooling flags, source link).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 12, 2026

Greptile Summary

This PR adds two new Azure AI Foundry model entries — azure_ai/grok-4-20-reasoning and azure_ai/grok-4-20-non-reasoning — to both the main and backup pricing/context-window JSON files, with 256K context windows and pricing matching the native xai variants ($2/$6 per M tokens). The backup file diff also includes unrelated OpenAI priority-tier pricing adjustments (gpt-5, gpt-5.4-pro, gpt-5.4-mini), which appear to be a file-sync rather than intentional new changes.

Two concerns raised in prior review rounds remain unaddressed: the supports_vision: true flag (present on these entries but absent from all other azure_ai/grok-* models) and the catalog-page source URLs rather than the official pricing page used by sibling entries.

Confidence Score: 4/5

Safe to merge if the author can confirm vision support and response-schema support on Azure AI Foundry for these specific model deployments.

Two P2 findings from prior review rounds — unverified supports_vision: true and catalog-page source URLs — remain open without author confirmation; the supports_response_schema concern is newly identified. All three are data-accuracy issues rather than runtime crashes, but incorrect capability flags can mislead callers into sending image content or expecting structured output on backends that won't honour them.

model_prices_and_context_window.json — capability flags (supports_vision, supports_response_schema) on the two new grok-4-20 entries need confirmation against the actual Azure AI Foundry deployment.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds azure_ai/grok-4-20-reasoning and azure_ai/grok-4-20-non-reasoning entries with 256K context windows, matching xai native pricing ($2/$6 per M tokens) but with supports_vision: true and catalog-page sources — both flags raised in prior review remain unaddressed.
litellm/model_prices_and_context_window_backup.json Contains the same two new grok-4-20 entries plus additional out-of-scope changes: removes priority-tier cost fields from gpt-5/gpt-5.4-pro/gpt-5.4-pro-2026-03-05 and adds priority-tier fields to gpt-5.4-mini — these appear to be file-sync changes bringing the backup in line with the main file.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    xai["xai/grok-4.20-beta-0309-*\n(2M ctx, $2/$6 per M tokens\nsupports_vision: true\nNO supports_response_schema)"]
    azure4["azure_ai/grok-4\n(131K ctx, $3/$15 per M tokens\nno vision)"]
    azure41["azure_ai/grok-4-1-fast-*\n(131K ctx, $0.2/$0.5 per M tokens\nno vision)"]
    azure420r["azure_ai/grok-4-20-reasoning\n(256K ctx, $2/$6 per M tokens\nsupports_vision: true ⚠️\nsupports_reasoning: true\nsupports_response_schema: true)"]
    azure420nr["azure_ai/grok-4-20-non-reasoning\n(256K ctx, $2/$6 per M tokens\nsupports_vision: true ⚠️\nsupports_response_schema: true)"]

    xai -->|"Azure AI Foundry route"| azure420r
    xai -->|"Azure AI Foundry route"| azure420nr
    azure4 --- azure41
    azure41 --- azure420r
    azure420r --- azure420nr
Loading

Reviews (2): Last reviewed commit: "update backup model db" | Re-trigger Greptile

"max_input_tokens": 262144,
"max_output_tokens": 262144,
"max_tokens": 262144,
"mode": "chat",
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.

P2 Source URL uses catalog page, not pricing documentation

The source for both new entries points to https://ai.azure.com/catalog/models/grok-4-20-*, while every other azure_ai/grok-* entry references an official pricing or blog page (e.g. https://azure.microsoft.com/en-us/pricing/details/ai-foundry-models/grok/). Catalog pages may change structure or become unavailable for models not yet publicly GA, making them a less stable authoritative source for pricing data. Consider linking to the Azure AI Foundry pricing page instead, consistent with azure_ai/grok-4 and azure_ai/grok-4-1-fast-*.

"source": "https://ai.azure.com/catalog/models/grok-4-20-reasoning",
"supports_function_calling": true,
"supports_reasoning": true,
"supports_response_schema": true,
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.

P2 First azure_ai grok entry to claim supports_vision: true

Every existing azure_ai/grok-* model (grok-3, grok-4, grok-4-1-fast, etc.) omits supports_vision or leaves it unset, while the native xai/grok-4.20-* entries set it to true. If Azure AI Foundry actually routes these models through an image-capable endpoint, the flag is correct. If not — for example, if the Foundry deployment strips vision inputs — liteLLM will silently forward image content to a backend that will reject it, confusing callers. Please confirm that grok-4-20-reasoning in Azure AI Foundry accepts multimodal inputs before merging.

@emerzon emerzon reopened this Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants