Skip to content

fix(model_prices): correct DeepSeek V4 max output tokens - #36925

Merged
mateo-berri merged 2 commits into
litellm_internal_stagingfrom
litellm_model_registry_lifecycle_audit_20260814
Aug 15, 2026
Merged

fix(model_prices): correct DeepSeek V4 max output tokens#36925
mateo-berri merged 2 commits into
litellm_internal_stagingfrom
litellm_model_registry_lifecycle_audit_20260814

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

TLDR

DeepSeek V4 max_output_tokens was 8192 in the registry, but DeepSeek documents a 384K maximum output. This raises deepseek-v4-flash and deepseek-v4-pro (and their deepseek/-prefixed aliases) to 393216 in both the canonical registry and the bundled copy.

User Flow

Before: a client that sizes max_tokens from GET /model/info for deepseek/deepseek-v4-pro reads back "max_output_tokens": 8192 and truncates long generations at 8K, where DeepSeek would have allowed 384K.

After: the same request reports "max_output_tokens": 393216.

Sources

  • https://api-docs.deepseek.com/quick_start/pricingdeepseek-v4-flash and deepseek-v4-pro list CONTEXT LENGTH: 1M and MAX OUTPUT: MAXIMUM: 384K. 384K is written as 393216, matching how the registry already stores DeepSeek limits in 1024 units (deepseek/deepseek-v3.2 is 163840).

Not changed, deliberately:

  • The DeepSeek peak/off-peak repricing on the same page takes effect 16:00 UTC on August 16, 2026 and is left out until it is live, since the registry has no peak/off-peak dimension.
  • Gemini lifecycle dates: an earlier revision of this PR added deprecation_date to the Gemini 2.5 GA models and changed gemini/gemini-embedding-001. That was wrong and has been reverted — https://ai.google.dev/gemini-api/docs/deprecations currently lists "No shutdown date announced" for gemini-2.5-pro, gemini-2.5-flash and gemini-2.5-flash-lite, and May 14, 2028 for gemini-embedding-001, which is what the registry already had.

The wider audit turned up nothing else verifiably stale: Anthropic, OpenAI, Bedrock, Mistral, Cohere, xAI and Azure lifecycle tables already match the registry entry for entry, and DeepSeek V4 pricing already matches the current per-token rates.

Relevant issues

Supports #26900

Pre-Submission checklist

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review

Existing coverage in tests/test_litellm/test_model_prices_schema.py validates these fields against the schema (18 passed), so no new test was added for a data-only change.

Screenshots / Proof of Fix

Live proxy on http://localhost:4000 started with LITELLM_LOCAL_MODEL_COST_MAP=True python litellm/proxy/proxy_cli.py --config litellm/proxy/dev_config.yaml --port 4000, with a deployment registered via /model/new.

Before, at base commit 423b791ee0:

$ curl -s -H "Authorization: Bearer sk-1234" http://localhost:4000/model/info \
  | jq '.data[] | select(.model_name == "deepseek/deepseek-v4-pro") | {model_name, max_input_tokens: .model_info.max_input_tokens, max_output_tokens: .model_info.max_output_tokens}'
{
  "model_name": "deepseek/deepseek-v4-pro",
  "max_input_tokens": 1000000,
  "max_output_tokens": 8192
}

After:

{
  "model_name": "deepseek/deepseek-v4-pro",
  "max_input_tokens": 1000000,
  "max_output_tokens": 393216
}

Type

🐛 Bug Fix

Caveats

Data-only change; no gateway code reads or exposes lifecycle metadata yet (that is #26900).

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

…max output tokens

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

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

@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR corrects lifecycle metadata for Gemini API models and raises the registered DeepSeek V4 output limit to the provider-published 384K value.

  • Adds or corrects shutdown dates for four Gemini API registry entries.
  • Updates both DeepSeek V4 variants and their provider-prefixed aliases to 393216 output tokens.
  • Keeps the canonical and bundled model registries synchronized.

Confidence Score: 5/5

The PR appears safe to merge, with both model registries consistently updated to the corrected provider metadata.

The changed dates conform to the registry schema, the DeepSeek limits are consistent across all affected aliases and existing sibling metadata, and the canonical and runtime-bundled files remain synchronized.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Updates the canonical registry’s Gemini lifecycle dates and DeepSeek V4 token limits consistently, with no actionable defect identified.
litellm/model_prices_and_context_window_backup.json Mirrors the canonical registry changes in the runtime-bundled copy, preserving the repository’s synchronization contract.

Reviews (1): Last reviewed commit: "fix(model_prices): correct Gemini 2.5 sh..." | Re-trigger Greptile

@codecov

codecov Bot commented Aug 14, 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 14, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_model_registry_lifecycle_audit_20260814 (30b1459) with litellm_internal_staging (d70cc14)1

Open in CodSpeed

Footnotes

  1. No successful run was found on litellm_internal_staging (7a5b98e) during the generation of this report, so d70cc14 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b066ed3. Configure here.

Comment thread model_prices_and_context_window.json Outdated
},
"gemini/gemini-embedding-001": {
"deprecation_date": "2028-05-14",
"deprecation_date": "2026-07-14",

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.

Wrong embedding shutdown date

Medium Severity

gemini/gemini-embedding-001 now carries deprecation_date 2026-07-14, which is already past and conflicts with Google’s current docs: the model remains available, the Gemini API deprecations page does not list it, and Cloud lifecycle guidance keeps it until at least May 2028. This replaces the nearer-correct prior value and will mislead migration tooling once deprecation metadata is surfaced.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b066ed3. Configure here.

Google's Gemini deprecations page lists no shutdown date for the 2.5 GA models and May 14, 2028 for gemini-embedding-001; keep only the DeepSeek V4 max output correction.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration devin-ai-integration Bot changed the title fix(model_prices): correct Gemini 2.5 shutdown dates and DeepSeek V4 max output tokens fix(model_prices): correct DeepSeek V4 max output tokens Aug 15, 2026

@mateo-berri mateo-berri left a comment

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.

LGTM

@mateo-berri
mateo-berri merged commit 87abb87 into litellm_internal_staging Aug 15, 2026
69 checks passed
@mateo-berri
mateo-berri deleted the litellm_model_registry_lifecycle_audit_20260814 branch August 15, 2026 16:58
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.

2 participants