Experimental llama.cpp fork for inference research and development
C++
874
10,489 commits
updated Sep 22, 2026

This is a highly experimental fork of llama.cpp. Use at your own discretion.
A research and development fork of llama.cpp, providing unique KV cache codecs, inference techniques, and bleeding edge features.
Why pay 3-bit or 4-bit quality for a context length you only sometimes reach? VBR quantizes the KV cache dynamically as your session grows — giving you the highest-quality cache possible at any given depth. It quantizes the cache layer by layer, using our best KV codecs, from the least-sensitive layers to the most-sensitive, and only as far down the ladder as your VRAM and context actually require.
The cache starts at FP16 and stays there until there is real budget pressure; then it degrades one
(layer, side) tensor at a time — first to an aggregate 15.75 bits/value, then 15.51, and so on down the
ladder (f16 → turbo8 → turbo4 → turbo3_tcq → turbo2_tcq → turbo1_tcq), following a per-model price
order measured on KLD panels. For Qwen35 (16 attention layers) that is 160 distinct steps from FP16
down to turbo1_tcq; for Gemma4-31B (60 layers), 600 — the finest-grained quality control we can give
you at every moment of a session.
And because VBR always draws from the best codecs on the ladder, you never have to track KV formats again: new codecs and research roll straight into VBR, so the default cache will always use the best available ladder.
On a dedicated GPU, just run:
llama-server -m model.gguf
VBR is the default cache. Codec selection is automatic: models whose complete KV geometry supports Turbo use a turbo4 quality floor, while BailingMoE3/Ling falls back to the classic F16→Q8_0→Q4_0 ladder. VBR derives a KV VRAM budget from whatever is left after weights and compute, advertises the largest context that fits without going below the selected codec's default floor (capped at the model's training length), and degrades tiers on the fly as context fills. The cache is still FP16 until memory pressure actually requires compression.
For maximum context, explicitly use -ct vbr. That deliberate opt-in opens the selected codec's complete
ladder (turbo1_tcq for Turbo, q4_0 for classic) unless you also set --vbr-floor:
llama-server -m model.gguf -ct vbr
Run with -v to watch the VBR degrade #… steps fire.
VBR balances three quantities: context length, KV VRAM, and minimum quality. Usually specify at most two and let VBR solve the third:
| You know | Use | VBR determines |
|---|---|---|
| How many tokens you need and how much KV VRAM you can spare | -ct vbr -c N --vbr-vram SIZE | The highest-quality terminal layer mixture that fits. Explicit -ct vbr leaves the full ladder available. |
| How many tokens you need and the lowest quality you will accept | -c N --vbr-floor TIER | The safe KV VRAM budget available on the machine. |
| How much KV VRAM you can spare and the lowest quality you will accept | --vbr-vram SIZE --vbr-floor TIER | The largest fillable context. |
Setting all three usually just over-constrains the same calculation. Pick the two requirements you actually know; VBR can then optimize the remaining dimension instead of receiving three potentially contradictory answers.
| flag | meaning |
|---|---|
-ct vbr (or -ctk vbr / -ctv vbr) | VBR is already enabled by default. Explicitly selecting it opens the selected codec's full ladder when no --vbr-floor is supplied. Explicitly pinning a side (-ctv q8_0) holds it at fixed bits and never degrades it. Use -ct f16 or another concrete type to opt out of VBR. |
-c <N> | Cap the context at N tokens; VBR then spends your whole VRAM budget running that window at the highest quality it can, instead of advertising the max floor-tier capacity. E.g. -c 30000 = the best-quality cache that fits a 30k window. |
--vbr-vram <SIZE> | Explicit KV VRAM budget (e.g. 8G). Default auto = whatever VRAM is left after weights and compute. |
--vbr-codec <auto|turbo|classic> | Representation ladder. auto (default) prefers Turbo when every KV layer supports the complete ladder, then falls back to classic for BailingMoE3/Ling. Explicit families are strict. |
--vbr-entry <tier> | Dynamic VBR entry tier. Default f16 preserves maximum quality; t8 (or a lower tier) explicitly trades some quality for lower KV bandwidth and memory from the first token. |
--vbr-floor <bits|tier> | Literal aggregate bits/value floor for dynamic mode. Implicit VBR defaults to t4 (4.125); explicit -ct vbr without this flag uses t1 (1.25). Degrades stop at the last step still ≥ the floor. |
Auto selects the classic ladder for BailingMoE3/Ling models whose head geometry is not supported by TurboQuant:
llama-server -m model.gguf
Classic keeps the model's native KV width and uses ordinary Q8_0/Q4_0 codecs; it does not allocate Turbo rotations or interpret Turbo model-price tables. Its generic order is still strictly banded: every movable KV layer reaches Q8_0 before any layer advances to Q4_0. Portable projected prompt artifacts are currently Turbo-only, so classic mode retains live KV but cold-prefills when a live prefix is no longer available instead of restoring that prefix from the host cache.
Requirements: a CUDA or ROCm backend (turbo-typed KV needs the TurboQuant interface; layers whose KV
lands on the CPU fall back to q8_0). Flash attention is required and force-enabled. Dynamic mode uses
unified KV (forced automatically with -np > 1). Context-shift / self-extend and slot/session
save-restore are disabled in dynamic mode (they would snapshot tier-typed KV that can't restore across a
degrade — tier-aware save-restore is planned); context checkpoints stay enabled on hybrid models. Generation stops cleanly when the context
fills. Models without a baked price order use a generic cross-model order.
Load supported .safetensors model directories directly, including EXL3 quants—no GGUF conversion
required. See the safetensors guide
for supported quantization types and limitations. Support depends on the model architecture and backend.
Standard KV cache quantization treats each value independently. TCQ constrains the quantization indices to follow a 512-state trellis, giving a much larger effective codebook at the same bit rate (with FWHT rotation and context-adaptive norm scaling on top). At the 3-bit setting, the trellis cuts median KL-divergence by ~40% versus scalar quantization while using slightly fewer bits (3.25 vs 3.50 bpv), and lands perplexity on par with an f16 KV cache.
Paper: Closing the Gap: Trellis-Coded Quantization for KV Cache at 2-3 Bits
turbo3 is scalar 3-bit, turbo3_tcq the trellis-coded version at fewer bits — the gap is exactly what
the trellis buys. pp = prefill t/s on a 16K prompt, tg = decode t/s at 16K depth.
| Codec | bpv | PPL | median KLD | pp (t/s) | tg (t/s) |
|---|---|---|---|---|---|
| turbo3 (scalar) | 3.5 | 5.730 | 0.00279 | 1015 | 28.1 |
| turbo3_tcq | 3.25 | 5.668 | 0.00163 | 818 | 26.6 |
The trellis cuts median KLD ~40% (and edges PPL below f16) at fewer bits. Its cost lands in prefill — the Viterbi re-encode drops prompt processing to ~818 t/s vs ~1015 for scalar turbo3; decode is barely affected on a dedicated GPU.
The trellis cost is compute, so it depends on hardware. On dedicated GPUs (e.g. RTX 3090) the fused
tensor-core decode path keeps generation at essentially vanilla / f16 speed (the tg numbers above). On
weaker-compute hardware (e.g. the Strix Halo iGPU) the cost is exposed and the TCQ types can be up to
~40% slower than their scalar counterparts — there, prefer the scalar or higher-bit codecs.
Trained codebooks are included in codebooks/. The defaults are compiled into the CUDA kernels, but you can override them:
TURBO_TCQ_CB=codebooks/3bit/product_aware_iter080.bin \
TURBO_TCQ_CB2=codebooks/2bit/product_aware_iter090.bin \
./build/bin/llama-server -m model.gguf -ngl 99 -fa \
-ctk turbo3_tcq -ctv turbo3_tcq
Codebook training scripts are in scripts/tcq_train_*.py.
These are the individual KV cache codecs the fork ships. In practice you rarely pick one by hand — dynamic VBR mixes them per layer automatically and is the recommended default; the codecs below are mainly for testing and comparison.
Measured on Qwen3.6-27B Q6_K at 16K context (18 chunks of the wikitext-2 test set) on an RTX 3090.
Median KL-divergence is versus an f16 KV cache (0 = identical logits); pp is prefill throughput on a
16K prompt and tg is decode throughput at 16K depth. Ordered by KL-divergence (quality) — lower is
better.
| Codec | bpv | PPL | median KLD | pp (t/s) | tg (t/s) |
|---|---|---|---|---|---|
| f16 | 16.0 | 5.683 | 0 (ref) | 1104 | 30.7 |
| q8_0 | 8.5 | 5.698 | 0.00020 | 1050 | 27.4 |
| turbo8 | 8.125 | 5.693 | 0.00020 | 1013 | 28.6 |
| turbo4 | 4.125 | 5.723 | 0.00090 | 1017 | 28.4 |
| q4_0 | 4.5 | 5.705 | 0.00115 | 1033 | 26.9 |
| turbo3_tcq | 3.25 | 5.668 | 0.00163 | 818 | 26.6 |
| turbo3 | 3.5 | 5.730 | 0.00279 | 1015 | 28.1 |
| turbo2_tcq | 2.25 | 5.711 | 0.00561 | 985 | 28.5 |
| turbo2 | 2.5 | 5.964 | 0.01083 | 1013 | 28.2 |
| turbo1_tcq | 1.25 | 6.012 | 0.02633 | 991 | 28.5 |
--mmproj-gpu-swap)On VRAM-constrained GPUs, a speculative context and the vision encoder (mmproj) may not fit in VRAM simultaneously. For example, Qwen3.6-27B Q6_K + MTP uses ~22.6 GiB on a 24 GiB RTX 3090, leaving no room for mmproj's ~1.1 GiB GPU footprint.
--mmproj-gpu-swap solves this by keeping mmproj on CPU at startup, then temporarily unloading MTP or an external draft-dflash sidecar when an image arrives, loading mmproj to GPU for fast encoding (~1-2s instead of 30-60s on CPU), and restoring speculation afterward. MTP is recreated from the target model; an external DFlash sidecar is reloaded from its GGUF.
./build/bin/llama-server -m Qwen3.6-27B-Q6_K.gguf \
--mmproj mmproj.gguf --spec-type draft-mtp \
--mmproj-gpu-swap -ngl 99
When combined with auto-fit (no -c flag), the server automatically sizes context to leave room for the swap. With a single slot, it also auto-enables --kv-unified to avoid splitting the KV cache into separate streams, which doubles usable per-slot context.
DeepSeek V4 Flash is much larger than a typical consumer-GPU model, but its routed experts can stay in system RAM while the hot expert tensors are cached in spare VRAM. On a multi-GPU machine, use layer splitting: tensor splitting was substantially slower for this CPU-expert workload even with NVLink.
Start with --fit on --moe-cache auto on both single- and multi-GPU hosts. This is the recommended
adaptive path for large CPU-expert models. It preserves normal placement when the complete model
fits, and otherwise selects canonical CPU experts when the remaining VRAM can form useful cache
pools. Explicit tensor overrides, GPU layers, tensor splits, CPU affinity, and thread counts remain
authoritative.
Leave the other resource knobs unset for the first run. The defaults now:
--moe-cache auto is the conservative, repack-preserving default and can use one or more eligible
devices. --moe-cache on forces canonical CPU expert weights immediately. soft remains available
when partial expert eviction is specifically desired: it first tries spare VRAM with stock placement,
then evicts the minimum expert footprint needed to form cache pools.
EXL3 supports CPU expert execution and CUDA/HIP MoE caching. HIP also supports standalone EXL3 matrix operations on wave32 GPUs (tested on RDNA4); wave64 GPUs retain CPU execution and the GPU expert-cache path. Eligible mmap-backed CPU weights can be paged from SSD; active pages still use host RAM, and heavy paging can be much slower than RAM residency. By default, cached EXL3 work stays on GPU rather than assigning a share to CPU: CPU trellis decoding can otherwise hold up the GPU's completed work. Experts missing from the GPU cache still run on CPU.
Use --moe-cache-cpu-overlap auto|N to override this policy:
auto: EXL3 overlap is disabled; other quant types retain their automatic policy.0: disable deliberate CPU overlap.1 through 8: assign that many cached expert rows per operation to CPU when all selected
rows are cached, leaving at least one GPU row. For example, --moe-cache-cpu-overlap 2.Leave this unset initially; benchmark explicit counts on your hardware before retaining them. See MoE cache configuration for environment overrides.
For SSD-paged experts, also compare --moe-cache-cpu-overlap 0: deliberately
moving a GPU-cache hit to CPU can require another disk read. This is a tuning
choice, not a claim that overlap is slower on every model or host.
For native safetensors SSD offloading, optionally add
--repack-cache /path/to/dedicated-directory (Linux) to reuse prepared host weights
on later launches. Disposable backing remains the default; retained files can use
tens of GiB and require manual cleanup. See storage and validation.
For these bandwidth-heavy models, start with --vbr-entry t8. This starts the dynamic VBR cache at
Turbo8 instead of F16, then retains VBR's ability to quantize KV layers as its VRAM
budget fills. Use --vbr-entry t4 when cache capacity and bandwidth matter more than the additional
quality loss. Omit the option (F16 entry) when maximum KV quality is more important than decode
speed. Static -ctk t8 -ctv t8 and -ctk t4 -ctv t4 remain useful for fixed-tier comparisons, but
--vbr-entry is the recommended deployment interface.
./build/bin/llama-server \
-m DeepSeek-V4-Flash-0731-UD-IQ2_M-00001-of-00003.gguf \
-ngl auto -sm layer -fa on -c 8192 -np 1 -ub 4096 \
--vbr-entry t8 \
--fit on --moe-cache auto \
--moe-cache-expert-parallel auto \
--host 0.0.0.0 --port 8081
Automatic fit leaves the routed experts in system RAM only when doing so creates a viable cache
placement, fills available VRAM with the hottest expert tensors, and adapts their residency as
routing changes. Expert-parallel mode divides resident rows within a layer across the selected cache
devices while the CPU computes misses. It uses both devices on a dual-GPU host and caps larger hosts
at three-way dispatch. On one GPU, omit --moe-cache-expert-parallel auto; the remaining command is
unchanged.
./build/bin/llama-server \
-m Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf \
-md MTP/mtp-Qwen3.8-Flash-Next-shared-Q8_0.gguf \
-ngl auto -sm layer -fa on -c 8192 -np 1 -ub 512 \
--vbr-entry t8 \
--fit on --moe-cache auto \
--spec-type draft-mtp \
--host 0.0.0.0 --port 8081
The shared sidecar borrows the target embedding and output tensors instead of loading duplicate
copies. On a multi-GPU host, add --moe-cache-expert-parallel auto after selecting the intended
CUDA devices. Prefer layer placement for this CPU-expert workload; tensor splitting has been
substantially slower in testing.
./build/bin/llama-server \
-m DeepSeek-V4-Flash-0731-UD-IQ2_M-00001-of-00003.gguf \
-md dspark-DeepSeek-V4-Flash-0731-Q8_0.gguf \
-ngl auto -sm layer -fa on -c 8192 -np 1 -ub 4096 \
--vbr-entry t8 \
--fit on --moe-cache auto \
--moe-cache-expert-parallel auto \
--spec-type draft-dspark -ngld 0 -otd 'exps=CPU' \
--spec-draft-n-max 3 --spec-draft-p-min 0 \
--host 0.0.0.0 --port 8081
Without expert-parallel dispatch, the best measured dual-RTX-3090 configuration for the IQ2_M target averaged about 41.1 tokens/s on a 24-core EPYC 7443. With complete miss-row accounting, the historical manually tuned variant (22 threads and a 1 GiB reserve) produced seven warm 500-token completions at 50.26--52.28 tokens/s (51.48 mean). A 2 GiB reserve reduced the mean to 49.94 tokens/s but leaves more allocation headroom. The expert-parallel cache defaults to admitting up to 16 entries per node and requires 40 fresh misses before replacing a resident entry; these settings reduce expensive cache churn in both one- and two-slot testing. Two concurrent DSpark slots averaged 59.20 aggregate tokens/s over four warm 1,000-token waves and completed every response cleanly.
The 1 GiB reserve is an aggressive reproduction setting, not the recommendation or global default. The adaptive reserve resolves to 1408 MiB on a 24 GiB RTX 3090, and automatic host-MoE threads resolve to 12 on this 24-core host. Prompt processing measured 326 pp/s at 2,048 tokens before expert parallelism was added.
On four or more eligible GPUs, auto selects three-way dispatch. Fanout and CPU-thread optima are
host-specific, so compare fanouts two, three, and four rather than assuming every card should join
each expert operation.
Although the command requests -ngld 0, --spec-type draft-dspark lets the server recognize the
CPU-backbone DSpark configuration before model loading. The default GPU assist keeps the large
draft experts on CPU while placing all lightweight draft layers and the Markov/output tail in about
594 MiB of GPU memory. This raised the corrected, cache-tuned dual-3090 result from 48.7 to 51.5
tokens/s. Use --no-spec-dspark-gpu-assist when that allocation is more valuable as KV capacity;
use --spec-draft-device none to keep the entire drafter on CPU.
./build/bin/llama-server \
-m DeepSeek-V4-Flash-0731-UD-IQ2_M-00001-of-00003.gguf \
-md dspark-DeepSeek-V4-Flash-0731-Q8_0.gguf \
-ngl auto -sm layer -fa on -c 8192 -np 1 -ub 4096 \
--vbr-entry t8 \
--fit on --moe-cache auto \
--spec-type draft-dspark -ngld 0 -otd 'exps=CPU' \
--spec-draft-n-max 2 --spec-draft-p-min 0 \
--host 0.0.0.0 --port 8081
On an RTX 3090 with a 24-core EPYC 7443, the older manually tuned F16-KV configuration averaged 31.5 tokens/s after warmup. Target-only inference with the same forced cache averaged about 24.0 tokens/s. Depth two slightly beat depth three and four; depth five was slower. Twenty CPU threads won that historical sweep, but the current automatic 12-thread cap is the portable starting point; override it only after a matched local comparison. Prompt processing measured 333 pp/s at 2,048 tokens.
The CUDA MoE cache now derives its safety reserve per device: 6% of physical VRAM, rounded to 128 MiB and clamped to 1--3 GiB (and at most one quarter of the device). This is 1408 MiB on an RTX 3090. Leave it automatic initially. Advanced users can still test an explicit 2 GiB reserve:
GGML_CUDA_MOE_CACHE_RESERVE_MB=2048 ./build/bin/llama-server ...
That raised the older single-GPU result only slightly, from 31.5 to 31.8 tokens/s. The historical dual-GPU headline used an aggressive 1 GiB override. Do not eliminate the reserve: CUDA graphs, workspaces and transient allocations still need headroom.
First run the adaptive recipe without -t, -tb, a reserve environment variable, or a fixed cache
budget. Let the persistent heatmap learn during normal use; it is keyed by model semantics rather
than the model's pathname. Pass -lv 4 once to confirm the resolved thread count, mmap policy,
per-device reserve and pools, nonzero hits, and zero fill/dispatch/collect failures.
Only tune manually when a repeatable gap remains. Change one group at a time and restart the server between configurations. Use the same prompt, temperature and output length throughout; discard the first completion after each load and compare at least three warmed 512-token completions. Record both generation speed and accepted/drafted token counts—a faster result caused only by a different temperature-0 numerical trajectory or luckier speculative acceptance is not a reliable win.
--fit on --moe-cache soft --vbr-entry t8; use --vbr-entry t4 only after checking
the quality tradeoff on your workload.--moe-cache-expert-parallel auto with 0. It changes cache placement
and the CPU/GPU numerical path, so it is not enabled implicitly for every model.-t N -tb N
and, when a drafter is present, -td N -tbd N. Compare around the automatic value instead of
starting at every physical or SMT thread.GGML_CUDA_MOE_CACHE_RESERVE_MB. Keep the automatic or larger reserve unless
a smaller value wins repeatedly and survives long-context generation without allocation errors.The reported PP figures used -ub 4096, five distinct 2,048-token prompts per server, no reusable
prefix, and one discarded cold prompt. Two server loads were run in reverse single/dual order; the
eight warmed measurements averaged 332.8 pp/s on one 3090 and 326.3 pp/s on two. Layer splitting
helps decode but adds device handoffs during the already-efficient large-batch prefill path, so a
second 3090 did not improve PP in this configuration.
The tested IQ2_M target plus Q8_0 DSpark sidecar occupied 95.3 GiB of process RSS/PSS, including
about 94.4 GiB of file-backed model data. 128 GiB of system RAM is recommended. Around
100–104 GiB usable is the practical floor for keeping this working set resident; a nominal 96 GiB
machine will rely on reclaim/reload or swap and can slow down sharply. More slots, --no-mmap, and
other resident models require additional headroom. Context length, KV type, host memory bandwidth,
CPU threads, and expert-cache hit rate all affect the final speed.
CPU/CUDA inference supports Prism's Bonsai 2 PQ2_0 and PTQ1_0 GGUFs,
including their Hadamard-folded weights. See Bonsai 2 for
format details, launch flags, and backend limitations.
cmake -B build \
-DGGML_CUDA=ON \
-DGGML_NATIVE=ON \
-DGGML_CUDA_FA=ON \
-DGGML_CUDA_FA_ALL_QUANTS=ON \
-DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)
Tested on ROCm 7.2 + RDNA3 (gfx1100, RX 7900 XTX). Other RDNA3/RDNA4 targets should work by swapping AMDGPU_TARGETS.
cmake -B build \
-DGGML_HIP=ON \
-DAMDGPU_TARGETS=gfx1100 \
-DCMAKE_BUILD_TYPE=Release \
-DLLAMA_BUILD_SERVER=ON \
-DCMAKE_C_COMPILER=/opt/rocm/bin/amdclang \
-DCMAKE_CXX_COMPILER=/opt/rocm/bin/amdclang++
cmake --build build -j$(nproc)
Test on ROCm 7.13 + AMD Radeon AI PRO R9700
For most use, VBR needs no cache flags — it picks the best codec per layer automatically, spends all your spare VRAM on quality, and keeps a t4 quality floor:
./build/bin/llama-server -m model.gguf -ngl 99
Use explicit -ct vbr to open the complete ladder to t1 for maximum context. The fixed-tier codecs
below are for pinning a specific tier — benchmarking, a fixed budget, or a backend without VBR support.
The safe fixed-tier default. 4-bit KV cache at ~3.8x compression with no speed penalty — higher fidelity (lower KL-divergence from FP16) than the 2–3 bit codecs below.
./build/bin/llama-server -m model.gguf -ngl 99 -fa \
-ctk turbo4 -ctv turbo4
The best-quality 3-bit option — about 40% lower KL-divergence than scalar turbo3 at the same tier. ~5x KV cache compression.
./build/bin/llama-server -m model.gguf -ngl 99 -fa \
-ctk turbo3_tcq -ctv turbo3_tcq
~7x KV cache compression. Best for fitting very long contexts in limited VRAM.
./build/bin/llama-server -m model.gguf -ngl 99 -fa \
-ctk turbo2_tcq -ctv turbo2_tcq
3-bit keys + 2-bit values. 15-17% lower KLD than the reverse, because adaptive alpha already compensates V quantization error.
./build/bin/llama-server -m model.gguf -ngl 99 -fa \
-ctk turbo3_tcq -ctv turbo2_tcq
Scalar quantization without TCQ. Faster encode, worse quality than TCQ equivalents.
# 3-bit scalar
./build/bin/llama-server -m model.gguf -ngl 99 -fa \
-ctk turbo3 -ctv turbo3
# 2-bit scalar
./build/bin/llama-server -m model.gguf -ngl 99 -fa \
-ctk turbo2 -ctv turbo2
A few options to get llama.cpp installed on your machine:
Once installed:
# Download and run a model directly from Hugging Face
llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF
# Launch OpenAI-compatible API server
llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF
For supported native safetensors models, -hf downloads the weights and metadata
into the Hugging Face cache and loads that directory directly—no GGUF conversion:
llama-server -hf unsloth/Qwen3.6-27B-NVFP4
Omit :quant for safetensors: the repository already identifies the quantization.
If a repo contains several model directories, select one with
-hff path/to/config.json. Repos containing both formats still prefer GGUF;
-hff config.json explicitly selects the native model. Indexed downloads fetch
only the named weight shards, plus metadata and supported auxiliary files.
Subsequent runs reuse the cache; --offline requires the model to be cached already.
Downloading a repository does not add support for a new architecture or quantization.
|
|
|
The main goal of llama.cpp is to enable LLM (and VLM) inference with minimal setup and state-of-the-art performance on
a wide range of hardware - locally and in the cloud.
The llama.cpp project is build on top of the ggml library.
The fork's Turbo/TCQ KV codecs and dynamic VBR support these GPU backends:
CPU offloading remains supported; CPU-resident KV layers fall back to q8_0 rather than Turbo/TCQ.
Other upstream backends remain in the source tree but are not supported for these fork-specific features.
llama.cpp repo and merge PRs into the master branchllama-server - MIT license(top 30 of 444)
C++
66.6%
C
12.4%
Cuda
6.5%
Python
4.7%
TypeScript
2.5%
Metal
1.7%
Svelte
1.3%
HTML
1.2%
Experimental llama.cpp fork for inference research and development
C++
874
10,489 commits
updated Sep 22, 2026

This is a highly experimental fork of llama.cpp. Use at your own discretion.
A research and development fork of llama.cpp, providing unique KV cache codecs, inference techniques, and bleeding edge features.
Why pay 3-bit or 4-bit quality for a context length you only sometimes reach? VBR quantizes the KV cache dynamically as your session grows — giving you the highest-quality cache possible at any given depth. It quantizes the cache layer by layer, using our best KV codecs, from the least-sensitive layers to the most-sensitive, and only as far down the ladder as your VRAM and context actually require.
The cache starts at FP16 and stays there until there is real budget pressure; then it degrades one
(layer, side) tensor at a time — first to an aggregate 15.75 bits/value, then 15.51, and so on down the
ladder (f16 → turbo8 → turbo4 → turbo3_tcq → turbo2_tcq → turbo1_tcq), following a per-model price
order measured on KLD panels. For Qwen35 (16 attention layers) that is 160 distinct steps from FP16
down to turbo1_tcq; for Gemma4-31B (60 layers), 600 — the finest-grained quality control we can give
you at every moment of a session.
And because VBR always draws from the best codecs on the ladder, you never have to track KV formats again: new codecs and research roll straight into VBR, so the default cache will always use the best available ladder.
On a dedicated GPU, just run:
llama-server -m model.gguf
VBR is the default cache. Codec selection is automatic: models whose complete KV geometry supports Turbo use a turbo4 quality floor, while BailingMoE3/Ling falls back to the classic F16→Q8_0→Q4_0 ladder. VBR derives a KV VRAM budget from whatever is left after weights and compute, advertises the largest context that fits without going below the selected codec's default floor (capped at the model's training length), and degrades tiers on the fly as context fills. The cache is still FP16 until memory pressure actually requires compression.
For maximum context, explicitly use -ct vbr. That deliberate opt-in opens the selected codec's complete
ladder (turbo1_tcq for Turbo, q4_0 for classic) unless you also set --vbr-floor:
llama-server -m model.gguf -ct vbr
Run with -v to watch the VBR degrade #… steps fire.
VBR balances three quantities: context length, KV VRAM, and minimum quality. Usually specify at most two and let VBR solve the third:
| You know | Use | VBR determines |
|---|---|---|
| How many tokens you need and how much KV VRAM you can spare | -ct vbr -c N --vbr-vram SIZE | The highest-quality terminal layer mixture that fits. Explicit -ct vbr leaves the full ladder available. |
| How many tokens you need and the lowest quality you will accept | -c N --vbr-floor TIER | The safe KV VRAM budget available on the machine. |
| How much KV VRAM you can spare and the lowest quality you will accept | --vbr-vram SIZE --vbr-floor TIER | The largest fillable context. |
Setting all three usually just over-constrains the same calculation. Pick the two requirements you actually know; VBR can then optimize the remaining dimension instead of receiving three potentially contradictory answers.
| flag | meaning |
|---|---|
-ct vbr (or -ctk vbr / -ctv vbr) | VBR is already enabled by default. Explicitly selecting it opens the selected codec's full ladder when no --vbr-floor is supplied. Explicitly pinning a side (-ctv q8_0) holds it at fixed bits and never degrades it. Use -ct f16 or another concrete type to opt out of VBR. |
-c <N> | Cap the context at N tokens; VBR then spends your whole VRAM budget running that window at the highest quality it can, instead of advertising the max floor-tier capacity. E.g. -c 30000 = the best-quality cache that fits a 30k window. |
--vbr-vram <SIZE> | Explicit KV VRAM budget (e.g. 8G). Default auto = whatever VRAM is left after weights and compute. |
--vbr-codec <auto|turbo|classic> | Representation ladder. auto (default) prefers Turbo when every KV layer supports the complete ladder, then falls back to classic for BailingMoE3/Ling. Explicit families are strict. |
--vbr-entry <tier> | Dynamic VBR entry tier. Default f16 preserves maximum quality; t8 (or a lower tier) explicitly trades some quality for lower KV bandwidth and memory from the first token. |
--vbr-floor <bits|tier> | Literal aggregate bits/value floor for dynamic mode. Implicit VBR defaults to t4 (4.125); explicit -ct vbr without this flag uses t1 (1.25). Degrades stop at the last step still ≥ the floor. |
Auto selects the classic ladder for BailingMoE3/Ling models whose head geometry is not supported by TurboQuant:
llama-server -m model.gguf
Classic keeps the model's native KV width and uses ordinary Q8_0/Q4_0 codecs; it does not allocate Turbo rotations or interpret Turbo model-price tables. Its generic order is still strictly banded: every movable KV layer reaches Q8_0 before any layer advances to Q4_0. Portable projected prompt artifacts are currently Turbo-only, so classic mode retains live KV but cold-prefills when a live prefix is no longer available instead of restoring that prefix from the host cache.
Requirements: a CUDA or ROCm backend (turbo-typed KV needs the TurboQuant interface; layers whose KV
lands on the CPU fall back to q8_0). Flash attention is required and force-enabled. Dynamic mode uses
unified KV (forced automatically with -np > 1). Context-shift / self-extend and slot/session
save-restore are disabled in dynamic mode (they would snapshot tier-typed KV that can't restore across a
degrade — tier-aware save-restore is planned); context checkpoints stay enabled on hybrid models. Generation stops cleanly when the context
fills. Models without a baked price order use a generic cross-model order.
Load supported .safetensors model directories directly, including EXL3 quants—no GGUF conversion
required. See the safetensors guide
for supported quantization types and limitations. Support depends on the model architecture and backend.
Standard KV cache quantization treats each value independently. TCQ constrains the quantization indices to follow a 512-state trellis, giving a much larger effective codebook at the same bit rate (with FWHT rotation and context-adaptive norm scaling on top). At the 3-bit setting, the trellis cuts median KL-divergence by ~40% versus scalar quantization while using slightly fewer bits (3.25 vs 3.50 bpv), and lands perplexity on par with an f16 KV cache.
Paper: Closing the Gap: Trellis-Coded Quantization for KV Cache at 2-3 Bits
turbo3 is scalar 3-bit, turbo3_tcq the trellis-coded version at fewer bits — the gap is exactly what
the trellis buys. pp = prefill t/s on a 16K prompt, tg = decode t/s at 16K depth.
| Codec | bpv | PPL | median KLD | pp (t/s) | tg (t/s) |
|---|---|---|---|---|---|
| turbo3 (scalar) | 3.5 | 5.730 | 0.00279 | 1015 | 28.1 |
| turbo3_tcq | 3.25 | 5.668 | 0.00163 | 818 | 26.6 |
The trellis cuts median KLD ~40% (and edges PPL below f16) at fewer bits. Its cost lands in prefill — the Viterbi re-encode drops prompt processing to ~818 t/s vs ~1015 for scalar turbo3; decode is barely affected on a dedicated GPU.
The trellis cost is compute, so it depends on hardware. On dedicated GPUs (e.g. RTX 3090) the fused
tensor-core decode path keeps generation at essentially vanilla / f16 speed (the tg numbers above). On
weaker-compute hardware (e.g. the Strix Halo iGPU) the cost is exposed and the TCQ types can be up to
~40% slower than their scalar counterparts — there, prefer the scalar or higher-bit codecs.
Trained codebooks are included in codebooks/. The defaults are compiled into the CUDA kernels, but you can override them:
TURBO_TCQ_CB=codebooks/3bit/product_aware_iter080.bin \
TURBO_TCQ_CB2=codebooks/2bit/product_aware_iter090.bin \
./build/bin/llama-server -m model.gguf -ngl 99 -fa \
-ctk turbo3_tcq -ctv turbo3_tcq
Codebook training scripts are in scripts/tcq_train_*.py.
These are the individual KV cache codecs the fork ships. In practice you rarely pick one by hand — dynamic VBR mixes them per layer automatically and is the recommended default; the codecs below are mainly for testing and comparison.
Measured on Qwen3.6-27B Q6_K at 16K context (18 chunks of the wikitext-2 test set) on an RTX 3090.
Median KL-divergence is versus an f16 KV cache (0 = identical logits); pp is prefill throughput on a
16K prompt and tg is decode throughput at 16K depth. Ordered by KL-divergence (quality) — lower is
better.
| Codec | bpv | PPL | median KLD | pp (t/s) | tg (t/s) |
|---|---|---|---|---|---|
| f16 | 16.0 | 5.683 | 0 (ref) | 1104 | 30.7 |
| q8_0 | 8.5 | 5.698 | 0.00020 | 1050 | 27.4 |
| turbo8 | 8.125 | 5.693 | 0.00020 | 1013 | 28.6 |
| turbo4 | 4.125 | 5.723 | 0.00090 | 1017 | 28.4 |
| q4_0 | 4.5 | 5.705 | 0.00115 | 1033 | 26.9 |
| turbo3_tcq | 3.25 | 5.668 | 0.00163 | 818 | 26.6 |
| turbo3 | 3.5 | 5.730 | 0.00279 | 1015 | 28.1 |
| turbo2_tcq | 2.25 | 5.711 | 0.00561 | 985 | 28.5 |
| turbo2 | 2.5 | 5.964 | 0.01083 | 1013 | 28.2 |
| turbo1_tcq | 1.25 | 6.012 | 0.02633 | 991 | 28.5 |
--mmproj-gpu-swap)On VRAM-constrained GPUs, a speculative context and the vision encoder (mmproj) may not fit in VRAM simultaneously. For example, Qwen3.6-27B Q6_K + MTP uses ~22.6 GiB on a 24 GiB RTX 3090, leaving no room for mmproj's ~1.1 GiB GPU footprint.
--mmproj-gpu-swap solves this by keeping mmproj on CPU at startup, then temporarily unloading MTP or an external draft-dflash sidecar when an image arrives, loading mmproj to GPU for fast encoding (~1-2s instead of 30-60s on CPU), and restoring speculation afterward. MTP is recreated from the target model; an external DFlash sidecar is reloaded from its GGUF.
./build/bin/llama-server -m Qwen3.6-27B-Q6_K.gguf \
--mmproj mmproj.gguf --spec-type draft-mtp \
--mmproj-gpu-swap -ngl 99
When combined with auto-fit (no -c flag), the server automatically sizes context to leave room for the swap. With a single slot, it also auto-enables --kv-unified to avoid splitting the KV cache into separate streams, which doubles usable per-slot context.
DeepSeek V4 Flash is much larger than a typical consumer-GPU model, but its routed experts can stay in system RAM while the hot expert tensors are cached in spare VRAM. On a multi-GPU machine, use layer splitting: tensor splitting was substantially slower for this CPU-expert workload even with NVLink.
Start with --fit on --moe-cache auto on both single- and multi-GPU hosts. This is the recommended
adaptive path for large CPU-expert models. It preserves normal placement when the complete model
fits, and otherwise selects canonical CPU experts when the remaining VRAM can form useful cache
pools. Explicit tensor overrides, GPU layers, tensor splits, CPU affinity, and thread counts remain
authoritative.
Leave the other resource knobs unset for the first run. The defaults now:
--moe-cache auto is the conservative, repack-preserving default and can use one or more eligible
devices. --moe-cache on forces canonical CPU expert weights immediately. soft remains available
when partial expert eviction is specifically desired: it first tries spare VRAM with stock placement,
then evicts the minimum expert footprint needed to form cache pools.
EXL3 supports CPU expert execution and CUDA/HIP MoE caching. HIP also supports standalone EXL3 matrix operations on wave32 GPUs (tested on RDNA4); wave64 GPUs retain CPU execution and the GPU expert-cache path. Eligible mmap-backed CPU weights can be paged from SSD; active pages still use host RAM, and heavy paging can be much slower than RAM residency. By default, cached EXL3 work stays on GPU rather than assigning a share to CPU: CPU trellis decoding can otherwise hold up the GPU's completed work. Experts missing from the GPU cache still run on CPU.
Use --moe-cache-cpu-overlap auto|N to override this policy:
auto: EXL3 overlap is disabled; other quant types retain their automatic policy.0: disable deliberate CPU overlap.1 through 8: assign that many cached expert rows per operation to CPU when all selected
rows are cached, leaving at least one GPU row. For example, --moe-cache-cpu-overlap 2.Leave this unset initially; benchmark explicit counts on your hardware before retaining them. See MoE cache configuration for environment overrides.
For SSD-paged experts, also compare --moe-cache-cpu-overlap 0: deliberately
moving a GPU-cache hit to CPU can require another disk read. This is a tuning
choice, not a claim that overlap is slower on every model or host.
For native safetensors SSD offloading, optionally add
--repack-cache /path/to/dedicated-directory (Linux) to reuse prepared host weights
on later launches. Disposable backing remains the default; retained files can use
tens of GiB and require manual cleanup. See storage and validation.
For these bandwidth-heavy models, start with --vbr-entry t8. This starts the dynamic VBR cache at
Turbo8 instead of F16, then retains VBR's ability to quantize KV layers as its VRAM
budget fills. Use --vbr-entry t4 when cache capacity and bandwidth matter more than the additional
quality loss. Omit the option (F16 entry) when maximum KV quality is more important than decode
speed. Static -ctk t8 -ctv t8 and -ctk t4 -ctv t4 remain useful for fixed-tier comparisons, but
--vbr-entry is the recommended deployment interface.
./build/bin/llama-server \
-m DeepSeek-V4-Flash-0731-UD-IQ2_M-00001-of-00003.gguf \
-ngl auto -sm layer -fa on -c 8192 -np 1 -ub 4096 \
--vbr-entry t8 \
--fit on --moe-cache auto \
--moe-cache-expert-parallel auto \
--host 0.0.0.0 --port 8081
Automatic fit leaves the routed experts in system RAM only when doing so creates a viable cache
placement, fills available VRAM with the hottest expert tensors, and adapts their residency as
routing changes. Expert-parallel mode divides resident rows within a layer across the selected cache
devices while the CPU computes misses. It uses both devices on a dual-GPU host and caps larger hosts
at three-way dispatch. On one GPU, omit --moe-cache-expert-parallel auto; the remaining command is
unchanged.
./build/bin/llama-server \
-m Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf \
-md MTP/mtp-Qwen3.8-Flash-Next-shared-Q8_0.gguf \
-ngl auto -sm layer -fa on -c 8192 -np 1 -ub 512 \
--vbr-entry t8 \
--fit on --moe-cache auto \
--spec-type draft-mtp \
--host 0.0.0.0 --port 8081
The shared sidecar borrows the target embedding and output tensors instead of loading duplicate
copies. On a multi-GPU host, add --moe-cache-expert-parallel auto after selecting the intended
CUDA devices. Prefer layer placement for this CPU-expert workload; tensor splitting has been
substantially slower in testing.
./build/bin/llama-server \
-m DeepSeek-V4-Flash-0731-UD-IQ2_M-00001-of-00003.gguf \
-md dspark-DeepSeek-V4-Flash-0731-Q8_0.gguf \
-ngl auto -sm layer -fa on -c 8192 -np 1 -ub 4096 \
--vbr-entry t8 \
--fit on --moe-cache auto \
--moe-cache-expert-parallel auto \
--spec-type draft-dspark -ngld 0 -otd 'exps=CPU' \
--spec-draft-n-max 3 --spec-draft-p-min 0 \
--host 0.0.0.0 --port 8081
Without expert-parallel dispatch, the best measured dual-RTX-3090 configuration for the IQ2_M target averaged about 41.1 tokens/s on a 24-core EPYC 7443. With complete miss-row accounting, the historical manually tuned variant (22 threads and a 1 GiB reserve) produced seven warm 500-token completions at 50.26--52.28 tokens/s (51.48 mean). A 2 GiB reserve reduced the mean to 49.94 tokens/s but leaves more allocation headroom. The expert-parallel cache defaults to admitting up to 16 entries per node and requires 40 fresh misses before replacing a resident entry; these settings reduce expensive cache churn in both one- and two-slot testing. Two concurrent DSpark slots averaged 59.20 aggregate tokens/s over four warm 1,000-token waves and completed every response cleanly.
The 1 GiB reserve is an aggressive reproduction setting, not the recommendation or global default. The adaptive reserve resolves to 1408 MiB on a 24 GiB RTX 3090, and automatic host-MoE threads resolve to 12 on this 24-core host. Prompt processing measured 326 pp/s at 2,048 tokens before expert parallelism was added.
On four or more eligible GPUs, auto selects three-way dispatch. Fanout and CPU-thread optima are
host-specific, so compare fanouts two, three, and four rather than assuming every card should join
each expert operation.
Although the command requests -ngld 0, --spec-type draft-dspark lets the server recognize the
CPU-backbone DSpark configuration before model loading. The default GPU assist keeps the large
draft experts on CPU while placing all lightweight draft layers and the Markov/output tail in about
594 MiB of GPU memory. This raised the corrected, cache-tuned dual-3090 result from 48.7 to 51.5
tokens/s. Use --no-spec-dspark-gpu-assist when that allocation is more valuable as KV capacity;
use --spec-draft-device none to keep the entire drafter on CPU.
./build/bin/llama-server \
-m DeepSeek-V4-Flash-0731-UD-IQ2_M-00001-of-00003.gguf \
-md dspark-DeepSeek-V4-Flash-0731-Q8_0.gguf \
-ngl auto -sm layer -fa on -c 8192 -np 1 -ub 4096 \
--vbr-entry t8 \
--fit on --moe-cache auto \
--spec-type draft-dspark -ngld 0 -otd 'exps=CPU' \
--spec-draft-n-max 2 --spec-draft-p-min 0 \
--host 0.0.0.0 --port 8081
On an RTX 3090 with a 24-core EPYC 7443, the older manually tuned F16-KV configuration averaged 31.5 tokens/s after warmup. Target-only inference with the same forced cache averaged about 24.0 tokens/s. Depth two slightly beat depth three and four; depth five was slower. Twenty CPU threads won that historical sweep, but the current automatic 12-thread cap is the portable starting point; override it only after a matched local comparison. Prompt processing measured 333 pp/s at 2,048 tokens.
The CUDA MoE cache now derives its safety reserve per device: 6% of physical VRAM, rounded to 128 MiB and clamped to 1--3 GiB (and at most one quarter of the device). This is 1408 MiB on an RTX 3090. Leave it automatic initially. Advanced users can still test an explicit 2 GiB reserve:
GGML_CUDA_MOE_CACHE_RESERVE_MB=2048 ./build/bin/llama-server ...
That raised the older single-GPU result only slightly, from 31.5 to 31.8 tokens/s. The historical dual-GPU headline used an aggressive 1 GiB override. Do not eliminate the reserve: CUDA graphs, workspaces and transient allocations still need headroom.
First run the adaptive recipe without -t, -tb, a reserve environment variable, or a fixed cache
budget. Let the persistent heatmap learn during normal use; it is keyed by model semantics rather
than the model's pathname. Pass -lv 4 once to confirm the resolved thread count, mmap policy,
per-device reserve and pools, nonzero hits, and zero fill/dispatch/collect failures.
Only tune manually when a repeatable gap remains. Change one group at a time and restart the server between configurations. Use the same prompt, temperature and output length throughout; discard the first completion after each load and compare at least three warmed 512-token completions. Record both generation speed and accepted/drafted token counts—a faster result caused only by a different temperature-0 numerical trajectory or luckier speculative acceptance is not a reliable win.
--fit on --moe-cache soft --vbr-entry t8; use --vbr-entry t4 only after checking
the quality tradeoff on your workload.--moe-cache-expert-parallel auto with 0. It changes cache placement
and the CPU/GPU numerical path, so it is not enabled implicitly for every model.-t N -tb N
and, when a drafter is present, -td N -tbd N. Compare around the automatic value instead of
starting at every physical or SMT thread.GGML_CUDA_MOE_CACHE_RESERVE_MB. Keep the automatic or larger reserve unless
a smaller value wins repeatedly and survives long-context generation without allocation errors.The reported PP figures used -ub 4096, five distinct 2,048-token prompts per server, no reusable
prefix, and one discarded cold prompt. Two server loads were run in reverse single/dual order; the
eight warmed measurements averaged 332.8 pp/s on one 3090 and 326.3 pp/s on two. Layer splitting
helps decode but adds device handoffs during the already-efficient large-batch prefill path, so a
second 3090 did not improve PP in this configuration.
The tested IQ2_M target plus Q8_0 DSpark sidecar occupied 95.3 GiB of process RSS/PSS, including
about 94.4 GiB of file-backed model data. 128 GiB of system RAM is recommended. Around
100–104 GiB usable is the practical floor for keeping this working set resident; a nominal 96 GiB
machine will rely on reclaim/reload or swap and can slow down sharply. More slots, --no-mmap, and
other resident models require additional headroom. Context length, KV type, host memory bandwidth,
CPU threads, and expert-cache hit rate all affect the final speed.
CPU/CUDA inference supports Prism's Bonsai 2 PQ2_0 and PTQ1_0 GGUFs,
including their Hadamard-folded weights. See Bonsai 2 for
format details, launch flags, and backend limitations.
cmake -B build \
-DGGML_CUDA=ON \
-DGGML_NATIVE=ON \
-DGGML_CUDA_FA=ON \
-DGGML_CUDA_FA_ALL_QUANTS=ON \
-DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)
Tested on ROCm 7.2 + RDNA3 (gfx1100, RX 7900 XTX). Other RDNA3/RDNA4 targets should work by swapping AMDGPU_TARGETS.
cmake -B build \
-DGGML_HIP=ON \
-DAMDGPU_TARGETS=gfx1100 \
-DCMAKE_BUILD_TYPE=Release \
-DLLAMA_BUILD_SERVER=ON \
-DCMAKE_C_COMPILER=/opt/rocm/bin/amdclang \
-DCMAKE_CXX_COMPILER=/opt/rocm/bin/amdclang++
cmake --build build -j$(nproc)
Test on ROCm 7.13 + AMD Radeon AI PRO R9700
For most use, VBR needs no cache flags — it picks the best codec per layer automatically, spends all your spare VRAM on quality, and keeps a t4 quality floor:
./build/bin/llama-server -m model.gguf -ngl 99
Use explicit -ct vbr to open the complete ladder to t1 for maximum context. The fixed-tier codecs
below are for pinning a specific tier — benchmarking, a fixed budget, or a backend without VBR support.
The safe fixed-tier default. 4-bit KV cache at ~3.8x compression with no speed penalty — higher fidelity (lower KL-divergence from FP16) than the 2–3 bit codecs below.
./build/bin/llama-server -m model.gguf -ngl 99 -fa \
-ctk turbo4 -ctv turbo4
The best-quality 3-bit option — about 40% lower KL-divergence than scalar turbo3 at the same tier. ~5x KV cache compression.
./build/bin/llama-server -m model.gguf -ngl 99 -fa \
-ctk turbo3_tcq -ctv turbo3_tcq
~7x KV cache compression. Best for fitting very long contexts in limited VRAM.
./build/bin/llama-server -m model.gguf -ngl 99 -fa \
-ctk turbo2_tcq -ctv turbo2_tcq
3-bit keys + 2-bit values. 15-17% lower KLD than the reverse, because adaptive alpha already compensates V quantization error.
./build/bin/llama-server -m model.gguf -ngl 99 -fa \
-ctk turbo3_tcq -ctv turbo2_tcq
Scalar quantization without TCQ. Faster encode, worse quality than TCQ equivalents.
# 3-bit scalar
./build/bin/llama-server -m model.gguf -ngl 99 -fa \
-ctk turbo3 -ctv turbo3
# 2-bit scalar
./build/bin/llama-server -m model.gguf -ngl 99 -fa \
-ctk turbo2 -ctv turbo2
A few options to get llama.cpp installed on your machine:
Once installed:
# Download and run a model directly from Hugging Face
llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF
# Launch OpenAI-compatible API server
llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF
For supported native safetensors models, -hf downloads the weights and metadata
into the Hugging Face cache and loads that directory directly—no GGUF conversion:
llama-server -hf unsloth/Qwen3.6-27B-NVFP4
Omit :quant for safetensors: the repository already identifies the quantization.
If a repo contains several model directories, select one with
-hff path/to/config.json. Repos containing both formats still prefer GGUF;
-hff config.json explicitly selects the native model. Indexed downloads fetch
only the named weight shards, plus metadata and supported auxiliary files.
Subsequent runs reuse the cache; --offline requires the model to be cached already.
Downloading a repository does not add support for a new architecture or quantization.
|
|
|
The main goal of llama.cpp is to enable LLM (and VLM) inference with minimal setup and state-of-the-art performance on
a wide range of hardware - locally and in the cloud.
The llama.cpp project is build on top of the ggml library.
The fork's Turbo/TCQ KV codecs and dynamic VBR support these GPU backends:
CPU offloading remains supported; CPU-resident KV layers fall back to q8_0 rather than Turbo/TCQ.
Other upstream backends remain in the source tree but are not supported for these fork-specific features.
llama.cpp repo and merge PRs into the master branchllama-server - MIT license(top 30 of 444)
C++
66.6%
C
12.4%
Cuda
6.5%
Python
4.7%
TypeScript
2.5%
Metal
1.7%
Svelte
1.3%
HTML
1.2%