Skip to content

feat(xai): cherry-pick grok-4.3 model entries onto main (#27154) - #27396

Merged
mateo-berri merged 1 commit into
mainfrom
litellm_hotfix_cherry-pick-grok-4.3-d843
May 7, 2026
Merged

feat(xai): cherry-pick grok-4.3 model entries onto main (#27154)#27396
mateo-berri merged 1 commit into
mainfrom
litellm_hotfix_cherry-pick-grok-4.3-d843

Conversation

@mateo-berri

Copy link
Copy Markdown
Contributor

Relevant issues

Cherry-picks #27154 from litellm_internal_staging onto main so that xai/grok-4.3 and xai/grok-4.3-latest show up in /v1/models for users running off main.

Linear ticket

Resolves LIT-2914

Pre-Submission checklist

  • I have Added testing in the tests/test_litellm/ directory — tests/test_litellm/test_xai_grok_4_3_model_metadata.py (3 tests: pricing/capabilities for xai/grok-4.3 and xai/grok-4.3-latest, plus parity between the canonical and bundled-backup cost maps).
  • My PR passes all unit tests on make test-unit (the new test file passes locally — see proof of fix below).
  • My PR's scope is as isolated as possible — it only adds the two grok-4.3 model entries and the matching test.
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Screenshots / Proof of Fix

$ uv run pytest tests/test_litellm/test_xai_grok_4_3_model_metadata.py -v
============================= test session starts ==============================
collected 3 items

tests/test_litellm/test_xai_grok_4_3_model_metadata.py::test_xai_grok_4_3_backup_matches_main PASSED [ 33%]
tests/test_litellm/test_xai_grok_4_3_model_metadata.py::test_xai_grok_4_3_model_info[xai/grok-4.3-latest] PASSED [ 66%]
tests/test_litellm/test_xai_grok_4_3_model_metadata.py::test_xai_grok_4_3_model_info[xai/grok-4.3] PASSED [100%]

============================== 3 passed in 0.14s ===============================

Type

🆕 New Feature

Changes

Straight cherry-pick of fee5900 (PR #27154) — no conflicts, no edits. Adds xai/grok-4.3 and xai/grok-4.3-latest to both the canonical model_prices_and_context_window.json and the bundled litellm/model_prices_and_context_window_backup.json, and includes the metadata/parity test.

Pricing/specs sourced from xAI's published model metadata (https://docs.x.ai/docs/models):

  • input: $1.25 / 1M tokens (≤200k), $2.50 / 1M tokens (>200k)
  • output: $2.50 / 1M tokens (≤200k), $5.00 / 1M tokens (>200k)
  • cached input: $0.20 / 1M tokens (≤200k), $0.40 / 1M tokens (>200k)
  • context window: 1,000,000 tokens
  • capabilities: vision, reasoning, function calling, structured outputs, prompt caching, web search

Slack Thread

Open in Web Open in Cursor 

#27154)

* feat(xai): add grok-4.3 and grok-4.3-latest to model_prices_and_context_window.json

xAI's docs page now lists grok-4.3 as the recommended chat / coding model:
"We strongly recommend all API callers use grok-4.3. It is the most
intelligent and fastest model we've built." (https://docs.x.ai/docs/models)

Pricing/specs sourced from xAI's published model metadata:
  - input:  $1.25 / 1M tokens (<=200k),  $2.50 / 1M tokens (>200k)
  - output: $2.50 / 1M tokens (<=200k),  $5.00 / 1M tokens (>200k)
  - cached: $0.20 / 1M tokens (<=200k),  $0.40 / 1M tokens (>200k)
  - context: 1,000,000 tokens
  - capabilities: vision, reasoning, function calling, structured outputs,
    prompt caching, web search

Adds two entries: `xai/grok-4.3` (canonical) and `xai/grok-4.3-latest` (alias),
mirroring the pattern used for the rest of the xAI/Grok-4 family.

* test(xai): add model_info test for grok-4.3 + sync backup cost map

- Mirror xai/grok-4.3 and xai/grok-4.3-latest entries into
  litellm/model_prices_and_context_window_backup.json so the bundled
  model cost map matches the canonical model_prices_and_context_window.json.
- Add tests/test_litellm/test_xai_grok_4_3_model_metadata.py covering
  pricing tiers, capability flags, context window, provider routing,
  and parity between the main and backup cost maps.
- Point 'source' at the live xAI models page (the per-model URL
  https://docs.x.ai/docs/models/grok-4.3 currently 404s).

Co-authored-by: Mateo Wang <mateo-berri@users.noreply.github.com>

---------

Co-authored-by: shin-watcher <shin-watcher@berri.ai>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Mateo Wang <mateo-berri@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codspeed-hq

codspeed-hq Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing litellm_hotfix_cherry-pick-grok-4.3-d843 (4b587dc) with main (6ff668c)

Open in CodSpeed

@mateo-berri
mateo-berri marked this pull request as ready for review May 7, 2026 16:28
@greptile-apps

greptile-apps Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Cherry-picks the xai/grok-4.3 and xai/grok-4.3-latest model entries from the internal staging branch onto main, adding them to both the canonical and bundled cost-map JSON files so they appear in /v1/models.

  • Pricing and capabilities match xAI's published documentation: $1.25/$2.50 per 1M tokens (≤200k), tiered higher-context pricing above 200k, 1M-token context window, vision, reasoning, function calling, prompt caching, and web search.
  • Both JSON files (model_prices_and_context_window.json and the bundled backup) are updated identically and verified by the new parity test.
  • New test file (test_xai_grok_4_3_model_metadata.py) validates pricing fields, capability flags, and provider routing using only local file reads — no network calls.

Confidence Score: 4/5

Safe to merge — the change is purely additive (two new JSON entries and a new test file), with no modifications to existing entries or logic.

The added entries are accurate against xAI's published docs and the two JSON files are kept in sync. The one gap is that xAI lists a third alias (grok-latest) for this model that is absent from both cost maps, which would cause a model-not-found error for callers using that alias.

Both model_prices_and_context_window.json and its backup are missing the xai/grok-latest alias entry documented by xAI.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds xai/grok-4.3 and xai/grok-4.3-latest entries with correct pricing and capabilities; missing the third published alias grok-latest
litellm/model_prices_and_context_window_backup.json Backup file kept in sync with canonical file; same two entries added, same missing grok-latest alias
tests/test_litellm/test_xai_grok_4_3_model_metadata.py New test file that reads JSON files locally and calls get_llm_provider; no network calls, CI-safe

Reviews (1): Last reviewed commit: "feat(xai): add grok-4.3 and grok-4.3-lat..." | Re-trigger Greptile

@@ -34932,6 +34932,48 @@
"supports_vision": 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 Missing grok-latest alias entry

xAI's published model page lists three aliases for this model: grok-4.3-latest, and grok-latest (alongside the canonical grok-4.3). This PR adds the first two but omits xai/grok-latest. Users who call xai/grok-latest (mirroring the provider alias) will get a model-not-found error. Consider adding the third alias entry with identical pricing/capabilities, or document the decision to skip it.

@mateo-berri
mateo-berri merged commit 8c9830e into main May 7, 2026
174 of 200 checks passed
@mateo-berri
mateo-berri deleted the litellm_hotfix_cherry-pick-grok-4.3-d843 branch May 7, 2026 16:39
usagi-epta pushed a commit to usagi-epta/litellm that referenced this pull request May 8, 2026
…aging

Restore lineage between main and internal staging so the next
staging->main promotion (BerriAI#27436) can merge without conflicts.

main was 2 commits ahead:
  - 6ff668c  squash-merge of the previous staging->main promotion (BerriAI#27245)
  - 8c9830e  feat(xai): add grok-4.3 (BerriAI#27396), already present on staging

The squash-merge has no shared lineage with the individual commits that
went into staging, which is why git surfaced 13 textual conflicts despite
both sides having the same logical content. Every conflicting file's
main-side change came from 6ff668c only, and the matching staging-side
changes are the post-promotion evolution. Resolved all 13 with --ours
(staging's version is the latest evolution; main's snapshot is stale).

The grok-4.3 entries auto-merged in model_prices_and_context_window.json
and its backup, but were already on staging via an independent commit, so
the net diff vs HEAD is empty for those files.

Net new content from this merge: 12 lines added to
ui/litellm-dashboard/package-lock.json -- npm 11 libc array tags on four
existing entries, no functional impact.
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
BerriAI#27154) (BerriAI#27396)

* feat(xai): add grok-4.3 and grok-4.3-latest to model_prices_and_context_window.json

xAI's docs page now lists grok-4.3 as the recommended chat / coding model:
"We strongly recommend all API callers use grok-4.3. It is the most
intelligent and fastest model we've built." (https://docs.x.ai/docs/models)

Pricing/specs sourced from xAI's published model metadata:
  - input:  $1.25 / 1M tokens (<=200k),  $2.50 / 1M tokens (>200k)
  - output: $2.50 / 1M tokens (<=200k),  $5.00 / 1M tokens (>200k)
  - cached: $0.20 / 1M tokens (<=200k),  $0.40 / 1M tokens (>200k)
  - context: 1,000,000 tokens
  - capabilities: vision, reasoning, function calling, structured outputs,
    prompt caching, web search

Adds two entries: `xai/grok-4.3` (canonical) and `xai/grok-4.3-latest` (alias),
mirroring the pattern used for the rest of the xAI/Grok-4 family.

* test(xai): add model_info test for grok-4.3 + sync backup cost map

- Mirror xai/grok-4.3 and xai/grok-4.3-latest entries into
  litellm/model_prices_and_context_window_backup.json so the bundled
  model cost map matches the canonical model_prices_and_context_window.json.
- Add tests/test_litellm/test_xai_grok_4_3_model_metadata.py covering
  pricing tiers, capability flags, context window, provider routing,
  and parity between the main and backup cost maps.
- Point 'source' at the live xAI models page (the per-model URL
  https://docs.x.ai/docs/models/grok-4.3 currently 404s).



---------

Co-authored-by: ishaan-berri <155045088+ishaan-berri@users.noreply.github.com>
Co-authored-by: shin-watcher <shin-watcher@berri.ai>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Mateo Wang <mateo-berri@users.noreply.github.com>
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…aging

Restore lineage between main and internal staging so the next
staging->main promotion (BerriAI#27436) can merge without conflicts.

main was 2 commits ahead:
  - 6ff668c  squash-merge of the previous staging->main promotion (BerriAI#27245)
  - 8c9830e  feat(xai): add grok-4.3 (BerriAI#27396), already present on staging

The squash-merge has no shared lineage with the individual commits that
went into staging, which is why git surfaced 13 textual conflicts despite
both sides having the same logical content. Every conflicting file's
main-side change came from 6ff668c only, and the matching staging-side
changes are the post-promotion evolution. Resolved all 13 with --ours
(staging's version is the latest evolution; main's snapshot is stale).

The grok-4.3 entries auto-merged in model_prices_and_context_window.json
and its backup, but were already on staging via an independent commit, so
the net diff vs HEAD is empty for those files.

Net new content from this merge: 12 lines added to
ui/litellm-dashboard/package-lock.json -- npm 11 libc array tags on four
existing entries, no functional impact.
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.

5 participants