DEV.co
Vector Databases · Anush008

fastembed-rs

FastEmbed-rs is a Rust library for generating vector embeddings and reranking text/images locally without external API calls. It supports multiple embedding models (BAAI, Sentence Transformers, Nomic, etc.) and uses ONNX inference for performance.

Source: GitHub — github.com/Anush008/fastembed-rs
954
GitHub stars
133
Forks
Rust
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
RepositoryAnush008/fastembed-rs
OwnerAnush008
Primary languageRust
LicenseApache-2.0 — OSI-approved
Stars954
Forks133
Open issues1
Latest releasev5.17.2 (2026-06-15)
Last updated2026-06-30
Sourcehttps://github.com/Anush008/fastembed-rs

What fastembed-rs is

Rust native library leveraging ONNX runtime (via ort crate) for inference and Hugging Face tokenizers for encoding. Supports dense/sparse text embeddings, image embeddings, and reranking with configurable batch processing and multi-threading. No async runtime dependency; synchronous API.

Quickstart

Get the fastembed-rs source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/Anush008/fastembed-rs.gitcd fastembed-rs# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Local RAG pipelines with on-premises data

Embed documents and queries locally for retrieval-augmented generation without sending sensitive data to cloud APIs. Supports multiple embedding models for language/domain-specific needs.

Hybrid search with sparse + dense embeddings

Combine SPLADE sparse embeddings with dense embeddings (BGE, Sentence Transformers) in the same library for improved ranking precision without external services.

Production Rust services requiring embeddings

Integrate directly into backend services written in Rust with minimal overhead; synchronous API avoids Tokio dependency and simplifies deployment in constrained environments.

Implementation considerations

  • ONNX model files are downloaded on first use; plan for network access and disk storage (~100MB–1GB per model depending on size).
  • Feature flags required for some models (e.g., `nomic-v2-moe`, `qwen3`); review Cargo.toml dependencies before release.
  • Multi-threading via `with_intra_threads()` configurable; tune per CPU cores and batch size for your workload.
  • Synchronous API means blocking calls; embed processing in thread pool or async runtime wrapper if needed in async contexts.
  • Quantized model variants (e.g., `EmbeddingGemma300MQ4`) available to reduce memory footprint and inference latency on resource-constrained hardware.

When to avoid it — and what to weigh

  • Need real-time latency guarantees on large batches — No published performance benchmarks provided. Inference speed depends on hardware and model size; verify against your latency SLAs before adoption.
  • Require models not in the curated list — Limited to pre-selected ONNX-compatible models. Adding unsupported models requires custom integration work.
  • Building polyglot systems without Rust expertise — Rust ecosystem tooling (cargo, build dependencies) may introduce friction for teams unfamiliar with the language. Consider Python/JS variants if team lacks Rust experience.
  • Need commercial support guarantees — Community-driven project with no explicit SLA or vendor support channel documented. Maintenance depends on community contributions.

License & commercial use

Apache License 2.0 (permissive). Allows commercial use, modification, and distribution with attribution and no warranty. Derivative works must retain the license.

Apache 2.0 explicitly permits commercial use. No license restrictions on integrating into proprietary products. However, verify compliance with upstream dependency licenses (ort, tokenizers) in your supply chain.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

No disclosed vulnerabilities or security audit mentioned. Models and tokenizers downloaded from Hugging Face Hub; verify source trustworthiness. Rust memory safety mitigates buffer overflows. No input sanitization documented; assume application responsibility for content filtering. ONNX runtime and tokenizer dependencies are external attack surface; keep versions current.

Alternatives to consider

fastembed (Python)

Official Python port by Qdrant. Better ecosystem integration, larger community, simpler deployment for ML-heavy teams, but less suitable for production Rust backends.

ollama

Lightweight local LLM runner with embedding support. Simpler onboarding but less fine-grained control and performance tuning than FastEmbed-rs.

llamacpp / llama.cpp Rust bindings

CPU-first inference engine with embedding support. Broader model compatibility but less optimized for embedding-specific workloads than FastEmbed-rs.

Software development agency

Build on fastembed-rs with DEV.co software developers

FastEmbed-rs gives you production-grade embeddings without external APIs. Explore the crate, review the model list, and assess hardware requirements for your use case.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

fastembed-rs FAQ

Does FastEmbed-rs require a GPU?
No. ONNX runtime defaults to CPU. GPU acceleration requires explicit CUDA/TensorRT setup; not documented in provided excerpt. Verify hardware support in official docs.
Can I use this in async Rust code (Tokio)?
Yes, embedding and reranking calls are blocking. Wrap in `tokio::task::spawn_blocking()` or run in a dedicated thread pool to avoid blocking the async runtime.
What are the memory requirements?
Depends on model size. Small models (MiniLM) ~100–200 MB; large models (BGE-large, Gemma-300M) 500 MB–1.5 GB. Check model cards on Hugging Face Hub.
Is inference reproducible across runs?
Unknown. No explicit statement on determinism or floating-point behavior. Test critical use cases locally if reproducibility is required.

Software developers & web developers for hire

DEV.co helps companies turn open-source tools like fastembed-rs into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your vector databases stack.

Ready to embed locally in Rust?

FastEmbed-rs gives you production-grade embeddings without external APIs. Explore the crate, review the model list, and assess hardware requirements for your use case.