Upgrade llama.cpp to b10154 and refactor server route registration - #364
Merged
bernardladenthin merged 3 commits intoJul 27, 2026
Merged
Conversation
Patch bump of org.jetbrains.kotlin.plugin.compose; tracks the Kotlin version and stays above AGP's bundled Kotlin floor. No other change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MeheJtyQwUzJGLcYpyWURD
Bumps com.android.application to 9.3.0 in both the android-llmservice app and the .github/android-consumer-test fixture. AGP 9.3.x requires Gradle >= 9.5.0, so the four gradle-version pins on the AGP-building CI jobs move 9.4.1 -> 9.5.0 (the AAR/lib-only jobs stay on their older Gradle). JDK floor stays 17 (CI runs 21); max API stays 37 (compileSdk 37). The R8 RecordTag regression fix first shipped in 9.2.1 is carried forward by 9.3.0. Docs (README, CLAUDE.md) updated to match. Validated only against Android's official AGP<->Gradle compatibility table; the isMinifyEnabled release/R8 path is validated by CI, which has the Android SDK a local sandbox lacks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MeheJtyQwUzJGLcYpyWURD
Bumps the pinned llama.cpp release across the four canonical files (CMakeLists.txt GIT_TAG + LLAMA_TAG, README badge, CLAUDE.md, and the LlamaCppVersion.LLAMA_CPP_VERSION Java constant) and refreshes patches/. Patch refresh (b10154 added upstream MCP-server support): - 0001: one common/arg.h hunk drifted (b10154 inserted common_print_available_devices() beside common_params_parse); the other 36 files applied unchanged. Regenerated against b10154. - 0007: reworked. b10154 moved the resumable-streaming routes (/v1/stream/:conv_id -> /v1/stream) into the middle of the route/CORS/tools block and coupled tools/CORS to a new server_mcp mcp_mgr lifecycle (2-arg tools.setup), so the old contiguous 'route-table + CORS-proxy + tools' extraction is no longer possible. The shared helper llama_server_register_common_routes() is narrowed to the pure core route table (health..slots); llama_server() keeps the streaming/GCP/CORS/MCP/tools blocks inline, byte-identical to upstream b10154. llama_server_attach() registers the route table + non-router streaming on the new /v1/stream paths + GCP compat + 403 stubs for the experimental /cors-proxy + /tools endpoints it does not wire. - 0002/0003/0006/0008 apply unchanged. No project source change needed. Verified in-sandbox: all 6 patches apply clean in order against a fresh b10154 checkout; cmake configure passes (fail-loud patch applier + OuteTTS generator anchors hold); full jllama shared-library build compiles and links at -O3; all 485 C++ unit tests pass. Appends the b10107-b10154 row to the breaking-changes history. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MeheJtyQwUzJGLcYpyWURD
bernardladenthin
had a problem deploying
to
maven-central
July 27, 2026 19:47 — with
GitHub Actions
Failure
bernardladenthin
had a problem deploying
to
startgate
July 27, 2026 19:47 — with
GitHub Actions
Error
bernardladenthin
had a problem deploying
to
maven-central
July 27, 2026 19:47 — with
GitHub Actions
Failure
bernardladenthin
deleted the
claude/dependency-plugin-updates-audit-lcubyh
branch
July 27, 2026 19:48
|
6 tasks
vaiju1981
pushed a commit
to vaiju1981/java-llama.cpp
that referenced
this pull request
Jul 29, 2026
… old glibc The b10154 upgrade (PR bernardladenthin#364) broke the Publish pipeline on 6 native jobs. Two independent root causes, both from upstream's new MCP-server support: 1. Undefined server_mcp symbols (macOS + all Windows jobs; latent on Linux). b10154 added tools/server/server-mcp.cpp, and server.cpp (llama_server's mcp_mgr lifecycle) + server-tools.cpp (tools.setup(..., mcp_mgr) / server_mcp::call_tool) — both already compiled into jllama — now reference server_mcp. server-mcp.cpp was missing from the CMake target_sources, so the link failed with undefined server_mcp::{start,shutdown,call_tool,list_tools, ~server_mcp}. A Linux .so tolerates undefined symbols (why the local build and Linux CI 'passed'); macOS/ld64 and Windows/MSVC hard-error. Add server-mcp.cpp to the non-Android jllama block (shares the subprocess.h posix_spawn Android guard). Not added to jllama_test (links neither server.cpp nor server-tools.cpp). Verified: nm now shows server_mcp::* as defined (T), and jllama links. 2. posix_spawn_file_actions_addchdir_np undeclared on manylinux2014 (glibc 2.17). b10154's vendored subprocess.h calls addchdir_np (glibc >= 2.29 / bionic API >= 34 / macOS >= 10.15) but guards it only for macOS. Add patch 0009 with a SUBPROCESS_HAVE_ADDCHDIR_NP probe (__GLIBC_PREREQ, nested under defined(__GLIBC__)) that falls back to ENOSYS on old glibc — this build never spawns with a cwd. Android already compiles it (weak-symbol macro). Also: /utf-8 for MSVC (C4566). server-tools.cpp embeds a U+2192 arrow in a narrow literal; MSVC/clang-cl warn C4566 and mangle it under code page 1252. Scope /utf-8 to jllama (gated on MSVC) — the documented C4566 fix. Verified locally: all 9 patches apply clean against b10154; cmake configure (fail-loud patch applier + TTS generator) passes; full jllama build links. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MeheJtyQwUzJGLcYpyWURD
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
llama_server()to extract a sharedllama_server_register_common_routes()helper that registers stable, state-independent routes (health, models, slots, etc.)llama_server_attach()entry point for embedded/JNI callers to attach the HTTP frontend to an already-loadedserver_context, enabling full route table + WebUI assets + resumable streaming without re-loading the modelDetails
Route registration refactor:
The new
llama_server_register_common_routes()extracts the core endpoint set (health, models, slots, etc.) that is identical between the standalone server and embedded attach mode. Experimental features (CORS proxy, built-in tools, MCP) remain wired per entry point since they depend on router state and lifecycle management that the shared helper does not carry. This prevents drift between the two entry points on the stable route set.New
llama_server_attach()entry point:Allows embedding callers (e.g., JNI/Java) to attach a full HTTP frontend to an already-loaded
server_contextwithout re-initializing the model or backend. The caller's worker thread continues driving the context; HTTP routes post tasks to its queue. Supports resumable streaming, WebUI assets, and all stable routes. Experimental features (CORS proxy, built-in tools) answer 403 "disabled" to match a stock server built without those features.Windows JNI regression fix (patch 0001):
Carries upstream llama.cpp changes to fix a Windows regression where
common_params_parseunconditionally re-derived argv from the process command line, clobbering embedded caller args. The fix introducescommon_params_parse_main()for standalone tools and guardscommon_params_parse()to honor caller-supplied argv. All ~34 standalone call sites flip to the new wrapper; embedded callers (jllama.cpp) keep callingcommon_params_parsedirectly and are never overridden.Test plan
test-arg-parser.cpp)llama_server()llama_server_attach()is new code; integration tested via JNI layer in downstream jllama buildsRelated issues / PRs
Upstream llama.cpp b10154 release; carries PR #22393 (slot_prompt_similarity getter/setter) and Windows arg-parse regression fix.
Checklist
CONTRIBUTING.mdandCODE_OF_CONDUCT.mdhttps://claude.ai/code/session_01MeheJtyQwUzJGLcYpyWURD