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

View Source

Binary Quantization (BQ) configuration.

BQ converts vectors to binary representations, providing the most aggressive compression and fastest search. However, it may result in some accuracy loss.

Fields

  • :enabled - Whether BQ is enabled (default: true)
  • :cache - Enable vector cache for faster rescoring
  • :rescore_limit - Number of candidates to rescore with original vectors

Summary

Functions

Parse a BQ configuration from API response.

Create a new BQ configuration.

Convert a BQ configuration to API format.

Types

t()

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

Functions

from_api(map)

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

Parse a BQ configuration from API response.

Examples

iex> BQConfig.from_api(%{"bq" => %{"enabled" => true, "cache" => true}})
%BQConfig{enabled: true, cache: true}

new(opts \\ [])

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

Create a new BQ configuration.

Options

  • :enabled - Enable BQ (default: true)
  • :cache - Enable vector cache
  • :rescore_limit - Number of candidates to rescore

Examples

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

iex> BQConfig.new(cache: true, rescore_limit: 200)
%BQConfig{enabled: true, cache: true, rescore_limit: 200}

to_api(config)

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

Convert a BQ configuration to API format.

Examples

iex> config = BQConfig.new(cache: true)
iex> BQConfig.to_api(config)
%{"bq" => %{"enabled" => true, "cache" => true}}