Skip to content

fix(provider): default top_p to 0.95 for deepseek-v4-flash - #40247

Open
hoooou wants to merge 2 commits into
anomalyco:devfrom
hoooou:feat/top-p-deepseek-v4-flash
Open

fix(provider): default top_p to 0.95 for deepseek-v4-flash#40247
hoooou wants to merge 2 commits into
anomalyco:devfrom
hoooou:feat/top-p-deepseek-v4-flash

Conversation

@hoooou

@hoooou hoooou commented Aug 3, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #40249

Type of change

  • Bug fix

What does this PR do?

opencode currently sends deepseek-v4-flash requests without a top_p, so the API default of 1.0 is used. DeepSeek recommends top_p = 0.95 (with temperature = 1.0) for agentic scenarios with this model, and OpenCode is a coding agent (see https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731).

This adds a top_p = 0.95 default in the sampling defaults, matching the existing treatment of minimax-m2 and the kimi-k2.5 family. The match is scoped to deepseek-v4-flash only so other deepseek models (deepseek-chat / reasoner / v3 / v4-pro) are unaffected.

How did you verify your code works?

Added a unit test in packages/opencode/test/provider/transform.test.ts asserting topP() returns 0.95 for deepseek-v4-flash (temperature/topK stay unset). bun test test/provider/transform.test.ts passes: 398 tests, 0 failures. Prettier check passes on both changed files.

Screenshots / recordings

N/A, not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

deepseek-v4-flash missing recommended top_p=0.95 sampling default

1 participant