Skip to content

DeepSeek V4 output limit is capped at 32K #38236

Closed as duplicate
Closed as duplicate

Description

@punkisnotdead3

Description

DeepSeek V4 models declare a 384K/393,216-token output limit, but ProviderTransform.maxOutputTokens() applies the global 32K default to every model. Requests therefore send 32K even though DeepSeek V4 advertises a much larger supported output budget.

DeepSeek V4 should use its positive model-declared output limit by default. Other model families should retain the existing 32K default, and an explicit OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX should remain authoritative.

Plugins

None

OpenCode version

1.18.4

Steps to reproduce

  1. Configure a DeepSeek V4 model with its models.dev output limit.
  2. Start a request without setting OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX.
  3. Observe that the request max output tokens is 32,000 instead of 384,000/393,216.

Screenshot and/or share link

No response

Operating System

macOS 26.5.2

Terminal

Terminal.app

Activity

  1. github-actions commented on Jul 22, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct from the above (e.g. you specifically want model-declared output limits to be respected automatically without any config override), please clarify the difference in a comment so maintainers can track it separately.

  2. punkisnotdead3 commented on Sep 9, 2026

    @punkisnotdead3
    Author

    Clarifying the distinction from #29363: this issue targets the no-override path for DeepSeek V4. The model metadata already declares a 384K/393,216 output limit, but the shipped dev path still replaces it with the generic 32K default in ProviderTransform.maxOutputTokens(). #38232 deliberately keeps 32K for other model families and preserves OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX, so the change is narrow and low-risk while the broader v2 rewrite is pending.

    I synced #38232 with current dev in 31f8b4195a, resolved the conflict, and revalidated the focused tests and typecheck.

  3. neriousy commented on Oct 1, 2026

    @neriousy
    Member

    Closing as a duplicate of #29363. DeepSeek is one case of the general per-step output cap tracked in #29363.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions