This guide uses example hostnames and private IP addresses. Replace them with addresses from your own network.
What you will deploy
The examples use three machines:
Applications send requests to the router. Each agent connects its local inference backend to the router.
Network requirements
Restrict ports
50051 and 9000 to agent hosts.
Agent hosts initiate their connections to the router and do not need to expose an inbound Hivenet Router port. Keep the metrics endpoint limited to your monitoring network.
Prerequisites
You need:- Linux with systemd on the router and agent hosts
- Go 1.25.5 or later on one build machine
- Git, OpenSSL, SSH,
scp,curl, andjq - an inference backend on each agent host
- an NVIDIA driver on GPU hosts if you want GPU metrics
- network access between the router and agents
Build the binaries
On the build machine:Prepare the runtime hosts
Create a dedicated service account and directories before copying the binaries.Router host
Onrouter-server:
useradd will report an error that you can ignore.
Create the required directories:
Agent hosts
Run these commands on each inference host:video group so it can access NVIDIA device metrics:
render group for device access, add that group as well:
Install the binaries
Copy the router binary to the router host through a temporary location:router-server:
root prevents the service account from replacing its own executable.
Create and distribute the JWT secret
The router and every agent must use the same JWT secret. On the build machine:Start an inference backend
Run an inference backend on each agent host. For vLLM:200.
The Hivenet Router agent runs as a long-lived daemon. It can start before the backend is ready and will continue polling until it becomes available. If the backend or router later becomes unavailable, the agent waits and reconnects rather than exiting on the first transient failure.
Configure the router service
Create:--p2p-listen-addr 0.0.0.0 setting is required when agents connect from other machines. The router defaults to listening on 127.0.0.1.
Configure the first agent
Create a host-specific environment file ongpu-eu-1:
If the
video group does not exist on your host, remove the SupplementaryGroups=video line. If your NVIDIA device permissions use another group, add that group instead.Configure the second agent
Install the same systemd service file ongpu-eu-2.
Create /etc/hivenet-router/agent.env with host-specific values:
Start the services
Onrouter-server:
Verify the deployment
On the router host, check the public liveness endpoint:Send an inference request
From a machine that can reach the router:Add another agent host
You do not need to restart the router when adding capacity. On the new host:- Create the
hivenet-routeraccount and directories. - Install the agent binary.
- Install the shared JWT secret.
- Create
/etc/hivenet-router/agent.envwith the router address and agent region. - Install the agent systemd unit.
- Start the inference backend.
- Enable and start
hivenet-agent.
Upgrade Hivenet Router
Build the new binaries on the build machine:Upgrade agents
When several agents serve the same model, upgrade them one at a time to preserve capacity. Copy the new agent binary:Upgrade the router
Copy the new binary:Roll back
To restore the previous router binary:hivenet-agent on an agent host.
Run an agent behind NAT
Agents initiate both authentication and libp2p connectivity to the router. An agent behind NAT therefore does not need an inbound port, reverse tunnel, or public announce address. The agent host needs outbound access to:--p2p-announce-addr with a multiaddress the agent can reach.
Troubleshooting
A service does not start
Inspect its status and recent logs:The router cannot read the JWT secret
Check the file ownership and mode:An agent does not register
From the agent host, check the router:- the router is not listening on
0.0.0.0 ROUTER_IPis incorrect- the router advertises a libp2p address the agent cannot reach
- the router needs a correct
--p2p-announce-addrbehind NAT or port translation - the router or agent firewall blocks outbound agent connectivity
- the JWT secret differs between hosts
- the backend has not become healthy
- the agent environment file contains an invalid value
The agent gets a new peer ID after restart
Confirm that the persistent identity file exists:GPU metrics are missing
Check NVIDIA access:Ports are already in use
Check live routing data
Next steps
vLLM agent
Configure vLLM discovery, capacity, metrics, and multi-model deployments.
Configuration reference
Review every router and agent flag and environment variable.
Authentication overview
Protect the client and administration APIs before production use.

