Skip to content

vllm.parser.minimax_m3

MiniMax M3 parser for namespace-delimited XML-style tool calls.

MiniMax M3 prefixes every structural tag with the ]<]minimax[>[ marker::

]<]minimax[>[<tool_call>
]<]minimax[>[<invoke name="create_order">
]<]minimax[>[<user_id>42]<]minimax[>[</user_id>
]<]minimax[>[<items>
]<]minimax[>[<item>]<]minimax[>[<sku>book-001]<]minimax[>[</sku>]<]minimax[>[</item>
]<]minimax[>[</items>
]<]minimax[>[</invoke>
]<]minimax[>[</tool_call>

Each <invoke> becomes one tool call. Parameters are elements named after the argument and may nest: an element holding child elements becomes an object, or an array when its schema says so (the chat template renders list items as <item>). Arguments are emitted once the whole <invoke> is parsed. Reasoning is handled by MiniMaxM3ReasoningParser.

Classes:

  • MinimaxM3Parser –

    MiniMax M3 tool-call parser backed by the declarative parser engine.

MinimaxM3Parser

Bases: ParserEngine

MiniMax M3 tool-call parser backed by the declarative parser engine.

_container_schema(schema)

Return the first array or object alternative of schema.

_convert_object(elements, schema)

Convert named elements to an object; repeated names collect into a list.

_parse_element(text, pos, depth)

Parse the element starting at pos; None if malformed.

_parse_invoke_params(raw_args)

Parse the parameter elements of one <invoke> body.

Parsing stops at the first malformed or unterminated element, keeping the parameters before it.