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.
The idea
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:
Rounds each number to a nearby level
Scalar quantization: a whole range of values mapped onto 256 integer levels, one byte each.
Swaps chunks for the closest codebook entry
Product quantization: split a vector into pieces, replace each with its nearest learned centroid.
Keeps the question exact, the data squashed
Asymmetric distance: estimate closeness from compressed vectors without ever decompressing them.
Measures exactly what the squashing costs
Recall against exact results, plotted against the memory saved. The ruler is the whole point.
How it's built
Scalar int8, then product quantization, and a recall-versus-compression benchmark on real embeddings. The textbook baselines, small in lines, deep in ideas.
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 lessonsAn 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.
The trade-off
What quantization is, memory versus accuracy, and the ruler that measures the loss.
Scalar quantization
Map a range of floats onto 256 integer levels, one byte each. The hello world.
k-means
Group points into clusters and learn a codebook. The tool product quantization is built on.
Product quantization
Split a vector, replace each chunk with a codebook index, measure the reconstruction error.
Searching squashed data
Asymmetric distance, the recall-versus-compression curve, and a cheap re-ranking pass.
The frontier
TurboQuant, Extended RaBitQ, and the live debate over what is genuinely new.