SciPhi-AI / R2R

The most advanced Retrieval-Augmented Generation (RAG) system, containerized and RESTful
https://r2r-docs.sciphi.ai/
MIT License
3.65k stars 270 forks source link

add add-hoc rerank implementation to embedding, add async rerank #1572

Closed emrgnt-cmplxty closed 6 days ago

emrgnt-cmplxty commented 6 days ago

[!IMPORTANT] Adds asynchronous reranking to embedding providers and updates reranking configuration and dependencies.

  • Behavior:
    • Adds arerank() method to EmbeddingProvider class in embedding.py for asynchronous reranking.
    • Implements arerank() in litellm.py, ollama.py, and openai.py to return reranked results or original results if reranking fails.
    • Updates rerank() in litellm.py to support reranking via HuggingFace API.
  • Configuration:
    • Replaces rerank_dimension and rerank_transformer_type with rerank_url in EmbeddingConfig.
    • Updates r2r.toml to include rerank model configuration.
  • Dependencies:
    • Adds aiohttp to pyproject.toml for asynchronous HTTP requests.

This description was created by Ellipsis for 158a674f6511fd250287a3c84275436dee18b9e6. It will automatically update as commits are pushed.