Add support for Mistral 3 series templates#13
Open
aldehir wants to merge 5 commits intoochafik:mainfrom
Open
Conversation
The new 2512 Mistral 3 series models do not allow empty assistant content, which affects Minja's ability to determine its tool calling capabilities. This adds an additional `requires_non_empty_content` capability.
Collaborator
|
Hmmm, looks like the tests are failing to download templates, thought that was fixed? @ochafik |
ochafik
requested changes
Dec 29, 2025
include/minja/chat-template.hpp
Outdated
| return json(""); | ||
| } | ||
| if ((content.is_null() || (content.is_string() && content.empty())) && caps_.requires_non_empty_content) { | ||
| return json("<Assitant Needle>"); |
Owner
There was a problem hiding this comment.
please extract a constant (+ fix typo) above next to the others
const std::string assistant_needle = "<Assistant Needle>";
Owner
There was a problem hiding this comment.
I'm disturbed by this needle. The semantics here is you need a non-empty content, not that you need a needle to be found from outside (otherwise someone would have passed the needle explicitly).
Just use " " here?
Author
There was a problem hiding this comment.
Do you agree there is no need to extract a constant if I use " "?
Co-authored-by: Olivier Chafik <olivier.chafik@gmail.com>
Collaborator
|
@ochafik gentle ping |
ochafik
approved these changes
Jan 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The new Mistral 3 (2512) series models do not allow empty assistant content, which affects Minja's ability to determine its tool calling capabilities. This adds an additional
requires_non_empty_contentcapability.ref: ggml-org/llama.cpp#17713 (comment)