From 5f6d640eb1ae3c92d6db12de89db23956bda421f Mon Sep 17 00:00:00 2001 From: stefanwalcz Date: Sat, 25 Apr 2026 13:03:02 +0200 Subject: [PATCH] fix(llama-cpp): adapt grpc-server.cpp to upstream API changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The llama.cpp pin at 187a45637054 (2026-04-23) tightened the upstream API in two ways that broke our grpc-server.cpp build: 1. server_task::params_from_json_cmpl reduced from five parameters to four — the logit_bias_eog vector argument was removed. server_context_meta no longer carries the field; it now lives only on common_params / sampling. Drop the argument from both call sites (line 1648 and 2432). 2. get_media_marker() is no longer a member of the server_context_meta accessor surface. The MTMD module exposes mtmd_default_marker() (in tools/mtmd/mtmd.h) which returns the same default marker string the server-context.cpp uses internally. Switch to that. Verified by rebuilding the rocm7-llama-cpp backend image against this patch (Build "Backends fertig: 1 OK, 0 FEHLER (3m10s)" against pin 187a45637054). The earlier build (9m56s) failed with: grpc-server.cpp:1648:47: error: no member named 'logit_bias_eog' in 'server_context_meta' grpc-server.cpp:2432:47: same error grpc-server.cpp:2838:40: error: use of undeclared identifier 'get_media_marker' After this patch the same build completes cleanly. Co-Authored-By: Claude Opus 4.7 (1M context) --- backend/cpp/llama-cpp/grpc-server.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/cpp/llama-cpp/grpc-server.cpp b/backend/cpp/llama-cpp/grpc-server.cpp index 6bf144e913b3..dcac7710c07b 100644 --- a/backend/cpp/llama-cpp/grpc-server.cpp +++ b/backend/cpp/llama-cpp/grpc-server.cpp @@ -1660,7 +1660,6 @@ class BackendServiceImpl final : public backend::Backend::Service { ctx_server.impl->vocab, params_base, ctx_server.get_meta().slot_n_ctx, - ctx_server.get_meta().logit_bias_eog, data); task.id_slot = json_value(data, "id_slot", -1); @@ -2444,7 +2443,6 @@ class BackendServiceImpl final : public backend::Backend::Service { ctx_server.impl->vocab, params_base, ctx_server.get_meta().slot_n_ctx, - ctx_server.get_meta().logit_bias_eog, data); task.id_slot = json_value(data, "id_slot", -1); @@ -2841,7 +2839,7 @@ class BackendServiceImpl final : public backend::Backend::Service { // same string when rendering prompts outside the tokenizer-template path. // Only meaningful when an mtmd context was initialized (vision/audio models). if (ctx_server.impl->mctx != nullptr) { - response->set_media_marker(get_media_marker()); + response->set_media_marker(mtmd_default_marker()); } // Check if chat templates are initialized