From 6098c51bc229c360857d36832f4e6bdaa8c65dde Mon Sep 17 00:00:00 2001 From: shuwenn <47200617+alphabetc1@users.noreply.github.com> Date: Thu, 2 Apr 2026 00:47:27 +0800 Subject: [PATCH] fix(MiMo-V2-Flash): add mimo reasoning parser (#21414) --- python/sglang/srt/entrypoints/openai/serving_chat.py | 6 ++++++ python/sglang/srt/parser/reasoning_parser.py | 1 + 2 files changed, 7 insertions(+) diff --git a/python/sglang/srt/entrypoints/openai/serving_chat.py b/python/sglang/srt/entrypoints/openai/serving_chat.py index 67cfef0a9..f7dffd111 100644 --- a/python/sglang/srt/entrypoints/openai/serving_chat.py +++ b/python/sglang/srt/entrypoints/openai/serving_chat.py @@ -1268,6 +1268,12 @@ class OpenAIServingChat(OpenAIServingBase): not request.chat_template_kwargs or request.chat_template_kwargs.get("enable_thinking") is not False ) + if self.reasoning_parser in ["mimo"]: + # Models that require explicit enable thinking (enable_thinking=True) + return ( + request.chat_template_kwargs is not None + and request.chat_template_kwargs.get("enable_thinking") is True + ) if self.reasoning_parser in ["mistral"]: # Mistral models only reason when reasoning_effort is explicitly # set to a value other than None/"none" (typically "high"). diff --git a/python/sglang/srt/parser/reasoning_parser.py b/python/sglang/srt/parser/reasoning_parser.py index a6867c9f8..c3dbb3116 100644 --- a/python/sglang/srt/parser/reasoning_parser.py +++ b/python/sglang/srt/parser/reasoning_parser.py @@ -495,6 +495,7 @@ class ReasoningParser: "gpt-oss": GptOssDetector, "kimi": KimiDetector, "kimi_k2": KimiK2Detector, + "mimo": Qwen3Detector, "qwen3": Qwen3Detector, "qwen3-thinking": Qwen3Detector, "minimax": Qwen3Detector,