Before you start
You need:- a running Hivenet Router router
- an NVIDIA GPU with CUDA support
- network access between the agent host and the router
- access to the model you want to serve
- either Docker or a Python environment supported by vLLM
- the Hivenet Router agent binary or Docker image
- the same JWT secret used by the router
Start vLLM
- Docker
- Bare metal
Start vLLM with host networking:If the model requires authentication or license acceptance, provide the required credentials through your normal secrets-management process.Follow the startup logs:
200.
List the models reported by vLLM:
Prepare the Hivenet Router agent
- 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 agent identity:Place the router’s JWT secret at:Protect it:
Start the agent
- Docker
- Bare metal
/app/data mount preserves the agent’s peer identity across container replacement and restarts.The agent container receives GPU access so it can collect NVIDIA hardware metrics. Inference still runs in the separate vLLM process or container.Understand the agent settings
You can also add comma-separated routing tags:
Select the model
The agent can discover the model automatically or use an explicit model name.Automatic discovery
When--model is omitted, the agent requests:
Explicit model selection
Use--model when you want to pin the agent to a specific model:
The model name registered by the agent must match the model name clients send to Hivenet Router.
Connect multiple models
Each agent registers as an independent peer and represents one model. If one backend exposes multiple models, start one agent process for each model:--identity-path so every process keeps a distinct peer identity.
Set agent capacity
Set--capacity to the number of concurrent requests the backend can safely accept.
For vLLM, start by matching it to --max-num-seqs:
For streaming responses, Hivenet Router releases the agent capacity slot when response headers arrive, while backend generation can continue. Treat
--capacity as a routing-admission setting rather than a hard limit on ongoing streams, and verify vLLM concurrency under sustained streaming load.Verify the connection
On the router, check agent health:vLLM metrics
The agent scrapes vLLM’s/metrics endpoint every 500 milliseconds by default.
It sends the resulting engine data to the router, which exposes it through the router’s Prometheus endpoint. The agent does not expose a separate Prometheus port.
View all engine metrics on the router:
Use vLLM metrics in routing policies
You can exclude agents whose KV cache is under pressure:Troubleshooting
The agent cannot discover a model
Check vLLM health:The wrong model is registered
Automatic discovery selects the first model returned by/v1/models.
Pin the correct one:
The agent does not register
Check the agent logs:- Docker
- systemd
KV cache utilization remains high
Reduce the amount of work Hivenet Router assigns to the agent:Preemptions keep increasing
Rising preemptions indicate that vLLM is evicting in-flight KV-cache data under memory pressure. Reduce:--capacityon the Hivenet Router agent--max-num-seqson vLLM- model context or batch pressure, where appropriate for your workload
Backend requests time out
The agent’s backend HTTP timeout defaults to two minutes. Increase it for longer requests:The peer ID changes after restart
Make sure--identity-path points to persistent storage.
For Docker, confirm the volume is mounted:
Metrics are missing
Check vLLM’s metrics endpoint:Next steps
Ollama agent
Connect an Ollama backend for local or edge inference.
Routing concepts
Learn how Hivenet Router filters and ranks matching agents.
Engine metrics
Understand the metrics collected from vLLM and other engines.

