QuantizationConfig

sealed interface QuantizationConfig

Vector quantization, to shrink a collection's memory footprint.

The four families trade recall against size differently, and the choice is not a dial:

  • Scalar stores one byte per dimension. The safe default, and the one to start from.

  • Product stores a codebook index per sub-vector and is the answer where scalar loses too much recall, at the cost of a slower comparison.

  • Binary stores one bit per dimension. The smallest, and it needs rescoring to be usable on most embeddings.

  • Turbo is Qdrant's TurboQuant at one of four bit sizes, and it is what Qdrant's own benchmarks and release notes are written about. At four bits it can also be the collection's primary storage rather than a layer over it, which is VectorDatatype.TURBO4 instead of this.

Quantizing without asking for rescoring on the read side is the mistake worth naming here: see QuantizationSearchParams.

Inheritors

Types

Link copied to clipboard
data class Binary(val alwaysRam: Boolean? = null, val memory: Memory? = null) : QuantizationConfig

Binary quantization (1 bit per dimension) — the smallest footprint.

Link copied to clipboard
data class Product(val compression: CompressionRatio, val alwaysRam: Boolean? = null, val memory: Memory? = null) : QuantizationConfig

Product quantization at a fixed compression ratio.

Link copied to clipboard
data class Scalar(val quantile: Float? = null, val alwaysRam: Boolean? = null, val memory: Memory? = null) : QuantizationConfig

Scalar (int8) quantization.

Link copied to clipboard
data class Turbo(val bits: TurboQuantBitSize? = null, val alwaysRam: Boolean? = null, val memory: Memory? = null) : QuantizationConfig

TurboQuant, at one of four bit sizes.