ikawrakow/ik_llama.cpp

▲ 197 stars today★ 3,229⑂ 463

llama.cpp fork with additional SOTA quants and improved performance

About ikawrakow/ik_llama.cpp

ikawrakow/ik_llama.cpp is an open-source project on GitHub, mainly written in C++. llama.cpp fork with additional SOTA quants and improved performance It currently holds 3,229 stars and 463 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the Today's Trending board.

GitHub Repository Details

Repository ikawrakow/ik_llama.cpp · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

ik_llama.cpp: llama.cpp fork with better CPU performance

License: MIT

TL;DR

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 -rtr option 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 (AVX2 or better, ARM_NEON or better) and CUDA (Turing or newer).
Please do not enter issues related to ROCm, Vulkan, Metal, old Nvidia GPUs, AVX CPUs, 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 in llama.cpp.
[!IMPORTANT]
Do not use quantized models from Unsloth that have _XL in their name. These are likely to not work with ik_llama.cpp.
>The above has caused some stir, so to clarify: the Unsloth _XL models that are likely to not work are those that contain f16 tensors (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-moe or --n-cpu-moe or tensor overrides). If you are using/want to use split mode graph and observe gibberish/incoherent responses, try adding -cuda graphs=0 to your command line.

Quickstart

Prerequisites

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

Build for CPU

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.

Build for GPU

Install Nvidia Drivers and CUDA Toolkit.

cmake -B build -DGGML_NATIVE=ON -DGGML_CUDA=ON

cmake --build build --config Release -j$(nproc)

Step-by-step instructions for a case of a successful Windows build

https://github.com/ikawrakow/ik_llama.cpp/blob/main/docs/build.md

Run

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.

Run in Docker or Podman

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.

Common parameters and options

Latest News

Model Support

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, Ling-3.0 PR 2295, DSpark PR 2304, Qwen-3.8-Flash-Next PR 2365, GLM-5.3-Flash PR 2376, DeepSeek-V4-Flash-Vision-Exp PR 2431, K2-Horizon PR 2435

Quantization

Quantization additions

Trellis quants (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.

IQK quants

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

Hadamard transforms for K-cache

CPU PR 1033 and CUDA PR 1034

Hadamard transforms for V-cache

PR 1527

MXFP4 as used in gpt-oss models

Implemented for Zen4, AVX2, ARM_NEON, Metal, CUDA PR 682

Quantization improvements

Quantization performance improvements

Features

Performance improvements

Flash-MLA

Fixes

Resources

There 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

GitHub Stars & Activity

3,229Stars
463Forks
0Open issues
C++Language

GitHub Popularity

GitHub stars3,229
Forks463
Open issues0
Primary languageC++
License-
Stars gained today197
Created-
Last pushed-

Trending History

Monthly boardrank #74 · ▲ 197 stars

Related AI Projects

1

microsoft / BitNet

C++★ 40,265⑂ 3,730▲ 17 stars
2

Neroued / ninfer

C++★ 1,904⑂ 355▲ 144 stars
3

obra / superpowers

Shell★ 287,446⑂ 25,707▲ 522 stars
4

mattpocock / skills

Shell★ 263,286⑂ 22,208▲ 820 stars
5

affaan-m / ECC

JavaScript★ 259,730⑂ 38,861▲ 1,046 stars
6

NousResearch / hermes-agent

Python★ 245,944⑂ 0
7

deepseek-ai / deepseek-harness

TypeScript★ 225,686⑂ 0
8

n8n-io / n8n

TypeScript★ 204,528⑂ 60,702▲ 167 stars

More AI Rankings