fix(llama-cpp): adapt grpc-server.cpp to upstream API changes#9569
Open
walcz-de wants to merge 1 commit intomudler:masterfrom
Open
fix(llama-cpp): adapt grpc-server.cpp to upstream API changes#9569walcz-de wants to merge 1 commit intomudler:masterfrom
walcz-de wants to merge 1 commit intomudler:masterfrom
Conversation
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) <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.
Summary
The llama.cpp pin at
187a45637054(2026-04-23) tightened the upstream server API in two ways that breakbackend/cpp/llama-cpp/grpc-server.cpp. This PR adapts the call sites so the rocm-7.x / hipblas build (and presumably any other build that pulls this pin) compiles again.What broke
Root cause
server_task::params_from_json_cmplwas reduced from five parameters to four. Thelogit_bias_eogvector argument was removed andserver_context_metano longer carries the field — it now lives only oncommon_params/sampling. The upstreamserver-context.cppwas updated accordingly (task.params = server_task::params_from_json_cmpl(ctx_server.vocab, params, meta->slot_n_ctx, data);) butgrpc-server.cppwas not.get_media_marker()is no longer a member of the server context accessor surface. The MTMD module exposesmtmd_default_marker()(declared intools/mtmd/mtmd.h, line 104) which returns the same default marker string the upstream server uses internally.mtmd.his already included transitively byserver-context.cpp, so no new include is required.Fix
Test plan
rocm7-llama-cppbackend image against this patch on AMD gfx1151 / Strix Halo. Earlier build with the same llama.cpp pin failed atgrpc-server.cpp:1648with the error above (9m56s wall, exit 2). After the patch the same build completes cleanly:Backends fertig: 1 OK, 0 FEHLER (3m10s).logit_bias_eogis sourced fromparams_base.sampling.logit_bias_eoginsideparams_from_json_cmpl(where the upstreamserver-context.cppreads it from), andmtmd_default_marker()returns the same stringget_media_marker()previously returned.