feat: Support deployment-level thinking defaults for chat templates (… - #12440
Merged
Conversation
…11047) Signed-off-by: Indrajit Bhosale <iamindrajitb@gmail.com>
Contributor
Comment on lines
160
to
167
| } | ||
| OpenAiThinkingMode::Disabled => { | ||
| args.insert("thinking".to_string(), serde_json::Value::Bool(false)); | ||
| args.insert( | ||
| "enable_thinking".to_string(), | ||
| serde_json::Value::Bool(false), | ||
| ); | ||
| args.insert( |
Contributor
There was a problem hiding this comment.
🔍 Adding enable_thinking to normalized thinking payloads changes rendered prompts for existing deployments
normalize_reasoning_template_args now writes enable_thinking in addition to thinking/thinking_mode for the enabled/disabled cases. Two consequences worth confirming against expectations:
- Templates that key on
enable_thinking(Qwen3, GLM, Gemma4, ...) will now honor a client'sthinking: {"type": ...}payload; previously they saw onlythinking, so the same request rendered differently. This is a behavior change for any live deployment already sending root-levelthinking. - Precedence flips for a conflicting request: with
thinking:{"type":"enabled"}+reasoning_effort:"none", the reasoning-effort branch atlib/llm/src/protocols/openai/chat_completions.rs:176-179previously seededenable_thinking=falseviaentry(...).or_insert(...); it now cannot, because the explicit insert already ran, soenable_thinkingstaystrue. Converselythinking:{"type":"disabled"}now also forcesenable_thinking=falseover a client-suppliedchat_template_kwargs.enable_thinking=true(previously left intact, producing contradictory kwargs). Both directions look intentional per the new tests, but they are not mentioned in the PR description.
(Refers to lines 154-167)
Was this helpful? React with 👍 or 👎 to provide feedback.
This comment has been minimized.
This comment has been minimized.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CP for #11047