WeaviateEx.API.Quantizer.RQConfig (WeaviateEx v0.7.4)

View Source

Rotational Quantization (RQ) configuration.

RQ uses rotational transformations before quantization, which can provide better accuracy than other methods at similar compression ratios.

Fields

  • :enabled - Whether RQ is enabled (default: true)
  • :bits - Number of bits for quantization (4, 8, or 16)
  • :cache - Enable vector cache for faster rescoring
  • :rescore_limit - Number of candidates to rescore with original vectors
  • :training_limit - Number of vectors to use for training

Summary

Functions

Parse an RQ configuration from API response.

Create a new RQ configuration.

Convert an RQ configuration to API format.

Types

t()

@type t() :: %WeaviateEx.API.Quantizer.RQConfig{
  bits: non_neg_integer() | nil,
  cache: boolean() | nil,
  enabled: boolean(),
  rescore_limit: non_neg_integer() | nil,
  training_limit: non_neg_integer() | nil
}

Functions

from_api(map)

@spec from_api(map()) :: t()

Parse an RQ configuration from API response.

Examples

iex> RQConfig.from_api(%{"rq" => %{"enabled" => true, "bits" => 8}})
%RQConfig{enabled: true, bits: 8}

new(opts \\ [])

@spec new(keyword()) :: t()

Create a new RQ configuration.

Options

  • :enabled - Enable RQ (default: true)
  • :bits - Number of bits (4, 8, or 16)
  • :cache - Enable vector cache
  • :rescore_limit - Number of candidates to rescore
  • :training_limit - Number of vectors to train on

Examples

iex> RQConfig.new()
%RQConfig{enabled: true}

iex> RQConfig.new(bits: 8, cache: true)
%RQConfig{enabled: true, bits: 8, cache: true}

to_api(config)

@spec to_api(t()) :: map()

Convert an RQ configuration to API format.

Examples

iex> config = RQConfig.new(bits: 8, cache: true)
iex> RQConfig.to_api(config)
%{"rq" => %{"enabled" => true, "bits" => 8, "cache" => true}}