dense text embedding generation with onnx runtime acceleration
Generates dense vector representations of text using the TextEmbedding class, which leverages ONNX Runtime for CPU-optimized inference instead of PyTorch. The library automatically downloads and caches pre-trained models (default: BAAI/bge-small-en-v1.5), applies tokenization and pooling strategies (mean, cls, last-token), and supports batch processing with data parallelism for efficient multi-document embedding at scale.
Unique: Uses ONNX Runtime instead of PyTorch for inference, eliminating torch dependency overhead and achieving 2-3x faster embedding generation on CPU compared to sentence-transformers; includes automatic model downloading with Hugging Face integration and built-in batch parallelism via data-parallel processing
vs alternatives: Faster than sentence-transformers on CPU by 2-3x due to ONNX Runtime optimization and lighter dependency footprint; more accurate than basic TF-IDF but significantly faster than OpenAI API calls with local control
sparse text embedding generation for hybrid search
Generates sparse vector representations using the SparseTextEmbedding class, supporting multiple sparse embedding strategies (SPLADE, BM25, BM42) that produce high-dimensional vectors with mostly zero values. These sparse embeddings are designed to integrate with traditional keyword-based search systems, enabling hybrid search by combining dense semantic vectors with sparse lexical matching in a single retrieval pipeline.
Unique: Provides unified interface for multiple sparse embedding strategies (SPLADE, BM25, BM42) via SparseTextEmbedding class, enabling developers to switch strategies without code changes; integrates directly with Qdrant's native sparse vector support for efficient hybrid search without external systems
vs alternatives: More flexible than pure BM25 (adds semantic understanding) and more storage-efficient than maintaining separate dense+sparse indices; native Qdrant integration eliminates need for Elasticsearch or custom sparse indexing layers
minimal dependency footprint for serverless and edge deployment
Designed with minimal external dependencies (primarily ONNX Runtime and numpy), avoiding heavy frameworks like PyTorch or TensorFlow. This lightweight design enables deployment in resource-constrained environments such as AWS Lambda, Google Cloud Functions, and edge devices where package size and memory limits are strict. The library's total package size is <50MB, compared to 500MB+ for PyTorch-based alternatives.
Unique: Designed with minimal dependencies (ONNX Runtime, numpy only) achieving <50MB package size, enabling deployment in serverless and edge environments with strict size/memory limits; ONNX Runtime choice eliminates PyTorch overhead while maintaining inference quality
vs alternatives: Significantly smaller than PyTorch-based sentence-transformers (50MB vs 500MB+); faster cold start in serverless due to minimal dependencies; more practical for edge devices with memory constraints
late interaction token-level embedding with colbert
Generates token-level embeddings using the LateInteractionTextEmbedding class, which implements the ColBERT architecture to produce embeddings for each token in a document rather than a single aggregate embedding. This enables fine-grained matching where query tokens are compared against all document tokens, allowing relevance scoring based on the best token-pair matches rather than document-level similarity.
Unique: Implements ColBERT token-level embedding architecture via LateInteractionTextEmbedding class, enabling fine-grained token-to-token matching for improved relevance scoring; ONNX Runtime optimization makes token-level inference practical for production use despite computational overhead
vs alternatives: More precise than dense-only retrieval for phrase and entity matching; more efficient than running separate reranking models because token embeddings are computed once during indexing, not per-query
image embedding generation with clip-based models
Generates dense vector representations of images using the ImageEmbedding class, which leverages CLIP and similar vision-language models via ONNX Runtime. The class handles image loading, preprocessing (resizing, normalization), and batch inference to produce embeddings that capture visual semantics in a shared embedding space with text embeddings, enabling cross-modal search.
Unique: Provides unified ImageEmbedding class for CLIP-based models with ONNX Runtime optimization, enabling image embeddings in the same vector space as text embeddings for true cross-modal search; automatic image preprocessing and batch handling reduce boilerplate compared to raw CLIP usage
vs alternatives: Faster than PyTorch-based CLIP implementations due to ONNX optimization; more practical than cloud vision APIs for privacy-sensitive applications and high-volume indexing; shared embedding space with text enables direct text-to-image search without separate ranking
multimodal late interaction embedding for document images
Generates token-level embeddings for document images using the LateInteractionMultimodalEmbedding class, implementing the ColPali architecture to produce per-patch embeddings from document images (PDFs, scans). This enables fine-grained matching where query tokens are compared against visual patches in documents, supporting retrieval of specific content within document images without OCR.
Unique: Implements ColPali multimodal late interaction architecture for document images, enabling OCR-free document retrieval by matching query tokens against visual patches; ONNX Runtime integration with GPU support makes patch-level indexing feasible for production document collections
vs alternatives: Eliminates OCR pipeline complexity and errors; more accurate for documents with complex layouts, handwriting, or non-Latin scripts; patch-level matching provides better precision than document-level image embeddings for finding specific content
text pair scoring and reranking with cross-encoders
Scores pairs of texts (query-document, question-answer) using the TextCrossEncoder class, which applies transformer models that jointly encode both texts to produce relevance scores. Unlike bi-encoders that embed texts independently, cross-encoders directly model the relationship between text pairs, enabling accurate reranking of retrieval results or scoring of candidate answers without embedding the entire candidate set.
Unique: Provides TextCrossEncoder class for joint text pair encoding via ONNX Runtime, enabling efficient reranking without embedding all candidates; integrates seamlessly with dense retrieval results for two-stage ranking pipelines
vs alternatives: More accurate than dense similarity for relevance scoring because it models query-document interaction directly; more efficient than embedding all candidates when reranking top-k results; faster than LLM-based scoring while maintaining competitive quality
automatic model downloading and caching with hugging face integration
Automatically downloads pre-trained embedding models from Hugging Face Model Hub and caches them locally using a configurable cache directory. The system handles model versioning, integrity checking, and lazy loading, allowing developers to specify models by name (e.g., 'BAAI/bge-small-en-v1.5') without manual download management. Cache location defaults to ~/.cache/fastembed but is configurable for containerized or restricted-filesystem environments.
Unique: Provides transparent model downloading and caching integrated with Hugging Face Model Hub, eliminating manual model management; cache is configurable and supports custom backends for non-standard filesystems, enabling deployment in serverless and containerized environments
vs alternatives: Simpler than manual model downloading and version management; more flexible than sentence-transformers' caching (supports custom cache backends); integrates directly with Hugging Face ecosystem without requiring separate model management tools
+3 more capabilities