fix(turboquant): guard upstream-only grpc-server fields for fork#10043
Merged
Conversation
backend/cpp/llama-cpp/grpc-server.cpp is reused by the turboquant build,
which compiles against an older llama.cpp fork (TheTom/llama-cpp-turboquant).
Two recent changes added references to upstream-only struct fields outside the
existing LOCALAI_LEGACY_LLAMA_CPP_SPEC guards:
- common_params::checkpoint_min_step (default + option handler), added with
the ggml-org/llama.cpp 35c9b1f3 bump (#9998)
- the common_params_speculative::draft tensor_buft_overrides sentinel
termination (#9919), which sat after the guard's #endif
The fork has neither field, so grpc-server.cpp failed to compile for every
turboquant flavor. Wrap the three references in #ifndef
LOCALAI_LEGACY_LLAMA_CPP_SPEC, matching the existing fork-compat guards, so the
stock llama-cpp build is unchanged and the fork build skips them. Update
patch-grpc-server.sh's doc comment to record what the macro now gates out.
Verified by a local fallback-flavor turboquant build: grpc-server.cpp compiles
against the fork and the backend image builds.
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Assisted-by: Claude:claude-opus-4-7 [Claude Code]
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 turboquant backend reuses
backend/cpp/llama-cpp/grpc-server.cppbut compiles it against an older llama.cpp fork (TheTom/llama-cpp-turboquant). Two recent changes added references to upstream-only struct fields outside the existingLOCALAI_LEGACY_LLAMA_CPP_SPECguards, breaking the turboquant build for every flavor:common_params::checkpoint_min_step(default + option handler) — added with the llama.cpp35c9b1f3bump (chore: ⬆️ Update ggml-org/llama.cpp to35c9b1f39ebe5a7bb83986d64415a079218be78d#9998)common_params_speculative::drafttensor_buft_overridessentinel termination (fix(llama-cpp): terminate tensor_buft_overrides with sentinel #9919) — sat just after the guard's#endifThe fork has neither field, so
grpc-server.cpp.ofailed with'struct common_params' has no member named 'checkpoint_min_step'and'struct common_params_speculative' has no member named 'draft'.This wraps the three references in
#ifndef LOCALAI_LEGACY_LLAMA_CPP_SPEC(the same fork-compat pattern already used elsewhere in the file). The stock llama-cpp build is unchanged (macro undefined → code compiled as before); the turboquant build (macro injected bypatch-grpc-server.sh) skips them. Thepatch-grpc-server.shdoc comment is updated to record what the macro now gates out.Test plan
fallback-flavor turboquant build:grpc-server.cppcompiles against the fork andlocal-ai-backend:turboquantimage buildsbackend-jobs-multiarch -cpu-turboquant(amd64 + arm64) green