From 906afdd98c2b7f79cb0fd2cc9d67caebb873a66c Mon Sep 17 00:00:00 2001 From: Laurent-Philippe Albou Date: Sun, 1 Nov 2026 14:37:36 +0100 Subject: [PATCH] feat: update llama.cpp to b12032 (dde879bc4) - vendor/llama.cpp: 0c1e57098 -> dde879bc4 (tag b12032) - llama_context_params: add the new moe_cache_size (size_t) field after type_v; without it the struct is one word short and every field after type_v (abort_callback, embeddings, kv_unified, samplers, ...) is read at the wrong offset by llama_context_default_params / llama_init_from_model - llama_perf_context_data: add n_reallocs_same / n_reallocs_diff No other llama.h API change between the two commits (the declared LLAMA_API functions are identical). Brings the decision-model support merged in ggml-org/llama.cpp#29818 (.decision.* metadata, projected embeddings output for kev/laya) to the Python bindings. --- llama_cpp/llama_cpp.py | 7 +++++++ vendor/llama.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/llama_cpp/llama_cpp.py b/llama_cpp/llama_cpp.py index 94e5aede3..ac00bfb00 100644 --- a/llama_cpp/llama_cpp.py +++ b/llama_cpp/llama_cpp.py @@ -971,6 +971,8 @@ class llama_sampler_seq_config(ctypes.Structure): # enum ggml_type type_k; // data type for K cache [EXPERIMENTAL] # enum ggml_type type_v; // data type for V cache [EXPERIMENTAL] +# +# size_t moe_cache_size; // device cache in bytes for the experts kept in host memory, split among the devices like the layers, 0 = disabled [EXPERIMENTAL] # // Abort callback # // if it returns true, execution of llama_decode() will be aborted @@ -1027,6 +1029,7 @@ class llama_context_params(ctypes.Structure): cb_eval_user_data (ctypes.ctypes.c_void_p): user data for cb_eval type_k (int): data type for K cache type_v (int): data type for V cache + moe_cache_size (int): device cache in bytes for the experts kept in host memory, 0 = disabled abort_callback (ggml_abort_callback): abort callback if it returns true, execution of llama_decode() will be aborted abort_callback_data (ctypes.ctypes.c_void_p): data for abort_callback embeddings (bool): if true, extract embeddings (together with logits) @@ -1067,6 +1070,7 @@ class llama_context_params(ctypes.Structure): cb_eval_user_data: ctypes.c_void_p type_k: int type_v: int + moe_cache_size: int abort_callback: Callable[[ctypes.c_void_p], bool] abort_callback_data: ctypes.c_void_p embeddings: bool @@ -1106,6 +1110,7 @@ class llama_context_params(ctypes.Structure): ("cb_eval_user_data", ctypes.c_void_p), ("type_k", ctypes.c_int), ("type_v", ctypes.c_int), + ("moe_cache_size", ctypes.c_size_t), ("abort_callback", ggml_abort_callback), ("abort_callback_data", ctypes.c_void_p), ("embeddings", ctypes.c_bool), @@ -5248,6 +5253,8 @@ class llama_perf_context_data(ctypes.Structure): ("n_p_eval", ctypes.c_int32), ("n_eval", ctypes.c_int32), ("n_reused", ctypes.c_int32), + ("n_reallocs_same", ctypes.c_int32), + ("n_reallocs_diff", ctypes.c_int32), ] diff --git a/vendor/llama.cpp b/vendor/llama.cpp index 0c1e57098..dde879bc4 160000 --- a/vendor/llama.cpp +++ b/vendor/llama.cpp @@ -1 +1 @@ -Subproject commit 0c1e57098bba43ac29e6e3b677cdceebdd22334f +Subproject commit dde879bc4f954b809892fd0d660515f42536394a