vllm - ✅(Solved) Fix [Bug]: MiniMaxM2Parser incompatible with refactored OpenAIServingChat [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#39847Fetched 2026-04-16 06:36:17
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
referenced ×2cross-referenced ×1labeled ×1

Error Message

(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] Error in parser creation. (APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] Traceback (most recent call last): (APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] File "/runtime/lib/python3.13/site-packages/vllm/entrypoints/openai/chat_completion/serving.py", line 571, in chat_completion_stream_generator (APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] self.parser_cls( (APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] ~~~~~~~~~~~~~~~^ (APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] tokenizer, (APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] ^^^^^^^^^^ (APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] request.tools, (APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] ^^^^^^^^^^^^^^ (APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] chat_template_kwargs=chat_template_kwargs, (APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] ) (APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] ^ (APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] TypeError: MiniMaxM2Parser.init() got an unexpected keyword argument 'chat_template_kwargs'

PR fix notes

PR #39861: [Bugfix] Accept **kwargs in MiniMaxM2Parser.init()

Description (problem / solution / changelog)

Fixes #39847.

Summary

MiniMaxM2Parser.__init__() does not accept **kwargs, causing a TypeError on every streaming chat completion request when serving MiniMax M2 models:

TypeError: MiniMaxM2Parser.__init__() got an unexpected keyword argument 'chat_template_kwargs'

The error originates in serving.py line 571–578, where the refactored chat_completion_stream_generator now passes chat_template_kwargs= to all parser constructors:

self.parser_cls(
    tokenizer,
    request.tools,
    chat_template_kwargs=chat_template_kwargs,
)

The base class Parser.__init__ already accepts *args, **kwargs, and the sibling _WrappedParser in abstract_parser.py also accepts **kwargs. MiniMaxM2Parser is the only Parser subclass that does not forward them.

Fix

Add **kwargs to MiniMaxM2Parser.__init__() for consistency with the base class contract.

-    def __init__(self, tokenizer: TokenizerLike, tools: list[Tool] | None = None):
+    def __init__(self, tokenizer: TokenizerLike, tools: list[Tool] | None = None, **kwargs):

Impact

  • Before: Every streaming chat completion to a MiniMax M2 model logs Error in parser creation and falls back to raw output (no tool call / reasoning parsing).
  • After: Parser is constructed normally; tool calling and reasoning extraction work as intended.

Testing

  • Verified the fix resolves the TypeError when serving MiniMax-M2.7-AWQ with streaming chat completions.

Changed files

  • vllm/parser/minimax_m2_parser.py (modified, +9/-3)

Code Example

(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] Error in parser creation.
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] Traceback (most recent call last):
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]   File "/runtime/lib/python3.13/site-packages/vllm/entrypoints/openai/chat_completion/serving.py", line 571, in chat_completion_stream_generator
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]     self.parser_cls(
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]     ~~~~~~~~~~~~~~~^
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]         tokenizer,
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]         ^^^^^^^^^^
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]         request.tools,
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]         ^^^^^^^^^^^^^^
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]         chat_template_kwargs=chat_template_kwargs,
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]     )
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]     ^
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] TypeError: MiniMaxM2Parser.__init__() got an unexpected keyword argument 'chat_template_kwargs'
RAW_BUFFERClick to expand / collapse

Your current environment

build db8a6d66b

🐛 Describe the bug

(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] Error in parser creation.
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] Traceback (most recent call last):
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]   File "/runtime/lib/python3.13/site-packages/vllm/entrypoints/openai/chat_completion/serving.py", line 571, in chat_completion_stream_generator
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]     self.parser_cls(
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]     ~~~~~~~~~~~~~~~^
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]         tokenizer,
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]         ^^^^^^^^^^
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]         request.tools,
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]         ^^^^^^^^^^^^^^
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]         chat_template_kwargs=chat_template_kwargs,
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]     )
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581]     ^
(APIServer pid=109941) ERROR 04-14 23:12:44 [serving.py:581] TypeError: MiniMaxM2Parser.__init__() got an unexpected keyword argument 'chat_template_kwargs'

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

extent analysis

TL;DR

The error is likely due to an incompatible argument chat_template_kwargs being passed to the MiniMaxM2Parser constructor.

Guidance

  • Verify that the MiniMaxM2Parser class does not support the chat_template_kwargs argument by checking its documentation or implementation.
  • Check the version of the library or module that provides MiniMaxM2Parser to see if it has been updated to support this argument.
  • If the argument is not supported, remove it from the constructor call to fix the error.
  • Review the code that calls MiniMaxM2Parser to ensure it is passing the correct arguments.

Example

# Before
self.parser_cls(tokenizer, request.tools, chat_template_kwargs=chat_template_kwargs)

# After (if chat_template_kwargs is not supported)
self.parser_cls(tokenizer, request.tools)

Notes

The exact fix may depend on the specific requirements of the MiniMaxM2Parser class and the code that uses it.

Recommendation

Apply workaround: Remove the chat_template_kwargs argument from the MiniMaxM2Parser constructor call, as it is not supported by the class.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING