Expand description
Local embedding model integration backed by fastembed.
A loaded fastembed model is the Fastembed transport, the runtime
behind a local embedding wire (text_embeddings) that embeds in the
calling process. The default feature set enables Hugging Face model
downloads and ONNX Runtime binary downloads.
use rig_core::Model;
use rig_fastembed::{Fastembed, FastembedModel, text_embeddings};
let model = Fastembed::load(&FastembedModel::AllMiniLML6V2Q)?.embedding(&FastembedModel::AllMiniLML6V2Q, None)?;rig-fastembed is native-only and does not target wasm32-unknown-unknown.
The root rig facade re-exports this crate as rig::fastembed when one of
its Fastembed features is enabled.
Structs§
- Fastembed
- A loaded Fastembed model: the transport that embeds in the calling
process. Clones share the loaded model. Pair it with the
text_embeddingswire of the model it loaded: the wire names the model and width that spans and capabilities report, and the transport embeds with whatever it loaded. In-process execution reports no raw payload, usage, or request id.
Enums§
- Fastembed
Error - Errors raised while resolving or initializing a Fastembed model.
- Fastembed
Model
Functions§
- text_
embeddings - The local embedding wire of
modelatndimsdimensions, namedfastembedand addressing the model by itsfastembedname.Nonetakes the width from the model metadata, which errors for modelsfastembeddoes not know.