fix(openai-adapter): map max_tokens to max_completion_tokens for DeepSeek reasoner#11889
Merged
fix(openai-adapter): map max_tokens to max_completion_tokens for DeepSeek reasoner#11889
Conversation
…Seek reasoner DeepSeek Reasoner models require max_completion_tokens instead of max_tokens, similar to OpenAI's o-series models. This maps the parameter automatically when the API base is api.deepseek.com or the model name includes "deepseek-reasoner". Co-authored-by: Burak Bebek <BurakBebek1@users.noreply.github.com>
Contributor
|
📝 Documentation Review: No docs update needed. This PR implements an internal fix that automatically maps |
Patrick-Erichsen
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on the work by @BurakBebek1 in #10478 — extracting just the
max_completion_tokensfix as requested in review comments.Summary
max_completion_tokensinstead ofmax_tokens(similar to OpenAI's o-series models)api.deepseek.comor the model name includesdeepseek-reasonerTest plan
max_tokensbeing sentSummary by cubic
Map
max_tokenstomax_completion_tokensfor DeepSeek Reasoner models in the OpenAI adapter to prevent request failures. Applies when the API base includesapi.deepseek.comor the model name includesdeepseek-reasoner; standard OpenAI and o-series handling remain unchanged.Written for commit 4f13740. Summary will update on new commits.