LocalAI/backend/cpp/llama-cpp
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
..
CMakeLists.txt fix(llama-cpp): rename linked target common -> llama-common (#9408) 2026-04-18 00:42:05 +02:00
grpc-server.cpp fix(vision): propagate mtmd media marker from backend via ModelMetadata (#9412) 2026-04-18 20:30:13 +02:00
Makefile fix(llama-cpp): rename linked target common -> llama-common (#9408) 2026-04-18 00:42:05 +02:00
package.sh fix(llama.cpp): bundle libdl, librt, libpthread in llama-cpp backend (#9099) 2026-03-22 00:58:14 +01:00
prepare.sh chore: ⬆️ Update ggml-org/llama.cpp to 7f8ef50cce40e3e7e4526a3696cb45658190e69a (#7402) 2025-12-01 07:50:40 +01:00
run.sh feat(rocm): bump to 7.x (#9323) 2026-04-12 08:51:30 +02:00