The hostnames and private IP addresses in this guide are examples. Replace them with addresses from your own network.
What you will deploy
Applications send requests to the router on port
8080.
Agents authenticate with the router over gRPC, receive the router’s libp2p connection details, and initiate the persistent connection used for registration and inference traffic.
Network requirements
Agent hosts initiate their connections to the router and do not need to expose an inbound Hivenet Router port.
Keep the Prometheus endpoint restricted to your monitoring network.
Prerequisites
You need:- three Ubuntu or Debian machines
- Docker 20.10 or later on the router
- Docker Compose 2.0 or later
- an NVIDIA driver on each GPU machine
- Git, OpenSSL,
curl,jq, andscp - network access between the hosts on the ports listed above
- access to the model used in this guide
1
Prepare the router
On Make sure Docker is installed and running:Build the router image:Create the persistent database directory:
router-server, clone the repository:2
Prepare the GPU hosts
Run these steps on both Run the agent-host setup script:The script:Create a directory for the shared secret and persistent agent identity:
gpu-eu-1 and gpu-eu-2.Clone the repository:- verifies that the NVIDIA driver is available
- installs Docker and the Docker Compose plugin when needed
- installs and configures the NVIDIA Container Toolkit
- checks that containers can access the GPU
- verifies outbound connectivity requirements for the agent host
- installs host packages used by inference engines that compile native extensions
sudo.Build the agent image:3
Create and distribute the shared secret
On Copy the secret to both agent hosts:On each agent host, restrict access to the file:
router-server, from the repository root:4
Start the router
On The router uses host networking so its HTTP, gRPC, libp2p, and metrics interfaces bind directly to the machine.Check the public liveness endpoint:Expected response:Check the operational health endpoint:Before any agents register, the response should report zero agents:The full response also contains a Unix timestamp.
router-server, from the repository root:If the router is behind NAT, Docker port mapping, or a public hostname, configure
--p2p-announce-addr with an address the agents can reach.5
Start vLLM on the first GPU host
On Wait for the model to load:Check the backend health endpoint:A ready vLLM server returns HTTP status
gpu-eu-1:200.6
Start the first agent
On The declared capacity matches the vLLM The agent waits for the backend to become healthy, discovers the model through
gpu-eu-1:--max-num-seqs value used in this example.Check the agent logs:GET /v1/models, authenticates with the router, and registers.These flags are important in a multi-machine Docker deployment:7
Start vLLM and the agent on the second GPU host
On Wait for the backend to become healthy:Then start the second agent:
gpu-eu-2, start the second vLLM backend:8
Verify agent registration
On With both agents healthy, the response should resemble:Peer IDs and timestamps will differ.For a fuller view of routing, latency, hardware, and engine state:
router-server:9
Send an inference request
From a machine that can reach the router:The router selects one of the two agents serving the model and forwards the request to its local vLLM backend.Client authentication is disabled by default when no auth configuration is provided. To require API keys, configure the router with an auth file and include an authorization header in requests.See API keys for the complete setup.
10
Observe load distribution
Send ten requests in parallel:Inspect the routing counter:
Port reference
Because the agent container uses host networking, it reaches vLLM at
localhost:8888. The backend port does not need to be exposed outside the GPU machine.
Troubleshooting
An agent does not register
Check the agent logs:--router-grpcpoints to the wrong address- the router advertises a libp2p address the agent cannot reach
- the router is not listening on
0.0.0.0 - the backend is not healthy
- the router and agent use different JWT secrets
vLLM is not ready
Inspect the logs:The JWT secret does not match
On the router and each agent host:GPU metrics are missing
Check that Docker can access the GPU:A firewall blocks traffic
On the router, allow only the traffic your deployment requires. With UFW:Clean up
On each agent host:badger directory and agent identity files in /opt/hivenet-router remain after the containers are removed.
Next steps
Docker Compose
Add Prometheus, Grafana, Loki, and Tempo using the repository’s Compose stack.
vLLM agent
Configure model discovery, metrics, capacity, and multi-model deployments.
Routing concepts
Control how Hivenet Router filters, ranks, and falls back across agents.

