LocalAI/core/backend
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
..
backend_suite_test.go feat: extract output with regexes from LLMs (#3491) 2024-09-13 13:27:36 +02:00
detection.go feat(sam.cpp): add sam.cpp detection backend (#9288) 2026-04-09 21:49:11 +02:00
embeddings.go feat(ui): Per model backend logs and various fixes (#9028) 2026-03-18 08:31:26 +01:00
image.go feat(ui): Per model backend logs and various fixes (#9028) 2026-03-18 08:31:26 +01:00
llm.go fix(vision): propagate mtmd media marker from backend via ModelMetadata (#9412) 2026-04-18 20:30:13 +02:00
llm_test.go feat(autoparser): prefer chat deltas from backends when emitted (#9224) 2026-04-04 12:12:08 +02:00
options.go feat: add node reconciler, allow to schedule to group of nodes, min/max autoscaler (#9186) 2026-03-31 08:28:56 +02:00
rerank.go feat(ui): Per model backend logs and various fixes (#9028) 2026-03-18 08:31:26 +01:00
soundgeneration.go feat(ui): Per model backend logs and various fixes (#9028) 2026-03-18 08:31:26 +01:00
stores.go feat: refactor build process, drop embedded backends (#5875) 2025-07-22 16:31:04 +02:00
token_metrics.go feat(ui): Per model backend logs and various fixes (#9028) 2026-03-18 08:31:26 +01:00
tokenize.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
transcript.go feat: wire transcription for llama.cpp, add streaming support (#9353) 2026-04-14 16:13:40 +02:00
tts.go feat(ui): Per model backend logs and various fixes (#9028) 2026-03-18 08:31:26 +01:00
vad.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
video.go feat(ui): Per model backend logs and various fixes (#9028) 2026-03-18 08:31:26 +01:00