Before you start
You need:- a running Hivenet Router router
- Infinity installed or available as a Docker image
- one or more embedding or reranking models
- network access between the agent host and router
- the Hivenet Router agent binary or Docker image
- the same JWT secret used by the router
- an NVIDIA GPU if you want CUDA inference and GPU metrics
They also use:
Start Infinity
Hivenet Router expects Infinity to expose:INFINITY_URL_PREFIX=/v1 so the inference and model endpoints use the paths expected by Hivenet Router.
- Docker
- Bare metal
Start one Infinity process with an embedding model and a reranking model:The named volume preserves downloaded model data between container replacements.Follow the startup logs:For CPU inference, use an appropriate CPU image and remove:Adjust
--device and --dtype for the selected Infinity image and hardware.200.
List the exposed models:
Understand model names
--model-id tells Infinity which model to load.
--served-model-name gives that model the public name exposed through Infinity’s API.
For example:
The order of repeated
--served-model-name values must match the order of the corresponding --model-id values.Prepare the Hivenet Router agents
You need two agents for this example:- one embedding agent for
bge-m3 - one reranking agent for
bge-reranker-large
- Docker
- Bare metal
From the Hivenet Router repository, build the agent image if you have not already done so:Create a directory for the shared secret and persistent identities:Place the router’s JWT secret at:Protect it:
Start the embedding agent
The embedding agent representsbge-m3 and accepts requests sent to:
- Docker
- Bare metal
Start the reranking agent
The reranking agent representsbge-reranker-large and accepts requests sent to:
- Docker
- Bare metal
- a separate
--identity-path - a unique process or container name
--backend-url. They initiate their own connections to the router, so you do not need a separate inbound agent port for each process.
Understand capabilities
Hivenet Router uses the agent capability to separate different kinds of inference traffic.
The router filters agents by capability before applying the rest of the routing policy.
An embedding request cannot be sent to a reranking agent, even if both agents use Infinity or share the same backend process.
Do not leave the default capability of
llm on an Infinity agent. Infinity rejects chat-completion requests, and Hivenet Router reports a structured invalid-request error.
Set agent capacity
--capacity controls how many concurrent requests Hivenet Router may assign to an agent.
It does not change Infinity’s batching or scheduler settings.
The original deployment examples use:
Treat these as starting points. The appropriate value depends on:
- model size
- accelerator and available memory
- input length
- batch size
- number of models sharing the Infinity process
- acceptable latency
For streaming-capable workloads, Hivenet Router releases an agent capacity slot when response headers arrive, while backend work can continue. Infinity embeddings and reranking are normally non-streaming, but the same
--capacity value remains a routing-admission setting rather than a direct backend scheduler limit.Verify both agents
On the router, check health:Test embeddings
Send a batch embedding request:Test reranking
Send a reranking request:index value points to the document’s position in the original input array.
Routing behavior
Hivenet Router routes embedding and reranking requests through the same policy pipeline used for language-model requests:- Filter by model.
- Filter by capability.
- Apply static policy matches.
- Apply health, capacity, and dynamic gates.
- Rank the remaining agents.
- Continue through configured fallback steps if needed.
Observability
The Infinity integration does not currently scrape engine-specific metrics from the Infinity backend. Hivenet Router still exposes:- registered agent state
- capability and model metadata
- routed and failed request counters
- active requests and capacity utilization
- request success rate
- smoothed round-trip time
- CPU and memory metrics
- NVIDIA GPU metrics when NVML is available
- audit records when audit logging is enabled
Troubleshooting
/v1/models returns 404
Confirm that Infinity was started with:
An agent cannot discover its model
Check Infinity:--model value exactly.
The wrong model name is exposed
Check the order of:Embedding requests are routed incorrectly
Confirm that the agent uses:Reranking requests are routed incorrectly
Confirm that the agent uses:reranker, while the HTTP endpoint is:
An agent does not register
Check its logs:- Docker
- systemd
- the router and agents use the same JWT secret
- the agent host can reach the router’s gRPC and libp2p ports
- each agent has a unique identity path
- Infinity is healthy
- the selected model is listed by
/v1/models
A peer ID changes after restart
Make sure each--identity-path points to persistent storage.
For Docker:
Requests time out
The agent’s backend HTTP timeout defaults to two minutes. Increase it when large batches need more time:- embedding or document batch size
- input length
- declared agent capacity
- Infinity batch size
- whether both models compete for the same GPU memory
GPU metrics are missing
Check the host:Next steps
Custom engine agent
Connect another OpenAI-compatible backend to Hivenet Router.
Embeddings
Review the embedding request and response format.
Reranking
Review reranking fields, examples, and response ordering.

