Repository navigation
Releases
Releases · RavenXAILabs/turboquant-mlx
v2.0.0 — Walsh-Hadamard, Asymmetric K/V, Ollama + HuggingFace, 39 Tests
TurboQuant-MLX v2.0.0
First major release. Production-ready KV cache compression for Apple Silicon.
⚡ Core Improvements
- Walsh-Hadamard Transform: Replaced Gram-Schmidt O(n²) with fast WHT O(n log n). ~4x faster rotation. Same Gaussianization quality.
- Asymmetric K/V Compression: Keys get full TurboQuant (PolarQuant + QJL). Values get PolarQuant only — QJL corrects Q·K inner product bias, mathematically redundant for V. Lower MSE on value reconstruction.
- FP16 Attention Sinks: First 128 tokens kept in float16. Prevents instruction-following degradation at extreme compression ratios.
- Dynamic Chunk Buffering: 64-token staged compression. Reduces per-token overhead during autoregressive decode.
🌐 New Backends
- HuggingFace Transformers:
TurboQuantHFCacheextendsDynamicCache. One-lineload_and_patch()function. - Ollama:
TurboQuantOllamaClientstats/monitoring wrapper with env optimization. Note: Ollama manages its own KV cache internally; true compression requires mlx-lm or exo.
🧪 Test Suite
39 passed, 2 skipped
TestWHT (7) TestPolarQuant (5) TestQJL (4) TestKVCache (6)
TestAsymmetric (4) TestOllama (5) TestHFIntegration (5) TestLazyImports (3)
🔌 OpenClaw Skill
TurboQuant-MLX ships as a first-class OpenClaw AI agent skill. Agents can monitor, patch, and report compression stats across all backends.
🍎 Apple Neural Engine Note
All operations run on GPU via MLX Metal. MLX does not currently expose the ANE directly. ANE support via Core ML conversion is on the roadmap.
Install
git clone https://github.com/DeadByDawn101/turboquant-mlx.git
cd turboquant-mlx && pip install mlx numpy -e .Community
Asymmetric K/V, attention sinks, and chunk buffering optimizations inspired by helgklaizar/turboquant_mlx Issue #1. 🤝
Built with 🖤 by RavenX AI