fastembed
Fast, light, accurate library built for retrieval embedding generation
What it is and what it does
FastEmbed is a Python library for generating vector embeddings from text, images, and multimodal documents using pre-trained ONNX models. It avoids the overhead of PyTorch by using ONNX Runtime, making it lightweight enough for serverless environments like AWS Lambda. The library supports multiple embedding types: dense embeddings (default Flag Embedding model), sparse embeddings (SPLADE++), late-interaction models (ColBERT), image embeddings (CLIP-based), and multimodal embeddings (ColPali). It also includes reranking via cross-encoders.
The package is built around a simple API: instantiate an embedding model by name, call its embed method with a list of inputs, and iterate over the resulting vectors. Models are downloaded from Hugging Face Hub on first use and cached locally. The library supports custom models and GPU acceleration via the optional fastembed-gpu variant. It integrates directly with Qdrant vector database for retrieval workflows.
Use it for:
- Build semantic search systems by embedding documents and queries, then finding nearest neighbors in a vector database.
- Embed product images and descriptions for multimodal e-commerce search without GPU infrastructure.
- Rerank search results using cross-encoders to improve relevance without recomputing full embeddings.
- Deploy embedding pipelines in serverless functions where PyTorch dependencies would exceed size limits.
- Generate sparse embeddings for hybrid search combining keyword and semantic matching.
- Embed PDF document screenshots with ColPali for document retrieval and question-answering.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
FastEmbed generates vector embeddings for text, images, and multimodal content using ONNX Runtime models, supporting dense, sparse, late-interaction, and reranking approaches without requiring GPU or large PyTorch dependencies.
Yes. FastEmbed is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem—generating embeddings without PyTorch overhead. The permissive Apache license and broad model support make it a practical choice for retrieval systems, serverless deployments, and CPU-only environments. Start with it if you need embeddings without GPU or large dependencies.
Install
fastembed on PyPI
pip
pip install fastembeduv
uv add fastembedpoetry
poetry add fastembedInstalling fastembed
Before you install
Low friction: pure Python wheel with no compiled dependencies beyond ONNX Runtime. Active maintenance (last commit 2026-08-12, 3140 GitHub stars) and supports current Python versions (3.10–3.14). Requires Python >=3.10.0.
License in practice
Licensed under Apache License with permissive treatment, allowing commercial and private use with minimal restrictions.
Quickstart
pip install fastembed
from fastembed import TextEmbedding
documents = ["Example text 1", "Example text 2"]
model = TextEmbedding()
embeddings = list(model.embed(documents))
Requires Python >=3.10.0; models are downloaded on first use and cached locally.
Verify before relying
- Whether model download size and cache location are configurable for constrained environments.
- Performance benchmarks comparing ONNX Runtime speed claims against PyTorch-based alternatives.
- Memory footprint for concurrent embedding operations on large datasets.
Package facts
| License | Apache License (permissive) |
| Python support | supports the current Python release (>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 10 — huggingface-hub, loguru, mmh3, numpy, onnxruntime, pillow, py-rust-stemmers, requests, tokenizers, tqdm |
| Maintenance | actively maintained — 144 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,608,559/month — #1,603 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fastembed-0.8.0-py3-none-any.whl
Keywords: vector, embedding, neural, search, qdrant, sentence-transformers
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
model2vecModel2Vec converts sentence transformers into…
permissive · top 5,000 on PyPI
mtebMTEB evaluates text and multimodal embeddings…
permissive · top 5,000 on PyPI
voyageaiProvides Python access to Voyage AI's embedding…
permissive · top 5,000 on PyPI
FlagEmbeddingFlagEmbedding provides embedding and reranking…
unclear · top 15,000 on PyPI
llama-index-embeddings-ollamaIntegrates Ollama's local embedding models with…
permissive · top 15,000 on PyPI
colpali-engineColPali-engine provides training and inference…
permissive · top 15,000 on PyPI
sentence-transformersComputes embeddings and reranking scores for…
permissive · top 1,000 on PyPI
InstructorEmbeddingInstructorEmbedding generates task-specific…
permissive · top 15,000 on PyPI
llama-index-vector-stores-qdrantIntegrates Qdrant vector database with…
permissive · top 15,000 on PyPI
pymilvus.modelProvides embedding and reranker model…
permissive · top 15,000 on PyPI