Add GLM-4-MoE tool calling support#5463
Merged
Merged
Conversation
…sages + async grpo
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Member
Author
|
cc @Rocketknight1 for the schema |
qgallouedec
commented
Apr 6, 2026
Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com>
qgallouedec
commented
Apr 8, 2026
albertvillanova
approved these changes
Apr 8, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3fc2ca8. Configure here.
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.

<tool_call>name\n<arg_key>...<arg_value>...format) (done by Claude)glm4moe.jinjatemplate for identity matching inadd_response_schemaTestAddResponseSchemaandTestParseResponsetest parametrizationsPart of #5460
Warning
Requires/contains #5459
Note
Medium Risk
Adds new response-parsing regex/schema and chat-template matching for GLM-4-MoE; incorrect regex/template identity matching could break tool-call parsing for affected tokenizers. Test coverage is added, but behavior depends on exact template text matching.
Overview
Adds GLM-4-MoE tool-calling response parsing by introducing a
glm4moe_schema(including<tool_call>...<arg_key>/<arg_value>argument extraction) and wiring it intoadd_response_schemavia exact match against a newglm4moe.jinjatemplate.Extends the test suite to run
add_response_schemaandparse_responseagainst a GLM-4-MoE tiny model, and updates GRPO agent-training docs to list GLM-4-MoE as a tested/supported model.Reviewed by Cursor Bugbot for commit dba573c. Bugbot is set up for automated code reviews on this repo. Configure here.