LocalAI/core
Ettore Di Giacinto 7809c5f5d0
fix(vision): propagate mtmd media marker from backend via ModelMetadata (#9412)
Upstream llama.cpp (PR #21962) switched the server-side mtmd media
marker to a random per-server string and removed the legacy
"<__media__>" backward-compat replacement in mtmd_tokenizer. The
Go layer still emitted the hardcoded "<__media__>", so on the
non-tokenizer-template path the prompt arrived with a marker mtmd
did not recognize and tokenization failed with "number of bitmaps
(1) does not match number of markers (0)".

Report the active media marker via ModelMetadataResponse.media_marker
and substitute the sentinel "<__media__>" with it right before the
gRPC call, after the backend has been loaded and probed. Also skip
the Go-side multimodal templating entirely when UseTokenizerTemplate
is true — llama.cpp's oaicompat_chat_params_parse already injects its
own marker and StringContent is unused in that path. Backends that do
not expose the field keep the legacy "<__media__>" behavior.
2026-04-18 20:30:13 +02:00
..
application feat(ux): backend management enhancement (#9325) 2026-04-12 00:35:22 +02:00
backend fix(vision): propagate mtmd media marker from backend via ModelMetadata (#9412) 2026-04-18 20:30:13 +02:00
cli feat(ux): backend management enhancement (#9325) 2026-04-12 00:35:22 +02:00
clients feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
config fix(vision): propagate mtmd media marker from backend via ModelMetadata (#9412) 2026-04-18 20:30:13 +02:00
dependencies_manager feat(ui): move to React for frontend (#8772) 2026-03-05 21:47:12 +01:00
explorer feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
gallery fix(ui): rename model config files on save to prevent duplicates (#9388) 2026-04-17 08:12:48 +02:00
http fix(vision): propagate mtmd media marker from backend via ModelMetadata (#9412) 2026-04-18 20:30:13 +02:00
p2p feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
schema feat: wire transcription for llama.cpp, add streaming support (#9353) 2026-04-14 16:13:40 +02:00
services feat: wire transcription for llama.cpp, add streaming support (#9353) 2026-04-14 16:13:40 +02:00
startup feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
templates fix(vision): propagate mtmd media marker from backend via ModelMetadata (#9412) 2026-04-18 20:30:13 +02:00
trace feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00