Skip to content

fix(model_prices): refresh stale Mistral entries, add Z.ai GLM 5.2 / OCR 4.1, add xAI + Cohere deprecation dates - #37632

Closed
devin-ai-integration[bot] wants to merge 1 commit into
litellm_internal_stagingfrom
litellm_model_registry_audit_20260820
Closed

fix(model_prices): refresh stale Mistral entries, add Z.ai GLM 5.2 / OCR 4.1, add xAI + Cohere deprecation dates#37632
devin-ai-integration[bot] wants to merge 1 commit into
litellm_internal_stagingfrom
litellm_model_registry_audit_20260820

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Mistral *-latest aliases still priced as retired 2024/2025 model versions
  • Current Mistral models (Z.ai GLM 5.2, OCR 4.1) missing from the registry
  • Provider-announced deprecations missing for xAI and Cohere models

How it solves it:

  • Refresh codestral-latest, codestral-2508, mistral-small-latest from Mistral model cards
  • Add mistral/zai-glm-5-2 and mistral/mistral-ocr-4-1
  • Add deprecation_date to retired xAI and Cohere models

User 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.

  1. They send POST https://litellm-domain/v1/chat/completions with "model": "mistral/codestral-latest" and a 60k-token prompt
  2. The request is rejected client-side as over the limit, because the gateway believes the model tops out at 32,000 input / 8,191 output tokens (the retired Codestral 24.05 shape)
  3. When a shorter request does go through, https://litellm-domain/ui/?page=logs shows it billed at $1.00/$3.00 per 1M tokens instead of Mistral's current $0.30/$0.90
  4. They send POST https://litellm-domain/v1/chat/completions with "model": "mistral/zai-glm-5-2" and get an unmapped-model error with $0 spend recorded
  5. They call GET https://litellm-domain/model/info for xai/grok-code-fast-1 and see no deprecation information, so nothing warns them that the slug is retired on 2026-05-15

After: 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.

  1. They send the same POST https://litellm-domain/v1/chat/completions with "model": "mistral/codestral-latest" and the 60k-token prompt
  2. It is accepted — the gateway now uses Codestral 25.08's 128k context
  3. https://litellm-domain/ui/?page=logs shows the request billed at $0.30/$0.90 per 1M tokens
  4. POST https://litellm-domain/v1/chat/completions with "model": "mistral/zai-glm-5-2" resolves and bills at $1.40 in / $0.14 cached in / $4.40 out per 1M tokens, and mistral/mistral-ocr-4-1 bills at $4 per 1,000 pages ($5 annotated)
  5. GET https://litellm-domain/model/info for xai/grok-code-fast-1 returns "deprecation_date": "2026-05-15", so the retirement is visible before the slug starts redirecting to grok-4.3 pricing

Relevant issues

Supports #26900 (model deprecation metadata) by filling in deprecation_date for provider-announced retirements. No schema change: the existing deprecation_date key is used.

Linear ticket

Changes and sources

Mistral — stale values

Key Before After Source
mistral/codestral-latest 32,000 / 8,191 tokens, $1.00 / $3.00 per 1M 128,000 tokens, $0.30 / $0.90 per 1M, supports_function_calling https://docs.mistral.ai/models/model-cards/codestral-25-08 (Codestral 25.08, codestral-2508, context 128k, $0.3 / $0.9 per 1M, Function Calling)
mistral/codestral-2508 256,000 tokens 128,000 tokens same model card (context 128k; the previously cited blog post does not state 256k)
mistral/mistral-small-latest 131,072 tokens, $0.06 / $0.18 per 1M, supports_vision 262,144 tokens, $0.15 / $0.60 per 1M, supports_reasoning https://docs.mistral.ai/models/model-cards/mistral-small-4-0-26-03 (Mistral Small 4, mistral-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-latest now mirrors the existing mistral/mistral-small-2603 entry; mistral/codestral-latest mirrors mistral/codestral-2508.

Mistral — missing models

+ "mistral/zai-glm-5-2":      1M in / 128k out, $1.4 in, $0.14 cached in, $4.4 out per 1M,
+                             function calling, structured outputs, prefix, prompt caching
+ "mistral/mistral-ocr-4-1":  ocr_cost_per_page 0.004, annotation_cost_per_page 0.005

xAI — 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-0709 and the grok-4[-1]-fast-* slugs already carried 2026-05-15; these were missing:

+ "xai/grok-code-fast":        "deprecation_date": "2026-05-15"
+ "xai/grok-code-fast-1":      "deprecation_date": "2026-05-15"
+ "xai/grok-code-fast-1-0825": "deprecation_date": "2026-05-15"
+ "xai/grok-3-latest":         "deprecation_date": "2026-05-15"
+ "xai/grok-4":                "deprecation_date": "2026-05-15"
+ "xai/grok-4-latest":         "deprecation_date": "2026-05-15"

The alias entries are included because xAI documents <modelname> / <modelname>-latest as aliases of the retiring versions (https://docs.x.ai/docs/models, "Model Aliases"): grok-code-fastgrok-code-fast-1-0825, grok-3-latestgrok-3, grok-4 / grok-4-latestgrok-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":                   "deprecation_date": "2025-09-15"
+ "command-light":             "deprecation_date": "2025-09-15"
+ "command-r":                 "deprecation_date": "2025-09-15"
+ "command-r-plus":            "deprecation_date": "2025-09-15"
+ "rerank-english-v2.0":       "deprecation_date": "2025-04-30"
+ "rerank-multilingual-v2.0":  "deprecation_date": "2025-04-30"
  • "Effective September 15, 2025 … Deprecated Models: command-r-03-2024 (and the alias command-r), command-r-plus-04-2024 (and the alias command-r-plus), command-light, command". Cohere has not announced a shutdown date for this batch, so the announced deprecation date is used.
  • Rerank v2.0 table on the same page: shutdown date 2025-04-30 for rerank-english-v2.0 and rerank-multilingual-v2.0.

The Cohere embed v2.0 models already carry 2026-04-04, matching the current deprecations page.

Checked, no change needed

  • Anthropic: every model on https://docs.claude.com/en/docs/about-claude/model-deprecations already has a matching 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.
  • xAI pricing/limits (https://docs.x.ai/docs/models, https://docs.x.ai/docs/pricing), including grok-4.6 long-context tiers.
  • DeepSeek (https://api-docs.deepseek.com/quick_start/pricing): V4 / V4 Pro / Flash pricing and 1M-context / 393,216-output limits already correct.
  • Groq (https://console.groq.com/docs/models): 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 lifecycle table: all retired versions present in the registry already carry the retirement date (mistral-medium-2508 2026-08-31, mistral-small-2506/open-mistral-nemo-2407 2026-07-31, mistral-large-2411/pixtral-large-2411/mistral-ocr-2505* 2026-05-31, etc.).
  • Cohere pricing for 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-fast is 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 the command-r / command-r-plus alias prices alone: the pricing FAQ lists legacy command-r-03-2024 at $0.50/$1.50 and command-r-plus-04-2024 at $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

  • I have added meaningful tests — data-only change; covered by the existing registry schema/consistency tests below
  • The handful of test files covering my change pass locally
  • My PR passes all required CI/CD checks
  • My PR's scope is as isolated as possible
  • I have received a Greptile Confidence Score of at least 4/5

Screenshots / Proof of Fix

Before (merge base 6d47468dae)

Case 1: mistral/codestral-latest and mistral-small-latest are stale, new models missing

  1. Command:
python3 -c "import json;d=json.load(open('model_prices_and_context_window.json'))
print({k:v for k,v in d['mistral/codestral-latest'].items() if 'cost' in k or 'token' in k})
print({k:v for k,v in d['mistral/mistral-small-latest'].items() if 'cost' in k or 'token' in k})
print('zai:', 'mistral/zai-glm-5-2' in d, 'ocr41:', 'mistral/mistral-ocr-4-1' in d)"
  1. Output:
{'input_cost_per_token': 1e-06, 'max_input_tokens': 32000, 'max_output_tokens': 8191, 'max_tokens': 8191, 'output_cost_per_token': 3e-06}
{'input_cost_per_token': 6e-08, 'max_input_tokens': 131072, 'max_output_tokens': 131072, 'max_tokens': 131072, 'output_cost_per_token': 1.8e-07}
zai: False ocr41: False

Case 2: retired xAI / Cohere slugs carry no deprecation date

  1. Command:
python3 -c "import json;d=json.load(open('model_prices_and_context_window.json'));
print([(k,d[k].get('deprecation_date')) for k in ['xai/grok-code-fast-1','xai/grok-3-latest','xai/grok-4','command','command-r','rerank-english-v2.0']])"
  1. Output:
[('xai/grok-code-fast-1', None), ('xai/grok-3-latest', None), ('xai/grok-4', None), ('command', None), ('command-r', None), ('rerank-english-v2.0', None)]

After (47ee5c17e9)

Case 1: mistral/codestral-latest and mistral-small-latest are stale, new models missing

  1. Same command as above
  2. Output:
{'input_cost_per_token': 3e-07, 'max_input_tokens': 128000, 'max_output_tokens': 128000, 'max_tokens': 128000, 'output_cost_per_token': 9e-07}
{'input_cost_per_token': 1.5e-07, 'max_input_tokens': 262144, 'max_output_tokens': 262144, 'max_tokens': 262144, 'output_cost_per_token': 6e-07}
zai: True ocr41: True

Case 2: retired xAI / Cohere slugs carry no deprecation date

  1. Same command as above
  2. Output:
[('xai/grok-code-fast-1', '2026-05-15'), ('xai/grok-3-latest', '2026-05-15'), ('xai/grok-4', '2026-05-15'), ('command', '2025-09-15'), ('command-r', '2025-09-15'), ('rerank-english-v2.0', '2025-04-30')]

Validation

  1. python3 ci_cd/check_files_match.pyPassed! Files model_prices_and_context_window.json and litellm/model_prices_and_context_window_backup.json match.
  2. uv run python ci_cd/generate_model_prices_schema.py → regenerated model_prices_and_context_window.schema.json byte-identical (no schema change; no new keys introduced)
  3. 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.py55 passed

Link to Devin session: https://app.devin.ai/sessions/a039d64b388c4ac68effd474ab2255dd

…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-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Updates the canonical and backup model registries with refreshed Mistral pricing, limits, and capabilities, adds two Mistral models, and records xAI and Cohere deprecation dates

  • Synchronizes Codestral and Mistral Small aliases with current model metadata
  • Adds Z.ai GLM 5.2 chat pricing and Mistral OCR 4.1 page pricing
  • Adds deprecation metadata for selected xAI and Cohere models

Confidence Score: 4/5

The 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

Important Files Changed

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": {

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 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

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed-hq

codspeed-hq Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_model_registry_audit_20260820 (47ee5c1) with litellm_internal_staging (6d47468)

Open in CodSpeed

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Superseded by #37658, which carries this PR's registry data (field-level, on top of current litellm_internal_staging) together with the other open cost-map PRs, so maintainers only have one registry PR to review. See the per-source-PR table in #37658 for exactly what was carried in, and reopen if anything looks dropped.

Srivatsa03 pushed a commit to Srivatsa03/litellm that referenced this pull request Aug 21, 2026
…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>
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.

0 participants