Skip to content

feat: Add MiniMax M3 tool-calling, reasoning, and conformance coverage - #83

Merged
indrajit96 merged 5 commits into
mainfrom
ibhosale/minimax_m3_tool_call
Jun 26, 2026
Merged

indrajit96 merged 5 commits into
mainfrom
ibhosale/minimax_m3_tool_call

Conversation

@indrajit96

Copy link
Copy Markdown
Contributor

Description

This adds MiniMax M3 support to the frontend parser crates and conformance matrix.

MiniMax M3 uses a namespace-token XML-ish tool-call format:

]<]minimax[>[<tool_call>
]<]minimax[>[<invoke name="get_weather">
]<]minimax[>[<location>NYC]<]minimax[>[</location>
]<]minimax[>[</invoke>
]<]minimax[>[</tool_call>

It also uses <mm:think>...</mm:think> reasoning markers, where the opener can
be prompt-prefilled by the chat template.

Changes

  • Added minimax_m3 / minimax-m3 tool-call parser registration.
  • Added MiniMaxM3ParserConfig and ParserConfig::MiniMaxM3.
  • Added a MiniMax M3 parser for:
    • namespace-prefixed tool-call blocks
    • <invoke name="..."> calls
    • parameter tags where tag names are argument names
    • duplicate parameter tags as arrays
    • schema-based scalar coercion
    • nested MiniMax XML object/array payloads
    • EOF recovery for complete invokes with a missing outer close
  • Added minimax_m3 / minimax-m3 reasoning parser registration.
  • Added opt-in streaming dangling-end recovery for MiniMax M3 reasoning, so
    reason</mm:think>answer is parsed as reasoning plus answer when the opener
    was prompt-prefilled.
  • Added MiniMax M3 conformance coverage:
    • tool-calling batch fixtures
    • tool-calling stream-v2 inventory fixtures
    • reasoning batch fixtures
    • reasoning stream fixtures
    • Top-N table/registry metadata
  • Wired MiniMax M3 into the vLLM/SGLang conformance wrappers, with pinned peer
    engines marked unavailable where they do not yet expose M3 parsers.

Notes

  • TC stream-v2 coverage for MiniMax M3 is table/inventory coverage only. It marks
    dynamo_rust, vllm_rust, vllm_python, and sglang_python unavailable for
    now.
  • This PR does not add a real parsers_v2 MiniMax M3 streaming parser.

Validation

Rust parser coverage

Targeted MiniMax M3 parser tests:

cargo test --locked -p dynamo-parsers minimax_m3 -- --nocapture

This covers:

  • MiniMax M3 reasoning parser registration for both minimax_m3 and
    minimax-m3.
  • Batch reasoning extraction for visible <mm:think>...</mm:think> spans.
  • Streaming reasoning extraction across split chunks.
  • Prompt-prefilled reasoning opener behavior:
    reason</mm:think>answer.
  • Dangling end-marker recovery in batch and streaming paths.
  • Close-marker-only streaming case where the close marker is stripped and does
    not leak into normal text.
  • MiniMax M3 tool-call parsing for the namespace-token XML format.
  • EOF recovery for a complete <invoke> when the outer tool_call close is
    missing.
  • Streaming jail start detection regression:
    normal text ending in ] or ]< does not trigger MiniMax M3 tool-call mode,
    while ]<] and the full opener still do.

Live E2E validation

In addition to the repo-local parser/conformance tests above, these
frontend-crates changes were built into the downstream Dynamo vLLM runtime image
and exercised in a live K8s deployment. Used vllm/vllm-openai:minimax-m3 vllm base container.

Signed-off-by: Indrajit Bhosale <iamindrajitb@gmail.com>
@indrajit96
indrajit96 requested a review from a team as a code owner June 25, 2026 22:52
@github-actions github-actions Bot added the feat label Jun 25, 2026
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

📊 Conformance matrix rendered — view in CI summary

indrajit96 and others added 2 commits June 25, 2026 16:16
Signed-off-by: Indrajit Bhosale <iamindrajitb@gmail.com>
The HTML markup highlighter mis-split the MiniMax M3 namespace token
]<]minimax[>[ : the generic <...> rule matched <]minimax[>, rendering
the token as a red orphan tag with stray ]/[ brackets before every
structural tag.

Recognize ]<]minimax[>[ as a whole token in _TAG_RE (higher priority
than the generic rule) and color it as a muted namespace decoration
(.tt-ns) in both the static (_colorize_xml) and streaming
(_xml_token_intervals) paths. Streaming-split tokens across deltas are
handled too.

@keivenchang keivenchang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the M3 work. Locally at 56447bd: 628 parser tests pass (12 new), all 3 parity suites pass, clippy clean.

]<]minimax[>[ is verified real -- MiniMax M3 namespace token 200058; checked the upstream chat_template.jinja (params encoded as tag names), so the config.rs M2-difference comment is accurate. The shared BasicReasoningParser opt-in recover_dangling_end is the right pattern -- extends the parent, no fork, no regression.

Pushed 14eb3bc: the HTML highlighter was rendering ]<]minimax[>[ as a red orphan tag before every structural tag; now muted (.tt-ns) in static + streaming.

Inline notes below. Nothing blocking.

Comment thread parsers/src/tool_calling/xml/minimax_m3_parser.rs Outdated
Comment thread parsers/src/tool_calling/parsers.rs
Comment thread conformance/toolcalling/fixtures/minimax_m3/TOOLCALLING.batch.yaml
Comment thread conformance/toolcalling/fixtures/minimax_m3/TOOLCALLING.batch.yaml
…_token

parse_parameter_value/parse_nested_minimax_xml hardcoded the
]<]minimax[>[ literal while the rest of the file derives every marker
from config.namespace_token. Thread config through both and reuse
parameter_start()/config.namespace_token so a non-default namespace_token
no longer silently falls back to scalar parsing for nested values.

@rmccorm4 rmccorm4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after open comments addressed

Signed-off-by: Indrajit Bhosale <iamindrajitb@gmail.com>
@indrajit96

Copy link
Copy Markdown
Contributor Author

Merging, as all opens addressed.

@indrajit96
indrajit96 merged commit fa34220 into main Jun 26, 2026
5 checks passed
@indrajit96
indrajit96 deleted the ibhosale/minimax_m3_tool_call branch June 26, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants