Simple container to use FlashRank as an API.
405
FlashRank-API is a FastAPI-based REST service that provides text reranking capabilities using the FlashRank library. It allows you to rerank a list of passages based on their relevance to a given query using various BERT-based models.
docker pull flashrank-api:latest
docker run -p 8000:8000 flashrank-api:latest
The API will be available at http://localhost:8000.
Reranks a list of passages based on their relevance to a query.
{
"query": "your search query",
"passages": [
{
"id": "1",
"text": "passage content",
"meta": {
"optional_key": "optional_value"
}
}
],
"max_length": 128,
"model": "ms-marco-MultiBERT-L-12"
}
Parameters:
query (required): The search query to rank passages againstpassages (required): Array of passages to rank
id: Unique identifier for the passage (any type)text: The passage contentmeta: Optional metadata objectmax_length (optional): Maximum sequence length for the model (default: 128)model (optional): Name of the BERT model to use (default: "ms-marco-MultiBERT-L-12"){
"results": [
{
"id": "1",
"score": 0.95,
"text": "passage content",
"meta": {
"optional_key": "optional_value"
}
}
]
}
Health check endpoint to verify service status.
{
"status": "healthy"
}
This project is licensed under the MIT License - see the LICENSE file for details.
Content type
Image
Digest
sha256:5cdc0d158…
Size
106.5 MB
Last updated
almost 2 years ago
docker pull zandervdm/flashrank-api