Skip to content
Projects

About

llama.cpp fork for significantly improved performance on Ampere generation Nvidia cards (especially RTX 3090 / 3090 Ti): example: 120+ tok/s over a 100K-token generation at temperature 1 for qwen 27b, supporting full 262K ctx. Supports low memory (12gb) configs for 200k+ ctx. 120+ TPS, 3300+ prefill for QFN 3.8. Inkling-2-mini: 185+ TPS @100k depth

AI & Machine Learning

How these counts are measured

Measured star growth

in 24h
+5
in 7 days
+29
in 15 days
+89
in 1 month
+275

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

llamAmpere

llamAmpere is llama.cpp (the open-source program that runs AI language models on your own PC) tuned for NVIDIA RTX 30-series "Ampere" cards, from the 8 GB RTX 3070 to the 24 GB RTX 3090. It tracks mainline llama.cpp v1.0 and adds faster GPU code, model files sized for each card, and one --preset per card that sets everything up. Linux and Windows, text and images, OpenAI-compatible server.

Two model families are tuned and measured on every card size: Inkling 2 Mini and Qwen3.8 27B (Swift 1.5). It also runs Qwen3.8 Flash-Next and ordinary GGUF files. Three terms used below:

  • Drafter: a small helper model that guesses the next few tokens. The main model checks the guesses in one pass and keeps the ones it agrees with, so replies come faster.
  • MTP (multi-token prediction): the drafter built into Qwen3.8 27B. Nothing extra to download on 24 GB.
  • KLD (KL divergence): how far a compressed model's word choices drift from the full-size model. Lower is closer.

Which file for my card

Decode = tokens per second written after a 100K-token prompt, chat template, temperature 1. Each number's card, power limit and prompt are in the notes under the table.

Card Model Preset File Decode at 100K Context (tokens)
24 GB Inkling 2 Mini 24ink Inkling-2-Mini-ATX-NVFP4Q8-5.4bpw.gguf + drafter 141.8 ¹ 262,144 (up to 385,024)
24 GB Qwen3.8 27B 24dense qwen3.8-27b-Swift1.5-Uncensored-ATX-AI4.gguf 126.2 ² 262,144
12 GB Inkling 2 Mini 12ink Inkling-2-Mini-ATX-12GB-4.1bpw.gguf (new in v0.8) 66.9 ⁷ 262,144
16 GB Qwen3.8 27B 16dense qwen3.8-27b-Swift1.5-Uncensored-ATX-AI3.gguf (the 12 GB file) not measured 262,144 (tested headless)
12 GB Qwen3.8 27B 12dense qwen3.8-27b-Swift1.5-Uncensored-ATX-AI3.gguf 70.8 ⁴ 196,608 (262,144 headless)
10 GB Inkling 2 Mini 10ink Inkling-2-Mini-ATX-8GB-10GB-3.7bpw.gguf 58.0 ³ 262,144
10 GB Qwen3.8 27B 10dense qwen3.8-27b-Swift1.5-Uncensored-ATX-AI2.gguf 60.8 ⁵ 180,224 (212,992 headless)
8 GB Inkling 2 Mini 8ink Inkling-2-Mini-ATX-8GB-10GB-3.7bpw.gguf 38.8 ³ 212,992
8 GB Qwen3.8 27B 8dense qwen3.8-27b-Swift1.5-Uncensored-ATX-AI2-8GB.gguf 41.4 ⁶ 204,800 (headless only)
  1. RTX 3090 Ti at 350 W, shown 2% lower as an RTX 3090 figure; 100K-token prompt, v0.7.5, 6 seeds. The smaller Inkling-2-Mini-ATX-AI4-4.4bpw.gguf writes 144.9 and reaches 614,400 tokens of context.
  2. RTX 3090 Ti at 350 W, as measured; 98,766-token coding prompt already cached, v0.7.5, 6 seeds.
  3. One RTX 3090 at 390 W limited to that card's memory, PCIe 4.0 x16, drafter off, 100K-token prompt, v0.7.5, 6 seeds.
  4. RTX 3080 Ti 12 GB, no display on the card, 100K-token prompt, v0.7 (power limit not published).
  5. RTX 3080 10 GB at 320 W, no display on the card, 98,842-token prompt, v0.7.0.1, 6 seeds.
  6. RTX 3070 8 GB at 220 W, PCIe 4.0 x16, 99,984-token prompt, v0.7.1, 6 seeds, on the file before its final tuning pass (same size and layout). A PCIe 3.0 host measured 35.7 (v0.7.2.1).
  7. RTX 3090 Ti at 350 W, as measured, limited to 11,264 MiB, x16 PCIe link, drafter off, ~100K-token prompts, v0.8 candidate d267e658a (before the page-locked-experts change), 6 seeds. The v0.7.5 12 GB file (Inkling-2-Mini-ATX-12GB-4.2bpw.gguf, in the 8/10 GB repo) still works with --preset 12ink; the new file needs v0.8.

Model downloads: Inkling 24 GB, Inkling 8/10 GB, Inkling 12 GB, Qwen3.8 27B for 24 GB, 16 and 12 GB, 10 GB and 8 GB; looped 27B for 24 GB and 12 GB.

On 8, 10 and 12 GB cards part of the work is done from system RAM, so speed depends on your PCIe slot and RAM. The Qwen3.8 27B small-card presets serve one user.

Speed against stock llama.cpp

One 24 GB card, one user, v0.7.5 (v0.7.5.1 is the same speed). Decode in tokens per second after a prompt of the given length; prefill = how fast the prompt is read.

Engine and file Size Decode 3K Decode 32K Decode 100K Prefill 100K Max context
llamAmpere, Inkling 2 Mini 5.4 bpw + drafter 17.6 GB 185.2 179.0 141.8 2,462 385,024
llamAmpere, Inkling 2 Mini 4.4 bpw + drafter 14.4 GB 188.7 186.9 144.9 2,692 614,400
stock llama.cpp b12627, Inkling 2 Mini UD-Q4_K_XL 17.6 GB 51.3 48.4 33.3 249 278,528
llamAmpere, Qwen3.8 27B 4.2 bpw + MTP 14.4 GB see notes see notes 126.2 see notes 262,144

Setup: chat template, temperature 1, 5,120-token replies, 6 seeds per build. Inkling rows: RTX 3090 Ti at 350 W, shown 2% lower as RTX 3090 figures, 3K / 31,985 / 100K-token prompts, our 4-bit KV cache; stock llama.cpp uses its 8-bit KV cache and no drafter. Qwen3.8 27B row: RTX 3090 Ti at 350 W as measured, 98,766-token coding prompt. No stock llama.cpp row is published for the current 27B file.

Inkling 2 Mini is 3.6x stock decode at a 3K prompt and 4.3x at 100K with the same 17.6 GB file size and the same quality (KLD 0.0032 for both; the 4.4 bpw file scores 0.0060). Method and every other row: docs/BENCHMARKS.md.

Quick start

  1. Download the build from Releases: the Linux tar (Ubuntu 22.04 or newer) or the Windows zip. Both need an RTX 30-series card and NVIDIA driver R550 or newer; no CUDA toolkit.
  2. Download the file for your card from the table above (hf download <repo> --local-dir models).
  3. Start the server with the preset for your card:
# Inkling 2 Mini, 24 GB (keep the drafter in the same folder)
./llama-server --preset 24ink -m models/Inkling-2-Mini-ATX-NVFP4Q8-5.4bpw.gguf -md models/Inkling-2-Mini-ATX-Drafter-Q8_0.gguf

# Qwen3.8 27B, 24 GB (MTP is inside the file)
./llama-server --preset 24dense -m models/qwen3.8-27b-Swift1.5-Uncensored-ATX-AI4.gguf

# 8, 10, 12 or 16 GB: the same command with your card's preset and file
./llama-server --preset 12ink -m models/Inkling-2-Mini-ATX-12GB-4.1bpw.gguf
./llama-server --preset 12dense -m models/qwen3.8-27b-Swift1.5-Uncensored-ATX-AI3.gguf   # LSA map in the same folder

# Looped Qwen3.8 27B, 12 GB card with no display (v0.8.0.2+; the LSA map ships in the same repo)
./llama-server --preset 12dense-headless -c 180224 -m models/qwen3.8-27b-Swift1.5-Uncensored-ATX-12GB-3.0bpw-Looped.gguf

The server listens on http://127.0.0.1:8080 with an OpenAI-compatible API and a web UI. The preset sets context, memory and sampling; any flag you add wins. Do not add -b or -ub.

  • Images: add --mmproj mmproj-Inkling-2-Mini-F16.gguf (in every Inkling repo) and send image_url parts in a chat request. Images also work with --preset 24dense and a Qwen3.8 27B vision file.
  • Small-card extras: Qwen3.8 27B on 8, 10, 12 and 16 GB needs lsa-qwen38-27b-d2048.gguf beside the model (in the 12 GB and 8 GB repos), and 8 GB also mtp-dm.gguf (in the 8 GB repo). Inkling on small cards needs free RAM of at least the file size.
  • No display on the card? Add headless (--preset 12dense headless, --preset 8ink-headless) for more room.
  • More: every preset's defaults, several users on one card, building from source and Docker are in docs/SETUP.md. A coding agent can do the setup for you: docs/AI_SETUP.md.

Windows

Every release has a Windows zip (llama-server.exe with the CUDA 12.4 runtime inside, RTX 30-series, driver R550 or newer). Flags, presets and model files are the same as on Linux; run llama-server.exe in place of ./llama-server: llama-server.exe --preset 24ink -m C:\models\Inkling-2-Mini-ATX-NVFP4Q8-5.4bpw.gguf -md C:\models\Inkling-2-Mini-ATX-Drafter-Q8_0.gguf

What's new in v0.8

  • Inkling 2 Mini, faster on every card: 189 tokens/s at a 100K-token prompt on a 24 GB card (5.4 bpw file with its drafter). ² Against v0.7.5.1 on the same test: 8.9% faster decode on 24 GB and 9.1% on 12 GB, with prompts read 91% faster on 12 GB. ¹ New in v0.8.0.2: 24ink with the 4.4 bpw file reads prompts 7-9% faster (chunk size 2048 where memory allows; the 5.4 bpw file keeps 1024).
  • Small Inkling cards: experts in page-locked system RAM add 25% decode on 8 GB, 14% on 10 GB and 18% on 12 GB. ¹ A new 12 GB file has better quality (KLD 0.0063, down from 0.0080): Inkling-2-Mini-ATX-12GB-4.1bpw.
  • Qwen3.8 27B, faster on 24 GB: 124.2 tokens/s at a 100K-token prompt, 5.4% faster than v0.7.5.3 (tensor-core output head, int8 prompt attention). ² Follow-up chat turns are quicker (1,360 to 1,148 ms) with fewer runaway thinking loops.
  • Huge context on small cards: Inkling holds 262,144 tokens on 10 and 12 GB and 212,992 on 8 GB. Qwen3.8 27B holds up to 204,800 on 8 GB and 262,144 on 12 GB (LSA + KV cache offload to system RAM). New --preset 16dense keeps the whole KV cache on a 16 GB card (262,144 tokens, tested with no display on the card).
  • Looped models: Qwen3.8 27B looped files (LLAMA_LOOP_PASSES, loop design by Jason Titus), Flash-Next with a looped-core adapter (LLAMA_LOOP_ADAPTER, ported from alesha-pro's work), and Inkling 2 Mini, looped natively. New in v0.8.0.1 / v0.8.0.2: the loop passes of looped 27B files use LSA too (on by default from v0.8.0.2; LLAMA_LOOP_LSA=0 turns it off), so the 12 GB looped file runs on a 12 GB card with no display at 180,224 tokens with 3 passes (the default; about 38-40 tokens/s, at or below our 40 tokens/s bar), or 262,144 with 2 passes (about 54 tokens/s). With a display on the card, 3 passes do not fit; use the stock 12 GB file. LLAMA_LOOP_PASSES=1 gives the same output as the stock 12 GB file.
  • Two cards, same answers: --split-mode tensor runs Qwen3.8 27B across two cards within rounding of one card (KLD 0.000445); LLAMA_SM_TENSOR_EXACT=1 matches it exactly. Gemma 4 31B on two cards: layer split 70 to 83% faster, tensor split 79 tokens/s at a 90K-token prompt.
  • Everywhere: Linux and Windows downloads (Docker image from v0.8.0.1), all with image input. Caught up with upstream llama.cpp (12-02). RTX 50-series: source builds compile, untuned.
  • Details: changelog, v0.8 release notes, v0.8.0.1 release notes, v0.8.0.2 release notes, v0.8.0.3 release notes.
  • v0.8.0.3: fixes a server crash when context shift (--context-shift) or cache reuse (--cache-reuse) was on.

¹ Release-over-release A/B: RTX 3090 Ti at 350 W, 100K-token prompts, chat template, temperature 1, replies of 5,120+ tokens, builds alternating on the card (ABBA), 6 runs per arm, drafter off, memory capped to the card; the 12 GB page-locked row on a rented RTX 3090 at 300 W, 5 valid runs per arm. Each number is its own A/B; they were not added up.

² Same-session runs on an RTX 3090 Ti at 350 W, mixed coding, document Q&A and agent prompts of ~100K tokens, drafter on, 6 runs per engine. A different prompt set from ¹, so the two are not comparable.

Links

License and credits

llamAmpere is MIT licensed (see LICENSE) and is based on mainline llama.cpp by the ggml authors. It includes TheTom's TurboQuant KV-cache work and contributions from that fork. Original authors and license headers are retained. It is the successor of llama-cpp-qwen-ampere. See CREDITS.md for contribution links. Contributing: CONTRIBUTING.md.

Our attention selector is derived from Distilled Latent Sparse Attention (D-LSA), introduced by Ales Kubicek and colleagues in Latent Sparse Attention: Towards Subquadratic Ultra-Long Context Attention. The paper projects queries and keys into a learned index space, groups keys by similarity, searches group summaries, and applies attention to the selected original keys plus a local window and sink tokens. We use the authors' released Qwen d2048 projection map. Our implementation adapts this approach with fixed blocks of 128 or 16 tokens, finer selection, and host KV offload; these are our adaptations, rather than a reproduction of the paper's semantic clustering or tree search. Attention on selected keys uses the stored KV representation; selection, KV quantization, and compensation still introduce approximation. The map's actual index width is 64; d2048 is its release name.

See the published evaluation and measured quality and limits.

Third-party libraries (from upstream llama.cpp):

  • 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

Explore related projects

Loading…