Skip to content
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

Reranker API “top_k” Support #342

Open
etwk opened this issue Aug 19, 2024 · 5 comments
Open

Reranker API “top_k” Support #342

etwk opened this issue Aug 19, 2024 · 5 comments

Comments

@etwk
Copy link

etwk commented Aug 19, 2024

Feature request

Reran top_n is widely supported, for example here: https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/postprocessor/llama-index-postprocessor-jinaai-rerank/llama_index/postprocessor/jinaai_rerank/base.py

Suggest adding this feature. Thanks.

Motivation

This is a key feature in reranking at this moment.

Your contribution

I could submit a PR, please let me know what files need to be updated.

@michaelfeil
Copy link
Owner

michaelfeil commented Aug 19, 2024

I think you are looking for rerankiner models? And yes, these are supported under the Rerank endpoint. View the Readme.md.

A top_k argument is not widley supported, and there are no openAI rerank specs.

@michaelfeil
Copy link
Owner

michaelfeil commented Aug 19, 2024

https://docs.cohere.com/reference/rerank is supported - why would you need it? I personally see that you can do this in two lines of code client side.

@michaelfeil michaelfeil changed the title Embedding API top_n Support Reranker API “top_k” Support Aug 19, 2024
@etwk
Copy link
Author

etwk commented Aug 20, 2024

https://docs.cohere.com/reference/rerank is supported - why would you need it? I personally see that you can do this in two lines of code client side.

Maybe when a 3rd party app does not support API that does not support selecting the top n, and we have no direct control over how to use the output from reranker.

@michaelfeil
Copy link
Owner

michaelfeil commented Aug 20, 2024

@etwk Your instructions are not clear.

Please deploy, e.g. https://huggingface.co/mixedbread-ai/mxbai-rerank-xsmall-v1 via

infinity_emb v2 —model-id mixedbread-ai/mxbai-rerank-xsmall-v1

@michaelfeil
Copy link
Owner

@aloababa

Can you align this implementation to one of the following API protocols?

https://docs.voyageai.com/reference/reranker-api {return_documents: bool = False} {.., documents: str}
https://jina.ai/reranker/ {return_documents: bool = False} -> {.., documents: str}
https://docs.cohere.com/reference/rerank {no_kwarg_for_documents} -> {document: {text: str}}
https://huggingface.github.io/text-embeddings-inference {return_text: bool = False} -> {.., text: str}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants