api: add Qwen3.6 tool calling support - #1723
GenericRikka wants to merge 1 commit into
Conversation
|
Thank you, and welcome. Two things happened here, so the red checks make sense. The red checks are not your code. The PR was opened against The decoder fix is right and is a real bug on dev: The tool-calling half needs a rebase that is not mechanical: dev's |
|
Thank you for looking into this so quickly, and also for already splitting out and fixing the decoder issue in #1724. And sorry about originally basing the PR on I have now rebased the tool-calling commit onto
The reference-template test is now fully green: Thanks again for the prompt and detailed review. |
|
Thanks for the quick rebase, and the template test with the tool cases in both thinking modes is exactly the check I asked for. CI is red for a real reason though, in the Python suite:
1.12.1 is being tagged now, so this lands in the next release; once the suite is green I merge it. |
Implements the checkpoint's native tool declaration/call/response protocol and translates it to OpenAI tool_calls.
|
Thanks for this. Your branch started before #1767 and replaced the whole of |
Summary
Add native tool-calling support for Qwen3.6 through the OpenAI-compatible API.
The implementation follows Qwen3.6's native chat template for:
<tool_call>blocks<tool_response>blockstool_callsThe Qwen tool-call renderer/parser helpers are shared with Qwen3.8 where
the wire format is identical.
Qwen3.6 tokenizer fix
End-to-end testing exposed a separate tokenizer issue affecting Qwen3.6
tool calling.
Qwen3.6's
tokenizer.jsonstores protocol tokens such as:<tool_call>/</tool_call><tool_response>/</tool_response><think>/</think>in
added_tokens, outsidemodel.vocab.The Qwen3.6 decoder previously built its ID-to-piece table only from
model.vocab. As a result, generated added-token IDs were accepted bythe tokenizer but produced no bytes during detokenization. In practice,
this caused native protocol delimiters such as
</think>and<tool_call>to disappear from generated output.The second commit includes
added_tokensin the decoder table and addsa real-adapter regression test covering the six Qwen3.6 protocol tokens.
Testing
git diff --check: cleanQwen3.6-35B-A3B tokenizer
is returned as
tool_callswithfinish_reason: "tool_calls"The existing Qwen3.6 real-adapter oracle test reports:
The same failure reproduces unchanged on the upstream base (
9d5d05d)with the same model/reference fixture, so it is unrelated to this
change.