fix(models): drop retired xAI models and mark multi-agent responses-only - #38510
fix(models): drop retired xAI models and mark multi-agent responses-only#38510msdianprince-7 wants to merge 1 commit into
Conversation
xAI no longer serves the grok-2 family, grok-beta or grok-vision-beta. They are absent from https://docs.x.ai/docs/models and requests to them 404 rather than redirecting the way the May 15 retirements do, so the registry was advertising models nobody can call. No retirement date was ever published for them, and this repo reverts unverified deprecation dates, so they are removed rather than dated. xAI documents that the multi-agent models do not work with the OpenAI Chat Completions API, so grok-4.20-multi-agent-0309 and grok-4.20-multi-agent-beta-0309 are marked responses-only instead of chat. Fixes BerriAI#38179
Greptile SummaryThe PR removes eight retired xAI model entries from both model registries and marks two xAI multi-agent models as Responses-only. It adds regression coverage for removals, endpoint metadata, surviving chat models, and registry synchronization. Confidence Score: 4/5The PR appears safe to merge, with only non-blocking typing and comment-policy cleanup needed in the new tests. The xAI Responses path has a registered native adapter and both registries remain synchronized; the only accepted concern is imprecise test typing and unnecessary explanatory comments. Files Needing Attention: tests/test_litellm/llms/xai/test_xai_model_registry.py
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Removes retired xAI entries and correctly aligns both multi-agent entries with the native Responses endpoint. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the primary registry changes without xAI metadata drift. |
| tests/test_litellm/llms/xai/test_xai_model_registry.py | Adds meaningful registry regression coverage but violates repository typing and comment conventions. |
Reviews (1): Last reviewed commit: "fix(models): drop retired xAI models and..." | Re-trigger Greptile
|
|
||
|
|
||
| @pytest.fixture(scope="module", params=[p.name for p in MAP_PATHS]) | ||
| def cost_map(request: pytest.FixtureRequest) -> dict: |
There was a problem hiding this comment.
The new fixture and three tests use bare dict annotations, reducing static type checking, while the explanatory comments on the model tuples fall outside the repository's source-comment convention. Please use precise map types and remove the unnecessary comments.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Closing in favor of the rolling registry PR #38207, which now removes these retired xAI entries and carries the multi-agent Responses-only metadata and registry test |
TLDR
Problem this solves:
How it solves it:
User Flow
Before: a developer browsing the gateway's xAI models picks one that xAI stopped serving, and only finds out at request time
xai/grok-2,xai/grok-2-vision,xai/grok-betaandxai/grok-vision-betaoffered with full pricing and a 131k context windowxai/grok-2to their config and send POST https://litellm-domain/v1/chat/completionsxai/grok-4.20-multi-agent-0309, which the same page lists as a chat model, on POST https://litellm-domain/v1/chat/completionsAfter: the list only offers models xAI still serves, and the multi-agent models are pointed at the right endpoint
xai/grok-4.20-multi-agent-0309now shows as a/v1/responsesmodel rather than a chat modelxai/grok-4.3,xai/grok-4.6and every other live xAI model are listed and priced exactly as beforeRelevant issues
Fixes #38179
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Sources
Screenshots / Proof of Fix
This is a registry-metadata change, so the user-visible surface is what the proxy reports for a configured deployment. Live proxy on localhost:4000, config:
Each case reads
GET /model/infoand prints the resolvedmodel_infofor one deployment:Before (cd63c7e)
retired slugs are priced as live chat models
curl -s http://localhost:4000/model/info -H 'Authorization: Bearer sk-qa-38179'xai/grok-2: mode=chat input_cost_per_token=2e-06xai/grok-beta: mode=chat input_cost_per_token=5e-06multi-agent advertised for chat completions
curl -s http://localhost:4000/model/info -H 'Authorization: Bearer sk-qa-38179'xai/grok-4.20-multi-agent-0309: mode=chat supported_endpoints=Nonea live xAI model
curl -s http://localhost:4000/model/info -H 'Authorization: Bearer sk-qa-38179'xai/grok-4.3: mode=chat input_cost_per_token=1.25e-06After (7a65f3a)
retired slugs are priced as live chat models
curl -s http://localhost:4000/model/info -H 'Authorization: Bearer sk-qa-38179'xai/grok-2: mode=None input_cost_per_token=0xai/grok-beta: mode=None input_cost_per_token=0multi-agent advertised for chat completions
curl -s http://localhost:4000/model/info -H 'Authorization: Bearer sk-qa-38179'xai/grok-4.20-multi-agent-0309: mode=responses supported_endpoints=['/v1/responses']a live xAI model
curl -s http://localhost:4000/model/info -H 'Authorization: Bearer sk-qa-38179'xai/grok-4.3: mode=chat input_cost_per_token=1.25e-06, unchangedNo request is sent to xAI here, since I have no xAI key and the retired slugs would only return the 404 the issue already reports.
Type
🐛 Bug Fix
Caveats (if any)
Medium
Low
xai/grok-2-vision-1212did already carrydeprecation_date: 2026-02-28; if maintainers would rather mark the family than remove it, that is the date to applylitellm/constants.pystill lists Clarifai-hostedgrok-2slugs, deliberately left alone since Clarifai serves those independently of xAIFinal Attestation