LM-Kit OneDocs2026.8.10lm-kit.com
Inference

Reranking

Scores documents against a query using a reranking model.#

POST/lmkit/v1/rerank/score

Computes relevance scores for one or more documents against a query. Uses a cross-encoder or embedding-based reranking model to produce sigmoid-normalized similarity scores. Supports batch scoring. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/ for status and results.

Request body

application/json ·

PropertyTypeDescription
queryrequiredstring

The query text to score documents against.

documentsrequiredstring[]

A list of text passages to score against the query.

modelstring

The reranking model identifier. If not provided, the default reranking model is used.

normalizeboolean

If true, scores are normalized to [0,1] range using sigmoid. Defaults to true.

top_kobject (int32)

If specified, returns only the top K results sorted by score descending. If not specified, returns all results.

Responses

StatusTypeDescription
200

OK

202

Accepted

400

Bad Request

curl -X POST "$LMKIT_ONE_URL/lmkit/v1/rerank/score" \
  -H "Authorization: Bearer $LMKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "string",
  "documents": [
    "string"
  ],
  "model": "string",
  "normalize": true,
  "top_k": "string"
}'

Reranks search results with alpha-blended score fusion.#

POST/lmkit/v1/rerank/rerank

Takes caller-supplied search results (each carrying its raw similarity score) and applies a reranking model to produce blended scores. The final score is computed as: (alpha * raw_similarity) + ((1 - alpha) * reranker_score). Results are returned sorted by blended score descending. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/ for status and results.

Request body

application/json ·

PropertyTypeDescription
queryrequiredstring

The query text to rerank results against.

resultsrequired[]

The search results to rerank. Each must include content and raw_similarity.

modelstring

The reranking model identifier. If not provided, the default reranking model is used.

alphaobject (float)

Blending factor between original similarity and reranker score. 0.0 = original similarity only, 0.5 = equal blend (default), 1.0 = reranker score only.

top_kobject (int32)

If specified, returns only the top K results after reranking. If not specified, returns all results.

normalizeboolean

If true, reranker scores are normalized using sigmoid before blending. Defaults to true.

Responses

StatusTypeDescription
200

OK

202

Accepted

400

Bad Request

curl -X POST "$LMKIT_ONE_URL/lmkit/v1/rerank/rerank" \
  -H "Authorization: Bearer $LMKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "string",
  "results": [
    {
      "content": "string",
      "raw_similarity": "string",
      "collection_identifier": "string",
      "section_identifier": "string",
      "metadata": {}
    }
  ],
  "model": "string",
  "alpha": 0.5,
  "top_k": "string",
  "normalize": true
}'