rpopreapovle/llama.cpp-eden

7

stars

9,057

commits

C++

primary language

Sep 5, 2026

updated

Browse cluster: Local LLM Inference Optimization

README

llama.cpp

License: MIT

EDEN KV Cache Quantization

AI-written implementation of EDEN quantized KV cache.

Two new quantization types for the key-value cache:

TypeBitsEnumBlock SizeDescription
eden44GGML_TYPE_EDEN432Lloyd-Max codebook (16 levels) + EDEN-biased optimal scale
eden33GGML_TYPE_EDEN332Lloyd-Max codebook (8 levels) + EDEN-biased optimal scale

Based on EDEN: Communication-Efficient and Robust Distributed Mean Estimation for Federated Learning (ICML 2022).

Usage

llama-server \
  --cache-type-v eden4 \       # quantize value cache
  --cache-type-k q8_0 \        # K cache recommended as F16 or q8_0
  -fa on \                     # flash attention required for GPU
  ...

For K cache with EDEN:

  --cache-type-k eden3 --cache-type-v eden3

Note: CUDA converts to F16 internally for flash attention.

Backend Support

BackendTarget devicesget_rowsset_rowsvec_dotFlash Attention
CPUAllYesYesYesYes
CUDANvidia GPUYesYesYesYes
HIPAMD GPUYesYesYesYes
VulkanGPUYesYesYesYes
MetalApple SiliconNoNoNoNo
BLASAllNoNoNoNo
SYCLIntel GPUNoNoNoNo
OpenCLAdreno GPUNoNoNoNo
MUSAMoore Threads GPUNoNoNoNo
OpenVINOIntel CPU/GPU/NPUNoNoNoNo
CANNAscend NPUNoNoNoNo
WebGPUAllNoNoNoNo
RPCAllNoNoNoNo
ZenDNNAMD CPUNoNoNoNo
BLISAllNoNoNoNo
IBM zDNNIBM Z & LinuxONENoNoNoNo
HexagonSnapdragonNoNoNoNo
VirtGPUVirtGPU APINoNoNoNo

Note: vec_dot on CUDA uses __dp4a for eden4 (table lookup + int8 dp4a) and direct float dequant for eden3. MMQ and FATTN direct paths are not yet implemented for EDEN types on CUDA (fall back to generic paths). OpenCL, SYCL, and Metal backends lack EDEN type support entirely - CUDA is the primary GPU target.

Comparison with Turboquant

EDEN achieves the same perplexity as Turboquant with ~80% less code:

QuantizationPPL (gemma-4-E2B-it-qat-UD-Q4_K_XL)Relative code size
eden41.8049~1x
turbo41.8062~5x

Both methods target 4-bit KV cache quantization. EDEN uses a simple Lloyd-Max codebook with a closed-form optimal scale, while Turboquant employs a more complex iterative optimization.


llama

Quick start

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
VLM session with `llama cli` VLM session with llama cli Built-in web UI against `llama serve` running Qwen 3.6 Built-in web UI against llama serve

Description

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.

  • Plain C/C++ implementation without any dependencies
  • Apple silicon is a first-class citizen - optimized via ARM NEON, Accelerate and Metal frameworks
  • AVX, AVX2, AVX512 and AMX support for x86 architectures
  • RVV, ZVFH, ZFH, ZICBOP and ZIHINTPAUSE support for RISC-V architectures
  • 1.5-bit, 2-bit, 3-bit, 4-bit, 5-bit, 6-bit, and 8-bit integer quantization for faster inference and reduced memory use
  • Custom CUDA kernels for running LLMs on NVIDIA GPUs (support for AMD GPUs via HIP and Moore Threads GPUs via MUSA)
  • Vulkan and SYCL backend support
  • CPU+GPU hybrid inference to partially accelerate models larger than the total VRAM capacity

The llama.cpp project is build on top of the ggml library.

Supported backends

BackendTarget devices
BLASAll
BLISAll
CANNAscend NPU
CUDANvidia GPU
HIPAMD GPU
HexagonSnapdragon
IBM zDNNIBM Z & LinuxONE
MUSAMoore Threads GPU
MetalApple Silicon
OpenCLAdreno GPU
OpenVINO [In Progress]Intel CPUs, GPUs, and NPUs
RPCAll
SYCLIntel GPU
VirtGPUVirtGPU APIR
VulkanGPU
WebGPUAll
ZenDNNAMD CPU

Documentation

Tools

Development

Contributing

  • Contributors can open PRs
  • Collaborators will be invited based on contributions
  • Maintainers can push to branches in the llama.cpp repo and merge PRs into the master branch
  • Any help with managing issues, PRs and projects is very appreciated!
  • Read the CONTRIBUTING.md for more information

Acknowledgements

  • yhirose/cpp-httplib - Single-header HTTP server, used by llama-server - MIT license
  • nothings/stb - Single-header image format decoder, used by multimodal subsystem - Public domain
  • nlohmann/json - Single-header JSON library, used by various tools/examples - MIT License
  • mackron/miniaudio - Single-header audio format decoder, used by multimodal subsystem - Public domain
  • sheredom/subprocess.h - Single-header process launching solution for C and C++ - Public domain

Contributors

(top 30 of 446)

ggerganov

1,942 commits

ngxson

598 commits

JohannesGaessler

391 commits

slaren

362 commits

rpopreapovle/llama.cpp-eden

7

stars

9,057

commits

C++

primary language

Sep 5, 2026

updated

Browse cluster: Local LLM Inference Optimization

README

llama.cpp

License: MIT

EDEN KV Cache Quantization

AI-written implementation of EDEN quantized KV cache.

Two new quantization types for the key-value cache:

TypeBitsEnumBlock SizeDescription
eden44GGML_TYPE_EDEN432Lloyd-Max codebook (16 levels) + EDEN-biased optimal scale
eden33GGML_TYPE_EDEN332Lloyd-Max codebook (8 levels) + EDEN-biased optimal scale

Based on EDEN: Communication-Efficient and Robust Distributed Mean Estimation for Federated Learning (ICML 2022).

Usage

llama-server \
  --cache-type-v eden4 \       # quantize value cache
  --cache-type-k q8_0 \        # K cache recommended as F16 or q8_0
  -fa on \                     # flash attention required for GPU
  ...

For K cache with EDEN:

  --cache-type-k eden3 --cache-type-v eden3

Note: CUDA converts to F16 internally for flash attention.

Backend Support

BackendTarget devicesget_rowsset_rowsvec_dotFlash Attention
CPUAllYesYesYesYes
CUDANvidia GPUYesYesYesYes
HIPAMD GPUYesYesYesYes
VulkanGPUYesYesYesYes
MetalApple SiliconNoNoNoNo
BLASAllNoNoNoNo
SYCLIntel GPUNoNoNoNo
OpenCLAdreno GPUNoNoNoNo
MUSAMoore Threads GPUNoNoNoNo
OpenVINOIntel CPU/GPU/NPUNoNoNoNo
CANNAscend NPUNoNoNoNo
WebGPUAllNoNoNoNo
RPCAllNoNoNoNo
ZenDNNAMD CPUNoNoNoNo
BLISAllNoNoNoNo
IBM zDNNIBM Z & LinuxONENoNoNoNo
HexagonSnapdragonNoNoNoNo
VirtGPUVirtGPU APINoNoNoNo

Note: vec_dot on CUDA uses __dp4a for eden4 (table lookup + int8 dp4a) and direct float dequant for eden3. MMQ and FATTN direct paths are not yet implemented for EDEN types on CUDA (fall back to generic paths). OpenCL, SYCL, and Metal backends lack EDEN type support entirely - CUDA is the primary GPU target.

Comparison with Turboquant

EDEN achieves the same perplexity as Turboquant with ~80% less code:

QuantizationPPL (gemma-4-E2B-it-qat-UD-Q4_K_XL)Relative code size
eden41.8049~1x
turbo41.8062~5x

Both methods target 4-bit KV cache quantization. EDEN uses a simple Lloyd-Max codebook with a closed-form optimal scale, while Turboquant employs a more complex iterative optimization.


llama

Quick start

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
VLM session with `llama cli` VLM session with llama cli Built-in web UI against `llama serve` running Qwen 3.6 Built-in web UI against llama serve

Description

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.

  • Plain C/C++ implementation without any dependencies
  • Apple silicon is a first-class citizen - optimized via ARM NEON, Accelerate and Metal frameworks
  • AVX, AVX2, AVX512 and AMX support for x86 architectures
  • RVV, ZVFH, ZFH, ZICBOP and ZIHINTPAUSE support for RISC-V architectures
  • 1.5-bit, 2-bit, 3-bit, 4-bit, 5-bit, 6-bit, and 8-bit integer quantization for faster inference and reduced memory use
  • Custom CUDA kernels for running LLMs on NVIDIA GPUs (support for AMD GPUs via HIP and Moore Threads GPUs via MUSA)
  • Vulkan and SYCL backend support
  • CPU+GPU hybrid inference to partially accelerate models larger than the total VRAM capacity

The llama.cpp project is build on top of the ggml library.

Supported backends

BackendTarget devices
BLASAll
BLISAll
CANNAscend NPU
CUDANvidia GPU
HIPAMD GPU
HexagonSnapdragon
IBM zDNNIBM Z & LinuxONE
MUSAMoore Threads GPU
MetalApple Silicon
OpenCLAdreno GPU
OpenVINO [In Progress]Intel CPUs, GPUs, and NPUs
RPCAll
SYCLIntel GPU
VirtGPUVirtGPU APIR
VulkanGPU
WebGPUAll
ZenDNNAMD CPU

Documentation

Tools

Development

Contributing

  • Contributors can open PRs
  • Collaborators will be invited based on contributions
  • Maintainers can push to branches in the llama.cpp repo and merge PRs into the master branch
  • Any help with managing issues, PRs and projects is very appreciated!
  • Read the CONTRIBUTING.md for more information

Acknowledgements

  • yhirose/cpp-httplib - Single-header HTTP server, used by llama-server - MIT license
  • nothings/stb - Single-header image format decoder, used by multimodal subsystem - Public domain
  • nlohmann/json - Single-header JSON library, used by various tools/examples - MIT License
  • mackron/miniaudio - Single-header audio format decoder, used by multimodal subsystem - Public domain
  • sheredom/subprocess.h - Single-header process launching solution for C and C++ - Public domain

Contributors

(top 30 of 446)

ggerganov

1,942 commits

ngxson

598 commits

JohannesGaessler

391 commits

slaren

362 commits

Languages

C++

56.1%

C

15.9%

Python

7.2%

Cuda

5.4%

TypeScript

4.2%

Svelte

2.2%

HTML

2.1%

Metal

1.5%

Jinja

1.2%