Skip to main content

Module embedding

Module embedding 

Source
Expand description

Embedding provider abstraction.

Defines a trait for text embedding and provides common utilities. Concrete backends (local ONNX, candle, OpenAI) are feature-gated.

use llm_kernel::embedding::{EmbeddingProvider, EmbeddingResult};

Re-exports§

pub use catalog::EmbeddingModel;
pub use types::EmbeddingProvider;
pub use types::EmbeddingResult;
pub use types::chunk_batch;
pub use types::cosine_similarity;
pub use openai::OpenAIEmbeddingClient;
pub use fastembed::FastembedProvider;
pub use lazy::EmbeddingCache;
pub use lazy::LazyFastembedProvider;
pub use lazy::LazyOpts;
pub use lazy::ModelState;
pub use lazy::is_model_cached;
pub use qwen3::Qwen3Provider;
pub use nomic_moe::NomicMoeProvider;
pub use async_vector_index::AsyncVectorIndex;
pub use vector_index::SearchHit;
pub use vector_index::VectorIndex;
pub use qdrant::QdrantVectorIndex;
pub use elastic::ElasticsearchVectorIndex;
pub use turbovec::TurbovecIndex;

Modules§

async_vector_index
Async vector index trait for remote/shared backends (needs async_trait). Async vector index trait for remote/shared backends.
catalog
Zero-dep embedding model catalog.
elastic
Elasticsearch AsyncVectorIndex (feature elastic). Elasticsearch AsyncVectorIndex (elastic feature).
fastembed
Local ONNX embedding provider via fastembed-rs.
lazy
Lazy-loading embedding provider with idle eviction and LRU query cache.
nomic_moe
Nomic V2 MoE embedding provider via fastembed-rs candle backend.
openai
OpenAI text-embedding provider (sync, via ureq).
qdrant
Qdrant AsyncVectorIndex (feature qdrant). Qdrant AsyncVectorIndex (qdrant feature).
qwen3
Qwen3 embedding provider via fastembed-rs candle backend.
turbovec
TurboQuant-backed vector index implementation.
types
Embedding types and trait definitions.
vector_index
Vector index trait and types (zero dependencies). Vector index trait for compressed approximate nearest neighbor search.