fix(model_prices): refresh stale Mistral entries, add Z.ai GLM 5.2 / OCR 4.1, add xAI + Cohere deprecation dates - #37632
Conversation
…vider docs - add mistral/zai-glm-5-2 and mistral/mistral-ocr-4-1 - refresh mistral/codestral-latest, mistral/codestral-2508, mistral/mistral-small-latest - add provider-announced deprecation dates for xAI grok-code-fast/grok-3/grok-4 aliases, Cohere command + rerank v2.0 models Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Greptile SummaryUpdates the canonical and backup model registries with refreshed Mistral pricing, limits, and capabilities, adds two Mistral models, and records xAI and Cohere deprecation dates
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking need for focused regression coverage around the corrected registry values The metadata changes are consistent with existing consumers and mirrored across both registry files, but generic schema checks cannot detect future restoration of stale values Files Needing Attention: model_prices_and_context_window.json, litellm/model_prices_and_context_window_backup.json
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Canonical registry updates are internally consistent, but the corrected values lack focused regression assertions |
| litellm/model_prices_and_context_window_backup.json | Backup registry mirrors the canonical metadata changes without divergence |
Reviews (1): Last reviewed commit: "fix(model_prices): sync Mistral/Cohere/x..." | Re-trigger Greptile
| "supports_response_schema": true, | ||
| "supports_tool_choice": true | ||
| }, | ||
| "mistral/codestral-latest": { |
There was a problem hiding this comment.
Registry fixes lack regression coverage
The generic schema and mirror checks accept valid but stale metadata, so these corrected prices, limits, and capabilities can regress without CI detecting it. Add focused assertions for the corrected model entries
Context Used: CLAUDE.md (source)
Knowledge Base Used: Cost Tracking and Budget Enforcement
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! |
|
Superseded by #37658, which carries this PR's registry data (field-level, on top of current |
…ngeset Combines the model-cost-map data from BerriAI#35911, BerriAI#36017, BerriAI#36080, BerriAI#36113, BerriAI#36188, BerriAI#36444, BerriAI#37029, BerriAI#37252 and BerriAI#37632 onto current litellm_internal_staging, merged per entry field so older branches no longer revert fields the base has gained since they were opened. Drops the Gemini deprecation dates from BerriAI#36188 and the text-embedding-004 date from BerriAI#36080 that the official docs contradict. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
TLDR
Problem this solves:
*-latestaliases still priced as retired 2024/2025 model versionsHow it solves it:
codestral-latest,codestral-2508,mistral-small-latestfrom Mistral model cardsmistral/zai-glm-5-2andmistral/mistral-ocr-4-1deprecation_dateto retired xAI and Cohere modelsUser Flow
Before: a developer billing Mistral traffic through the proxy sees wrong cost and wrong context limits for
mistral/codestral-latest, and cannot call two current Mistral models at all.POST https://litellm-domain/v1/chat/completionswith"model": "mistral/codestral-latest"and a 60k-token prompthttps://litellm-domain/ui/?page=logsshows it billed at $1.00/$3.00 per 1M tokens instead of Mistral's current $0.30/$0.90POST https://litellm-domain/v1/chat/completionswith"model": "mistral/zai-glm-5-2"and get an unmapped-model error with $0 spend recordedGET https://litellm-domain/model/infoforxai/grok-code-fast-1and see no deprecation information, so nothing warns them that the slug is retired on 2026-05-15After: the same calls are priced and limited per Mistral's current model cards, the two new models resolve, and retired slugs carry their announced dates.
POST https://litellm-domain/v1/chat/completionswith"model": "mistral/codestral-latest"and the 60k-token prompthttps://litellm-domain/ui/?page=logsshows the request billed at $0.30/$0.90 per 1M tokensPOST https://litellm-domain/v1/chat/completionswith"model": "mistral/zai-glm-5-2"resolves and bills at $1.40 in / $0.14 cached in / $4.40 out per 1M tokens, andmistral/mistral-ocr-4-1bills at $4 per 1,000 pages ($5 annotated)GET https://litellm-domain/model/infoforxai/grok-code-fast-1returns"deprecation_date": "2026-05-15", so the retirement is visible before the slug starts redirecting togrok-4.3pricingRelevant issues
Supports #26900 (model deprecation metadata) by filling in
deprecation_datefor provider-announced retirements. No schema change: the existingdeprecation_datekey is used.Linear ticket
Changes and sources
Mistral — stale values
mistral/codestral-latestsupports_function_callingcodestral-2508, context 128k, $0.3 / $0.9 per 1M, Function Calling)mistral/codestral-2508mistral/mistral-small-latestsupports_visionsupports_reasoningmistral-small-2603, context 256k, $0.15 / $0.6 per 1M). The old values were Mistral Small 3.2 (mistral-small-2506), which the lifecycle table lists as deprecated 4/30/2026, retired 7/31/2026 (https://docs.mistral.ai/getting-started/models/models_overview/)mistral/mistral-small-latestnow mirrors the existingmistral/mistral-small-2603entry;mistral/codestral-latestmirrorsmistral/codestral-2508.Mistral — missing models
zai-glm-5-2, Context 1M, Max output 128k, $1.4 / $0.14 cached / $4.4 per 1M, features: Chat Completions, Function Calling, Structured Outputs, Predicted Outputs, Prefix, Batchingmistral-ocr-4-1, $4 / 1000 Pages, $5 / 1000 Annotated PagesxAI — deprecation dates
Source: https://docs.x.ai/developers/migration/may-15-retirement — "Effective May 15, 2026 at 12:00 PM PT, the following models will be retired from the xAI API: … grok-code-fast-1, grok-3, …". Existing entries for
grok-3,grok-4-0709and thegrok-4[-1]-fast-*slugs already carried2026-05-15; these were missing:The alias entries are included because xAI documents
<modelname>/<modelname>-latestas aliases of the retiring versions (https://docs.x.ai/docs/models, "Model Aliases"):grok-code-fast→grok-code-fast-1-0825,grok-3-latest→grok-3,grok-4/grok-4-latest→grok-4-0709.grok-imagine-image-pro, also on the retirement list, has no registry entry, so nothing to tag.Cohere — deprecation dates
Source: https://docs.cohere.com/docs/deprecations
command-r-03-2024(and the aliascommand-r),command-r-plus-04-2024(and the aliascommand-r-plus),command-light,command". Cohere has not announced a shutdown date for this batch, so the announced deprecation date is used.2025-04-30forrerank-english-v2.0andrerank-multilingual-v2.0.The Cohere embed v2.0 models already carry
2026-04-04, matching the current deprecations page.Checked, no change needed
deprecation_date(3.7 Sonnet 2026-02-19 … Opus 5 2027-07-24); pricing on https://docs.claude.com/en/docs/about-claude/pricing matches.grok-4.6long-context tiers.openai/gpt-oss-120b|20b(131,072 / 65,536, $0.15/$0.60 and $0.075/$0.30), Qwen 3.6, Whisper entries match.mistral-medium-25082026-08-31,mistral-small-2506/open-mistral-nemo-24072026-07-31,mistral-large-2411/pixtral-large-2411/mistral-ocr-2505*2026-05-31, etc.).command-a-plus-05-2026,command-a-reasoning-08-2025,command-a-vision-07-2025,command-a-translate-08-2025,rerank-v4.0-pro,rerank-v4.0-fastis not published on https://cohere.com/pricing (per-token rates are not in the page for these models), so these models were deliberately not added rather than guessed. Same reason for leaving thecommand-r/command-r-plusalias prices alone: the pricing FAQ lists legacycommand-r-03-2024at $0.50/$1.50 andcommand-r-plus-04-2024at $3.00/$15.00, which conflicts with LiteLLM's current alias-to-08-2024 pricing — flagging rather than changing, since it is a routing decision, not a doc fact.Pre-Submission checklist
Screenshots / Proof of Fix
Before (merge base
6d47468dae)Case 1: mistral/codestral-latest and mistral-small-latest are stale, new models missing
Case 2: retired xAI / Cohere slugs carry no deprecation date
After (
47ee5c17e9)Case 1: mistral/codestral-latest and mistral-small-latest are stale, new models missing
Case 2: retired xAI / Cohere slugs carry no deprecation date
Validation
python3 ci_cd/check_files_match.py→Passed! Files model_prices_and_context_window.json and litellm/model_prices_and_context_window_backup.json match.uv run python ci_cd/generate_model_prices_schema.py→ regeneratedmodel_prices_and_context_window.schema.jsonbyte-identical (no schema change; no new keys introduced)LITELLM_LOCAL_MODEL_COST_MAP=True uv run pytest tests/test_litellm/test_model_prices_schema.py tests/test_litellm/test_model_cost_aliases.py tests/test_litellm/test_mistral_medium_3_5_model_metadata.py tests/test_litellm/llms/mistral/ocr/test_mistral_ocr_cost.py→55 passedLink to Devin session: https://app.devin.ai/sessions/a039d64b388c4ac68effd474ab2255dd