Skip to main content

blazen_embed/
lib.rs

1//! Facade over the concrete embedding backend for the current target.
2//!
3//! - On non-musl, non-Intel-macOS targets, re-exports `blazen-embed-fastembed`
4//!   (fast C++ ONNX Runtime).
5//! - On musl Linux and Intel macOS (`x86_64-apple-darwin`), re-exports
6//!   `blazen-embed-tract` (pure-Rust ONNX inference via tract). ORT has no
7//!   prebuilt binaries for either platform.
8//!
9//! Downstream code imports ONLY from this crate. The backend selection is invisible.
10
11#[cfg(not(any(target_env = "musl", all(target_os = "macos", target_arch = "x86_64"))))]
12pub use blazen_embed_fastembed::{
13    FastEmbedError as EmbedError, FastEmbedModel as EmbedModel, FastEmbedOptions as EmbedOptions,
14    FastEmbedResponse as EmbedResponse,
15};
16
17#[cfg(any(target_env = "musl", all(target_os = "macos", target_arch = "x86_64")))]
18pub use blazen_embed_tract::{
19    TractEmbedModel as EmbedModel, TractError as EmbedError, TractOptions as EmbedOptions,
20    TractResponse as EmbedResponse,
21};