fix(model_prices): annotate retired xAI grok-2-era models and mark grok-4.20-multi-agent Responses-only - #38526
Conversation
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
ci: promote staging to main
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
models.litellm.ai and released litellm versions read model_prices_and_context_window.json from main at runtime, so Kimi K3 is missing from the hosted catalog even though the entry is in review for litellm_internal_staging in BerriAI#37552. This copies that entry onto main so the catalog picks it up on its next fetch. Data only: the cost map and its backup copy, no code changes. Pricing matches Moonshot's published rates ($3/M input, $0.30/M cache read, $15/M output, 1,048,576-token context). The fireworks_ai and Azure Foundry kimi-k3 variants are separate work in BerriAI#37512 and BerriAI#37658; neither touches the native moonshot/kimi-k3 key.
…cost_map fix: add moonshot/kimi-k3 to the cost map on main
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
Greptile SummaryThis PR annotates retired xAI Grok model entries with deprecation dates and marks two Grok multi-agent models as Responses-only
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking request to place the regression coverage in the mapped tests and remove unused global mutation The model metadata updates are synchronized and match supported deprecation and Responses-mode behavior; the only accepted concern is test organization and unnecessary fixture state mutation Files Needing Attention: tests/test_litellm/test_xai_grok_model_metadata.py
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds valid ISO deprecation dates and changes two xAI multi-agent entries to the supported responses mode without an identified functional defect |
| litellm/model_prices_and_context_window_backup.json | Mirrors the primary model metadata changes and remains synchronized for all affected entries |
| tests/test_litellm/test_xai_grok_model_metadata.py | Adds useful metadata assertions, but creates a separate bug-fix test module and includes an unnecessary global model-cost fixture |
Reviews (1): Last reviewed commit: "fix(model_prices): annotate retired xAI ..." | Re-trigger Greptile
| @@ -0,0 +1,98 @@ | |||
| import json | |||
There was a problem hiding this comment.
This bug fix creates a separate test module whose autouse fixture replaces litellm.model_cost, although every assertion reads the JSON files directly. This bypasses the mapped-test convention and adds global-state and cache-isolation risk without contributing to the regression coverage
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! |
…ok-4.20-multi-agent Responses-only xAI retired the grok-2 generation effective 2026-02-28 and the retired slugs now hard-fail with "Model not found - retired by xAI"; grok-beta and grok-vision-beta were retired earlier without a published date and are annotated with the same batch date. - add deprecation_date to xai/grok-2, grok-2-1212, grok-2-latest, grok-2-vision, grok-2-vision-latest, grok-beta, grok-vision-beta so they surface via GET /v1/model/deprecations - set mode=responses on xai/grok-4.20-multi-agent-0309 and xai/grok-4.20-multi-agent-beta-0309: xAI documents that the multi-agent model does not work with the Chat Completions API - pricing metadata unchanged; main and backup cost maps kept in sync Fixes BerriAI#38179
f0d753b to
ca78d54
Compare
|
Folded into rolling PR #38693; the Feb 28 dates could not be verified on live xAI docs, other changes already landed. |
TLDR
Problem this solves:
xai/grok-4.20-multi-agent-*was listed as a chat model even though xAI documents that it does not work with the Chat Completions APIHow it solves it:
deprecation_dateso they surface viaGET /v1/model/deprecations; pricing metadata is kept for historical spend datamode: responses)User Flow
Before: a stale model entry causes unexplained production failures
xai/grok-2in their LiteLLM setupGET /v1/model/deprecationslists nothing about itAfter: retirement is visible before it breaks anything
GET /v1/model/deprecationslistsxai/grok-2(and the other grok-2-era slugs) with its deprecation datexai/grok-4.20-multi-agent-0309shows under Responses-API capabilities rather than chatRelevant issues
Fixes #38179
Pre-Submission checklist
uv run pytest tests/test_litellm/<your_test_file>.py -vCaveats
xai/grok-2-vision-1212annotationxai/grok-beta/xai/grok-vision-betawere retired earlier without a published date; they are confirmed hard-failing upstream (repro in [Bug]: xAI models can't use #38179) and are annotated with the same batch date — happy to adjust per maintainer preferenceoci/xai.grok-4.20-multi-agentetc.) are untouched: the Responses-only limitation is xAI-API-specificScreenshots / Proof of Fix