common : add parser for ministral/mistral large 3 #17713
Draft
+5,362
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
This is intended to be an functional demonstration of the PEG parser implemented in #17136, and as such depends on that PR. I have squashed the commits down to make it easy to view the parser implementation for Ministral 3 Reasoning/Instruct and Mistral Large 3 Instruct.
Parser implementation for Ministral 3 Reasoning/Instruct and Mistral Large 3 Instruct. It deviates from the previous Mistral outputs by generating tool calls in the form:
[TOOL_CALLS]tool_name[ARGS]{"arg1": ... }...Features
reasoning_content1systemandassistantmessages containingreasoning_contentinto{"type": "thinking", "thinking": "..."}content blocks the chat template expects. server: thinking type rejected as invalid but used by Ministral 3 #17700tool_choice = autoandtool_choice = required(with thinking).response_formatwith thinking.Keeping this as a draft until #17136 gets the stamp of approval.
Footnotes
Currently only
reasoning_format = auto/deepseekis supported. I was unaware the reasoning format is not exposed during chat param init, but this is easy to address. ↩