Skip to content

Xinference Rerank Format

This page at a glance

Important note

In 4All API, the structure of Xinference rerank responses is formatted to match Jina’s rerank response structure, and usage is the same as Jina rerank. For Dify and other client users: when configuring, please select Jina AI as the provider type instead of Xinference, and use the model name supported by Xinference.

Xinference’s rerank API is fully compatible with Jina AI’s rerank API. Please refer to the Jina AI Rerank Format documentation for detailed usage instructions, request parameters, and response format.

When using the Xinference rerank API, simply set the model parameter to a rerank model supported by Xinference; the rest of the parameters and usage are the same as with the Jina AI rerank API.

curl https://4All API地址/v1/rerank \
-H "Authorization: Bearer $4All API_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jina-reranker-v2",
"query": "What is the capital of the United States?",
"documents": [
"The capital of Nevada is Carson City.",
"The Northern Mariana Islands are a group of islands in the Pacific Ocean, and their capital is Saipan.",
"Washington, D.C. (also called Washington or D.C., officially the District of Columbia) is the capital of the United States.",
"In English grammar, capitalization is the use of uppercase letters at the beginning of words. English usage differs from other languages in capitalization.",
"The death penalty existed in the United States before the country became a nation. As of 2017, it was legal in 30 of the 50 states."
],
"top_n": 3
}'

For more details, please refer to the Jina AI Rerank Format documentation.