Skip to main content
This guide deploys one Hivenet Router router and three agents across multiple machines. Two agents connect to vLLM backends serving the same model. A third connects to Ollama. You will send requests through the router, confirm that the agents registered, and inspect the resulting routing metrics.
The hostnames and private IP addresses in this guide are examples. Replace them with addresses from your own network.

What you will deploy

This example uses four machines: The router exposes one client-facing API to applications. Each agent connects an inference backend to the router.

Network requirements

The machines must be able to communicate over these ports: Agent hosts need outbound access to the router’s gRPC and libp2p ports. They do not need to expose an inbound Hivenet Router port. Keep the Prometheus endpoint limited to your monitoring network.

Prerequisites

You need:
  • Go 1.25.5 or later on one build machine
  • Git
  • OpenSSL
  • SSH and scp
  • curl
  • jq for formatting JSON responses
  • vLLM installed on the two vLLM hosts
  • Ollama installed, or permission to install it, on the Ollama host
  • access to the models used in this example
The compiled Hivenet Router binaries do not require Go on the target machines.

Prepare the target machines

On each router and agent machine, create the Hivenet Router directory:
Run these commands on:
  • router-server
  • gpu-eu-1
  • gpu-eu-2
  • gpu-us-1

Build and distribute Hivenet Router

On the build machine:
Copy the router binary:
Copy the agent binary to each inference host:

Create the shared JWT secret

The router and every agent must use the same JWT secret. On the build machine:
Copy it to every machine:
Set restrictive permissions on each machine:
Anyone with this secret can authenticate an agent with the router. Store and distribute it through your normal secrets-management process in production.

Start the vLLM backends

Run the following command on both gpu-eu-1 and gpu-eu-2:
Wait for the model to load, then check the health endpoint:
A ready vLLM server returns HTTP status 200.

Start the Ollama backend

On gpu-us-1, install Ollama if it is not already installed:
Configure and start the server:
Pull the model:
Check that Ollama is ready:
The endpoint should return HTTP status 200 and a list containing llama3.1:8b.

Start the router

On router-server, prepare the persistent database directory:
Start the router with unauthenticated administrator endpoints enabled for this isolated quickstart:
The --p2p-listen-addr 0.0.0.0 flag allows agents on other machines to reach the router’s libp2p endpoint.
HIVENET_ROUTER_ALLOW_INSECURE_ADMIN=true is suitable only for this isolated quickstart. It permits unauthenticated access to /admin/*. Configure administrator API-key authentication before exposing the router to shared or untrusted networks.
Check the public liveness endpoint:
Expected response:
Check the operational health endpoint:
Before any agents register, the response should report zero agents and a degraded operational state:
The full response also includes a Unix timestamp.
If the router runs behind NAT, inside Docker, or behind a public hostname, you may also need --p2p-announce-addr so agents receive a reachable router address.

Start the first vLLM agent

On gpu-eu-1:

Start the second vLLM agent

On gpu-eu-2:

Start the Ollama agent

On gpu-us-1:
This example gives the Ollama agent a capacity of 5. Set capacity according to the concurrency your backend can handle. For a multi-machine deployment, these two agent settings are particularly important: Agents initiate the connection to the router. You do not need to expose an inbound agent port or configure an agent announce address. The agent waits until its backend is healthy and a model is available before registering. If you do not pass --model, it registers the first model returned by the backend. Each agent registers one model.

Verify agent registration

On router-server:
With all three agents healthy, the response should resemble:
Peer IDs and timestamps will differ. For a fuller snapshot that includes routing, latency, hardware, and engine data:

Send an inference request

From any machine that can reach the router:
The router selects one of the two vLLM agents serving the requested model and forwards the request to it.

Observe load distribution

Send ten requests in parallel:
Inspect the routing counter:

Troubleshooting

The router gRPC endpoint is unreachable

On router-server, check that the port is listening:
On an agent machine, test connectivity to the router:

An agent does not register

Check for these common causes:
  • --router-grpc points to the wrong or unreachable address
  • the router is still listening for libp2p only on 127.0.0.1
  • the router advertises a libp2p address the agent cannot reach
  • the router needs a correct --p2p-announce-addr
  • the inference backend is not ready
  • the router and agent use different JWT secrets

A backend is not ready

Check vLLM:
Check Ollama:

The JWT secret does not match

Confirm that every machine has the same secret:
The hash should be identical on the router and every agent host.

A firewall blocks the connection

The exact commands depend on your firewall. With UFW, a basic router configuration could look like:
Agent hosts do not need an inbound Hivenet Router firewall rule. Allow their outbound connections to the router’s ports 50051 and 9000.
These are examples, not a complete network-security policy. Restrict every port to the clients, agents, or monitoring systems that require access.

Next step

Read the architecture overview to understand the router-agent control flow, data plane, storage, authentication, and routing pipeline.