Skip to main content

DEFAULT_EMBEDDING_DIM

Constant DEFAULT_EMBEDDING_DIM 

Source
pub const DEFAULT_EMBEDDING_DIM: usize = 1024;
Expand description

Default embedding vector dimensionality for a NEWLY created database.

Sized for qwen/qwen3-embedding-8b, the model the OpenRouter REST backend uses today. Matryoshka Representation Learning (MRL, arXiv 2205.13147) lets a prefix of the native vector stand on its own, so 1024 is a real truncation point rather than a lossy resize.

This value governs init only. An existing database keeps the width recorded in schema_meta.dim, which crate::storage::connection adopts on every open — so raising this default can never silently reinterpret vectors already on disk. Widening a populated database is a deliberate migration that must re-embed every row; the previous default was 384, generated against multilingual-e5-small.

Precedence for the active dim is documented on embedding_dim.