-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please support reranker API #2018
Comments
I spent some time trying to figure out how to implement. Below are my workouts:
from sentence_transformers import CrossEncoder
# init reranker model
model = CrossEncoder('maidalun1020/bce-reranker-base_v1', max_length=512)
# calculate scores of sentence pairs
scores = model.predict(sentence_pairs)
|
that's definetly a good addition - adding to our roadmap. Thanks also for pointing out the steps |
Thank you for your feature request, Thiner! We appreciate the details and the code example you provided to help illustrate the implementation. Adding reranker API support to LocalAI would indeed be a valuable improvement, especially considering the current state-of-the-art solutions for RAG systems. To proceed with this feature request, we will evaluate the feasibility of incorporating a reranker API implementation similar to the example you provided, using a model like We will update the roadmap to include this feature request. Once we have completed our internal discussions and evaluations, we will provide an estimate of when this feature can be implemented, along with any additional details regarding the implementation. Feel free to reach out if you have any further questions or concerns in the meantime. Thanks again for your suggestion and for helping us improve LocalAI! |
as a possible more configurable approach we may benefit from the project https://github.com/AnswerDotAI/rerankers |
having a quick look at this - let's see if can get something working before the weekend |
that is a very good news. thank you very much |
Please forgive me for my lazy thinking, the solution is quite straightforward, |
@mudler thank you for the cross-link references since I was mostly focused on LiteLLM and Ollama for maximizing compatibility, but knowing that LocalAI is "getting there" is quite a relief |
I'd suggest you to use standard (non-core) images as those do not come with additional python dependencies. If you want to use the core images still, you can or either create a Dockerfile based on top of it and run the command to prepare the backend, or use https://localai.io/advanced/#extra-backends So, for instance you can use it like this:
and that should bring you up the needed python dependencies on startup. |
Yes, I did so. The docker image is created successfully by specifying the extra nackend. But I got the grpc error at runtime still. Is there any changes to grpc module in the v2.13.0 release? I built the autogptq image with this dockerfile previousely, and that's working. |
Is your feature request related to a problem? Please describe.
Nowadays, embedding + reranker is the SOTA solution to improve the accuracy of RAG system. We've already have the embedding API support in LocalAI, it would be a big step forward if we can support reranker API.
Describe the solution you'd like
There are many reranker models out there, some famous names:
bce-reranker-base_v1
,CohereRerank
,bge-reranker-v2-m3
. I think the Jina reranker API would be a good format to implement. https://jina.ai/reranker/#apiformDescribe alternatives you've considered
n/a
Additional context
The benchmark regarding embedding+reranker for RAG:
The text was updated successfully, but these errors were encountered: