Skip to main content

Module validation

Module validation 

Source
Expand description

Unified validation helpers.

Centralizes dimension range checks, collection name validation, and mismatch validation used across collection creation, CRUD, and search paths.

Constants§

MAX_COLLECTION_NAME_LENGTH
Maximum allowed length for a collection name.
MAX_DIMENSION
Maximum valid vector dimension (65,536 — covers all known embedding models).
MIN_DIMENSION
Minimum valid vector dimension.

Functions§

validate_collection_name
Validates that a collection name is safe for use as a filesystem directory.
validate_dimension
Validates that a vector dimension is within the allowed range.
validate_dimension_match
Validates that a vector’s actual dimension matches the expected dimension.