[0.4.0] - 2026-07-01
Removed (breaking)
LlamaContextParams::with_flash_attention/flash_attention— usewith_flash_attn_type/flash_attn_typewithLlamaFlashAttnType.LlamaContextParams::with_defrag_thold/defrag_thold— upstream removed the field from active use; leave the C default (-1.0, disabled).CommonParams::defrag_thold.LlamaSampler::grammar_lazy— usegrammar_lazy_patterns.MtmdContext::audio_bitrate— useaudio_sample_rate.llama_cpp_4::params_fit— usellama_cpp_4::fit::fit_params.llama_cpp_4::model_quantize_default_params— useQuantizeParams::new.
Added
- llama.cpp: vendored submodule updated to
4fc4ec5(tagb9859). - Context params (
llama-cpp-4): flash attention, attention type,n_outputs_max,kv_unified,swa_full,op_offload,ctx_other, YaRN fields,no_perf, abort callback, per-sequence sampler configs, andLlamaPoolingType::Rank. - Context (
llama-cpp-4):memory_breakdown(), layer input embeddings,set_nextn_layer_offset(),ctx_other();TensorCaptureforcb_evalhooks. - Model (
llama-cpp-4):n_layer_nextn(),n_expert(),n_devices(),get_device()/LlamaBackendDevice,target_layer_ids(),devices()iterator. - Fit (
llama-cpp-4):fit::get_device_memory_datafor per-device memory estimates;fit::fit_paramssafe wrapper aroundcommon_fit_params. - Prelude (
llama-cpp-4):llama_cpp_4::preludere-exports common inference types; expanded re-exports. - mtmd (
llama-cpp-4):batch_max_tokens, flash attention, progress callback. - sys (
llama-cpp-sys-4):ext_shimfor structured memory breakdown and fit helpers. - Prebuilt download (
llama-cpp-sys-4):--features prebuiltdownloads matching GitHub release tarballs; falls back to local CMake when no asset exists. - Integration tests (
llama-cpp-4): GGUF end-to-end suite withscripts/fetch-test-model.shand CI job.
Changed
LlamaContextParams: split intoparams::{types,advanced}submodules; addedtry_clone().- READMEs: updated to crate
0.4.0and llama.cpp4fc4ec5(b9859); prelude-first quick-start and corrected API snippets. - Examples: migrated to
llama_cpp_4::prelude; chat example usesapply_chat_template.
Fixed
LlamaContextParams: Clone: manual impl clears sampler chains soparams.clone()works in examples such asincremental-chat.
Prebuilt library tarballs for --features prebuilt are uploaded automatically by CI after this tag is pushed.