Back to directory

llama.cpp — TurboQuant + TriAttention

A fork of llama.cpp that adds TurboQuant, custom low-bit quantization formats with CUDA kernels for smaller memory use, and TriAttention, GPU-accelerated KV-cache pruning that scores cached tokens by importance to keep long-context inference inside a fixed memory budget.

llama.cpp — TurboQuant + TriAttention

This fork adds two features to llama.cpp. TurboQuant introduces low-bit quantization formats named turbo2, turbo3 and turbo4 with hardware-tuned CUDA kernels aimed at faster inference with a smaller memory footprint. TriAttention prunes the KV cache by periodically scoring every cached token's importance, using the geometric structure of RoPE-encoded key vectors rather than any additional model weights or fine-tuning, and evicting the lowest-scoring tokens once a fixed token budget is reached.

Measured on a Qwen3-8B model on an RTX 3080, moving TriAttention's scoring from the CPU to the GPU cuts scoring overhead from about 5,900 milliseconds to 4 to 9 milliseconds per eviction event, which in turn keeps the KV cache within its VRAM budget and raises generation speed from 17.5 to 75.0 tokens per second by avoiding eviction stalls. Enabling TriAttention requires a calibration file generated from a representative text corpus beforehand.

Pre-built Windows binaries requiring CUDA 13 are distributed through Hugging Face; the project is licensed under MIT.

More in Inference

See all 770
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • Lifeboat

    iterate.ai

    A local inference server that puts an OpenAI- and Anthropic-compatible API in front of open-weight language models running on hardware you control, from a laptop to a GPU cluster.

  • Claude S40

    github.com

    An unofficial Claude chat client for 2007-era Nokia Series 40 phones, built as a Java ME app plus a small Go relay server, with web search, reading mode and saved chats.