fix(sglang,vllm): forward enable_thinking=false to chat templates - #1
Closed
gokay-ai wants to merge 1 commit into
Closed
fix(sglang,vllm): forward enable_thinking=false to chat templates#1gokay-ai wants to merge 1 commit into
gokay-ai wants to merge 1 commit into
Conversation
Go already emits both "true" and "false" in gRPC metadata, but the Python sglang and vllm backends only set template_kwargs when the value is "true". "false" then takes the same path as "key absent", so Qwen3-style templates keep thinking on. Coerce both directions to a bool so thinking-off reaches apply_chat_template. Assisted-by: Cursor:Cursor Grok 4.6 Co-authored-by: GokayAI <gokay-ai@users.noreply.github.com>
Owner
Author
|
Upstream mudler#11715 landed first. |
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.
Description
Fixes finding 1 of mudler#11674:
enable_thinking=falsewas dropped in the Python sglang and vllm backends.Go (
core/backend/options.go) already forwards both"true"and"false"in gRPC metadata. The Python backends only settemplate_kwargs["enable_thinking"]when the value was"true", so"false"took the same path as "key absent" and Qwen3-style templates kept thinking on.Both backends now coerce
"true"/"false"to a bool via a shared helper. Absent or unrecognized values still leave the template default alone.Finding 2 (
force_reasoning/ emptyreasoning_content) is intentionally untouched.Notes for Reviewers
apply_enable_thinkinginbackend/python/common/python_utils.pyrequest.Metadataand do not need a GPUmake test-python-helpers(and the new_build_promptcases inbackend/python/sglang/test.py/backend/python/vllm/test.py)Signed commits