Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

Java bindings for [llama.cpp](https://github.com/ggerganov/llama.cpp) via JNI, providing a high-level API for LLM inference in Java. The Java layer communicates with a native C++ library through JNI.

Current llama.cpp pinned version: **b10423**
Current llama.cpp pinned version: **b10456**

## Upgrading CUDA Version

Expand Down Expand Up @@ -490,7 +490,7 @@ needs no extra step here, `build-webui` re-reads the tag and rebuilds the matchi
ships no UI):
```bash
# needs node/npm + network; embed.cpp is plain C++17 (no npm)
git clone --depth 1 --branch b10423 https://github.com/ggml-org/llama.cpp /tmp/lc
git clone --depth 1 --branch b10456 https://github.com/ggml-org/llama.cpp /tmp/lc
( cd /tmp/lc/tools/ui && npm ci && npm run build \
&& ( cd dist && find . -type f -not -path './_gzip/*' \
| while read -r f; do mkdir -p "_gzip/$(dirname "$f")"; gzip -9 -c "$f" > "_gzip/$f"; done ) \
Expand Down Expand Up @@ -530,7 +530,7 @@ cache lives in **Depot Cache** over sccache's **WebDAV** backend:
- `SCCACHE_WEBDAV_TOKEN: ${{ secrets.DEPOT_TOKEN }}` — a Depot **organization** token, stored
as the repo secret **`DEPOT_TOKEN`**.

Because `sccache` is **content-addressed** and llama.cpp is pinned (`GIT_TAG b10423`), the
Because `sccache` is **content-addressed** and llama.cpp is pinned (`GIT_TAG b10456`), the
~280 upstream object files are byte-identical every run, so a warm cache recompiles only the
*changed* files. Depot's cache is **shared across all branches** (unlike GitHub's
per-branch `actions/cache`), so every branch builds incrementally; a `b<nnnn>` version bump
Expand Down Expand Up @@ -1357,7 +1357,7 @@ ctest --test-dir build --output-on-failure -R "ResultsToJson"

#### Upstream source location (in CMake build tree)

llama.cpp is fetched via CMake FetchContent, pinned to `GIT_TAG b10423`.
llama.cpp is fetched via CMake FetchContent, pinned to `GIT_TAG b10456`.

**GoogleTest** is a separate `BUILD_TESTING`-only FetchContent (`GIT_TAG v1.17.0`), used solely
by the `jllama_test` C++ unit-test binary — not by the shipped library, and not coupled to the
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
**Build:**
![Java 8+](https://img.shields.io/badge/Java-8%2B-informational)
![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20macOS%20%7C%20Windows%20%7C%20Android-lightgrey)
[![llama.cpp b10423](https://img.shields.io/badge/llama.cpp-%23b10423-informational)](https://github.com/ggml-org/llama.cpp/releases/tag/b10423)
[![llama.cpp b10456](https://img.shields.io/badge/llama.cpp-%23b10456-informational)](https://github.com/ggml-org/llama.cpp/releases/tag/b10456)
[![JPMS](https://img.shields.io/badge/JPMS-modular%20JAR-25A162)](https://openjdk.org/projects/jigsaw/)
![JUnit](https://img.shields.io/badge/tested%20with-JUnit6-25A162)
[![JSpecify](https://img.shields.io/badge/JSpecify-1.0.0%20%40NullMarked-25A162)](https://jspecify.dev)
Expand Down
9 changes: 9 additions & 0 deletions docs/history/llama-cpp-breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -610,3 +610,12 @@ Used during `llama.cpp` version bumps: when upgrading, scan this file from the r
| b10418–b10419 | `ggml/src/ggml-openvino/**` (**Qwen3.5 support, memory optimization, new ops, #26952**) | **No project-source change.** A single commit entirely inside the OpenVINO backend; no shared header touched, so only the `openvino-{linux,windows}-x86-64` classifier's compiled sources change. |
| b10419–b10423 | `common/{common.h,common.cpp}` + `tools/completion/completion.cpp` (**shared CPU-parameter handling, #27026 — new `common_threadpools` RAII helper, `ggml_threadpool_params_from_cpu_params()` moved next to it**), `tools/ui/**` | **No project-source change (final step).** `ggml_threadpool_params_from_cpu_params()` moved within `common.h` but kept its signature; confirmed via grep that no project source mentions `threadpool` at all. |
| b10360–b10423 | upstream verification (sandbox, final target) | All **6** patches re-verified against a clean b10423 checkout: sequential `git apply` (filename order, mirroring the `PATCH_COMMAND` applier) succeeded at **every** intermediate tag of the walk, and the fail-loud `PATCH_COMMAND` ran clean on a fresh `cmake -B build` at the target — no patch needed refreshing across the whole range. **Full local verification (mandatory for the final target):** fresh configure + full `cmake --build` (`libjllama.so` + `jllama_test` compile and link, `-O3`, no undefined references) + `ctest` **485/485 passing**. Walk of 10 steps (b10360→b10362→b10369→b10375→b10380→b10398→b10405→b10408→b10418→b10419→b10423) on branch `claude/update-b10423-ciih0h`. Four steps exceeded the 100 KiB chunking threshold unavoidably — upstream has **no** intermediate tags there (b10363–b10368, b10381–b10397, b10406–b10407 and b10420–b10422 do not exist), so the tag list itself, not the threshold, bounded the step size. |
| b10423–b10430 | `tools/server/server-queue.{h,cpp}` + `tools/server/server-context.cpp` (**`/metrics` and `/slots` served during `llama_decode()`, #27041 — new `server_queue::yield_to_queue()` worker thread, and `on_new_task`'s callback type changed from `std::function<void(server_task &&)>` to `std::function<bool(server_task &&, bool)>`**), `src/llama.cpp` (**virtual iGPU devices, #26953**), `ggml/src/ggml-sycl/**`, `ggml/src/ggml-cpu/ggml-cpu.c` (**single thread on WASI, #25686**) | **No project-source change.** `on_new_task`'s signature change is the only breaking edit in a header the project compiles, and it is inert here: `server-context.cpp` (compiled in from upstream) is the sole registrant — confirmed via grep that no project source mentions `on_new_task`, `server_queue`, `queue_tasks` or `yield_to_queue`. First step of the b10423→b10456 walk. |
| b10430–b10436 | `common/arg.cpp` (**additive `--reasoning-effort` / `LLAMA_ARG_REASONING_EFFORT`, plus a negative-value guard on `--spec-draft-n-max`**), `common/chat.cpp` + `common/jinja/{caps,runtime,string}.{h,cpp}` (**`reasoning_effort` passed to the chat template; quadratic-cost fix in `gather_string_parts`, #27034**), `tools/server/server-common.cpp` (**`oaicompat_chat_params_parse` now forwards a non-`"none"` `reasoning_effort` into `chat_template_kwargs` instead of ignoring it**), `tools/mtmd/{clip.cpp,clip-impl.h,mtmd-image.cpp,mtmd-helper-common.h}` (**various fixes, #27071 — `decode_embd_batch` index arithmetic widened to `size_t`**), `ggml/include/ggml.h` (**`ggml_ssm_scan()` gained a trailing `int64_t K` parameter, #26623**) | **No project-source change.** `ggml_ssm_scan` is a model-graph builder called only inside llama.cpp's own translation units (the project includes `ggml.h` for types, never this function); the `mtmd-helper-common.h` edits are `size_t` casts with no signature change; the `arg.cpp`/`chat.cpp`/`server-common.cpp` edits are additive or internal to upstream-compiled files. The `reasoning_effort` forwarding is behavioral, not API — worth noting because `test_utils.cpp` covers `oaicompat_chat_params_parse` (suite re-run green at the target). |
| b10436–b10441 | `tools/mtmd/{clip.cpp,clip-impl.h,mtmd-image.{h,cpp},mtmd.cpp,models/granite4-vision.cpp,models/models.h}` (**Granite4-Vision image sequence assembly fix, #26653 — internal `mtmd-image.h`/`models.h` helper signatures changed**), `src/{llama-arch,llama-hparams,llama-model,llama-context,llama-model-loader}.*` + `src/models/minimax-01.cpp` (**new MiniMaxText01/MiniMaxM1 architectures, #27018**), `ggml/src/ggml-vulkan/ggml-vulkan.cpp` (**Intel Xe coopmat1 gating fix**), `conversion/`, `docs/`, `scripts/` | **No project-source change.** The mtmd edits are confined to the library's *internal* headers (`clip-impl.h`, `mtmd-image.h`, `models/models.h`) — the two public headers the project includes, `mtmd.h` and `mtmd-helper.h`, are byte-identical across the whole b10423→b10456 range. New model architectures are entirely inside upstream-compiled `src/` translation units. |
| b10441–b10447 | `tools/server/server-queue.{h,cpp}` + `tools/server/server-context.cpp` (**`yield_to_queue` thread model re-designed, #27133 — follow-up to #27041 from the b10423→b10430 step**), `vendor/cpp-httplib/{httplib.h,httplib.cpp,CMakeLists.txt}` (**cpp-httplib 0.53.0 → 0.53.1, #27103: `CPPHTTPLIB_REGEX_ROUTE_PATH_MAX_LENGTH` stack-exhaustion guard + IPv6-literal URL parsing fix; BoringSSL pin 0.20260803.0 → 0.20260813.0, #27099**), `common/preset.cpp` (**`--models-dir` loads MTP assistant models, #24431**), `common/imatrix-loader.cpp` (**GGUF array-type check, #27075**), `tools/mtmd/clip.cpp`, `ggml/src/ggml-vulkan/**` | **No project-source change.** Same `server_queue` reasoning as the b10423→b10430 row (no project source touches that API). The vendored `httplib.cpp` **is** compiled into `jllama`, but the point release is source-compatible — the two behavioral fixes are internal to `parse_url`/regex-route dispatch, and the new macro has a default. The BoringSSL pin is inert here: `LLAMA_BUILD_BORINGSSL` is off and `CPPHTTPLIB_OPENSSL_SUPPORT` is never defined (plain-HTTP by design). |
| b10447–b10448 | `common/chat.cpp` (**new `common_chat_params_init_kimi_k3()` + a dispatch arm in `common_chat_try_specialized_template()`**), `src/{llama-arch,llama-graph,llama-hparams,llama-model,llama-model-saver,llama-context}.*` + `src/models/kimi-k3.cpp` + `models/templates/Kimi-K3.jinja`, `tests/test-chat.cpp` (**Kimi-K3 text model, #26185**) | **No project-source change.** A single-commit model addition: purely additive inside upstream-compiled translation units, and `common/chat.h` is unchanged (no new enum value or signature the project would have to switch on). Step forced above the 100 KiB threshold (114 KiB) — upstream has no tag between b10447 and b10448, so the tag list, not the threshold, bounded it. |
| b10448–b10454 | `common/chat.cpp` + `common/jinja/caps.cpp` (**`supports_string_content` / `supports_typed_content` handling refactored, #27130**), `src/llama-adapter.cpp` (**LoRA tensor data bounds-checked against the file, #27056**), `src/models/**` (**some `ggml_concat` removed, #27176**), `tools/ui/**` (**API-key masking, MCP `structuredContent`**) | **No project-source change.** The chat refactor stays inside `chat.cpp`/`caps.cpp` — `common/chat.h` and `common/jinja/caps.h` are unchanged, so nothing the project compiles against moved. The LoRA hardening is a defensive check inside upstream's adapter loader; `tools/ui` is auto-followed (CI rebuilds the Svelte WebUI from the pinned `GIT_TAG`). |
| b10454–b10455 | `ggml/src/ggml-sycl/{ggml-sycl.cpp,opt-step.cpp,opt-step.hpp}` (**SYCL `OPT_STEP_ADAMW` / `OPT_STEP_SGD`, #25268**), `docs/ops/SYCL.csv` + `docs/ops.md` + `examples/sycl/update-ops-doc.sh` (**regenerated op-support table**) | **No project-source change.** A single commit inside the SYCL backend, so only the `sycl-{fp16,fp32}-linux-x86-64` / `sycl-windows-x86-64` classifiers' compiled sources change. Step forced above the 100 KiB threshold (3.2 MiB) — but ~3.2 MiB of that is the regenerated `docs/ops/SYCL.csv` alone (20 646 lines rewritten); the reviewable code is ~150 lines, and upstream has no tag between b10454 and b10455 anyway. |
| b10455–b10456 | `ggml/src/ggml-sycl/cpy.cpp` (**thread/block count fixed in the quantized cpy kernel launches, #27160**) | **No project-source change (final step).** A single one-commit fix inside the SYCL backend; no shared header touched, so only the `sycl-{fp16,fp32}-linux-x86-64` / `sycl-windows-x86-64` classifiers' compiled sources change. |
| b10423–b10456 | upstream verification (sandbox, final target) | All **6** patches re-verified against a clean b10456 checkout: sequential `git apply` (filename order, mirroring the `PATCH_COMMAND` applier) succeeded at **every** intermediate tag of the walk, and the fail-loud `PATCH_COMMAND` ran clean on a fresh `cmake -B build` at the target — no patch needed refreshing across the whole range. **Full local verification (mandatory for the final target):** fresh configure (resolved `ggml commit f275595dd` = b10456 HEAD; all six patch markers confirmed present in the fetched tree) + full `cmake --build` (`libjllama.so` + `jllama_test` compile and link, `-O3`, no undefined references) + `ctest` **485/485 passing**. **API surface:** of the 22 upstream headers project source `#include`s directly, only three changed across the whole range — `tools/server/server-queue.h` (breaking: `on_new_task`'s callback type became `std::function<bool(server_task &&, bool)>`, plus the new `yield_to_queue()`; inert here, upstream's own `server-context.cpp` is the sole registrant), `ggml/include/ggml.h` (`ggml_ssm_scan()` gained a trailing `int64_t K`; called only inside llama.cpp's own TUs) and `tools/mtmd/mtmd-helper-common.h` (`size_t` widening, no signature change). `mtmd.h`, `mtmd-helper.h`, `common.h`, `chat.h`, `llama.h`, `arg.h` and every `tools/server/*.h` the project includes are byte-identical b10423→b10456; no files were added or removed under `tools/server`/`tools/mtmd`/`vendor` and no upstream `CMakeLists.txt` changed, so the b10154 `server-mcp.cpp` missing-`target_sources` failure class does not recur. Walk of 8 steps (b10423→b10430→b10436→b10441→b10447→b10448→b10454→b10455→b10456) on branch `claude/update-b10456-8a7j58`. Two steps exceeded the 100 KiB chunking threshold unavoidably — upstream has **no** intermediate tags there (b10449–b10453 and b10456 aside, nothing sits between b10447/b10448 or b10454/b10455) — and the 3.2 MiB b10454→b10455 figure is almost entirely the regenerated `docs/ops/SYCL.csv` (20 646 lines rewritten), leaving ~150 lines of reviewable code. |
2 changes: 1 addition & 1 deletion llama/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ set(LLAMA_BUILD_APP OFF CACHE BOOL "" FORCE)
FetchContent_Declare(
llama.cpp
GIT_REPOSITORY https://github.com/ggerganov/llama.cpp.git
GIT_TAG b10423
GIT_TAG b10456
PATCH_COMMAND ${CMAKE_COMMAND}
-DPATCH_DIR=${CMAKE_CURRENT_SOURCE_DIR}/patches
-DLLAMA_SRC=<SOURCE_DIR>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@
* library was compiled against, exposed as a compile-time constant so callers can render a badge or
* emit a startup log line without loading the native library.
*
* <p>{@link #LLAMA_CPP_VERSION} is a pure-Java string ({@code "b10423"}) that mirrors the
* <p>{@link #LLAMA_CPP_VERSION} is a pure-Java string ({@code "b10456"}) that mirrors the
* {@code GIT_TAG} in {@code llama/CMakeLists.txt}. It is available even when {@code libjllama} is
* absent (pure-Java checkout, before {@code System.load}), which is what makes it suitable for a
* lightweight version badge in Android or other UIs.</p>
*
* <p>For the <em>authoritative</em> value that is baked into the native binary — the build number
* plus the resolved upstream commit, e.g. {@code "b10423-<commit>"} — call
* plus the resolved upstream commit, e.g. {@code "b10456-<commit>"} — call
* {@link net.ladenthin.llama.LlamaModel#getLlamaCppBuildInfo()} instead; that reads llama.cpp's own
* {@code build-info} through JNI and therefore cannot drift from the compiled library (but requires
* the native library to be loaded).</p>
*/
public final class LlamaCppVersion {

/**
* The pinned llama.cpp release tag this library was built against, e.g. {@code "b10423"}.
* The pinned llama.cpp release tag this library was built against, e.g. {@code "b10456"}.
*
* <p>Kept in lockstep with {@code GIT_TAG} in {@code llama/CMakeLists.txt} — see the
* "Upgrading/Downgrading llama.cpp Version" checklist in {@code CLAUDE.md}. This is the
* compile-time pin; use {@link net.ladenthin.llama.LlamaModel#getLlamaCppBuildInfo()} for the
* value actually linked into the native binary.</p>
*/
public static final String LLAMA_CPP_VERSION = "b10423";
public static final String LLAMA_CPP_VERSION = "b10456";

// Constants holder — not instantiable.
private LlamaCppVersion() {}
Expand Down
Loading