Skip to main content

Module embed

Module embed 

Source
Expand description

Pluggable embedding providers.

All providers implement Embedder. The default is ollama (bge-m3, 1024-dim); gemini and the feature-gated onnx provider are alternatives, and [hash] is a deterministic offline embedder for tests and evaluation.

Modules§

gemini
Google Gemini embedding provider. Uses the Generative Language API’s embedContent endpoint with outputDimensionality so gemini-embedding-001 (natively 3072-dim, Matryoshka-truncatable) returns the configured dimension.
ollama
Ollama embedding provider (the default). Talks to a local Ollama server’s /api/embed endpoint. bge-m3 yields 1024-dimensional vectors.

Structs§

HashEmbedder
Feature-hashing embedder of a fixed dimensionality.

Traits§

Embedder
A source of embedding vectors. Implementations must be cheap to clone via Arc and safe to share across tasks.

Functions§

from_config
Build the embedder selected by cfg.embed_provider.