talira

fastembed-rs

Rust library for generating vector embeddings, reranking locally

open sourceApache-2.0self-hostablefree

fastembed-rs is the Rust counterpart of FastEmbed: it generates dense, sparse and image embeddings and reranks documents locally, using the ort crate for ONNX Runtime inference and Hugging Face tokenizers. It is synchronous with no Tokio dependency, downloads supported models (BGE, MiniLM, nomic, e5, gte, Jina, Snowflake Arctic, EmbeddingGemma and more) on first use and caches them, and can load local model files; its default text model is bge-small-en-v1.5 (384 dimensions). Optional candle backends add Qwen3 embedding models (including quantized GGUF), nomic-embed-text-v2-moe and BERT encoders with Metal or CUDA acceleration, and DirectML runs ONNX models on Windows GPUs.

Problems it solves

  • run embedding models from Rust without Python
  • semantic search inside a Rust web server with no external embedding API
  • rerank results in a Rust service on CPU
  • I don't want a Python sidecar just to compute embeddings for my Rust app
  • embeddings in Rust without pulling in an async runtime
  • load an ONNX embedding model from Hugging Face in Rust
  • sparse vectors for hybrid search from Rust
  • local embeddings on Apple silicon GPU from Rust
  • ship a single binary that does its own embeddings and reranking
  • port my Python fastembed search pipeline to Rust with the same models

Features

  • dense, sparse and image embeddings
  • rerankers (BGE, Jina)
  • synchronous API, no Tokio dependency
  • ONNX inference through ort
  • quantized model variants
  • user-defined local models via try_new_from_user_defined
  • candle backend for Qwen3, nomic v2 MoE and BERT, with Metal and CUDA
  • DirectML on Windows
  • default text model: BAAI/bge-small-en-v1.5 (384 dimensions)
  • models download from Hugging Face on first use and are cached (FASTEMBED_CACHE_DIR); no network needed once cached
View 2 more
  • default features download ONNX Runtime binaries at build time (ort/download-binaries); ort-load-dynamic links a system library instead
  • similarity helpers (cosine_similarity, top_k) for small in-memory searches

Capabilities

Has official SDKsplan not known

Alternatives

The same job

These do what fastembed-rs does.

  1. model2vec-rs Fast State-of-the-Art Static Embeddings in Rust
  2. FastEmbed Fast, light, accurate library built for retrieval embedding generation
  3. candle Minimalist ML framework for Rust

Compare fastembed-rs with the top 3