Repository navigation
convert: Zamba2-VL template, images as llama.cpp's media markers - #17
Merged
bong-water-water-bong merged 1 commit intoSep 26, 2026
Merged
Conversation
llama-server passes a message with media to the template as a string holding a marker, <__media_<id>__> with an id random per server, where each image was. The template only knew the literal <__media__>, so the marker stayed in the user text: the image landed inside the user turn instead of in front of it, where Zyphra's template puts it. Find markers by their <__media_ prefix, put them in front of the user turn, and keep Zyphra's list form as it was. Checked: rendered with jinja2, the template gives Zyphra's prompt for its list form and for string content with <__media__> or a random marker; in llama-server (Zamba2-VL-2.7B, --chat-template-file) the image now starts at prompt index 2 (<s>, <|vision_start|>), as in Zyphra's processor, where it started at 4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Follow-up to #16. The Zamba2-VL chat template embedded by the converter put the image inside the user turn; Zyphra's template puts it in front.
Cause: llama-server hands a message with media to the template as a string containing a marker,
<__media_<id>__>, whose id is random per server. The template only recognised the literal<__media__>, so the marker stayed inside the user text.Fix: the template finds markers by their
<__media_prefix and moves them in front of the user turn. Zyphra's own list form (imageandtextparts) renders as before.Checked
<__media__>, and string content with a random marker.--chat-template-file, the image now starts at prompt index 2 (<s>,<|vision_start|>), as in Zyphra's processor. It used to start at 4.GGUFs converted with #16 carry the old template. Reconvert them, or serve them with
--chat-template-file.🤖 Generated with Claude Code