blazen_embed_fastembed/lib.rs
1//! Local embedding model backend for Blazen using [`fastembed`].
2//!
3//! This crate wraps the [`fastembed`] Rust crate (ONNX Runtime) to provide
4//! fully local, offline vector embeddings with no API keys required.
5//!
6//! When used through `blazen-llm` with the `fastembed` feature flag, this
7//! crate's [`FastEmbedModel`] automatically implements
8//! `blazen_llm::EmbeddingModel`.
9//!
10//! # Quick start
11//!
12//! ```rust,no_run
13//! use blazen_embed_fastembed::{FastEmbedModel, FastEmbedOptions};
14//!
15//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
16//! let model = FastEmbedModel::from_options(FastEmbedOptions::default())?;
17//! let response = model.embed(&["hello".into(), "world".into()]).await?;
18//! assert_eq!(response.embeddings.len(), 2);
19//! # Ok(())
20//! # }
21//! ```
22
23mod options;
24mod provider;
25
26pub use options::FastEmbedOptions;
27pub use provider::{FastEmbedError, FastEmbedModel, FastEmbedResponse};