
Turboquant Pytorch
Two-stage PyTorch KV cache compressor that preserves attention inner products at 2 to 4 bits per coordinate.
- skills.sh installs
- 772
- GitHub stars
- 98
- last updated
- Jul 14, 2026
Own this skill? Claim it
What it does
- Covers TurboQuant's rotation, Lloyd-Max scalar quantization, and QJL residual correction for LLM key-value caches
- Provides
TurboQuantMSE,TurboQuantProd,TurboQuantKVCache, and production compressors for real model tensors - Includes synthetic validation via
python -m turboquant.test_turboquantand Qwen2.5-3B validation viapython -m turboquant.validate - Designed for inference workloads where 3-bit compression at roughly 5x memory reduction is the target
Install
$ npx -y skills add reason-machines/trending-skills --skill turboquant-pytorch -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
TurboQuant PyTorch
Skill by ara.so — Daily 2026 Skills collection.
From-scratch PyTorch implementation of Google's TurboQuant (ICLR 2026) for compressing LLM KV caches. Achieves 5x compression at 3-bit with 99.5% attention fidelity via two-stage vector quantization.
What It Does
TurboQuant compresses LLM key-value caches to 2–4 bits per coordinate:
- Stage 1: Random orthogonal rotation + Lloyd-Max scalar quantization (MSE-optimal)
- Stage 2: QJL residual correction — 1-bit sign projection that makes inner product estimates unbiased
Result: attention scores remain accurate even when individual vectors look quite different from originals. The algorithm preserves inner products, not vector fidelity.
Compression ratios at 8K context on Qwen2.5-3B (289 MB FP16 baseline):
- 4-bit → 76 MB (3.8x)
- 3-bit → 58 MB (5.0x) ← practical sweet spot
- 2-bit → 40 MB (7.3x)
Installation
git clone https://github.com/tonbistudio/turboquant-pytorch
cd turboquant-pytorch
pip install -r requirements.txt
# For CUDA PyTorch:
pip install torch --index-url https://download.pytorch.org/whl/cu128
Details
- Repository
- github.com/reason-machines/trending-skills
- Categories
- AI Agents & LLM Apps, Python
- First seen
- May 16, 2026
More from reason-machines/trending-skills
All 163- App Store Screenshots Generator769
- Caveman Token Optimizer768
- Open Pencil Design Editor766
- Pgmicro Postgres Sqlite764
- Tribev2 Brain Encoding764
- Polymarket Arbitrage Bot762
- Polymarket Copy Trading Bot757
- Taiwan Equity Research Coverage755
- Torchcode Pytorch Interview Practice753
- Codex Session Patcher750
- Learn Docker K8s Game746
- Claude Better Cli744
- Ministack Aws Emulator743
- Wildworld Dataset739
- Phantom Ai Coworker729
- Kordoc Korean Document Parser727
- Claw Code Harness721
- Clawd Code Python Port714
- See Through Anime Layer Decomposition706
- Open Agent Sdk701
- Openclaude Multi Llm673
- Emdash Cms672
- Cc Gateway Ai Proxy668
- Open Multi Agent Orchestration665
Similar to Turboquant Pytorch
More AI Agents & LLM Apps
hqq-quantizationSkillorchestra-research/ai-research-skills1.1K installsCalibration-free weight quantization for LLMs at 8/4/3/2/1-bit, with HuggingFace and vLLM integration.
gptqSkillorchestra-research/ai-research-skills1.1K installsPost-training 4-bit quantization for large LLMs that cuts memory roughly fourfold with small accuracy loss.
HeadroomMCP serverchopratejas80.3K starsCompresses tool outputs, logs, files, and RAG chunks to cut LLM input tokens while keeping answers.
llmtrimMCP serverfkiene276 starsLocal proxy and MCP server that compresses LLM prompts, tool output, and replies to cut token cost.
pennylaneSkillk-dense-ai/scientific-agent-skills2.1K installsHardware-agnostic PennyLane workflows for variational circuits, hybrid PyTorch or JAX models, and molecular VQE.
metal-kernelSkillpytorch/pytorch3.2K installsMetal/MPS kernel authoring guide for PyTorch operators, covering dispatch, Metal shaders, and host-side stubs on Apple Silicon.