Store numbers in fewer bits.

monkquant is a quantization toolkit, built from scratch. It squashes vectors into a fraction of the memory, estimates closeness straight from the squashed form, and measures exactly how much accuracy that costs. Built in the open, and taught one piece at a time.

Start the course View on GitHub

The idea

Rounding, on purpose

A gem cutter takes a rough stone with endless tiny irregularities and reduces it to a handful of clean flat facets. It loses a little of the original surface, but what is left is lighter, sharper, and far easier to carry. Quantization does the same to numbers: keep only a few allowed levels, snap every value to the nearest one. Each thing monkquant does is one more way of choosing those levels well:

How it's built

Two stages

v1

Vector Quantization

Scalar int8, then product quantization, and a recall-versus-compression benchmark on real embeddings. The textbook baselines, small in lines, deep in ideas.

v2

TurboQuant vs RaBitQ

The 2026 methods benchmarked head to head against that baseline on the same plot, with a written verdict on the novelty debate, then new surfaces (KV cache, weights).

The course

16 lessons

What you'll learn

An interactive course that teaches the concepts behind monkquant, then leaves the implementation to you, which is where the understanding sticks. Six units, each concept with a demo you can drive. Start with the trade-off.

  1. 0

    The trade-off

    What quantization is, memory versus accuracy, and the ruler that measures the loss.

  2. 1

    Scalar quantization

    Map a range of floats onto 256 integer levels, one byte each. The hello world.

  3. 2

    k-means

    Group points into clusters and learn a codebook. The tool product quantization is built on.

  4. 3

    Product quantization

    Split a vector, replace each chunk with a codebook index, measure the reconstruction error.

  5. 4

    Searching squashed data

    Asymmetric distance, the recall-versus-compression curve, and a cheap re-ranking pass.

  6. 5

    The frontier

    TurboQuant, Extended RaBitQ, and the live debate over what is genuinely new.

See the full course map →