Back to directory

turboquant-mlx

A key-value cache compression library for MLX on Apple Silicon that quantizes cached keys and values to as low as 3 bits, using mixed precision to keep decode quality unchanged.

turboquant-mlx

turboquant-mlx compresses the KV cache used during LLM inference with PolarQuant, a combination of randomized Hadamard rotation and Lloyd-Max quantization, implemented as fused Metal kernels and offered as a drop-in replacement for mlx-lm's KVCache. Its central finding is that keys and values behave differently under quantization: compressing keys destroys greedy decoding accuracy even at 4 bits because softmax is sensitive to small errors, while values tolerate compression well down to 3 bits because their use is a weighted interpolation.

Based on that, the recommended configuration keeps keys at 8 bits and values at 4 bits or lower; on a 7B model with a 32K context, the README reports meaningfully less active memory with output identical to full-precision decoding. A value-only mode works with stock mlx-lm, while mixed key-value compression needs a patched fork.

It is written in Python.

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.