llama.cpp fork with additional SOTA quants and improved performance
3,210
stars
3,198
commits
C++
primary language
Sep 10, 2026
updated
This repository started as a fork of llama.cpp in June of 2024 and was last synced with upstream in August of 2024. Compared to mainline llama.cpp, it offers additional SOTA quantization types and, in many cases, better performance. Various features related to LLM inference appeared here first before becoming available in llama.cpp. MLA, quant repacking, fused delta-net (known in `llama.cpp as "Gated Delta Net" - GDN), tensor parallel, MTP, DFlash, to just name a few.
[!IMPORTANT] If you are running hybrid CPU/GPU inference for MoE models with all or some experts left on the CPU, do not use -rtr unless you know what you are doing. The
-rtroption causes all tensors left in RAM to be repacked to row-interleaved format while loading the model. As not all quantization types have a CUDA implementation, this will result in matrix multiplications with these tensors to be always done on the CPU, even when it would have been much better to offload the computation to the GPU, typically resulting in lower prompt processing speed. Most notably, k-quants (K2_K, Q3_K, Q4_K, Q5_K, Q6_K) do not have CUDA row-interleaved implementation.
[!NOTE] The only fully functional and performant compute backends are CPU (
AVX2or better,ARM_NEONor better) and CUDA (Turing or newer). Please do not enter issues related to ROCm, Vulkan, Metal, old Nvidia GPUs,AVXCPUs, etc. They will not get resolved unless you roll up your sleeves and help bring your favorite backend up to speed. With the current regular contributors this project simply does not have the bandwidth to work on all backends available inllama.cpp.
[!IMPORTANT] Do not use quantized models from Unsloth that have
_XLin their name. These are likely to not work withik_llama.cpp.The above has caused some stir, so to clarify: the Unsloth
_XLmodels that are likely to not work are those that containf16tensors (which is never a good idea in the first place). All others are fine.
[!NOTE] Some users have reported issues with graph parallel (a.k.a. split mode
graph) and partial GPU offload (using--cpu-moeor--n-cpu-moeor tensor overrides). If you are using/want to use split mode graph and observe gibberish/incoherent responses, try adding-cuda graphs=0to your command line.
git clone https://github.com/ikawrakow/ik_llama.cpp
cd ik_llama.cpp
On Debian/Ubuntu Linux, install the required packages (if using another Linux distro, you need to find the corresponding packages and adapt):
apt-get update && apt-get install build-essential git libcurl4-openssl-dev curl libgomp1 cmake
cmake -B build -DGGML_NATIVE=ON
cmake --build build --config Release -j$(nproc)
For AVX-512-capable CPUs (AMD Zen4 / Intel Sapphire Rapids+), see
docs/build.md section "CPU build flags for AVX-512" for the
additional flags that activate the IQK quantized GEMM kernels (the
HAVE_FANCY_SIMD path). Without those flags, a vanilla Release build
silently falls back to the AVX2 path on this hardware.
Install Nvidia Drivers and CUDA Toolkit.
cmake -B build -DGGML_NATIVE=ON -DGGML_CUDA=ON
cmake --build build --config Release -j$(nproc)
https://github.com/ikawrakow/ik_llama.cpp/blob/main/docs/build.md
Download .gguf model files (e.g. bartowski/Qwen_Qwen3-0.6B-IQ4_NL.gguf) to your favorite directory (e.g. /my_local_files/gguf).
Start the server with one of the commands (CPU or GPU):
./build/bin/llama-server --model /my_local_files/gguf/Qwen_Qwen3-0.6B-IQ4_NL.gguf --ctx-size 4096
./build/bin/llama-server --model /my_local_files/gguf/Qwen_Qwen3-0.6B-IQ4_NL.gguf --ctx-size 4096 -ngl 999
That's all! Open http://127.0.0.1:8080 in Browser and start chatting, or use the available API endpoins in your program/harness.
Pull one of the available images from ghcr.io. View all tags
docker pull ghcr.io/ikawrakow/ik-llama-cpp:cpu-swap
docker pull ghcr.io/ikawrakow/ik-llama-cpp:cpu-server
docker pull ghcr.io/ikawrakow/ik-llama-cpp:cpu-full
docker pull ghcr.io/ikawrakow/ik-llama-cpp:cu12-swap
docker pull ghcr.io/ikawrakow/ik-llama-cpp:cu12-server
docker pull ghcr.io/ikawrakow/ik-llama-cpp:cu12-full
Check Step by step guide for image customization and other details.
LlaMA-3-Nemotron PR 377, Qwen3 PR 355, GLM-4 PR 344, Command-A PR 341, bitnet-b1.58-2B-4T PR 337, LLaMA-4 PR 321, Gemma3 PR 276, DeepSeek-V3 PR 176, Kimi-2 PR 609, dots.llm1 PR 573, Hunyuan PR 565, GLM-4.5 PR 668 (4.5/4.6/4.7/AIR), Ernie 4.5 MOE and 0.3B PR 759, grok-2 PR 782, Ling/Ring (Bailing-MoE2) PR 833, Qwen3-VL PR 883, SmolLM3 PR 934, GigaChat3 PR 995, ministral3 PR 1030, Mimo-V2-Flash PR 1096, GLM-4.7-Flash PR 1168, Seed-OSS PR 1218, Step-3.5-Flash PR 1231, GLM-5 PR 1268, Qwen3-Next PR 1266, Qwen3.5-MoE PR 1288 and dense Qwen-3.5 1326, Mistral 4 PR 1450, Bonsai 1-bit PR 1570, Gemma4 PR 1581 including assistant, Mimo-2.5 PR 1723, JetBrains Mellum2 PR 1919, Poolside Laguna XS.2 PR 1911, Cohere2-MoE North Mini Code PR 1945, MiniMax-M3 PR 1963, Laguna M.1 PR 2003, OpenPangu #2065, DeepSeek-V4 PR 2165, Muse-Glimmer PR 2293, DSpark PR 2304, Qwen-3.8-Flash-Next PR 2365
IQ1_KT, IQ2_KT, IQ3_KT, IQ4_KT)Information and the original CUDA implementation in PR 113. Additional implementations: Metal PR 475, Neon PR 471, CPU PR 441. IQ1_KT was added more recently in PR 616. Note: these are base on a novel, integer-base trellis, which allows to achieve reasonable CPU performance, see PR 529 and PRs quoted there for details.
Information can be found in Discussion 8.
Initial implementations (Zen4, AVX2, NEON): IQ5_KS_R4 PR 426, IQ5_KS PR 422, IQ4_KS_R4 PR 150, IQ5_K_R4 PR 149, IQ2_K_R4 PR 146, IQ3_K_R4 PR 145, IQ4_K_R4 PR 138, IQ4_KSS PR 89, IQ2_KS PR 85, IQ4_KS PR 83, IQ6_K PR 14, IQ2_K, IQ3_K and IQ5_K PR 7, IQ4_K PR 6
Cuda implementations: IQ4_KS_R4 and IQ5_KS_R4 PR 493, IQ1_S_R4 PR 492, IQ1_M_R4 PR 494. IQ4_KS_R4 and IQ5_KS_R4 PR 462, IQ2_K_R4, IQ3_K_R4, IQ4_K_R4, IQ5_K_R4 PR 461, IQ4_K, IQ5_K, IQ6_K PR 417, IQ2_KS, IQ2_K, IQ3_K PR 418
IQ2_KL is a more recent addition in PR 602
Implemented for Zen4, AVX2, ARM_NEON, Metal, CUDA PR 682
IQ1_M PR 327, IQ2_XS PR 312, Q2_K, Q4_K, Q5_K, Q4_1, Q5_1 PR 302, Q4_0, Q5_0, Q6_0, Q3_K, Q6_K, IQ4_XS, IQ4_NL PR 295Q4_0 KV cache PR 1547 PR 1556--mtp-requantize-output-tensor new_type PR 1809iq2_ks TG performance improvement on CUDA PR 468IQ3_KT and IQ4_KT PR 453IQ2_KS, IQ4_KS, IQ5_KS PR 428IQ1_S PR 212/v1/responses API endpoint PR 1184convert_hf_to_gguf.py PR 449, Q6_0 in PR 483llama-mtmd-cli PR 798 and in llama-server PR 901--path ./examples/server/public_legacy is passed) PR 481iqk_mul_mat.cpp which speeds up compilation time significantly. PR 435llama.cpp GGUFs for DeepSeek models with MLA enabled were resolved in PR 394. The lower prompt processing performance resulting from using llama.cpp-style MLA GGUFs was recovered in PR 409.sweep-bench - better performance benchmarking PR 225Q8_KV - new type for 8-bit KV-cache quantization PR 208Q8_0 KV cache with FlashMLA-2 on CUDA PR 265Q8_0 quantized cache with MLA PR 206IQ4_K, IQ4_KS, IQ5_K, IQ6_K PR 427There is no single point of reference describing all new ik_llama.cpp features. Pull requests often contain detailed information, so browsing the PRs is often the best way to learn about new features and how to use them. In addition
llama.cppik_llama.cppTo run the function calls test suite:
cd build
cmake --build . --target test-function-calls
./bin/test-function-calls
The test suite covers parser functionality, streaming, error handling, content cleaning, and server integration. All tests should pass to ensure production readiness.
Contributions in form of pull requests, issue submissions (bug reports, feature requests), or general discussions, are welcome.
If your issue is with model generation quality, then please at least scan the following links and papers to understand the limitations of LLaMA models. This is especially important when choosing an appropriate model size and appreciating both the significant and subtle differences between LLaMA models and ChatGPT:
Command-line completion is available for some environments.
$ build/bin/llama-cli --completion-bash > ~/.llama-completion.bash
$ source ~/.llama-completion.bash
Optionally this can be added to your .bashrc or .bash_profile to load it
automatically. For example:
$ echo "source ~/.llama-completion.bash" >> ~/.bashrc
llama-server - MIT license(top 30 of 456)
C++
60.7%
C
13.4%
Cuda
13.0%
Python
5.2%
Metal
2.4%
Jinja
2.1%
Objective-C
1.7%
llama.cpp fork with additional SOTA quants and improved performance
3,210
stars
3,198
commits
C++
primary language
Sep 10, 2026
updated
This repository started as a fork of llama.cpp in June of 2024 and was last synced with upstream in August of 2024. Compared to mainline llama.cpp, it offers additional SOTA quantization types and, in many cases, better performance. Various features related to LLM inference appeared here first before becoming available in llama.cpp. MLA, quant repacking, fused delta-net (known in `llama.cpp as "Gated Delta Net" - GDN), tensor parallel, MTP, DFlash, to just name a few.
[!IMPORTANT] If you are running hybrid CPU/GPU inference for MoE models with all or some experts left on the CPU, do not use -rtr unless you know what you are doing. The
-rtroption causes all tensors left in RAM to be repacked to row-interleaved format while loading the model. As not all quantization types have a CUDA implementation, this will result in matrix multiplications with these tensors to be always done on the CPU, even when it would have been much better to offload the computation to the GPU, typically resulting in lower prompt processing speed. Most notably, k-quants (K2_K, Q3_K, Q4_K, Q5_K, Q6_K) do not have CUDA row-interleaved implementation.
[!NOTE] The only fully functional and performant compute backends are CPU (
AVX2or better,ARM_NEONor better) and CUDA (Turing or newer). Please do not enter issues related to ROCm, Vulkan, Metal, old Nvidia GPUs,AVXCPUs, etc. They will not get resolved unless you roll up your sleeves and help bring your favorite backend up to speed. With the current regular contributors this project simply does not have the bandwidth to work on all backends available inllama.cpp.
[!IMPORTANT] Do not use quantized models from Unsloth that have
_XLin their name. These are likely to not work withik_llama.cpp.The above has caused some stir, so to clarify: the Unsloth
_XLmodels that are likely to not work are those that containf16tensors (which is never a good idea in the first place). All others are fine.
[!NOTE] Some users have reported issues with graph parallel (a.k.a. split mode
graph) and partial GPU offload (using--cpu-moeor--n-cpu-moeor tensor overrides). If you are using/want to use split mode graph and observe gibberish/incoherent responses, try adding-cuda graphs=0to your command line.
git clone https://github.com/ikawrakow/ik_llama.cpp
cd ik_llama.cpp
On Debian/Ubuntu Linux, install the required packages (if using another Linux distro, you need to find the corresponding packages and adapt):
apt-get update && apt-get install build-essential git libcurl4-openssl-dev curl libgomp1 cmake
cmake -B build -DGGML_NATIVE=ON
cmake --build build --config Release -j$(nproc)
For AVX-512-capable CPUs (AMD Zen4 / Intel Sapphire Rapids+), see
docs/build.md section "CPU build flags for AVX-512" for the
additional flags that activate the IQK quantized GEMM kernels (the
HAVE_FANCY_SIMD path). Without those flags, a vanilla Release build
silently falls back to the AVX2 path on this hardware.
Install Nvidia Drivers and CUDA Toolkit.
cmake -B build -DGGML_NATIVE=ON -DGGML_CUDA=ON
cmake --build build --config Release -j$(nproc)
https://github.com/ikawrakow/ik_llama.cpp/blob/main/docs/build.md
Download .gguf model files (e.g. bartowski/Qwen_Qwen3-0.6B-IQ4_NL.gguf) to your favorite directory (e.g. /my_local_files/gguf).
Start the server with one of the commands (CPU or GPU):
./build/bin/llama-server --model /my_local_files/gguf/Qwen_Qwen3-0.6B-IQ4_NL.gguf --ctx-size 4096
./build/bin/llama-server --model /my_local_files/gguf/Qwen_Qwen3-0.6B-IQ4_NL.gguf --ctx-size 4096 -ngl 999
That's all! Open http://127.0.0.1:8080 in Browser and start chatting, or use the available API endpoins in your program/harness.
Pull one of the available images from ghcr.io. View all tags
docker pull ghcr.io/ikawrakow/ik-llama-cpp:cpu-swap
docker pull ghcr.io/ikawrakow/ik-llama-cpp:cpu-server
docker pull ghcr.io/ikawrakow/ik-llama-cpp:cpu-full
docker pull ghcr.io/ikawrakow/ik-llama-cpp:cu12-swap
docker pull ghcr.io/ikawrakow/ik-llama-cpp:cu12-server
docker pull ghcr.io/ikawrakow/ik-llama-cpp:cu12-full
Check Step by step guide for image customization and other details.
LlaMA-3-Nemotron PR 377, Qwen3 PR 355, GLM-4 PR 344, Command-A PR 341, bitnet-b1.58-2B-4T PR 337, LLaMA-4 PR 321, Gemma3 PR 276, DeepSeek-V3 PR 176, Kimi-2 PR 609, dots.llm1 PR 573, Hunyuan PR 565, GLM-4.5 PR 668 (4.5/4.6/4.7/AIR), Ernie 4.5 MOE and 0.3B PR 759, grok-2 PR 782, Ling/Ring (Bailing-MoE2) PR 833, Qwen3-VL PR 883, SmolLM3 PR 934, GigaChat3 PR 995, ministral3 PR 1030, Mimo-V2-Flash PR 1096, GLM-4.7-Flash PR 1168, Seed-OSS PR 1218, Step-3.5-Flash PR 1231, GLM-5 PR 1268, Qwen3-Next PR 1266, Qwen3.5-MoE PR 1288 and dense Qwen-3.5 1326, Mistral 4 PR 1450, Bonsai 1-bit PR 1570, Gemma4 PR 1581 including assistant, Mimo-2.5 PR 1723, JetBrains Mellum2 PR 1919, Poolside Laguna XS.2 PR 1911, Cohere2-MoE North Mini Code PR 1945, MiniMax-M3 PR 1963, Laguna M.1 PR 2003, OpenPangu #2065, DeepSeek-V4 PR 2165, Muse-Glimmer PR 2293, DSpark PR 2304, Qwen-3.8-Flash-Next PR 2365
IQ1_KT, IQ2_KT, IQ3_KT, IQ4_KT)Information and the original CUDA implementation in PR 113. Additional implementations: Metal PR 475, Neon PR 471, CPU PR 441. IQ1_KT was added more recently in PR 616. Note: these are base on a novel, integer-base trellis, which allows to achieve reasonable CPU performance, see PR 529 and PRs quoted there for details.
Information can be found in Discussion 8.
Initial implementations (Zen4, AVX2, NEON): IQ5_KS_R4 PR 426, IQ5_KS PR 422, IQ4_KS_R4 PR 150, IQ5_K_R4 PR 149, IQ2_K_R4 PR 146, IQ3_K_R4 PR 145, IQ4_K_R4 PR 138, IQ4_KSS PR 89, IQ2_KS PR 85, IQ4_KS PR 83, IQ6_K PR 14, IQ2_K, IQ3_K and IQ5_K PR 7, IQ4_K PR 6
Cuda implementations: IQ4_KS_R4 and IQ5_KS_R4 PR 493, IQ1_S_R4 PR 492, IQ1_M_R4 PR 494. IQ4_KS_R4 and IQ5_KS_R4 PR 462, IQ2_K_R4, IQ3_K_R4, IQ4_K_R4, IQ5_K_R4 PR 461, IQ4_K, IQ5_K, IQ6_K PR 417, IQ2_KS, IQ2_K, IQ3_K PR 418
IQ2_KL is a more recent addition in PR 602
Implemented for Zen4, AVX2, ARM_NEON, Metal, CUDA PR 682
IQ1_M PR 327, IQ2_XS PR 312, Q2_K, Q4_K, Q5_K, Q4_1, Q5_1 PR 302, Q4_0, Q5_0, Q6_0, Q3_K, Q6_K, IQ4_XS, IQ4_NL PR 295Q4_0 KV cache PR 1547 PR 1556--mtp-requantize-output-tensor new_type PR 1809iq2_ks TG performance improvement on CUDA PR 468IQ3_KT and IQ4_KT PR 453IQ2_KS, IQ4_KS, IQ5_KS PR 428IQ1_S PR 212/v1/responses API endpoint PR 1184convert_hf_to_gguf.py PR 449, Q6_0 in PR 483llama-mtmd-cli PR 798 and in llama-server PR 901--path ./examples/server/public_legacy is passed) PR 481iqk_mul_mat.cpp which speeds up compilation time significantly. PR 435llama.cpp GGUFs for DeepSeek models with MLA enabled were resolved in PR 394. The lower prompt processing performance resulting from using llama.cpp-style MLA GGUFs was recovered in PR 409.sweep-bench - better performance benchmarking PR 225Q8_KV - new type for 8-bit KV-cache quantization PR 208Q8_0 KV cache with FlashMLA-2 on CUDA PR 265Q8_0 quantized cache with MLA PR 206IQ4_K, IQ4_KS, IQ5_K, IQ6_K PR 427There is no single point of reference describing all new ik_llama.cpp features. Pull requests often contain detailed information, so browsing the PRs is often the best way to learn about new features and how to use them. In addition
llama.cppik_llama.cppTo run the function calls test suite:
cd build
cmake --build . --target test-function-calls
./bin/test-function-calls
The test suite covers parser functionality, streaming, error handling, content cleaning, and server integration. All tests should pass to ensure production readiness.
Contributions in form of pull requests, issue submissions (bug reports, feature requests), or general discussions, are welcome.
If your issue is with model generation quality, then please at least scan the following links and papers to understand the limitations of LLaMA models. This is especially important when choosing an appropriate model size and appreciating both the significant and subtle differences between LLaMA models and ChatGPT:
Command-line completion is available for some environments.
$ build/bin/llama-cli --completion-bash > ~/.llama-completion.bash
$ source ~/.llama-completion.bash
Optionally this can be added to your .bashrc or .bash_profile to load it
automatically. For example:
$ echo "source ~/.llama-completion.bash" >> ~/.bashrc
llama-server - MIT license(top 30 of 456)
C++
60.7%
C
13.4%
Cuda
13.0%
Python
5.2%
Metal
2.4%
Jinja
2.1%
Objective-C
1.7%