Skip to main content

Crate rightkit_embed

Crate rightkit_embed 

Source
Expand description

Local embeddings and a persistent cosine vector store.

Feature boundaries: inference (ONNX text embedder) and vector (SQLite-backed cosine store). Both are default-on; a vector-only build does not pull ort or tokenizers.

Structs§

AcceleratorParity
Result of the load-time vector parity check an accelerator passed; see Embedder::accelerator_parity.
Embedder
EmbedderConfig
Nearest
VectorStore

Enums§

EmbedError
ExecutionProvider
Where inference runs.
VectorError

Constants§

ACCELERATOR_PARITY_MIN_COSINE
An accelerator is admitted only if every parity prompt’s native-dimension vector has at least this cosine similarity to the CPU provider’s vector for the same prompt. Two correct runs of the same Q4 graph agree at about 0.999; a DirectML run of EmbeddingGemma 2 Q4 measured 0.58-0.72.
DEFAULT_MAX_BATCH
Default rows per ONNX call for embed_batch / embed_query_batch.
DEFAULT_VECTOR_DIM
EMBEDDINGGEMMA2_MODEL_ID
EmbeddingGemma 2 text-only Q4 export (b64, accuracy level 4). Selected when the model directory’s top-level config.json model_type is embedding_gemma2.
EMBEDDINGGEMMA_MODEL_ID

Functions§

cosine_similarity
truncate_and_normalize