Skip to main content

Module embeddings

Module embeddings 

Source

Structs§

EmbeddedBlockHeader
Embedding-enhanced block header
EmbeddingCache
Cached embedding storage
MockEmbeddingProvider
Mock embedding provider for testing
PythonEmbeddingProvider
Real embedding provider backed by the bundled embed.py subprocess (sentence-transformers / MiniLM). Wire protocol (see embed.py): the script writes a u32 LE dimension header on stdout, then for every line it reads on stdin it writes dim * f32 LE bytes on stdout.

Enums§

EmbeddingError

Constants§

EMBEDDING_DIM

Traits§

EmbeddingProvider
Embedding provider trait

Functions§

cosine_similarity_scalar
Fallback scalar cosine similarity
cosine_similarity_simd
Fast SIMD-accelerated cosine similarity
provider_from_config
Build the embedding provider requested by config with an honest fallback: a configured provider that cannot be initialized is reported on stderr instead of silently degrading to the mock. The mock is returned for “mock”/“none” (and as a last resort), with idx_dim as its dimension.
with_cached_provider
Run f with the configured provider, reusing the previous instance when (provider, model, dimension) is unchanged.