VeloxQuant-MLX compresses the KV cache your Mac builds during LLM inference — up to 98% less peak memory across 43 methods, accelerated with hand-written Metal kernels, integrated in three lines of code.
In Development VeloxQuant Studio, the native Mac app, is currently in development.
LLMs like Llama, Mistral, and Qwen store past context in a KV cache that grows linearly with sequence length. A 7B model at 8k context can consume 14 GB on an 18 GB MacBook M3 Pro — leaving almost no room for anything else.
VeloxQuant-MLX compresses that cache on-the-fly with Metal GPU kernels, making long-context inference practical on consumer hardware.
EXPLORE THE METHODSForty-three compression algorithms behind a single drop-in API. Change one method string to switch between them.
Fit bigger models and longer chats in the RAM you have — most methods need no calibration step.
The only methods that free RAM you'll see drop in Activity Monitor in real time.
Layers share memory instead of duplicating it. No code changes required.
Up to 13× faster and 98% less peak memory than plain MLX. Built for your GPU, not ported from elsewhere.
Change one method string to switch algorithms. Your model-loading code stays exactly the same.
Tested on Llama, Mistral, Qwen, Phi, Gemma, Falcon, and vision-language models.
Same Mac, a smaller KV cache. Here is where that helps, and what it costs.
A third less cache memory, near-fp16 quality.
TurboQuant RVQ at 3 bits compresses the keys; values stay fp16. On Qwen3-4B at 4,096 tokens the whole cache measured 0.67× its fp16 size, with perplexity 13.63 vs 13.57. Decoding is several times slower.
Cap how much of the prompt the cache keeps.
SnapKV keeps the prompt tokens it scores highest. At 4,096 tokens the cache measured 0.18× its fp16 size. Dropped tokens are gone, and exact recall on code is not benchmarked yet.
Know what the cache costs at your context length.
The calculator starts from the exact fp16 cache size for your model’s layers, KV heads and head dimension, then compares it with the RAM left after weights. Its compressed rows are estimates, not measurements.
Long documents never leave your Mac.
MLX runs the model on your GPU, and VeloxQuant’s cache code makes no network calls. With RVQ the cache is a third smaller at near-fp16 quality (0.67×, Qwen3-4B, 4,096 tokens). It is the cache layer, not a RAG framework.
A cache that stops growing while the model thinks.
StreamingLLM keeps sink tokens plus a recent window, so cache size stayed flat over 1,024 decode steps in a synthetic check. Older reasoning is forgotten, reasoning accuracy is untested, and next-token quality dropped in our 4,096-token run.
Compare 43 methods on your own model.
Every method sits behind the same KVCacheConfig, so switching is one string. The playground sizes a setup for your Mac, and the benchmarks page lists measured results with their caveats.
Cache sizes are the cache’s own array bytes, not bit-width estimates. Measured on an Apple M4 (24 GB) with Qwen3-4B-4bit and a 4,096-token prompt, one run each, against an fp16 cache of 642 MB and a 4.99 GB peak. Peak memory moves much less than cache size, and StreamingLLM’s peak was higher (5.34 GB) because prefill runs before eviction. Raw numbers and caveats.
The added lines are all you need. Your model-loading code stays exactly the same.
pip install VeloxQuant-MLX
from veloxquant_mlx import KVCacheBuilder, KVCacheConfig
config = KVCacheConfig(method="kivi", bit_width_inlier=2, seed=42)
caches = KVCacheBuilder.for_model(model, config)
CALCULATOR
Pick your model, how long a conversation you want, and how much RAM your Mac has. Calculations match what you get running on your Mac.
Example: Llama-3.1-8B with a 64k-token conversation needs 8.00 GB of memory normally — more than the ~7.5 GB free on a 16 GB Mac. Our RVQ-1bit setting brings that down to 1.07 GB; VecInfer-1bit to 512 MB. Enable JavaScript to size your own model.
mlx_lm — same weights, same file format, zero conversion step. You add the compression with three lines of code; your model file itself remains untouched.
turboquant_rvq — no calibration or setup step required. It's the default for a reason: it cuts memory use to roughly a third with near-zero effect on perplexity. If you need the smallest possible footprint, vecinfer reaches about 16× compression on keys with a one-time calibration pass.
Official Swift, Kotlin, NPM, Rust, and Go SDK runtimes and a VS Code extension available today — with native macOS app coming soon.
The flagship visual workspace engineered exclusively for macOS and Apple Silicon. Monitor local model memory in real-time, benchmark hand-written Metal kernels, and reclaim up to 98% of KV-cache footprint in a single click — without touching a terminal.