
Cross-encoder reranking of retrieved passages. Scores every query-document pair in a RerankInput with a local BGE cross-encoder, sorts by descending relevance, optionally truncates, and emits [RerankResult] carrying each document, score and original index.
Rerank retrieved passages and serve the ordered results as JSON.
Rerank, serialise the ordered list, then push it over HTTP.
RerankResult keeps the document's position in the original RerankInput document list as its index, preserved across the sort and any truncation, so downstream consumers can map results back to inputs.
[RerankResult] with no error rather than failing the message.
top_k zero keeps every reranked document; a positive value truncates to that many after the descending sort, so it only ever drops the lowest-scoring tail.
hf_model_id must be a cross-encoder reranker; a bi-encoder or other architecture loads but produces meaningless scores. A gated or private repo additionally needs an access token via hf_token.
device and all configuration are captured once at startup; the model is loaded once and reused across messages, and changing any setting requires a redeploy.
Automated release