Overview
llama.cpp 0.4.0 adds initial Qwen3.8-Flash-Next and Nemotron-3-Puzzle support, on-demand tensor reading, per-slot server context limits, video input options, and a ggml update to 0.23.0 with major sparse flash attention and RDMA work.
API changes
- Added
llama_lazy_modeandlazy_mode(#27794). - Added
max_buf_sizeto quantize params (#27795). - Bumped session/state versions for KV-cell token tracking (#27762).
- Added
mtmd_input_partandmtmd_tokenize_from_parts()(#28250). - Made
mtmd_tokenizeconst-correct (#28310). - Made
mtmd_bitmap_init_lazyconst-correct (#28307). - Added mtmd helper video/init options (#24318).
- Server multimodal helpers accept
mtmd_helper_init_opt(#24318).
New models
- Added initial Qwen3.8-Flash-Next (
qwen4exp) architecture support; optimization improvements are still pending (#27742). - Added NVIDIA Nemotron-3-Puzzle-75B-A9B support (#25444).
- Added DSpark support for Nemotron 3.5 (#27804).
- Added support for nanbeige4.2-3B (#27730).
Core changes
- Added lazy tensor reading (#27794).
- Renamed option to
--lazy-mode(#27969). - Added
--n-cpu-ffn(#26622). - Added per-layer expert routing/FFN (#28323).
- Added KV-cell token tracking (#27762).
- Added n-gram history lookup (#28040).
- Optimized KV cache restore (#27991).
- Stopped early sequence scans (#28011).
- Added quantizer RAM cap (#27795).
- Added quantizer row-slab streaming (#27830).
- Prevented RAM peaking during load (#27483).
- Autoscaled YaRN training context (#28030).
- Disabled non-fused GDN/LID (#27877).
- Simplified MiniMax-01 graph (#27790).
- Added DFlash2 support (#27816).
- Fused DFlash encoder into KV injection (#27310).
- Added sparse flash attention for DeepSeek-V4/GLM and Qwen4exp (#27970).
- Added Apple RDMA as an RPC transport (#26421).
- Added RPC event/async backend APIs (#18626).
- Fixed Qwen4exp graph issues (#27941).
- Added Qwen4exp recurrent rollback (#28123).
- Summed Qwen4exp indexer heads (#28023).
- Reduced Qwen4exp graph splits (#27880).
- Fixed DeepSeek-V4 input vision (#28154).
- Fixed Gemma-4 vision handling (#28335).
- Fixed Gemma-4 assistant (#28183).
- Added synthetic spec acceptance options (#27711).
- Made build info stream configurable (#28322).
- Fixed JSON-schema empty object grammar (#28279).
Multi-modality changes
- Added
mtmd_tokenize_from_parts()(#28250). - Added DeepSeek-V4-Flash-Vision-Exp (#28133).
- Added DeepSeek-V4 input vision handling (#28154).
- Fixed Gemma-4 vision handling (#28335).
- Fixed Idefics3 preprocessing (#28273).
- Fixed Qwen3-TTS (#28231).
- Added video parameters/
--video-*(#24318). - Made image preprocessors const-correct (#28310).
- Made audio preprocessors const-correct (#28307).
Server changes
- Added per-slot context limit (#24124).
- Accept
data:URLs for media (#27735). - Enabled
preserve_reasoningby default (#28174). - Reject prefilled assistant tool calls (#27626).
- Added synthetic spec acceptance options (#27711).
- Added pytest-xdist server tests (#28298).
UI changes
- Improved Chat Form Actions UI/UX (#27746).
- Replaced MCP overrides with tool policy (#27745).
- Moved Settings/MCP routes to dialogs (#27744).
- Updated dialog styling (#27743).
- Copy grouped agentic response text (#27832).
- Updated ESLint config (#27700).
- Updated package scripts (#28270).
ggml changes
- Bumped ggml from v0.22.0 to v0.23.0 (release).
Version 0.23.0 adds new operators and backend scheduling APIs for sparse attention, asynchronous execution, and allocation-dependency tracking. The most notable additions are sparse flash attention (ggml_flash_attn_ext_set_n_kv_max), RPC event/async APIs, and Apple RDMA transport support. It also includes broad correctness and performance work across CPU, GPU, and accelerator backends.
Assets
Nightly build: b10809
More info
Changelog since v0.3.0
5266f24 llama.cpp : bump version to 0.4.0 (#28386)
64a155d sync : ggml (#28379)
163a407 model, mtmd: fix gemma4 vision handling (#28335)
8f83678 metal : add remaining fa-vec tunings for M3 Max (#28373)
86b351f ggml : replace compile definitions with version.h.in (#28364)
d509cb1 Don't use npx inside a package.json script (#28270)
4cbe8b0 ggml : don't crash when backend search path can't be read (#28271)
24f5bf8 ggml : remove GGML_CUDA_PEER_MAX_BATCH_SIZE (#28177)
a529af9 docs : update maintainer PRs link and regenerate AUTHORS (#28365)
38521ec vendor: update BoringSSL to 0.20260903.0 (#28354)
0ef4d56 ci : disable failing openvino tests (#28347)
c390d0a common : make build info output stream configurable (#28322)
832fd6f ggml-cpu(s390x) : fix q5_1 uninitialized v_acc (#28332)
9a4843c src : add n_expert_used_max function (#28323)
6703d78 sycl: fuse rms_norm+mul+add and add+add residual chains (#27610)
f9f09f0 SYCL: Refactor GGML_SYCL_ENABLE_MKL_FA to global var (#26863)
d230ddd llama: fix whole source code rebuilt on each new commit (#28278)
c5a5535 common/json-schema : fix GBNF grammar generation for empty object schemas (#28279)
95ef7fc opencl: quant lm_head / decode GEMV and medium-batch GEMM optimizations (speculative decoding/MTP) (#26477)
8c1a251 tune MMVQ to MMQ crossover for SM87 (#28285)
d30500b snapdragon: ci updates to use new run script (#28293)
e107984 ops: add Hexagon to ops.md and update main README.md (#28263)
42f0225 server : use pytest-xdist for server tests (#28298)
de8656b mtmd: propagate const to preproc class (#28310)
7bb0fc1 metal : add sparse FA (#28098)
0df017d metal : fix glu dispatch with ne00 = 1 (#28306)
f45576a mtmd : add const in various places (#28307)
0ba6499 CUDA: Allow concurrent streams per split for multi-GPU (#28198)
c7bda03 vulkan: fix FA dequant path engagement (#28190)
0df974d sycl : enhance the api to support peer-to-peer copy (#27550)
d646c9d convert : skip bias_vl tensor in DeepSeek-V4 DSpark conversion (#28294)
5ec4eab misc : prevent RAM peaking at model loading stage (#27483)
4aa6ffb sycl: reduce redundant work in Q4_K multi-column MMVQ (#27062)
c61b98b model: add NVIDIA Nemotron-3-Puzzle-75B-A9B (NemotronHPuzzle) support (#25444)
67a17c1 mtmd: fix idefics3 preproc (#28273)
159b741 finetune: fix no KV cache (#27199)
9cffdcc server : accept data: URLs for input_video and input_audio (#27735)
f027c4f ggml-hexagon: add F16 support for unary ops (#28228)
7339054 mtmd: add mtmd_tokenize_from_parts() (#28250)
9cc3394 metal : add fa-vec tunings for M3 (#28236)
8c0b9cd metal : fix memory query under low-memory conditions (#27701)
03dbcc5 ci : check for missing autoreleasepools (#27884)
cff1844 Update ROCm to 10.0.0 release (#27803)
9400c89 model: correctly support input vision for deepseek4 (#28154)
d5fec32 ci : enable hf-jobs on server-cuda (#28258)
3d3d7c8 ggml-cuda : remove unused vars (#28235)
e750b88 common, server : enable preserve_reasoning kwarg by default, log its effective state (#28174)
7798007 mtmd: support DeepSeek-V4-Flash-Vision-Exp (#28133)
8e93a97 CUDA + ggml: add sparse-fa for DSV4/GLM (#27970)
0f3a71b mtmd: Fix Qwen3-tts-0.6b (#28231)
b81c99b ggml: avoid KleidiAI buffer type init on dispatch (#27891)
960dffa hexagon: MUL_MAT and MUL_MAT_ID fusion and fixes (#28202)
ba8818c vulkan: handle larger batch sizes (>4) efficiently for IQ3_S mat-vec (#27449)
56dd815 vulkan : only request VK_KHR_shader_bfloat16 extension if supported (#28155)
2637dfe ggml-cpu : conditionally add SpacemiT IME kernel sources (#27961)
43d87ff opencl: fix outβofβbound reads in the Adreno image kernels (#27632)
69320fe hexagon: add missing FARF logs for cpy/get_rows/set_rows/gdn ops (#28217)
b96806d metal : add metallib build support for xcframework (#28163)
3466812 cuda: fuse MoE weighted expert reduction (#25952)
b356fa2 kv-cells: look up the n-gram history in the sequence position index (#28040)
dfc29b6 context : autoscale n_ctx_train when yarn scaling specified (#28030)
f28493c models : appropriately flag noscan ssm_a tensors (#28121)
73159c3 model : fix gemma4-assistant (#28183)
d11b3cc model : load relevant arrays with n_layer_all (#28173)
c845263 Revert "sycl : add Kronecker product FWHT support for sizes 384, 640, 768, 12β¦" (#28184)
1f3d318 sycl : add Kronecker product FWHT support for sizes 384, 640, 768, 1280 (#28016)
8887a48 metal : add fa-vec tuning for M2 Pro (#28122)
be789c3 metal : add fa-vec tunings for A18 Pro (MacBook Neo) (#28152)
9d81721 model : load hparams.n_layer_nextn before n_layer() calls (#28159)
fe2120b metal : fix more leaks due to missing autoreleasepools (#27883)
d08c787 metal : add fa-vec tuning for M2 Max (#28015)
5eec3ad sycl : support limit max alloc memory within 2GB for host-pinned memory (#27559)
36b1015 qwen4exp: fix seq_cp, block position keying, mtmd input, cuda abort, add tests (#27941)
d086dbb tests : fix log verbosity for test-llama-archs (#28147)
1b89a43 quantize: row-slab stream to avoid thread starvation (#27830)
d5d993a metal: enable Metal 4.0 tensor API on M5+/A19+ (#27461)
234a6eb ci: Bump ggml-org/ccache-action to v1.2.24 (#28083)
518b762 kleidiai : Update KleidiAI Documentation (#26078)
0eadefe qwen4exp: support recurrent state rollback (#28123)
09412af qwen4exp: sum the indexer heads by slices (#28023)
458681e metal : add fa-vec tunings for M1 Ultra (#28088)
e4b9af0 CUDA: XOR swizzle flash attn K,V smem fp16 tiles (#25635)
ab0b3bd metal : add concat support for quantized types (#28116)
85c5522 AVX2: Speed up large batch size prompt processing of IQ models (#27402)
2a74817 metal : add top-k radix implementation (#28073)
2d8d612 kv-cache : optimize restoring non-contiguous cells (#27991)
010be96 opencl: tune the quant paths for Intel Xe-LP GPUs to improve its TG and PP performance (#26438)
774ee0e ui: copy the displayed text of grouped agentic responses (#27832)
8e53fce webgpu : avoid crash when offset is not multiple of 4 in WebGPU ggml_backend_tensor_get() implementation (#28045)
f8dbcd6 ROCm: add radix TOP_K for long rows (#27466)
5d4a3be metal : add fa-vec tunings for M1 (#28078)
41ef91f CUDA: extend MOE fusion to specdec, earlier MOE glu fusion and topk-router fusion were restricted to 1 token (#27621)
a32af33 sycl : Enhance to get the free memory of Intel GPU (#27968)
580e88d ci : add check for unzip (#28082)
662a0b0 spec : fuse the DFlash encoder into the KV cache injection (#27310)
2cdae80 vulkan: tune mat-vec rows for batched inference on Strix Halo (#27909)
557614e ggml : add MUL_MAT to the list of ops that may need additional memory (for WebGPU) (#28071)
daef7b6 vulkan: top_k radix select for k >= 1024 for Qwen 3.8 Flash Next (#28032)
9723942 hexagon: fix CPY fence bug (#28033)
bd55e6a metal : add remaining Q4_1/Q5_0/Q5_1 fa-vec tunings for M2 (#28017)
a7cc83b rpc: avoid serializing buffers from other servers (#26500)
6d1479c ggml : fix ggml_backend_buft_get_alloc_size() guard (#28038)
62acc89 kv-cells: stop the sequence scan once all sequences are seen (#28011)
0190529 ggml: add SWIGLU_CLAMP (#27930)
2578138 llama: improve TENSOR_READ_LAZY handling (#27837)
f1793c1 CUDA: use the fast mm_ids_helper path for any n_expert_used (#27978)
0b5be7e hip: tune rdna 3 mmq config (#26284)
e422148 hip : optimize Q2_0 dot-product path for gfx1201 (#26753)
cc231cb dflash: pass missing NVFP4 scales to attention operations (#28000)
bebc935 common: rename --tensor-read-lazy to --lazy-mode, add -lzm shorthand (#27969)
73f56d1 ggml : add ggml_backend_op_alloc_size_may_expand, use it in RPC (#27960)
742347b rpc: fix apple rdma error spew on teardown (#27908)
093adb2 metal: add fa-vec tunings for M3 Ultra (#27999)
b8b743c metal : Add fa-vec tuning for M3 Pro (#27963)
dc7aecf vendor : update cpp-httplib to 0.54.0 (#27919)
2bf0415 rpc : fix pre-rdma macOS versions (#27815)
9e54e68 hexagon: support for device discovery and create sessions on demand (#27785)
370cb12 sycl: split long rows in TOP_K instead of one work-group per row (#27847)
d882575 metal : fix null-pipeline crash for F16 src1 mul_mat/mul_mat_id (#25648)
bdf3955 memory : copy Hadamard matrix to k_rot tensor only if it has buffer assigned to prevent crashes during context shift of unquantized K cache (#27967)
57291f2 ggml: allow passing alloc dependencies in graph_optimize (#27301)
c589f0e metal : add fa-vec tunings for M2 (#27940)
c841aee opencl: use a better matmul path on two Adreno GPU generations (#27640)
3173a56 metal : assert shared memory padding (#27951)
17252c7 metal : add remaining fa-vec tunings for M4 Pro (#27915)
cc83d7b sycl: make --fit respect --fit-target better (#27629)
c9ca51c vulkan: combine duplicated fastdiv functions, rename the one optimizing small divs (#27526)
5ea1b12 metal : add fa-vec tunings for M1 Max (#27932)
77f132c vulkan: Change mul_mat_id to pad K rather than N (#27925)
d7bd3bf snapdragon: python SDK setup (Windows) (#27903)
50f068f bench: add --tensor-read-lazy (#27881)
6fe7498 model: qwen4exp: reduce number of graph splits (#27880)
b387ddf vulkan: fix missing view-alias dependencies in ggml_vk_graph_optimize (#27812)
a43c398 ggml : fix conv_transpose_2d for multiple batches (#26132)
90c26fc Vulkan: add hoisting support for row IDs and expert count in shaders (#26686)
8663224 context : disable non-fused GDN and LID ops (#27877)
f5e85d4 metal : add fa-vec tunings for M4 (#27875)
511f9c1 OpenVINO: Update OV to 2026.3.1, whisper.cpp support, Qwen3.5 on NPU, and new ops (#27843)
b19cbe9 convert: prevent ndarray conversion in LazyChunkedTensor (#27869)
d077b4c sycl: use TILE for quantized KV decode on BMG (#26689)
be87620 sycl: bind the f16 KV cache in place for the oneDNN SDPA path (#27468)
8963a9b metal : add fa-vec tunings for M3 Max, M5 and M5 Pro (#27863)
6d6b697 metal : add fa-vec tunings for M4 Pro (#27824)
4e97ac8 tests : run test-save-load-state across all architectures (#27755)
ca3d5a3 model: add DSpark support for Nemotron3.5 (#27804)
e70802a ggml-hexagon: add HTP unary ops for ABS and LOG (#27786)
83d855c hex-unary: fix RMS_NORM_MUL weight-offset bugs for grouped/broadcast norms (#27798)
1844325 server: add ctx-per-slot (--kv-unified-per-slot) (#24124)
3217633 ci : build only the ggml-hip backend for windows-rocm release (#27753)
6c84c7d model: add Qwen3.8-Flash-Next (qwen4exp) (#27742)
6fdd0ac ci : bundle HIP runtime DLLs with Windows ROCm release (#26973)
b10f9ca spec : add DFlash2 support (local convolution + candidate selector) (#27342) (#27816)
5854625 opencl: add bin kernels kernel_gemm_moe_q4_0_q8_1_dp4a_bin, kernel_gemm_moe_mxfp4_q8_1_dp4a_bin (#27768)
732707d quantize: cap working memory size to avoid loading big tensors onto RAM (#27795)
cb30059 Feature: Added LIGHTNING_INDEXER support for Deepseek V4 ops on Vulkan Backend (#27453)
1a946ec pr2wt : use ssh/https remote in worktree depending on base (#27800)
fac889f llama: model_loader: add TENSOR_READ_LAZY (#27794)
cae6357 ui: Improve Chat Form Actions UI/UX (models selector, add panel) (#27746)
bcb6084 convert : fix Nemotron-H LoRA GGUF conversion (#27356)
fe235f4 ui: Replace per-conversation MCP overrides with per-conversation tool policy (#27745)
2bb9bdd spec: Add benchmark-only synthetic speculative acceptance options (#27711)
deae5ee model : simplify MiniMax-01 graph (#27790)
f295512 args: add --video-* CLI arguments (#24318)
915dc6d metal : fix memory leaks due to missing autoreleasepools (#27758)
c5fc7e3 llama : add --n-cpu-ffn option (#26622)
d7a2074 models : support nanbeige4.2-3B (#27730)
192067b hexagon: support for multi-NPU devices (IQ9, IQ10) and fully asynchronous backend (#26501)
925e117 llama: add token ID tracking to KV cell (#27762)
539f245 ui: Move Settings and MCP Servers routes to dialog-based views (#27744)
0379a19 ui: Update Dialog component styling (#27743)
5e6a37c vulkan: warptiles currently assume warp sizes <= 64, clamp to work around larger warps (#27726)
bf94216 Implemented vulkan cross_entropy_loss and cross_entropy_loss_back (#27216)
d0132a6 rpc : implement event and async backend APIs (#18626)
4d19b28 ci: Clean up UI builds from releases (#27706)
fc35562 cuda: unblock mmq for MoE on sm_60 (#26264)
da9b5d6 ci : make cache bucket public (#27728)
dac869b conversion : fix Nemotron 3.5 Lightning layers (#27729)
11cd988 ggml-metal: add chunked SSD MMA for Mamba-2 prefill optimization (#26647)
5d5cb4c ggml-meta: propagate buffer usage and call init on the new tensors (#27586)
d222767 kleidiai: Rework KleidiAI Build System/Integration (#26077)
eab8ee4 ci : update OS used for ROCM to Ubuntu 24.04 (#27681)
b114b47 rpc: support apple RDMA as an RPC transport (#26421)
0a5ac49 devops: use GGML_NATIVE=OFF for OpenVINO (#27338)
1729ed5 server : reject prefilled assistant messages with tool calls (#27626)
0cc5b14 chat : scope qwen3-coder workarounds (#27679)
790b571 ci : store ccache on HF buckets (test with cuda-ubuntu for now) (#27699)
f1357e4 ui: ESLint config updates (#27700)
3737e41 metal : null-check buffer alloc to fix OOM crash (#25371)