Skip to content

fix(models): correct DeepSeek V4 max_output_tokens to the documented 384K - #758

Merged
ericleepi314 merged 1 commit into
mainfrom
fix/deepseek-max-output-tokens
Jul 28, 2026
Merged

fix(models): correct DeepSeek V4 max_output_tokens to the documented 384K#758
ericleepi314 merged 1 commit into
mainfrom
fix/deepseek-max-output-tokens

Conversation

@ericleepi314

Copy link
Copy Markdown
Collaborator

Both V4 rows carried max_output_tokens=8_192 — a placeholder sitting beside a 1_000_000 context window, under-reporting the model 47× in the token warning. DeepSeek documents 384,000 for V4 Pro (including the max reasoning modes).

It is advisory on this wire

Corrected and pinned, with a comment so the inertness isn't mistaken for a bug:

provider sends max_tokens?
Anthropic yes_default_max_tokens computes and sends one per request
Gemini yesconfig_kwargs["max_output_tokens"]
OpenAI-compat (DeepSeek, GLM…) no field at all — server default applies

The only live consumer is the auto-compact reservation, which clamps to MAX_OUTPUT_TOKENS_FOR_SUMMARY (20,000). Effective input moves 991,808 → 980,000 — 1.2%, in the more conservative direction.

Why the disclaimer earns its lines

This field was suspected of truncating long effort=max responses during the terminal-bench 2.1 DeepSeek triage. It cannot — it never reaches the request. Per-trial durations located the real cause elsewhere:

  • On the 50 trials both models completed, DeepSeek runs at 0.92× opus-5's wall-clock — marginally faster. effort=max latency is not the problem.
  • A handful of tasks stall outright: crack-7z-hash burns its full 30-minute budget where opus-5 finishes in 18 seconds — a 120× spread against a 0.92× median. That is a loop, not a token ceiling, and is tracked separately.

No score change expected from this commit. It fixes a displayed number and removes a false lead.

Tests: 389 passing in the affected area; the pinning test updated with the reasoning.

🤖 Generated with Claude Code

…384K

Both V4 rows carried max_output_tokens=8_192 — a placeholder sitting beside
a 1_000_000 context window, under-reporting the model 47x in the token
warning. DeepSeek documents 384_000 for V4 Pro (including the max reasoning
modes).

Corrected, and pinned in the test, with a note that it is ADVISORY on this
wire so the next reader does not mistake the inertness for a bug:

  * OpenAICompatibleProvider sends NO ``max_tokens`` field at all, so
    DeepSeek applies its own server-side default either way. Contrast
    AnthropicProvider (``_default_max_tokens`` computes and sends one on
    every request) and Gemini (``config_kwargs["max_output_tokens"]``) —
    on those wires the value is load-bearing; here it is not.
  * The one live consumer is the auto-compact reservation, which clamps to
    MAX_OUTPUT_TOKENS_FOR_SUMMARY (20_000). Effective input therefore moves
    991_808 -> 980_000: 1.2%, in the more conservative direction.

Why the disclaimer is worth the lines: this field was suspected of
truncating long ``effort=max`` responses during the terminal-bench 2.1
DeepSeek triage (2026-07-27). It cannot — it never reaches the request.
Per-trial durations located the real cause elsewhere: on the 50 trials both
models completed, DeepSeek runs at 0.92x opus-5's wall-clock (it is
marginally FASTER), while a handful of tasks stall outright —
crack-7z-hash burns its full 30-minute budget where opus-5 finishes in 18
seconds, a 120x spread against a 0.92x median. That is a loop, not a token
ceiling, and is tracked separately.

No score change expected from this commit.
@ericleepi314
ericleepi314 merged commit a0abf73 into main Jul 28, 2026
2 checks passed
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.

1 participant