Skip to main content

Module embedder

Module embedder 

Source
Expand description

Embedding generation via fastembed (ONNX-backed, no server required).

The embedder wraps a fastembed TextEmbedding model and serializes/ deserializes raw f32 vectors for storage in SQLite BLOBs.

Structs§

Embedder
Wraps the fastembed model and provides encode/decode helpers.

Constants§

DEFAULT_MODEL
Default embedding model — nomic-embed-text-v1.5 gives 768 dimensions and good code+text mixed-domain performance with Matryoshka support.

Functions§

cosine_similarity
Cosine similarity between two equal-length vectors. Returns 0.0 if either vector has zero magnitude.
decode_vector
Decode a little-endian byte blob back to f32 values.
dims_for_model
Return the known output dimensionality for a model without loading it.
encode_vector
Convert a slice of f32 to a little-endian byte blob for SQLite storage.