1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Local embedding model backend for Blazen using [`fastembed`].
//!
//! This crate wraps the [`fastembed`] Rust crate (ONNX Runtime) to provide
//! fully local, offline vector embeddings with no API keys required.
//!
//! When used through `blazen-llm` with the `fastembed` feature flag, this
//! crate's [`FastEmbedModel`] automatically implements
//! `blazen_llm::EmbeddingModel`.
//!
//! # Target gating
//!
//! As of `ort-sys` 2.0.0-rc.12, pyke dropped `x86_64-apple-darwin` from
//! their prebuilt distribution matrix. On that target this crate compiles
//! to a stub (see `provider_stub`) — the public API remains, but
//! [`FastEmbedModel::from_options`] always returns
//! [`FastEmbedError::UnsupportedTarget`]. Consumers should route through
//! `blazen-embed`'s facade, which picks `blazen-embed-tract` (pure-Rust
//! ONNX) on those targets automatically.
//!
//! # Quick start
//!
//! ```rust,no_run
//! use blazen_embed_fastembed::{FastEmbedModel, FastEmbedOptions};
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let model = FastEmbedModel::from_options(FastEmbedOptions::default())?;
//! let response = model.embed(&["hello".into(), "world".into()]).await?;
//! assert_eq!(response.embeddings.len(), 2);
//! # Ok(())
//! # }
//! ```
pub use FastEmbedOptions;
pub use ;
pub use ;