Add Mistral Small 4 (Pixtral) support (#20708)
Signed-off-by: Xinyuan Tong <xinyuantong.cs@gmail.com> Co-authored-by: Alex Nails <alexnails@radixark.ai> Co-authored-by: Dimitrios Bariamis <12195802+dbari@users.noreply.github.com> Co-authored-by: dbari <dbari@users.noreply.github.com>
This commit is contained in:
co-authored by
Alex Nails
Dimitrios Bariamis
dbari
parent
df1d046de2
commit
6b8a6545b2
@@ -450,6 +450,33 @@ class Nemotron3Detector(BaseReasoningFormatDetector):
|
||||
return ret
|
||||
|
||||
|
||||
class MistralDetector(BaseReasoningFormatDetector):
|
||||
"""
|
||||
Detector for Mistral models with reasoning (e.g., Mistral-Small-4-119B-2603).
|
||||
Assumes reasoning format:
|
||||
[THINK]reasoning content[/THINK]answer
|
||||
|
||||
Reasoning is optional — it only appears when reasoning_effort="high" is set.
|
||||
When reasoning_effort="none", the model outputs directly without thinking tokens.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
stream_reasoning: bool = True,
|
||||
force_reasoning: bool = False,
|
||||
continue_final_message: bool = False,
|
||||
previous_content: str = "",
|
||||
):
|
||||
super().__init__(
|
||||
"[THINK]",
|
||||
"[/THINK]",
|
||||
force_reasoning=force_reasoning,
|
||||
stream_reasoning=stream_reasoning,
|
||||
continue_final_message=continue_final_message,
|
||||
previous_content=previous_content,
|
||||
)
|
||||
|
||||
|
||||
class ReasoningParser:
|
||||
"""
|
||||
Parser that handles both streaming and non-streaming scenarios for extracting
|
||||
@@ -474,6 +501,7 @@ class ReasoningParser:
|
||||
"minimax-append-think": MiniMaxAppendThinkDetector,
|
||||
"step3": DeepSeekR1Detector,
|
||||
"step3p5": DeepSeekR1Detector,
|
||||
"mistral": MistralDetector,
|
||||
"nemotron_3": Nemotron3Detector,
|
||||
"interns1": Qwen3Detector,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user