Skip to content

Add support for grok-4.20-0309-reasoning model#25930

Merged
ishaan-berri merged 1 commit intolitellm_internal_stagingfrom
litellm_xai_grok-4.20-0309-reasoning
Apr 17, 2026
Merged

Add support for grok-4.20-0309-reasoning model#25930
ishaan-berri merged 1 commit intolitellm_internal_stagingfrom
litellm_xai_grok-4.20-0309-reasoning

Conversation

@Sameerlite
Copy link
Copy Markdown
Collaborator

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Screenshots / Proof of Fix

Type

🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test

Changes

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Apr 17, 2026 3:21am

Request Review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 17, 2026

Greptile Summary

This PR adds the stable xai/grok-4.20-0309-reasoning model entry to both JSON price files. The pricing values ($2.00/$0.20/$6.00 per M tokens) and the 2 M-token context window match the official xAI documentation. The structure is consistent with the existing xai/grok-4.20-beta-0309-reasoning entry.

  • No tests were added. CLAUDE.md explicitly states "Adding at least 1 test is a hard requirement" — even a simple assertion that the model key exists in litellm.model_cost would satisfy this requirement.

Confidence Score: 4/5

Safe to merge after adding the required test — pricing values and capabilities are accurate per official xAI docs.

One P1 finding remains: no test was added despite CLAUDE.md stating it is a hard requirement. The metadata itself is correct (pricing matches xAI docs, context window is accurate, capabilities are consistent with the beta predecessor).

No files have defects; the gap is a missing test file in tests/test_litellm/.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds xai/grok-4.20-0309-reasoning with correct pricing and context window values; no tests added.
litellm/model_prices_and_context_window_backup.json Mirror of the root JSON file; identical entry added, consistent with existing backup sync pattern.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["User calls litellm with xai/grok-4.20-0309-reasoning"] --> B["litellm.get_model_info()"]
    B --> C["Loads model_prices_and_context_window.json"]
    C --> D{"Model key found?"}
    D -- Yes --> E["Returns model metadata\n input cost, output cost,\n context window, capabilities"]
    D -- No --> F["KeyError / unknown model"]
    E --> G["Cost tracking and routing\nuse returned metadata"]
Loading

Reviews (1): Last reviewed commit: "Add support for grok-4.20-0309-reasoning..." | Re-trigger Greptile

Comment thread model_prices_and_context_window.json
Comment thread model_prices_and_context_window.json
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ishaan-berri ishaan-berri merged commit bd5f560 into litellm_internal_staging Apr 17, 2026
98 of 101 checks passed
@ishaan-berri ishaan-berri deleted the litellm_xai_grok-4.20-0309-reasoning branch April 17, 2026 19:30
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