Models
Cohere offers several reranking models:rerank-v3.5(default): Latest reranker, multilingual, best performancererank-english-v3.0: Previous generation, English onlyrerank-multilingual-v3.0: Previous generation, multilingual
Installation
Configuration
Python
TypeScript (self-hosted)
The TypeScript OSS SDK (mem0ai/oss) ships the Cohere reranker. Config keys are camelCase, it defaults to the rerank-v3.5 model, and you opt in per search with rerank: true.
Environment Variables
Set your API key as an environment variable:Usage Example
Python
Multilingual Support
For multilingual applications, use the multilingual model:Python
Configuration Parameters
| Parameter | Description | Type | Default |
|---|---|---|---|
model | Cohere rerank model to use | str | "rerank-v3.5" |
api_key | Cohere API key | str | None |
top_k | Maximum documents to return | int | None |
return_documents | Whether to return document texts | bool | False |
max_chunks_per_doc | Maximum chunks per document | int | None |
Features
- High Quality: Enterprise-grade relevance scoring
- Multilingual: Support for 100+ languages
- Scalable: Production-ready with high throughput
- Reliable: SLA-backed service with 99.9% uptime
Best Practices
- Model Selection:
rerank-v3.5handles English and multilingual workloads; pin an olderv3.0model only if you need to reproduce prior results - Batch Processing: Process multiple queries efficiently
- Error Handling: Implement retry logic for production systems
- Monitoring: Track reranking performance and costs