Repository navigation
dsv4.1: chat encoding and tool parsing - #39665
Merged
Merged
Conversation
hnyls2002
force-pushed
the
dsv4.1-chat
branch
from
September 15, 2026 22:43
2f28471 to
72f3422
Compare
hnyls2002
requested review from
HaiShaw,
mickqian,
yctseng0211,
yhyang201 and
yuan-luo
September 15, 2026 22:43
hnyls2002
force-pushed
the
dsv4.1-vision
branch
from
September 15, 2026 22:57
bf0fe9d to
9315d28
Compare
hnyls2002
requested review from
BBuf,
DarkSharpness,
Fridge003,
HydraQYH,
Qiaolin-Yu,
celve,
hebiao064,
ispobock and
merrymercy
September 15, 2026 22:57
hnyls2002
force-pushed
the
dsv4.1-chat
branch
from
September 15, 2026 22:57
72f3422 to
3e83da8
Compare
hnyls2002
force-pushed
the
dsv4.1-chat
branch
from
September 15, 2026 23:21
3e83da8 to
99c9a8f
Compare
hnyls2002
force-pushed
the
dsv4.1-vision
branch
from
September 15, 2026 23:38
9315d28 to
de8b756
Compare
hnyls2002
requested review from
sogalin,
wisclmy0611 and
zijiexia
as code owners
September 17, 2026 03:40
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Collaborator
Author
|
/rerun-test test_serving_chat.py test_deepseekv4_detector.py test_function_call_parser.py test_reasoning_parser.py test_template_manager.py test_serving_responses.py test_serving.py |
Contributor
|
Results for 🚀 |
Collaborator
Author
|
/tag-and-rerun-ai |
Contributor
|
⛔ See the command reference. |
5 tasks done
3 of 5 tasks
5 tasks done
3 tasks
5 tasks done
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.
Summary
encoding_dsv41.py): spaced DSML tag names (<|DSML| calls>/<|DSML| invoke>/<|DSML| parameter>), a numeric reasoning-effort prefix, mid-conversation system messages, quick-instructiontasktokens, and OpenAIimage_urlparts rendered as image placeholders.DeepSeekV41Detector(tool-call parserdeepseekv41) on top of the V3.2 detector, with an xgrammar structural tag built for the spaced names; register thedeepseek-v41reasoning parser as an alias of the V4 one.--tool-call-parser deepseekv41or from the model config (model_type == "deepseek_v41"/DeepseekV41*architectures); template auto-detection resolves both parsers the same way.Changes
Encoder and serving
serving_chat: V4.1 requests go through the dsv4/dsv32 encoding branch. Tools are passed as the client sent them (unset fields dropped, OpenAI field order). Image parts are collected from the encoder and the placeholder is replaced with the model's image token.reasoning_effort: tierslow/high/xhigh/maxpass through, an OpenAI float in[0, 0.99]maps onto the 1-100 budget, an integer budget is accepted viachat_template_kwargs.reasoning_effort. Unsupported values (minimal,medium) log a warning and fall back to the server default, which is the encoder defaulthighunlessSGLANG_DSV41_REASONING_EFFORTsets a tier or an integer budget.Detectors
DeepSeekV32Detector: the DSML block / invoke / parameter tag names become class attributes and every token and regex is derived from them. V3.2 and V4 keep their literal tags and behavior; V4 now only overrides the block name.Verification
test_serving_chat.pypins the newdsv41spec; the existing V4 / V3.2 detector, function-call parser, reasoning parser and template-manager CPU suites pass unchanged.CI States
Latest PR Test (Base): ❌ Run #35179071184
Latest PR Test (Extra): ❌ Run #35179070932
Latest PR Test (AMD ROCm 10): ❌ Run #35179071125