fix(sglang): split Kimi K3 reasoning and strip terminal tokens in SGLang chat processor - #12395
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
furionw
force-pushed
the
qiwa/sglang-k3-multimodal
branch
from
July 30, 2026 02:43
fd31d9c to
4c60564
Compare
Contributor
WalkthroughChangesKimi-K3 reasoning preprocessing
EOS token handling
Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
rmccorm4
approved these changes
Jul 31, 2026
rmccorm4
left a comment
Contributor
There was a problem hiding this comment.
LGTM, but needs merge conflicts addressed.
Is this validated e2e?
Contributor
Author
|
pasting results |
furionw
enabled auto-merge (squash)
July 31, 2026 22:07
furionw
force-pushed
the
qiwa/sglang-k3-multimodal
branch
from
July 31, 2026 22:10
4c60564 to
c08da74
Compare
furionw
force-pushed
the
qiwa/sglang-k3-multimodal
branch
2 times, most recently
from
July 31, 2026 23:21
8f79d88 to
625ce2d
Compare
furionw
force-pushed
the
qiwa/sglang-k3-multimodal
branch
from
August 1, 2026 01:29
625ce2d to
e9bb08b
Compare
furionw
force-pushed
the
qiwa/sglang-k3-multimodal
branch
from
August 1, 2026 03:21
e9bb08b to
1bed051
Compare
furionw
force-pushed
the
qiwa/sglang-k3-multimodal
branch
from
August 1, 2026 04:20
1bed051 to
2c14d6d
Compare
furionw
force-pushed
the
qiwa/sglang-k3-multimodal
branch
from
August 1, 2026 04:30
2c14d6d to
769aae5
Compare
furionw
force-pushed
the
qiwa/sglang-k3-multimodal
branch
from
August 1, 2026 04:31
769aae5 to
c97a354
Compare
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.
Why
With
--dyn-chat-processor sglang, Kimi-K3 responses come back with raw XTML protocol markers insidecontentandreasoning_contentnever populated. Two independent gaps cause it. First,kimi_k3is missing from the thinking-by-default parser family, soforce_reasoningresolves False and SGLang's streaming detector waits for an opening<|open|>think<|sep|>marker that K3 never emits — the chat template places it in the prompt, so generation begins already inside the think channel. Second, this mode detokenizes engine token IDs in the frontend and so bypasses SGLang's owntrim_matched_stop, letting K3's terminal<|end_of_msg|>survive into the text; that ID is declared only ingeneration_config.jsonand differs from the tokenizer's EOS, so neither source alone is sufficient. The Rust chat processor resolves both centrally and is unaffected.Effect
Request:
What is 17 + 25? One word.What Change
kimi_k3in the thinking-by-default parser family and aliases.Test Plan
pytest components/src/dynamo/frontend/tests/test_sglang_processor_unit.py— 193 passed.