Repository navigation
[Rust Frontend] Add hy_v3 reasoning parser - #48800
Closed
ricky-chaoju wants to merge 5 commits into
Closed
ricky-chaoju wants to merge 5 commits into
ricky-chaoju wants to merge 5 commits into
Conversation
Signed-off-by: RickyChen / 陳昭儒 <ricky.chen@infinirc.com>
|
To use Codex here, create a Codex account and connect to github. |
…soning-parser Signed-off-by: RickyChen / 陳昭儒 <ricky.chen@infinirc.com> # Conflicts: # rust/src/chat/src/lib.rs # rust/src/chat/tests/roundtrip.rs
…soning-parser Signed-off-by: RickyChen / 陳昭儒 <ricky.chen@infinirc.com> # Conflicts: # rust/src/chat/src/lib.rs
Contributor
Author
|
@BugenZhao PTAL. Thanks! |
4 tasks done
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
Contributor
Author
|
Superseded by #53054 |
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.
This PR is the reasoning half of Hunyuan V3 support in the Rust frontend. The
hy_v3tool parser landed in #43872, but the reasoning parser was missing, so reasoning output from a Hy3 model isn't split out. Roadmap item ishy_v3under #44280.Hy3 uses standard
<think>/</think>tags, so this registershy_v3as the eighthQwen3ReasoningParseralias, next to DeepSeek V3/V4, GLM45, Kimi K2, MiniMax M2, Nemotron V3, and Step3, plushy3/hy_v3model patterns mirroring the tool side. No new parser code. The Python parser's two hy_v3-specific behaviors are covered by the prompt-first design: the Hy3 template always leaves a reasoning boundary at the end of the generation prompt (<think></think>for no_think,<think>for low/high), so prompt-boundary initialization already lands in the right state, andtoken_suffixis only non-empty on the opensource checkpoint, not the preview one vLLM tests against; a suffixed checkpoint fails parser creation loudly rather than misparsing.I also added a roundtrip fixture over the real
tencent/Hy3-previewtemplate (public, ungated), covering the no_think default path end to end. The thinking path can't roundtrip on this template at all since history rendering strips reasoning, same reason gemma4/kimi_k25 are restricted, and the extraction state machine is already covered by the qwen3/glm45/deepseek_v4 roundtrips sharing the same parser.tool_call_mixneeds harness work due to per-turn eos differences, so I left it out on purpose. Hy3 shares the Qwen3 delimited parser; only the registered name differs.