Repository navigation
server: enforce required DeepSeek tools in DSML markup - #1684
Conversation
4b6d7ad to
e9f6685
Compare
|
Rebased onto main |
Recognize the native template call envelope and emit structural tags with each offered argument schema. Preserve named-tool filtering and parallel-call policy, and parse the grammar envelope through both whole replies and streamed prefixes. Host tests cover the actual template, schema alternatives, named calls, typed arguments and every streaming byte boundary. Formatting, zero new lean identities and the complete CPU gate set pass against the pinned upstream baseline. (cherry picked from commit 556665b)
e9f6685 to
0817c9e
Compare
|
Thank you @jayleaton. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
|
Thanks @jayleaton! Required and named tool calls held to DeepSeek's DSML markup are in 1.2.1: https://github.com/ashhart/TensorFold/releases/tag/v1.2.1 |
What this changes
tool_choice: "required"and named tool calls compile a structural-tag grammar from the template's call envelope. DeepSeek-V4.x writes calls in DSML (<|DSML|invoke …>), and the grammar had no DSML style, so these requests could not be constrained on DeepSeek. This adds adeepseekstyle. It recognizes the native template's call envelope and emits structural tags with each offered tool's argument schema. Named-tool filtering and the parallel-call policy are kept. The grammar envelope is parsed in whole replies and in streamed prefixes.Issue: none open upstream. Related: #1396 (stream and whole-reply agreement, including DSML whitespace), and #1665 (DeepSeek-V4.1 grammar masks on CUDA), which does not touch the tool-call grammar this PR changes. This PR does not change the stream filter that #1396 covers. Stacked on: nothing (based on main
d2ad5a7f2).Receipt
e9f668512bb2on maind2ad5a7f2; Zig 0.17.0; host checks on a Linux aarch64 DGX Spark (GB10, CUDA 13.0). Real-pack boot on two GB10s, TP=2 over RoCE, checkpointjayleaton/DeepSeek-V4.1-Flash-1017-EXL3-2.8bpwrevision859396591c34,TF_EXPERIMENTAL=deepseek.tool_grammar_deepseek_test.zig): the actual template, schema alternatives, named calls, typed arguments, and every streaming byte boundary of the envelope.atc overlapreports one-line additive conflicts with minimax_m3: a CUDA backend for MiniMax-M3.1-Flash at TP over GB10s, from the release's own formats #1388, minimax_m3: serve MiniMax-M3.1-Flash (428B-A23B MoE, images) natively on Metal #1235 and minimax_m3 (CUDA): draft several streams' DSpark blocks in one pass #1426 (MiniMax-M3), which each add anotherStylecase andleadsentry intool_grammar.zigandreply_text.zig. Whichever lands second keeps both entries.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Not measured for this change alone.)SUMMARYline is in the receipt. (No kernel changes.)