7 Use the Reranking Service
Use the Private AI Services Container reranking service to reorder a list of documents according to their relevance to a query. Reranking is useful when an application has already retrieved candidate passages or documents and needs to sort those results so that the most relevant items appear first.
The reranking service is made available through the /v1/rerank endpoint
and the model used for the request must be configured with the
TEXT_RERANK capability.
Reranking is just one of multiple inference services provided by the Private AI Services Container. For additional information relevant to this service along with chat completion and text classification, see Considerations for the Private Large Language Model Service.
Before you start using the reranking service, confirm the following:
- The Private AI Services Container is running.
- A reranking model is available in the container.
- The model is configured with the
TEXT_RERANKcapability. - You know the model name, which will be used in the request.
Note:
You can list the models that are currently available in the container by using the/v1/models endpoint. For
example:curl http://localhost:9091/v1/models- Configure a Reranking Model
A container administrator can configure a reranking model in the container configuration file. - Send a Reranking Request
Use the/v1/rerankendpoint to submit a query and a list of documents. The service returns the documents sorted by relevance.