Skip to main content

Crate rig_fastembed

Crate rig_fastembed 

Source
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_embeddings wire 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§

FastembedError
Errors raised while resolving or initializing a Fastembed model.
FastembedModel

Functions§

text_embeddings
The local embedding wire of model at ndims dimensions, named fastembed and addressing the model by its fastembed name. None takes the width from the model metadata, which errors for models fastembed does not know.