omni-stack — OmniRoute + OpenHands (self-hosted) + Hermes agent, in Docker
One docker compose stack that runs three things and wires them together:
- OmniRoute — a self-hosted, OpenAI-compatible
LLM gateway (one
/v1endpoint, many upstream providers, quota-aware fallback). This is the single place both agents send model traffic to. - OpenHands — the self-hosted coding agent, here as the
classic agent UI on
:3000, configured entirely through environment variables. - Hermes — Nous Research's self-improving agent, running as a messaging gateway, with its model pointed at OmniRoute.
OpenAI-compatible /v1 upstream
┌─────────────┐ ───────────────────────────────► ┌───────────┐ ─────────► ┌──────────────┐
│ OpenHands │ │ OmniRoute │ │ OpenAI, │
│ :3000 │ │ :20128 │ │ Anthropic, │
└─────────────┘ │ │ │ Gemini, │
┌─────────────┐ ───────────────────────────────► │ + Redis │ │ OpenRouter… │
│ Hermes │ └───────────┘ └──────────────┘
│ gateway │ (dashboard :9119 with `make up-ui`)
└─────────────┘Both agents share one OmniRoute API key and one model id (OMNI_MODEL). Add a provider once in the
OmniRoute dashboard and every agent can use every model OmniRoute exposes.
Requirements
- Docker Engine + Docker Compose v2 (
docker compose). - Linux, macOS (Docker Desktop), or WSL2. Linux hosts need the Docker socket available — the
stack mounts
/var/run/docker.sockso OpenHands can launch its sandbox. - ~4 vCPU and 8–16 GB RAM. OmniRoute is given an 8 GB V8 heap by default (coding agents need it); it is far below that when idle.
openssl,curl,awk(present on virtually every Linux/macOS host).- Outbound network access. Hermes' first boot clones its official plugin catalog from GitHub; if that is blocked it waits up to ~5 minutes once, then continues.
Quick start
# 1. Prepare .env (secrets, host paths, UIDs) and render the Hermes config.
make init # or just run `make up`, which does this first
# 2. Start OmniRoute, provision its API key, then start OpenHands + Hermes.
make up
# 3. Add at least one upstream provider in OmniRoute, then pick a model:
# open http://127.0.0.1:20128 (password = INITIAL_PASSWORD in .env)
# Providers -> add provider -> paste its API key
KEY=$(grep -E '^OMNIROUTE_API_KEY=' .env | cut -d= -f2-)
curl -s -H "Authorization: Bearer $KEY" http://127.0.0.1:20128/v1/models | jq -r '.data[].id' | head
# 4. Put a model id from that list into .env, then re-apply:
# OMNI_MODEL=auto/best-coding
make upUntil step 3 is done, /v1/chat/completions returns
{"error":"No active credentials for provider: …"} — that is OmniRoute telling you to connect a
provider, not a wiring problem.
Endpoints
| Service | URL (host, loopback only) | Notes |
|---|---|---|
OmniRoute dashboard + /v1 | http://127.0.0.1:20128 | login with INITIAL_PASSWORD |
| OmniRoute server-to-server API | http://127.0.0.1:20129 | rarely used directly |
| OpenHands | http://127.0.0.1:3000 | classic agent UI |
| Hermes dashboard | http://127.0.0.1:9119 | only with make up-ui; basic auth |
Inside the compose network the gateway is reachable at http://omniroute:20128/v1.
How the integration works
scripts/up.sh (run by make up) does the wiring:
- Creates
.envif missing, fillsJWT_SECRET,API_KEY_SECRET,INITIAL_PASSWORD, host paths, UIDs/GIDs and the dashboard secrets. - Renders
hermes/config.yamlfromhermes/config.yaml.tmplusingOMNI_MODEL/OMNI_BASE_URL. - Starts OmniRoute, waits for
/healthz, then logs into OmniRoute and creates a real API key, writing it toOMNIROUTE_API_KEYin.envandhermes/.env. - Starts the agents with that key.
OpenHands is configured purely by environment (see docker-compose.yml):
LLM_MODEL=openai/${OMNI_MODEL} # LiteLLM strips the openai/ prefix; OmniRoute sees ${OMNI_MODEL}
LLM_BASE_URL=${OMNI_BASE_URL} # http://omniroute:20128/v1
LLM_API_KEY=${OMNIROUTE_API_KEY}
CUSTOM_LLM_PROVIDER=openai
SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.9-nikolaik
WORKSPACE_MOUNT_PATH=<absolute host path> # mounted into the sandbox at /workspaceHermes reads hermes/config.yaml (mounted at /opt/data/config.yaml):
model:
provider: custom # any OpenAI-compatible endpoint
default: "auto/best-coding" # rendered from OMNI_MODEL
base_url: "http://omniroute:20128/v1"
api_mode: chat_completions
key_env: OMNIROUTE_API_KEY # read from hermes/.envModel ids
OMNI_MODEL must be exactly an id OmniRoute serves (from /v1/models or the dashboard). The
auto/* aliases (auto/best-coding, auto/best-chat, …) route across whatever providers you
connected. OpenHands sends ${OMNI_MODEL} verbatim (after the openai/ LiteLLM prefix); Hermes
sends model.default verbatim.
Hermes interfaces
- Messaging gateway: add platform tokens (e.g.
TELEGRAM_BOT_TOKEN) tohermes/.env, thendocker compose restart hermes. The gateway process is already running (gateway run). - Web dashboard:
make up-ui, then open http://127.0.0.1:9119. The login isHERMES_DASHBOARD_BASIC_AUTH_USERNAME/HERMES_DASHBOARD_BASIC_AUTH_PASSWORDfrom.env(default useradmin, password auto-generated). - Health/config check:
docker compose exec -T hermes hermes doctor.
hermes -z "..."(one-shot) may printGateway inaccessible: service_manager_unavailablewhen exec'd into the s6 container. Use the dashboard or a messaging channel for interactive chat.
Common commands
make init # prepare files only
make up # start everything
make up-ui # start everything + Hermes dashboard (:9119)
make ps # container status
make logs # follow logs
make health # probe OmniRoute /healthz
make reconfigure # re-render hermes/config.yaml and restart
make down # stop (keeps named volumes)
make reset # stop and DELETE volumes (wipes OmniRoute keys/data + OpenHands state)Security notes
- OpenHands mounts the host Docker socket. Anything running in that container can control the Docker daemon, which is effectively root on the host. Run this stack on a dedicated machine or VM, not on a shared workstation with other sensitive containers.
- All published ports bind to
127.0.0.1. Do not setAPP_BIND_HOST=0.0.0.0whileREQUIRE_API_KEY=false— that exposes an unauthenticated/v1proxy. To expose OmniRoute, setREQUIRE_API_KEY=true(and put the real key inOMNIROUTE_API_KEY), and front it with an authenticating reverse proxy + TLS. .envholds secrets and is gitignored. Secrets are generated atmake inittime.- The Hermes dashboard uses basic auth because it binds
0.0.0.0inside its container; keep the host port on loopback.
Troubleshooting
No active credentials for provider: X — add that provider and its key in the OmniRoute
dashboard (http://127.0.0.1:20128 → Providers). auto/* models pick from whatever is connected.
OpenHands can't write the workspace (Linux) — the sandbox runs as SANDBOX_USER_ID (auto-filled
from your uid). Make the workspace writable, or point OPENHANDS_WORKSPACE_PATH at a directory you
own:
chmod -R a+rwX ./workspace # quick, dedicated-workspace optionOpenHands first conversation is slow — the app pulls
ghcr.io/all-hands-ai/runtime:0.9-nikolaik (or builds a runtime image) the first time it starts a
sandbox. Later conversations reuse it.
Docker socket permission errors — make up detects the socket's GID into DOCKER_GID and adds
it via group_add. If you moved Docker or run rootless Docker, set DOCKER_GID in .env to
stat -c '%g' /var/run/docker.sock.
Hermes first boot is slow / logs install out of sync (pnpm…) / default plugins not settled —
it is installing its plugin catalog from GitHub (bounded to ~5 minutes, then boot continues). This
resolves on later boots. With GitHub blocked, configure only messaging platforms you need.
/v1/models returns 401 — it requires some credential even when REQUIRE_API_KEY=false.
make up provisions a real key automatically; if it could not (e.g. you changed the OmniRoute
password by hand), create a key in the dashboard and set OMNIROUTE_API_KEY in both .env and
hermes/.env.
Changing the model — edit OMNI_MODEL in .env, run make up. up.sh re-renders
hermes/config.yaml when the model differs and recreates both agents.
Files
docker-compose.yml # redis + omniroute + openhands + hermes
docker-compose.ui.yml # `make up-ui`: Hermes dashboard + gateway API server
.env.example # every knob, documented
scripts/up.sh # bootstrap: secrets, paths, key provisioning, start
Makefile # thin wrapper around up.sh / docker compose
hermes/config.yaml.tmpl # Hermes model config template (rendered to hermes/config.yaml)
omniroute/ # (OmniRoute state lives in the `omniroute-data` volume)
workspace/ # OpenHands' read/write workspace (gitignored)Alternative: OpenHands Agent Canvas (v1.x)
This stack uses the classic OpenHands agent UI (ghcr.io/all-hands-ai/openhands:0.9) because it is
fully configurable through LLM_* env vars. The current OpenHands/OpenHands line is Agent
Canvas (ghcr.io/openhands/agent-canvas:1.46.0, port 8000). It is a single container with no
Docker-socket requirement, but its LLM is set in the UI instead of env: in
Settings → LLM, set Model openai/<OMNI_MODEL>, Base URL http://omniroute:20128/v1, and an
OmniRoute key. To use it, swap the openhands service image/ports and drop the docker.sock mount.