fastembed-rs  by Anush008

Rust library for local vector embeddings and reranking

created 1 year ago
562 stars

Top 58.1% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This Rust library provides efficient, local generation of vector embeddings and reranking for text and images. It targets developers building AI-powered applications who need performant, self-contained solutions without external API dependencies. The library leverages ONNX Runtime and Hugging Face tokenizers for speed and supports a wide range of pre-trained models.

How It Works

The library utilizes ONNX Runtime for efficient, hardware-accelerated inference of pre-trained models, avoiding the need for heavy frameworks like PyTorch or TensorFlow. It integrates Hugging Face's tokenizers for fast text processing and Rayon for parallel batch processing of embeddings, optimizing throughput. This approach ensures a minimal dependency footprint and high performance for local execution.

Quick Start & Requirements

  • Install via Cargo: cargo add fastembed or add fastembed = "4" to Cargo.toml.
  • Requires Rust toolchain.
  • Supports local model files via try_new_from_user_defined(...) methods.
  • Official documentation and usage examples are available in the README.

Highlighted Details

  • Supports synchronous usage without Tokio dependency.
  • Offers a broad selection of text, image, and reranking models from Hugging Face and other providers.
  • Enables batch embedding generation with parallelism via Rayon.
  • Provides Rust, Python, Go, and JavaScript bindings for cross-language compatibility.

Maintenance & Community

The project is actively maintained by Anush008. It highlights its dependency on @pykeio/ort and @huggingface/tokenizers, suggesting potential community overlap. Support is encouraged via donations to the upstream ort project.

Licensing & Compatibility

Licensed under Apache 2.0. This license is permissive and generally compatible with commercial and closed-source applications.

Limitations & Caveats

The README does not specify any explicit limitations or known issues. The project appears to be a direct Rust port of existing fastembed libraries, implying feature parity is a goal.

Health Check
Last commit

15 hours ago

Responsiveness

1 day

Pull Requests (30d)
5
Issues (30d)
6
Star History
72 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.