---
title: "rerank"
sidebar_label: "rerank"
description: "Kotlin binding reference: rerank."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.modelverse](../index.md)/[RerankerModel](index.md)/[rerank](rerank.md)

# rerank

[common]\
fun [rerank](rerank.md)(query: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), documents: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)&gt;, instruction: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, listener: [RerankListener](../RerankListener/index.md)): [RerankHandle](../RerankHandle/index.md)

Score [documents](rerank.md) against [query](rerank.md). Returns at once; the worker runs the request and calls [listener](rerank.md) on its thread: [RerankListener.onScores](../RerankListener/onScores.md) with one score per document, in the documents' order, then [RerankListener.onDone](../RerankListener/onDone.md) with the [RerankReport](../RerankReport/index.md). [instruction](rerank.md) states the task in words when the checkpoint's default does not fit (null keeps it). A pair longer than the model's window is cut to it.