Skip to main content
skill CX Codex

turboquant-pytorch — Claude Code skill: what it does, how to install

Implements two-stage vector quantization in PyTorch to compress LLM KV cache down to 2–4 bits. Preserves attention scores while cutting memory consumption.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add reason-machines/trending-skills --skill turboquant-pytorch -a claude-code
Open on GitHub

What turboquant-pytorch does

This skill guides the AI assistant in setting up TurboQuant for transformer models. The method shrinks key and value caches using orthogonal random rotations, Lloyd-Max scalar quantizers, and 1-bit QJL residual sign projections. It targets inner product precision rather than reconstructing exact raw vectors.

The project layout includes ready-to-use building blocks like TurboQuantMSE and TurboQuantCompressorV2. During testing on Qwen2.5-3B with an 8K context window, 3-bit quantization reduces memory use from 289 MB to 58 MB. Keys yield unbiased attention scores without expanding back to full precision.

Codebook generation relies on scipy, and full model validation demands a CUDA GPU with at least 6GB of VRAM.

What it helps with

  • Compress transformer KV cache down to 3-bit representation
  • Generate Lloyd-Max scalar quantization codebooks with SciPy
  • Calculate asymmetric attention scores directly on compressed key vectors
  • Apply QJL 1-bit residual signs to keep dot product estimates unbiased

Example prompts for the agent

  • Implement a 3-bit KV cache compression layer using TurboQuantCompressorV2
  • Generate a Lloyd-Max codebook for head dimension 128 using turboquant
  • Show how to compute attention weights over compressed keys without full dequantization

How to install turboquant-pytorch

1Skills CLI (Vercel)

npx skills add reason-machines/trending-skills --skill turboquant-pytorch -a claude-code

2Manually: put the files in place

~/.claude/skills/turboquant-pytorch/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/turboquant-pytorch/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about turboquant-pytorch

How to install turboquant-pytorch in Claude Code?

Run npx skills add reason-machines/trending-skills --skill turboquant-pytorch -a claude-code. This imports the skill files into your assistant setup.

What does turboquant-pytorch do?

It provides PyTorch implementations of two-stage vector quantization for LLM context buffers. The technique compresses keys and values down to 2–4 bits while retaining attention accuracy.

What hardware and packages are required?

Basic algorithms require torch>=2.0 and scipy. Testing against Qwen2.5-3B requires a CUDA GPU with at least 6GB VRAM, along with transformers, accelerate, and bitsandbytes.

Similar skills

All skills for AI and ML →

From the same set186

caveman-token-optimizer A skill that makes AI agents answer in caveman-speak, dropping pleasantries and filler. It cuts roughly 65% of output tokens while code and technical terms stay exact. CX Codex +1 842installs codex-plugin-cc Runs OpenAI Codex reviews and delegates background fixes directly from Claude Code. Good for getting an outside critique on diffs. CX Codex +1 838installs pump-analyzer-solana A static front end for watching Pump.fun token launches on Solana: a WebSocket feed, price and volume charts, and alerts on your own criteria. CX Codex +1 837installs app-store-screenshots-generator Builds ad-style iOS app screenshots in Next.js and exports PNG files for App Store device sizes. It also handles localized sets. CX Codex +1 818installs pgmicro-postgres-sqlite Teaches your coding assistant how to configure pgmicro, an engine translating PostgreSQL queries into SQLite bytecode for in-process execution. CX Codex +1 811installs tribev2-brain-encoding A skill that wires the TRIBE v2 model into your agent so it can predict brain responses to video, audio and text. Built for research work. CX Codex +1 810installs open-pencil-design-editor Teaches your coding agent to inspect, modify, and export local .fig design files using OpenPencil CLI commands or an MCP server. Useful for automated layout generation. CX Codex +1 810installs polymarket-copy-trading-bot Configures a TypeScript bot that monitors target Polymarket wallets and mirrors BUY orders on Polygon mainnet. Useful for automated copy trading via CLOB API. CX Codex +1 804installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor