reranker capability.
Infinity is the documented reranking backend. Other engine types can register as rerankers when their backend exposes a compatible
POST /v1/rerank endpoint. Ollama agents cannot use the reranker capability.How reranking requests are routed
For each request, Hivenet Router:- authenticates the client when API authentication is enabled
- applies the configured request-rate quota
- reads and validates the top-level
modelfield - checks that the API key may use that model
- filters for agents registered with the
rerankercapability - applies routing policies and capacity checks
- forwards the original request to
POST /v1/rerankon the selected backend - returns the backend response to the client
Request headers
Request body
A typical request contains:
Hivenet Router validates the
model field. The backend validates the other fields.
The model name must:
- match a model registered by a reranking agent
- be allowed by the caller’s API key when model restrictions are enabled
- contain no more than 256 characters
Request-body size
Hivenet Router limits/v1/* request bodies to 10485760 bytes, or 10 MiB, by default. The complete query and document array count toward this limit.
Requests above the configured limit receive HTTP 413 before routing. Configure the limit with HIVENET_ROUTER_MAX_REQUEST_BYTES, or set it to 0 to disable the built-in check. A reverse proxy or ingress may enforce a smaller limit.
Reduce the number or size of documents when a request receives 413. Do not depend on a particular JSON error body for this early rejection.
Basic request
Response
A successful response resembles:
The exact fields depend on the backend. Hivenet Router returns the successful response without changing result scores or ordering.
Use the
index field to recover the original document. Do not assume that document will contain the text.Use Python
Use reranking in a search pipeline
Reranking normally follows a broader retrieval step. A search system might first retrieve 50 approximate matches from a vector database, then ask a reranker to select the 10 most relevant documents.Additional request fields
Hivenet Router forwards the original JSON request to the backend. You can include additional fields supported by the selected reranking service, but Hivenet Router does not interpret or normalize them. For example:return_documents or another optional field works depends entirely on the backend.
Unsupported fields may be ignored or rejected.
No streaming support
Reranking requests are synchronous. Hivenet Router waits for the selected backend to score the documents and return the complete result set. The endpoint does not use server-sent events. For large candidate sets, keep the batch within the backend’s limits and configure an appropriate request timeout.Authentication and model access
When API authentication is enabled, send:403:
Quotas
Reranking requests participate in request-rate quota enforcement. When a finite request quota is configured, responses may include:429.
The current reranking path does not charge query or document tokens against the daily token quota. Successful reranking requests are recorded with zero input and output tokens for quota accounting.Reranking requests are also exempt from the LLM admission gates, including per-request token caps, KV-occupancy budgets, and serverless token rates. These gates model KV-cache-bound generation. Request-rate, body-size, and agent-concurrency limits still protect this path.
Routing policies
Reranking agents use the same routing pipeline as other Hivenet Router workloads. For example:llm or embedding.
Fallback chains can route across several compatible reranking agents that expose the same model.
Discover reranking models
List the reranking models available through the router:Supported agent configurations
Start the agent with:- Infinity
- vLLM
- SGLang
- llama.cpp
- custom engines
Error responses
Router errors use this envelope:
See Error codes for the complete reference.
Troubleshooting
The model is not found
List available reranking models:- the agent uses
--capability reranker - the requested model matches the registered model exactly
- the agent is healthy
- the API key may access the model
The request reaches the wrong capability
Inspect the agent registration:The backend rejects the request
Test it directly:- an empty query
- an empty document list
- unsupported document formats
- too many documents
- documents above the model’s token limit
- an invalid
top_n - unsupported optional fields
The response contains document: null
This is expected for backends that do not return document text by default.
Use each result’s index to retrieve the original document from the input array.
Results do not contain every document
Checktop_n.
For example:
top_n is omitted, the documented Infinity behavior is to return all ranked documents.
Requests time out
Reduce the number or size of candidate documents, or increase the agent’s backend timeout:- backend model loading state
- declared agent capacity
- accelerator memory
- competing embedding or reranking traffic
- backend batch configuration
The request is rate-limited
Check:Next steps
Models
Discover available models, capabilities, engines, and healthy capacity.
Infinity agent
Configure embedding and reranking models through Infinity.
Routing concepts
Learn how reranking agents are filtered, ranked, and used in fallback chains.

