Overview
The Hugging Face reranker provider gives you access to thousands of reranking models available on the Hugging Face Hub. This includes popular models like BAAI’s BGE rerankers and other state-of-the-art cross-encoder models.Configuration
Basic Setup
Configuration Parameters
Advanced Configuration
TypeScript (self-hosted)
The TypeScript OSS SDK (mem0ai/oss) runs this reranker locally with Transformers.js, the same cross-encoder path as sentence_transformer, just a different default model. It executes ONNX weights, so the default is the ONNX mirror Xenova/bge-reranker-base. Point model at any ONNX-exported reranker on the Hub (a raw BAAI/bge-reranker-* PyTorch checkpoint will not load in this runtime).
batchSize and showProgressBar are accepted for parity with the Python SDK but are no-ops in the TypeScript runtime. trust_remote_code and model_kwargs are Python-only.Popular Models
BGE Rerankers (Recommended)
Multilingual Models
Domain-Specific Models
Usage Examples
Basic Usage
Batch Processing
Performance Optimization
GPU Acceleration
Memory Optimization
Model Comparison
Error Handling
Custom Models
Using Private Models
Local Model Path
Best Practices
- Choose the Right Model: Balance quality vs speed based on your needs
- Use GPU: Significantly faster than CPU for larger models
- Optimize Batch Size: Tune based on your hardware capabilities
- Monitor Memory: Watch GPU/CPU memory usage with large models
- Cache Models: Download once and reuse to avoid repeated downloads
Troubleshooting
Common Issues
Out of Memory ErrorNext Steps
Reranker Overview
Learn about reranking concepts
Configuration Guide
Detailed configuration options