Core
Clusters
Join workers, pin them to a GPU, drain and remove them, and move a model between workers without failing a request.
In short
A cluster is one leader and the workers that join it. You mint a join token on the leader, run opod join on each new machine, and the leader routes requests to every worker that holds the model. You can drain a worker, remove it, or move a model to another worker without a failed request.
Join a worker
Mint a join token on the leader
opod token create --nodeThe key is printed once. Copy it.
Join from the new machine
opod join "http://leader.example.com:8080?token=sk-orc-<node-token>"✔ joining cluster at http://leader.example.com:8080 as n_abc123The command stays in the foreground while the worker runs.
Put a model on it
On the leader:
opod model add llama-3.2-3b --node n_abc123
A token in the URL is visible to anyone who can list processes. A process manager or container image should leave the URL bare and pass the token in OPOD_JOIN_TOKEN instead:
OPOD_JOIN_TOKEN=sk-orc-<node-token> opod join https://leader.example.comA URL without a scheme gets http://. Joining a non-local leader over plain http with a token prints a warning: use https (see Security).
What the worker does
-
Detects its hardware: OS, architecture, RAM, CPU cores and GPUs.
-
Picks the address the leader should dial: the LAN address on its default route, port
8081, orOPOD_ADVERTISE_ADDRwhen set.OPOD_ADVERTISE_ADDR=192.0.2.51:8081 opod join "http://leader:8080?token=sk-orc-<node-token>" -
Saves
~/.opod/node.yamlwith its node id, so the next join keeps the same id. -
Starts its HTTP API and its heartbeat loop. Each heartbeat carries the engine's loaded models and load sample.
-
With
OPOD_LOAD_MODEL=<catalog id>, loads that model itself once its engine answers.OPOD_LOAD_MODEL=llama-3.2-3b opod join "http://leader:8080?token=sk-orc-<node-token>"
From an empty leader to a served request
Every call between your CLI, the leader, a worker and its engine
One GPU and a memory budget per worker
Several workers can share one machine or one card:
opod join "http://leader:8080?token=sk-orc-<node-token>" --gpu 1 --vram-budget 20--gpu 1pins the worker's engine to device 1. It setsCUDA_VISIBLE_DEVICESandHIP_VISIBLE_DEVICESto1andONEAPI_DEVICE_SELECTORtolevel_zero:1for the engine, unless the variable is already set.--vram-budget 20caps the engine at 20 GB. For vLLM and SGLang, opod turns this into the engine's memory fraction: (budget − the engine's own overhead) ÷ card memory, clamped to 0.05–0.95. The card memory comes fromOPOD_CARD_MIB, else fromnvidia-smi; without either, the budget is not applied. Seeopod joinfor the formula.
The same values can come from OPOD_GPU_INDEX and OPOD_VRAM_BUDGET_GB. The flags win.
OPOD_GPU_INDEX=1 OPOD_VRAM_BUDGET_GB=20 opod join "http://leader:8080?token=sk-orc-<node-token>"On a box that a manager measured, pass the card size so the budget applies without nvidia-smi:
OPOD_CARD_MIB=49140 opod join "http://leader:8080?token=sk-orc-<node-token>" --vram-budget 20Join with a certificate
A worker with OPOD_NODE_CERT and OPOD_NODE_KEY can join with no token.
OPOD_NODE_CERT=/etc/opod/node.crt OPOD_NODE_KEY=/etc/opod/node.key \
OPOD_LEADER_CA=/etc/opod/ca.crt opod join https://leader.example.comIts node id is read from the certificate's SPIFFE URI SAN spiffe://<domain>/opod/node/<id>. The leader must have certificate checking on in its auth snapshot. See Security.
List and inspect nodes
opod node lsID HOSTNAME OS/ARCH ADDRESS STATE LAST HB
local mac-studio-1 darwin/arm64 127.0.0.1:8080 ready 2026-10-30T10:12:44Z
n_abc123 gpu-tower linux/amd64 192.0.2.51:8081 ready 2026-10-30T10:12:43Z
n_def456 lab-mac darwin/arm64 192.0.2.52:8081 lost 2026-10-30T10:06:40Zopod node show <id> prints the stored record as JSON, plus loadedModels.
node show prints the worker token
The record includes the worker's token (WorkerToken), which signs leader-to-worker calls. Treat the output as a secret.
Drain, undrain, remove
opod node drain n_abc123 # no new requests or gang parts; running requests finish
opod node undrain n_abc123 # back in rotation
opod node remove n_abc123 # the leader forgets it (prompts; --yes skips)- A drain lasts across heartbeats and worker restarts, until you undrain.
- These commands call the running leader, so its router drops the node's cached connection, cooldown and placements at once. When no leader answers, they write the store directly. Each command says which it did.
- A gang with a part on a drained node stops serving.
- When every worker holding a model is drained, requests for that model get
503withRetry-Afterand a message that names the drain. Other models keep serving. - The leader's own
localnode cannot be drained. Unload its models or stop the leader. removedoes not stop the worker process. If the worker still runs, its next heartbeat registers it again.
Move a model to another worker
opod model move llama-3.2-3b --from n_abc123 --to n_ghi789A move hands a whole (not sharded) model to another worker. The two copies overlap, so no request fails and none waits for a cold load:
- started — the target loads the model while the source keeps serving.
- loaded — the target's heartbeat shows it serving.
- flipped — the router stops choosing the source.
- drained — requests on the source finish (bounded by
placement.drain_timeout_seconds). - finished — the source unloads.
If the target never serves (30 minutes by default, which includes a download), the target unloads again and the source keeps serving. That outcome is aborted.
A move is refused before anything changes when:
- the source does not hold the model, or serves LoRA adapters of it;
- the target is drained or lost;
- the target cannot hold the model beside what it already holds (the message has the numbers);
- the target runs a one-model engine (vLLM, SGLang, llama.cpp, TensorRT-LLM) that serves another model;
- the model is sharded. Rebuild a gang with
opod shard create.
No KV cache moves. A conversation recomputes its prompt on the target at its next turn. An Ollama source keeps the weights on disk; its placement is marked released and is not routed to until the model loads there again.
A move needs the running leader. If the leader restarts during a move, the move is abandoned: the source serves, and the target's copy is a second replica. The steps also appear as events model.move_started, model.move_loaded, model.move_flipped, model.move_drained, model.move_finished and model.move_aborted.
opod model move, over time
Memory held and requests served by the source and the target
Worker shutdown
On SIGINT or SIGTERM a worker:
- tells the leader it is leaving, so the router stops sending it requests at once;
- lets requests already running finish, for at most
OPOD_DRAIN_SECONDS(default10;0stops at once); - stops its engine.
OPOD_DRAIN_SECONDS=60 opod join "http://leader:8080?token=sk-orc-<node-token>" # let long answers finishGive a container a termination grace period longer than OPOD_DRAIN_SECONDS.
Check it worked
opod node lsID HOSTNAME OS/ARCH ADDRESS STATE LAST HB
local leader-1 linux/amd64 127.0.0.1:8080 ready 2026-10-30T10:12:44Z
n_abc123 gpu-tower linux/amd64 192.0.2.51:8081 ready 2026-10-30T10:12:43ZThe new worker shows ready and a LAST HB less than 5 seconds old. opod node show n_abc123 lists the models its engine holds in loadedModels.
If it fails
| Symptom | Fix |
|---|---|
opod: no join token (?token= in the URL, or OPOD_JOIN_TOKEN) and no worker certificate … | Put the token in the URL or in OPOD_JOIN_TOKEN. |
join token refused 6 times in a row: … and the worker exits | The token was revoked or rotated. Mint a new one with opod token create --node. |
The worker is ready but no request reaches it | The leader cannot dial the advertised address. Set OPOD_ADVERTISE_ADDR=host:port to an address the leader can reach. It must be this machine's own, unless OPOD_BIND_ADDR names the one it owns (from core v0.4.0). |
The worker goes lost | No heartbeat for 30 s: the process stopped, or the network broke. |
| HMAC calls are refused | The clocks of the two machines differ by more than 5 minutes. Fix NTP. |
opod: the leader's own node cannot be drained — … | Unload the leader's models, or stop it. |
A move ends aborted | The target did not serve within 30 minutes. The source still serves. Read the reason on the model.move_aborted event. |
More in Troubleshooting.
Network requirements
| From | To | Port | Purpose |
|---|---|---|---|
| clients | leader | 8080 (listen) | /v1, /admin/v1, probes |
| workers | leader | 8080 | register, heartbeat |
| leader | each worker | 8081, or OPOD_ADVERTISE_ADDR | requests, model loads, process control |
| coordinator | gang parts | rpc_port_base + part index (llama.cpp, default 50052) | the gang's own traffic |
| scrapers | leader | probe_listen, if set | /healthz, /readyz, /loadz, /metrics |
Leader-to-worker traffic is signed but not encrypted. Keep it on a trusted network or a VPN you run.
Last updated · Source: content/docs/core/clusters.mdx · View as Markdown