The router Compose file does not start an inference backend or agent. Run the agent Compose file separately on each host where an inference engine is available.
Stack overview
The router host runs:
Each inference host runs:
Prometheus scrapes the router’s metrics endpoint. Agents push their hardware, engine, latency, and routing signals to the router, so Prometheus does not need direct access to every agent host.
Network requirements
Prometheus, Loki, Tempo, and the router metrics endpoint remain inside the Compose network by default.
Before you start
You need:- Docker 20.10 or later
- Docker Compose 2.0 or later
- Git, OpenSSL,
curl, andjq - one router host
- one or more inference hosts
- network access between the router and agents
- an inference backend running on each agent host
- NVIDIA drivers and the NVIDIA Container Toolkit on GPU hosts
8888 of each agent host.
Configure the shared secret
The current Compose files contain achangeme placeholder for the router-agent JWT secret.
Before starting the stack, change this line in both docker-compose.yml and docker-compose.agent.yml:
HIVENET_ROUTER_JWT_SECRETis the host-side variable read by Docker Compose.HIVENET_ROUTER_JWT_SECRETis the environment variable read inside the Hivenet Router container.
.env file on the router host:
.env files by default. Do not commit the secret.
Allow administrator access for this walkthrough
The router refuses to start with unauthenticated/admin/* endpoints unless the insecure override is explicitly enabled.
For this local walkthrough, add the following environment value to the router service in docker-compose.yml:
Start the router stack
1
Clone the repository
On the router host:Make the JWT substitution described above in
docker-compose.yml, then create the .env file.2
Review the exposed ports
The router service publishes:Grafana publishes:Prometheus, Loki, Tempo, and port
2112 remain internal unless you change the Compose file.3
Start the stack
Build the router and start all services:Check their status:The stack should include:
routerprometheusgrafanatempolokipromtail
4
Check the router
Check the public liveness endpoint:Expected response:Check the operational health endpoint:Before any agents register, the router should report zero agents and a degraded operational state.
5
Open Grafana
Open:The default credentials are:Change the password before exposing Grafana outside a trusted environment.You can also change the initial password before startup by editing:in
docker-compose.yml.Connect an agent host
Repeat these steps on every machine that runs an inference backend.1
Prepare the GPU host
Clone the repository:Run the host setup script:Replace
192.168.1.100 with the router’s reachable IP address.The script checks or installs:- Docker
- Docker Compose
- the NVIDIA Container Toolkit
- GPU container access
- required host packages
- the host packages and container runtime required by the agent
2
Start the inference backend
The agent Compose file expects a backend on the host at:For vLLM, one example is:Wait for the model to load:Then check the backend:A ready vLLM server returns HTTP status
200.3
Copy the shared secret
Copy the router’s Make the same JWT substitution in
.env file to the agent host through a secure channel:docker-compose.agent.yml:4
Update and start the agent
The current agent connection path does not use Then set the router address and agent metadata:Replace:
--router-p2p, --p2p-listen-port, or --p2p-announce-addr.If docker-compose.agent.yml still contains these command entries, remove them before starting the agent:ROUTER_GRPCwith the router’s gRPC authentication addressAGENT_REGIONwith the region label you want to exposeAGENT_CAPACITYwith the concurrency the backend can supportMACHINEwith a stable machine identifier
8902 and 8903; it does not expose an inbound Hivenet Router port.5
Check the agent
Inspect the agent logs:The logs should show that the agent authenticated and registered with the router.On the router host, confirm registration:For a fuller view of routing, latency, hardware, and engine state:
Agent environment variables
The agent Compose file accepts:ROUTER_GRPC must be reachable from the agent host. After authentication, the router supplies the libp2p connection details the agent uses for its outbound transport connection.
Persistent data
The Compose files create named volumes:
Running
docker compose down stops and removes containers but retains these volumes.
Running docker compose down -v also deletes the volumes and their data.
Configure routing policies
The router mounts the repository’spolicies directory at:
command list in docker-compose.yml:
Configure API authentication
Client authentication is disabled when no auth configuration is provided.Static API keys
Copy the example configuration:docker-compose.yml:
Dynamic API keys
For runtime-managed keys, add these container environment variables to the router service:.env:
Configure persistent quota counters
Quota counters use in-memory storage by default and reset when the router restarts. To persist daily token counters in BadgerDB, add:badger_data volume preserves those counters across container restarts.
Configure debug logging
Set one global log level:Access the services
To inspect Prometheus without exposing it publicly, use an SSH tunnel:
Useful Prometheus queries
Active agents:Grafana dashboards
The repository provisions dashboards for:- router and agent health
- request and routing counters
- smoothed round-trip time
- hardware and engine metrics
- policy routing behavior
- tenant usage
- audit logs
audit_logs volume. Promtail reads those files and sends them to Loki.
Back up persistent data
Stop the stack before taking filesystem-level snapshots:hivenet-router. Confirm the actual names first:
Restore the router database
Stop the stack:Troubleshooting
An agent does not appear
Check the agent logs:- a different JWT secret on the router and agent
- an incorrect or unreachable
ROUTER_GRPCaddress - the router advertising a libp2p address the agent cannot reach
- a missing or incorrect router
--p2p-announce-addrbehind NAT or port translation - an unhealthy inference backend
Prometheus cannot scrape the router
Inspect Prometheus targets:Grafana has no metrics
Confirm that Prometheus contains Hivenet Router data:Grafana has no audit logs
Check Loki and Promtail:Agent metrics are missing
Agents do not expose a separate Prometheus endpoint for this deployment. They push metrics to the router. Inspect the routing table:Next steps
Bare metal
Run the router and agents directly without Docker.
vLLM agent
Configure a vLLM backend, model discovery, metrics, and capacity.
Grafana dashboards
Understand the provisioned dashboards and data sources.

