Module constants

Module constants 

Source
Expand description

Cross-cutting, shared constants.

Prefer deriving secondary constants (e.g. byte sizes) from primary ones to avoid drift.

§Dimension Invariants

The embedding dimension values are treated as compile-time invariants across many modules (embedding, vectordb, cache, scoring). If you need runtime-configurable dimensions:

  1. Use DimConfig to pass dimensions through initialization
  2. Use validate_embedding_dim at module boundaries to catch mismatches early
  3. The compile-time constants remain as defaults and for static size calculations

Structs§

DimConfig
Runtime dimension configuration for modules that support dynamic embedding sizes.

Enums§

DimValidationError
Error returned when dimension validation fails.

Constants§

DEFAULT_EMBEDDING_DIM
Default embedding vector dimension.
DEFAULT_MAX_SEQ_LEN
Default maximum sequence length for models that support truncation.
DEFAULT_VECTOR_SIZE_U64
Default vector size exported as u64 for Qdrant APIs.
DEFAULT_VERIFICATION_THRESHOLD
Default L3 verification threshold.
EMBEDDING_BQ_BYTES
Default embedding size in bytes when stored as binary quantization (1 bit/dim).
EMBEDDING_F16_BYTES
Default embedding size in bytes when stored as f16.
EMBEDDING_F32_BYTES
Default embedding size in bytes when stored as f32.

Functions§

validate_embedding_dim
Validates that a runtime embedding dimension matches the expected dimension.