Add new 05/11 IFM tool-call formats for K2 V3 parser#5
Open
hanseungwook wants to merge 5 commits into
Open
Conversation
Backport multi-format tool parser to v0.12.0
mylibrar
reviewed
May 16, 2026
Collaborator
mylibrar
left a comment
There was a problem hiding this comment.
The current PR does not contain the xllm patching in #4 yet. Will we merge tgat/multi-format-tool-parser-v0.12.0 into v0.12.0-ifm untimately?
Collaborator
Author
|
@mylibrar I can bring in that PR into this branch -- I wanted to keep the branches separate actually |
Collaborator
Author
mylibrar
approved these changes
May 17, 2026
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.
What changed
This updates the K2 V3 multi-format tool parser to understand the new IFM tool-call formats from the BBQ
0511 chat template.
The parser now supports these exact tool-call formats:
jsonxmlxml_typedIt still supports the existing older formats:
qwen3minimaxdsv32glmgptosspythonThe old
defaultformat is no longer accepted because it was confusing. If no format is provided, theparser now uses
xml.Type handling
For all three new IFM formats, parsed tool arguments are converted using the provided
toolsschema.Examples:
12345becomes"12345"."true"becomestrue."2"becomes2.For
xml_typed, the schema wins. The emitted<ifm|arg_type>is only used when the schema does notprovide a type.
How to run tests