# Opod docs > Self-hosted LLM inference on NVIDIA, AMD, Intel and Tenstorrent GPUs: an open-source core with an OpenAI-compatible API, and a Kubernetes control plane that packs VRAM and autoscales to zero. --- title: "What opod is" description: "opod has two parts. Core serves models on your GPUs. The control plane installs with one Helm chart and runs core for you on Kubernetes." url: "https://opod.io/docs/get-started/" markdown_url: "https://opod.io/docs/get-started.md" section: "Get started" last_updated: "2026-10-30" --- # What opod is > opod has two parts. Core serves models on your GPUs. The control plane installs with one Helm chart and runs core for you on Kubernetes. opod serves open models on GPUs you own, behind an OpenAI-compatible API. It has two parts: | Part | What it is | Licence | | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | | **Core** (`opod`) | The runtime. A **leader** takes OpenAI requests and routes them to **workers**. Each worker runs one inference engine (llama.cpp, vLLM, SGLang, TensorRT-LLM) on one or more GPUs. | Apache-2.0, no usage limit | | **Control plane** (`opodcp`) | The product you install with `helm install opodcp`. It runs leaders and workers as Kubernetes workloads, places them on GPUs by measured VRAM, rolls out changes with proofs, scales them, and exports usage. | Proprietary. Free up to 4 GPUs in total. | You can run core by hand with `opod up` and `opod join`. See [Core](https://opod.io/docs/core/). These pages are about the control plane. ## What the control plane does - **Places models by measured VRAM.** A probe on every GPU node measures each card. The **placer** (the part that chooses GPUs) packs workers against those numbers, never against a card's nameplate. - **One endpoint per model.** An **endpoint** is one leader and its workers, serving one model at one URL. You describe it in a **plan**. The control plane makes the cluster match the plan. - **Sizes the KV cache from your traffic.** You say how long requests are and how many run at once (`plan.workload`); the planner turns that into context, slots and memory, and later compares it with what the engines used. See [KV cache](https://opod.io/docs/control-plane-endpoints/kv-cache/). - **Verified rollouts.** A change runs as a sequence of steps (prefetch weights, apply, converge, probe, smoke test, optional canary and eval, promote). A failed step restores the previous plan. - **Autoscaling.** Per endpoint: more workers under load, engine sleep, scale to zero. With KEDA, scaling keeps working while the control plane is down. - **Usage facts, not prices.** Requests, tokens and GPU-seconds per endpoint, model, team and day. You export them to your own store and price them there. - **Governance.** Users, roles, OIDC sign-in, teams with GPU quotas, API keys, a hash-chained audit log. - **A console.** The web UI is built into the `opodcp` binary. ## What it never does - **It is never on the request path.** Clients call the leader. The leader serves from files mounted in its pod. If the control plane stops, endpoints keep serving. - **It never stores prompts or answers.** Usage rows carry counts, not text. - **It never stops a running worker because of a licence.** A licence limit applies to new placements only. - **It installs no external service by default.** No Postgres, NATS, Prometheus or registry pods. It uses your database and connects to what you already run. ## Where to go next - [Quickstart](https://opod.io/docs/get-started/quickstart/): Install on a cluster with GPUs and serve a model. - [Concepts](https://opod.io/docs/get-started/concepts/): Endpoint, leader, worker, gang, cell, plan, ledger, placer. - [Use with LiteLLM](https://opod.io/docs/get-started/litellm/): LiteLLM works in front of any endpoint with a few lines of config: per-user keys and budgets there, GPUs here. - [Architecture](https://opod.io/docs/get-started/architecture/): What runs where, and what survives an outage. - [Requirements](https://opod.io/docs/get-started/requirements/): Kubernetes, GPUs, database and network. - [Design decisions](https://opod.io/docs/design/): Why opod is built this way: what each choice gives you and what it costs. --- title: "Quickstart" description: "Install the control plane on a Kubernetes cluster with GPUs, create an endpoint and send it a chat request." url: "https://opod.io/docs/get-started/quickstart/" markdown_url: "https://opod.io/docs/get-started/quickstart.md" section: "Get started" last_updated: "2026-10-30" --- # Quickstart > Install the control plane on a Kubernetes cluster with GPUs, create an endpoint and send it a chat request. This page takes you from a Kubernetes cluster with GPUs to a served model. It takes about ten minutes, most of it image pulls. The control plane is free up to 4 GPUs in total. You need no key and no sign-up. Images and the chart pull from `ghcr.io/opod-io` with no credentials, for `linux/amd64` and `linux/arm64`. > **Where it runs** > > `opodcp` is one Deployment in the `opod` namespace of your cluster. It needs outbound pulls from `ghcr.io` (or your mirror) and from your model source. Nothing outside the cluster connects to it. ## Before you start - Kubernetes 1.28 or newer, all nodes `Ready`, CoreDNS running - GPUs that a device plugin advertises (the chart brings the NVIDIA, AMD, Intel and Tenstorrent plugins when they are absent) - For the published `0.2.1`: a default StorageClass (its state is SQLite on a volume). For `0.3.0`: a Postgres database instead - `kubectl` and `helm` on your machine No GPU yet, or bare machines with no Kubernetes? See [Install on bare machines](https://opod.io/docs/control-plane-install/bare-metal/). 1. **Check the cluster** The chart runs the same check as a pre-install Job and refuses a half-install. Running it first shows the answer earlier. ```bash docker run --rm --network host --user "$(id -u):$(id -g)" -v ~/.kube:/kube:ro \ ghcr.io/opod-io/opodcp:0.3.6 preflight --kubeconfig /kube/config ``` The image runs as uid 65532 by default; `--user` lets it read a kubeconfig that only you can read. Every row marked `✘` is fatal and prints what to do. See [Preflight](https://opod.io/docs/control-plane-install/preflight/). 2. **Install the chart** **0.2.1 (published)** `0.2.1` keeps its state in embedded SQLite on a volume. It needs a default StorageClass and no database. ```bash helm install opodcp oci://ghcr.io/opod-io/charts/opodcp --version 0.3.6 \ -n opodcp --create-namespace --set admin.token=$(openssl rand -hex 16) ``` **0.3.0** > **Warning** > > This release is not published yet. Until it is, `helm install oci://ghcr.io/opod-io/charts/opodcp` with no `--version` installs `0.2.1`, which has no `ports.state.dsnSecret` or `ha.postgres` values and ignores them. Add `--version` with the new release number once it is out. See [Releases](https://opod.io/docs/get-started/releases/). The control plane keeps its state in your Postgres and nothing on its own disk. Put the whole DSN in a Secret: ```bash kubectl create namespace opodcp kubectl -n opodcp create secret generic opod-state \ --from-literal=dsn='postgres://opod:PASSWORD@your-postgres:5432/opodcp' helm install opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp \ --set admin.token=$(openssl rand -hex 16) \ --set ports.state.dsnSecret.name=opod-state ``` The Secret's key must be `dsn` (`ports.state.dsnSecret.key` changes it). No Postgres for a trial? Replace the `ports.state` flag with `--set ha.postgres.provide=true --set ha.postgres.instances=1`. The chart then installs the CloudNativePG operator and runs one Postgres instance. Do not use that path in production. 3. **Open the console** ```bash kubectl -n opodcp rollout status deploy/opodcp kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d; echo kubectl -n opodcp port-forward svc/opodcp 8080:8080 ``` Open `http://127.0.0.1:8080` and sign in with the token the second command printed. Next, create a real user or connect your identity provider: see [Users, roles and SSO](https://opod.io/docs/control-plane-security/authentication/). 4. **Create an endpoint** In the console, open **Endpoints → New**. Pick a model from the catalog and leave placement on **Auto**. The control plane picks the engine and the GPU from the VRAM it measured. Press **Preview** to see the choice and the reason for each step, then **Create**. Or use the API. Preview first: it creates nothing. ```bash H="Authorization: Bearer " BODY='{"name":"chat","model":"qwen2.5-0.5b-gguf","plan":{"placement":"auto","model":{"id":"qwen2.5-0.5b-gguf"},"workers":[],"shardGroups":[]}}' curl -s -H "$H" -H 'Content-Type: application/json' \ -X POST http://127.0.0.1:8080/api/v1/endpoints/preview -d "$BODY" | jq .plan.resolved curl -s -H "$H" -H 'Content-Type: application/json' \ -X POST http://127.0.0.1:8080/api/v1/endpoints -d "$BODY" | jq .id ``` 5. **Wait for serving** ```bash curl -s -H "$H" http://127.0.0.1:8080/api/v1/endpoints//status | jq .phase,.proof ``` The phase moves from `pending` to `converging` to `serving`. **Serving** means the leader produced a first token, not only that a pod is Ready. The `proof` field holds the evidence, for example `first token in 412 ms`. 6. **Send a request** Through the control plane's proxy (the console's Playground uses the same route): ```bash curl -s -H "$H" -H 'Content-Type: application/json' \ -X POST http://127.0.0.1:8080/api/v1/endpoints//gateway/v1/chat/completions \ -d '{"model":"qwen2.5-0.5b-gguf","messages":[{"role":"user","content":"hello"}]}' ``` Your applications call the endpoint directly. Inside the cluster its address is the endpoint's `url` field, for example `http://opodcp-ep-chat.opod.svc:8080`; point an OpenAI SDK at that URL plus `/v1`. Any OpenAI SDK works unchanged. With `endpoints.tls.embedded=true` (off by default) the URL is `https://` and the endpoint page shows the certificate fingerprint to pin. ## Next steps - **Mint API keys** on the **API keys** page and turn on **Require keys**. See [API keys](https://opod.io/docs/control-plane-endpoints/api-keys/). - **Reach the endpoint from outside the cluster** with your Gateway or Ingress. See [Network and TLS](https://opod.io/docs/control-plane-security/network-tls/). - **Connect your services** (usage sink, OIDC, alerts, logs) on the **Connectors** page. See [Connectors](https://opod.io/docs/control-plane-operate/connectors/). - **More than 4 GPUs?** See [Licensing](https://opod.io/docs/control-plane/licensing/). ## What keeps working when the control plane is down | With every `opodcp` replica and its database gone | | | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | Serving, load balancing, API keys | works | | Scaling out, scaling in and waking from zero with `autoscaler.adapter=keda` | works for dedicated workers; for a gang, park and wake only (`max: 1`), since a second gang is placed by the embedded loop (the release after 0.3.6) | | Scaling on the embedded autoscaler, shared endpoints, the sleep tier | frozen at the current size | | New endpoints, plan edits, rollouts | wait for the control plane | --- title: "Concepts" description: "The words the control plane uses — endpoint, leader, worker, gang, cell, plan, ledger, placer, run — and how they fit together." url: "https://opod.io/docs/get-started/concepts/" markdown_url: "https://opod.io/docs/get-started/concepts.md" section: "Get started" last_updated: "2026-10-30" --- # Concepts > The words the control plane uses — endpoint, leader, worker, gang, cell, plan, ledger, placer, run — and how they fit together. Every page in these docs uses the terms below. Each one has one meaning. ## Endpoint An **endpoint** is one model behind one URL. It is one leader and the workers under it. It belongs to one cell and one team. - One endpoint serves **one model identity**. Two models are two endpoints. LoRA adapters of the same base model are variants of that one identity, served as `:`. - To serve more traffic, an endpoint adds workers or gangs under the same leader. It never adds a second leader. - Its state is one of `pending`, `converging`, `serving`, `degraded`, `sleeping` or `deleting`. `serving` means the leader produced a first token. ## Leader The **leader** is core's `opod up` process, one pod per endpoint. It holds no model and no GPU. It serves the OpenAI-compatible API (`/v1/chat/completions`, `/v1/embeddings`, `/v1/rerank`, `/v1/models`), checks API keys, admits requests by worker slots, and routes each request to a worker by load — optionally weighted by each worker's KV-cache use and by the prompt prefix it holds. It reads its plan, its keys and its policy from files mounted in its pod, so it keeps serving when the control plane is down. If the leader pod dies, Kubernetes restarts it in about ten seconds. ## Worker A **worker** is core's `opod join` process plus one inference engine (llama.cpp, vLLM, SGLang or TensorRT-LLM) in one pod. It holds the model in GPU memory and registers with its leader by heartbeat. A worker row in the plan may ask for several replicas. ## Front doors **Front doors** are optional stateless copies of the leader's request path in front of one endpoint (`plan.gateways`). With doors on, a leader restart costs no requests. The leader stays the only router that owns the worker list. ## Gang A **gang** is one engine instance split across several pods, usually on several machines, for a model too big for one. The plan calls it a **shard group** (`shardGroups[]`). Its **head** is the part that coordinates the gang; it is a worker rank, never the leader. llama.cpp gangs use RPC parts, vLLM gangs use Ray, SGLang uses its own launcher. With the LeaderWorkerSet controller installed, a gang lands and restarts as one unit. ## Cell A **cell** is one Kubernetes cluster and the one control plane that manages it. Every object carries the label `opod.io/cell`. An endpoint lives in one cell. A **fleet** control plane (`mode=fleet`) reads several cells into one view and manages none. ## Plan The **plan** is the endpoint's desired state: the model, the engine, the workers and gangs, where they run, the autoscale policy and more. It is versioned (`apiVersion: opod.io/v1`) and every write bumps its `revision`. The control plane keeps every revision and why it was written. See [The plan](https://opod.io/docs/control-plane-endpoints/plan/). A plan is **explicit** (you name nodes, engine and split) or **auto** (you name the model; the control plane chooses and pins the shape). ## KV cache and workload The **KV cache** is the attention state an engine keeps for every token it is working on, in GPU memory beside the weights. It decides how many requests a worker serves at once and how long each may be. The plan's **workload** (`plan.workload`: request length, peak concurrency, margin) is how you tell the planner the traffic, so it can size the KV cache. A **KV tier** keeps evicted KV blocks in host memory or on disk for reuse. See [KV cache](https://opod.io/docs/control-plane-endpoints/kv-cache/). ## Ledger The **ledger** is the control plane's record of GPU memory: for every card, its measured size, what each worker claims, and what something outside opod uses. VRAM is the unit of scheduling, not whole GPUs. A card is **dedicated** (one worker owns it) or **shared** (workers packed by a VRAM budget). One node hosts one class at a time. ## Placer The **placer** chooses the node and card for each worker the plan does not pin. It judges a plan against the ledger, the licence ceiling and the team's GPU quota, and either accepts it or refuses it with an `E-…` code, a reason and alternatives. Preview runs the same judgement and writes nothing. ## Run A **run** is one change to an endpoint, recorded step by step: a create, an edit, a verified rollout, a rollback, a scale, a sleep, a wake or a delete. A failed run gives back what it took. See [Rollouts and runs](https://opod.io/docs/control-plane-endpoints/rollouts/). ## Ports and adapters Every dependency of the control plane is a **port** with an embedded default, and an **adapter** you can point it at your own service: usage sink, event bus, metrics, traces, logs, identity, alert notifier, secret store, checkpoints, batch files, KV store. The database is the one port you must provide. See [Connectors](https://opod.io/docs/control-plane-operate/connectors/). ## Roles and teams People sign in as **viewer** (read), **operator** (endpoints, plans, rollouts, keys) or **admin** (users, licence, connectors). A user with a **team** sees only that team's endpoints, jobs, keys and usage. See [Users, roles and SSO](https://opod.io/docs/control-plane-security/authentication/). --- title: "Architecture" description: "What runs where in a cluster with opod, how a plan becomes pods, and what keeps working when the control plane is down." url: "https://opod.io/docs/get-started/architecture/" markdown_url: "https://opod.io/docs/get-started/architecture.md" section: "Get started" last_updated: "2026-10-30" --- # Architecture > What runs where in a cluster with opod, how a plan becomes pods, and what keeps working when the control plane is down. The control plane manages; core serves. Requests never pass through the control plane. For why it is built this way, and what each choice costs, see [Design decisions](https://opod.io/docs/design/). ```text clients ──► endpoint Service ──► leader (core) ──► workers (core + engine) ──► GPUs ▲ mounted plan, keys, policy │ (Kubernetes Secret + ConfigMap) operators ──► opodcp (API + console) ──► Kubernetes API ──► Deployments, LeaderWorkerSets, Jobs │ ▲ ▼ │ probe readings (VRAM, host facts) your Postgres per-vendor telemetry DaemonSets ``` **Figure: The request path of one endpoint.** Your app calls the leader, which routes each request to the least loaded live worker. The control plane only writes configuration and is not on the request path. Pick a failure and watch where requests go. The interactive figure is on the web page: ## What runs in the cluster | Object | Count | Purpose | | -------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | | `opodcp` Deployment | 1 (or more, see [High availability](https://opod.io/docs/control-plane-install/high-availability/)) | API, console, controller loops | | Pre-install preflight Job | once per install or upgrade | refuses a cluster that would half-install | | GPU telemetry DaemonSets | one per vendor, on nodes labelled `opod.io/gpu-vendor` | measure every card and push the readings to the control plane every 20 s | | Device plugins | when absent | NVIDIA, AMD, Intel, Tenstorrent; optional RDMA and Multus | | LeaderWorkerSet controller | chart dependency, on by default | lands a multi-pod gang as one unit | | Per endpoint | 1 leader, N workers, optional doors | serving | | Per endpoint | 1 plan ConfigMap, 1 auth Secret | what the leader reads | Optional, off by default: KEDA, a provided Postgres (CloudNativePG), a provided NATS, the cell door, a shared KV store (Valkey). ## From plan to pods 1. You write a plan (console, API, or `opodcp apply`). 2. The **planner** judges it: engine and vendor support, model fit against measured VRAM, the KV cache the workload needs, host memory and disk for KV tiers, licence ceiling, team quota, node taints, parallelism rules. A refusal returns an `E-…` code with alternatives and writes nothing. 3. The plan is stored with a new revision, and a **run** starts. A verified rollout runs: validate → prefetch → apply → converge → probe → fabric proof → smoke → canary → eval → promote. 4. The **executor** renders Kubernetes objects with Server-Side Apply, in its own namespace, on objects it labels. 5. The **reconciler** keeps the cluster matching the stored plan. It never restarts a serving pod on its own because a template changed; that waits for a rollout. ## Identity and ownership Objects belong to an endpoint by **id**, not by name: they are named `opodcp-ep--` and selected by the label `opod.io/endpoint-id`. The one exception is the leader's Service, `opodcp-ep-`, which stays stable across re-creates because it is the in-cluster hostname workers join and clients call. A re-created endpoint with an old name never adopts the old one's objects. Objects of an endpoint the store does not know are reported as foreign and never touched. ## What survives an outage The leader serves from its mounted plan, auth snapshot and policy. Those are Kubernetes objects that the kubelet keeps in the pod. | Lost | Effect | | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Every `opodcp` replica | Serving, routing and key checks continue. With `autoscaler.adapter=keda`, scaling and wake-from-zero continue inside the capacity the control plane approved. New endpoints, plan edits and rollouts wait. | | The database | Calls answer `503 E-DB-UNREACHABLE` and change nothing; the control plane reconnects by itself. Serving continues. | | A leader pod | Kubernetes restarts it (about 10 s). With front doors on, requests keep flowing. | | A worker | The leader routes to the others. The reconciler replaces the pod. | | A node | Its workers stop; the leader routes to the workers left. Evacuate the node to move its workers through rollouts. A leader on a node that may no longer hold one is pinned to another node. | Key revocation does not need the control plane either. See [Revoke a key with the control plane down](https://opod.io/docs/control-plane-endpoints/api-keys/). ## What the control plane talks to | Direction | Peer | Why | | --------------- | --------------------------- | -------------------------------------------------------------------------------------- | | Out | Kubernetes API server | everything it manages; calls to a leader ride the API server's Service proxy | | Out | Your Postgres | its only durable store | | Out | `ghcr.io` or your mirror | image digests and signatures | | Out (from pods) | Hugging Face or your mirror | prefetch Jobs and workers fetch weights; a prefetch checks a published model signature | | Out, optional | your sinks | usage, logs, metrics, traces, alerts, NATS, Vault, object store | | In | operators, scripts | API and console on port 8080 | | In | telemetry pods | probe readings | Nothing calls home. The licence is verified offline. ## Scale One cell is one cluster. To manage more clusters, run one control plane per cluster and a fleet control plane over them. See [Several cells](https://opod.io/docs/control-plane/fleet/). --- title: "Use with LiteLLM" description: "Put LiteLLM in front of any opod endpoint with one key and a few lines of config. LiteLLM keeps users, budgets and limits; opod keeps the GPUs." url: "https://opod.io/docs/get-started/litellm/" markdown_url: "https://opod.io/docs/get-started/litellm.md" section: "Get started" last_updated: "2026-10-31" --- # Use with LiteLLM > Put LiteLLM in front of any opod endpoint with one key and a few lines of config. LiteLLM keeps users, budgets and limits; opod keeps the GPUs. LiteLLM works in front of any opod endpoint with no change to opod. Every endpoint already speaks the OpenAI API, so LiteLLM registers it as an ordinary `openai/` model. You need one opod key and about ten lines of YAML. ## What you get - **One OpenAI URL for every model.** Your apps call LiteLLM. LiteLLM sends each model name to the opod endpoint that serves it. - **Per-user keys, budgets and limits in LiteLLM.** Virtual keys, teams, requests and tokens per minute, budgets, model access per key. A spent budget is refused in LiteLLM, before any GPU work. - **GPUs, placement and scaling in opod.** The control plane places each model on measured VRAM, scales its workers and rolls out changes. LiteLLM sees none of it. - **Guardrails, prompt logs and key control in LiteLLM.** PII checks, prompt logs, refused-request logs, key pause and IdP groups to teams. See [Guardrails, prompt logs and key control](#guardrails-prompt-logs-and-key-control). - **Traces end to end.** The caller's `traceparent` goes through LiteLLM into the opod leader, which continues the trace. - **Cost joined with usage.** LiteLLM counts tokens per team. opod counts GPU-hours per endpoint. One SQL join gives GPU-hours per team. ## How it fits opod has no per-user keys, budgets, rate limits or model allowlists: those are the gateway's job. LiteLLM holds them. Each opod endpoint holds **one** key, and only LiteLLM knows it. opod never reads LiteLLM, and LiteLLM reads nothing from opod but the endpoint URL. You can upgrade, move or remove either one without the other. ```text apps, agents ──► LiteLLM (yours) ──────► opod endpoint (leader) ──► workers (GPUs) OpenAI SDK virtual keys, teams, one endpoint key, llama.cpp, vLLM, sk-litellm-… budgets, rpm/tpm, admission, routing, SGLang, TensorRT-LLM spend, prompt logs usage counts ``` ## Steps 1. **Have an endpoint that is serving** Use an endpoint you already have, or create one as in the [Quickstart](https://opod.io/docs/get-started/quickstart/). This page uses an endpoint named `chat-small` in namespace `opodcp` that serves the model `qwen2.5-0.5b-gguf`. Write down two values from the endpoint's page in the console (or `GET /api/v1/endpoints/`): | Value | Where | Example | | -------- | ---------------------------- | ------------------------------------------- | | URL | the endpoint's `url` field | `http://opodcp-ep-chat-small.opod.svc:8080` | | Model id | the endpoint's `model` field | `qwen2.5-0.5b-gguf` | The Service is always `opodcp-ep-` on port `8080`. With front doors on (`plan.gateways`), the endpoint's `url` is `opodcp-ep--front`: it reaches every door, and the leader too unless leader isolation is on. With `endpoints.tls.embedded=true` (off by default) the URL starts with `https://`; see the TLS note in step 3. 2. **Create one opod key for LiteLLM** ```bash export OPODCP_URL=https://cp.example.com # your control plane; default http://127.0.0.1:8080 export OPODCP_TOKEN= opodcp key create --endpoint chat-small --no-expiry litellm ``` The command prints `key k_… on chat-small, expires never (--no-expiry)` on stderr and the key itself, `sk-orc-`, on stdout. Copy it now: it is printed once. You can also mint it on the console's **API keys** page. > **Use --no-expiry, or plan a rotation** > > Without `--no-expiry` (or `--expires-in`), a key expires after 90 days. LiteLLM then gets `401 key_expired` on every request. The no-expiry choice is recorded on the `key.created` event. Then turn on **Require keys** for the endpoint, on its Connect card or with the API. From then on, a caller without the key gets `401`: ```bash curl -s -X PUT -H "Authorization: Bearer $OPODCP_TOKEN" -H 'Content-Type: application/json' \ https://cp.example.com/api/v1/endpoints//auth -d '{"requireKeys": true}' ``` This is the only opod key LiteLLM holds. Your users get LiteLLM keys, never opod keys. See [API keys](https://opod.io/docs/control-plane-endpoints/api-keys/). 3. **Write litellm-config.yaml** ```yaml # litellm-config.yaml model_list: - model_name: chat-small # the name your users ask for litellm_params: model: openai/qwen2.5-0.5b-gguf # openai/ + the endpoint's model id api_base: http://opodcp-ep-chat-small.opod.svc:8080/v1 # the endpoint URL + /v1 api_key: os.environ/OPOD_CHAT_SMALL_KEY # the key from step 2 stream_options: { include_usage: true } # count streamed tokens timeout: 120 # longer than opod's wake hold (see Troubleshooting) model_info: # Optional: a price per token, so LiteLLM's spend is in your money. input_cost_per_token: 0.0000001 output_cost_per_token: 0.0000004 general_settings: master_key: os.environ/LITELLM_MASTER_KEY # sk-litellm-… admin key; keep it for the API only database_url: os.environ/DATABASE_URL # LiteLLM's Postgres: its keys, teams and spend litellm_settings: forward_traceparent_to_llm_provider: true # one trace from the caller into opod ``` Three things matter here: - **`openai/` + the exact model id.** The leader serves one model. Any other name gets `404`. - **`/v1` at the end of `api_base`.** LiteLLM adds `/chat/completions` to it. - **`stream_options.include_usage`.** Without it, LiteLLM counts a streamed answer as zero tokens. The Postgres is LiteLLM's state, not opod's. Virtual keys and budgets need it. > **Endpoints with embedded TLS** > > With `endpoints.tls.embedded=true`, use `https://` and a name in the endpoint's certificate. The certificate names only the leader's Service (`opodcp-ep-`, `opodcp-ep-.`, `….svc`, `….svc.cluster.local`), never `opodcp-ep--front`. So with TLS, call `https://opodcp-ep-..svc:8080/v1` whether or not the endpoint has front doors; a call to `-front` over TLS cannot verify the certificate. With front doors and leader isolation on, that means LiteLLM must be listed in `networkPolicy.leaderIsolation.from` (step 5). Give LiteLLM that certificate as its trust store: it is item `tls.crt` of the endpoint's auth Secret. Mount it and point `SSL_CERT_FILE` and `REQUESTS_CA_BUNDLE` at it. 4. **Run LiteLLM** **Docker (a quick try)** From a machine that can reach the endpoint URL: ```bash docker run --rm -p 4000:4000 \ -v "$PWD/litellm-config.yaml:/app/config.yaml:ro" \ -e OPOD_CHAT_SMALL_KEY='sk-orc-' \ -e LITELLM_MASTER_KEY='sk-litellm-master-change-me' \ -e DATABASE_URL='postgres://litellm:PASSWORD@192.0.2.20:5432/litellm' \ ghcr.io/berriai/litellm:main-stable --config /app/config.yaml --port 4000 ``` A `*.svc` name resolves only inside the cluster. From outside, use the address your Gateway or Ingress publishes for the endpoint. See [Network and TLS](https://opod.io/docs/control-plane-security/network-tls/). **Kubernetes** Run LiteLLM in its own namespace with the label `app: litellm`, so the NetworkPolicy in the next step can admit it. LiteLLM also publishes a Helm chart; if you use it, match the policy to the labels it sets. ```bash kubectl create namespace litellm kubectl -n litellm create configmap litellm-config --from-file=config.yaml=litellm-config.yaml kubectl -n litellm create secret generic litellm-env \ --from-literal=OPOD_CHAT_SMALL_KEY='sk-orc-' \ --from-literal=LITELLM_MASTER_KEY='sk-litellm-master-change-me' \ --from-literal=DATABASE_URL='postgres://litellm:PASSWORD@your-postgres:5432/litellm' ``` ```yaml apiVersion: apps/v1 kind: Deployment metadata: { name: litellm, namespace: litellm } spec: replicas: 2 selector: { matchLabels: { app: litellm } } template: metadata: { labels: { app: litellm } } spec: containers: - name: litellm image: ghcr.io/berriai/litellm:main-stable # pin by digest in production: …@sha256: args: ["--config", "/app/config.yaml", "--port", "4000"] envFrom: [{ secretRef: { name: litellm-env } }] ports: [{ containerPort: 4000 }] volumeMounts: [{ name: config, mountPath: /app/config.yaml, subPath: config.yaml }] volumes: [{ name: config, configMap: { name: litellm-config } }] --- apiVersion: v1 kind: Service metadata: { name: litellm, namespace: litellm } spec: selector: { app: litellm } ports: [{ port: 4000, targetPort: 4000 }] ``` **Pin LiteLLM's image by digest** in production, never a rolling tag. LiteLLM's package was compromised twice in 2026. 5. **Make LiteLLM the only way in (if your cluster enforces NetworkPolicy)** **Require keys** (step 2) already stops a caller without the key. As defence in depth, admit only LiteLLM to port `8080` of the endpoint. The policy must also admit the endpoint's own pods, the control plane and the **API server**: the control plane probes a leader through the API server's Service proxy, so without that rule every rollout fails its probe step and rolls back. Leave the probe port `8081` open (`/healthz`, `/readyz`, `/loadz`, `/metrics`, read-only). ```yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: { name: only-the-gateway, namespace: opodcp } spec: podSelector: { matchLabels: { opod.io/front: chat-small } } # the leader and its doors policyTypes: [Ingress] ingress: - from: [{ namespaceSelector: { matchLabels: { kubernetes.io/metadata.name: litellm } }, podSelector: { matchLabels: { app: litellm } } }] ports: [{ port: 8080 }] - from: [{ podSelector: { matchLabels: { opod.io/endpoint: chat-small } } }] # its workers and doors - from: [{ podSelector: { matchLabels: { app.kubernetes.io/name: opodcp } } }] # the control plane - from: [{ ipBlock: { cidr: 192.0.2.10/32 } }] # where the API server reaches pods from - ports: [{ port: 8081 }] ``` Replace `192.0.2.10` with the addresses the API server uses to reach pods: its node address, and on flannel also the two addresses its node's interfaces hold in the pod range. The chart's `networkPolicy.leaderIsolation` is a different policy. It closes the leader's port, not the doors, and only on an endpoint with front doors (`plan.gateways.enabled`); an endpoint without doors gets a policy that stays open. So: - LiteLLM calling the endpoint's `url` (`opodcp-ep--front`) reaches the doors, which that policy does not close. It needs no entry. - LiteLLM calling the leader's own Service (`opodcp-ep-`, as with embedded TLS) must be listed in `networkPolicy.leaderIsolation.from`, or it is cut off. Policies add up. With `networkPolicy.enabled=true` and leader isolation off, the chart's `-endpoints` policy admits every source on 8080, so the policy above then closes nothing. Turn on leader isolation, or keep `networkPolicy.enabled` off and rely on the policy above alone. See [Gateways in front](https://opod.io/docs/control-plane-endpoints/gateways/) and [Network and TLS](https://opod.io/docs/control-plane-security/network-tls/). An endpoint on the cell door is reachable through the door with any of its keys. Put LiteLLM in front of the door too, or keep a gated endpoint off it. 6. **Create a LiteLLM key with a budget** Create a team with a budget and limits, then a key for one app of that team. These are LiteLLM's own API calls ([LiteLLM docs](https://docs.litellm.ai/)): ```bash LITELLM=http://litellm.litellm.svc:4000 # or http://127.0.0.1:4000 for the Docker try M="Authorization: Bearer sk-litellm-master-change-me" curl -s $LITELLM/team/new -H "$M" -H 'Content-Type: application/json' \ -d '{"team_alias":"search","max_budget":50,"budget_duration":"30d","tpm_limit":20000,"rpm_limit":60,"models":["chat-small"]}' curl -s $LITELLM/key/generate -H "$M" -H 'Content-Type: application/json' \ -d '{"team_id":"","key_alias":"search-prod","max_budget":10,"budget_duration":"1d"}' ``` The second answer carries `"key": "sk-litellm-…"`. Give that key to the app. 7. **Call it with the OpenAI SDK** The app talks to LiteLLM as if it were OpenAI. It never sees opod's URL or key. ```python from openai import OpenAI client = OpenAI(base_url="http://litellm.litellm.svc:4000/v1", api_key="sk-litellm-…") r = client.chat.completions.create( model="chat-small", # the LiteLLM model_name, not the opod model id messages=[{"role": "user", "content": "Say hello in five words."}], user="alice@example.com", # the end user, for LiteLLM's per-user spend ) print(r.choices[0].message.content, r.usage) ``` Pass the end user in OpenAI's `user` field. opod's usage row records only which endpoint key called, and with LiteLLM in front that is always the one LiteLLM key. ## Check it worked Run these four requests. Each one proves one link. **1. opod answers with its key.** From a pod that the NetworkPolicy admits (or before you apply it): ```bash curl -s http://opodcp-ep-chat-small.opod.svc:8080/v1/chat/completions \ -H 'Authorization: Bearer sk-orc-' -H 'Content-Type: application/json' \ -d '{"model":"qwen2.5-0.5b-gguf","messages":[{"role":"user","content":"hi"}]}' ``` Good: `200` with `choices[0].message.content` and a `usage` block. **2. opod refuses a caller without the key.** The same request with no `Authorization` header. Good: `401` with `"error": {"type": "missing_api_key", …}`. If you get `200`, **Require keys** is off. With the NetworkPolicy on, a pod outside LiteLLM's namespace gets no answer at all: the connection times out. **3. LiteLLM lists the model.** ```bash curl -s $LITELLM/v1/models -H 'Authorization: Bearer sk-litellm-…' ``` Good: `data[].id` holds `chat-small`, the `model_name` from your config. **4. A chat through LiteLLM works, streamed and counted.** ```bash curl -sN $LITELLM/v1/chat/completions -H 'Authorization: Bearer sk-litellm-…' -H 'Content-Type: application/json' \ -d '{"model":"chat-small","stream":true,"messages":[{"role":"user","content":"count to five"}]}' ``` Good: `data:` chunks, then one chunk with a `usage` block, then `data: [DONE]`. The key's spend in LiteLLM grows (`GET $LITELLM/key/info?key=sk-litellm-…`). The endpoint's request count in the opod console grows by one. ## Several endpoints and models One opod endpoint serves one model. Register **one LiteLLM model group per endpoint**, each with its own opod key: ```yaml model_list: - model_name: chat-small litellm_params: model: openai/qwen2.5-0.5b-gguf api_base: http://opodcp-ep-chat-small.opod.svc:8080/v1 api_key: os.environ/OPOD_CHAT_SMALL_KEY stream_options: { include_usage: true } - model_name: chat-large litellm_params: model: openai/ api_base: http://opodcp-ep-chat-large.opod.svc:8080/v1 api_key: os.environ/OPOD_CHAT_LARGE_KEY stream_options: { include_usage: true } router_settings: fallbacks: [{ "chat-large": ["chat-small"] }] # if chat-large fails, LiteLLM tries chat-small num_retries: 2 ``` - **Scale is opod's.** To serve more traffic for one model, add workers or gangs to its endpoint, or let its autoscaler do it. Do not list two copies of one endpoint in LiteLLM: the leader already balances across its workers by load. - **Fallbacks are LiteLLM's.** A fallback to another endpoint is a different model, so the answer can differ. Inside opod, an endpoint's policy can name a `fallbackUrl` that the leader forwards to when it has no serving capacity; see [Routing](https://opod.io/docs/control-plane-endpoints/routing/). - **LoRA adapters** of one endpoint are `:`, for example `model: openai/qwen2.5-0.5b-gguf:support`, with the same `api_base` and key. The leader refuses an adapter the plan does not name. - **Streaming** works as with OpenAI. Keep `stream_options.include_usage` on every entry. A stream that crosses its budget in LiteLLM finishes; LiteLLM refuses the next request. - **A retry is a new request.** LiteLLM's retries reach opod as new requests and are counted as such. ## Guardrails, prompt logs and key control These are LiteLLM settings, not opod ones. They were read from LiteLLM's docs on 2026-10-31. Check them against the LiteLLM version you pin. **PII and injection checks.** Run Microsoft Presidio's Analyzer and Anonymizer containers, set `PRESIDIO_ANALYZER_API_BASE` and `PRESIDIO_ANONYMIZER_API_BASE` in LiteLLM's environment, and add a guardrail. With `default_on: true` it runs on every request, so a client cannot skip it: ```yaml guardrails: - guardrail_name: presidio-pii litellm_params: guardrail: presidio mode: pre_call # before the request reaches opod default_on: true pii_entities_config: EMAIL_ADDRESS: MASK # MASK replaces it; BLOCK refuses the request CREDIT_CARD: BLOCK ``` A blocked request gets LiteLLM's `400` "Violated guardrail policy" and never reaches the endpoint, so it costs no GPU time. Guardrails per key, per model or by tag are LiteLLM enterprise features. **Prompt and answer logs.** opod never logs request content. LiteLLM's callbacks send it to your own store, for example Langfuse (set `LANGFUSE_PUBLIC_KEY`, `LANGFUSE_SECRET_KEY` and `LANGFUSE_HOST`): ```yaml litellm_settings: success_callback: ["langfuse"] # turn_off_message_logging: true # keep spend and metadata, drop prompts and answers ``` **Refused requests.** LiteLLM writes each request, refused ones included, to `LiteLLM_SpendLogs`. Read the failures with its paginated log API. `status_filter` and `error_code` filter it, and your proxy's `/docs` page lists their values: ```bash curl -s "$LITELLM/spend/logs/v2?start_date=2026-10-31&end_date=2026-11-01&status_filter=failure&page_size=100" -H "$M" ``` Requests that opod sheds under load are counted on the leader's `/metrics` as `opod_admission_shed_total`, not in LiteLLM. **Pause a key without revoking it.** Block it, then unblock it later. Its budget and spend stay: ```bash curl -s -X POST $LITELLM/key/block -H "$M" -H 'Content-Type: application/json' -d '{"key":"sk-litellm-…"}' curl -s -X POST $LITELLM/key/unblock -H "$M" -H 'Content-Type: application/json' -d '{"key":"sk-litellm-…"}' ``` **IdP groups to teams.** With SSO on LiteLLM's admin UI, name the claim that carries the user's groups. On each login the user joins every LiteLLM team whose `team_id` equals one of the groups. LiteLLM does not create teams from the claim: create each one first with `/team/new`, with `team_id` set to the group's value. ```yaml general_settings: litellm_jwtauth: team_ids_jwt_field: groups ``` LiteLLM's SSO is free for up to 5 users. Past that, and for SCIM, it needs LiteLLM's enterprise licence. The opod console's own SSO maps OIDC groups to opod roles (`OPODCP_OIDC_ROLE_CLAIM`, default `groups`) and does not reach LiteLLM. ## Traces and cost **Traces.** Turn on LiteLLM's OpenTelemetry callback and send its spans to the same collector as opod's: ```yaml litellm_settings: callbacks: ["otel"] forward_traceparent_to_llm_provider: true ``` Set `OTEL_EXPORTER=otlp_http` and `OTEL_ENDPOINT=/v1/traces` in LiteLLM's environment. LiteLLM then passes the **caller's** `traceparent` header to the endpoint, and the leader continues that trace. In 0.3.0 the leader also passes it to the worker and into the engine, so one trace runs caller → LiteLLM → leader → engine. LiteLLM does not start a trace header of its own for the backend: a caller that sends no `traceparent` gets two traces, LiteLLM's and opod's. See [Observability](https://opod.io/docs/control-plane-operate/observability/). **Cost per team.** opod knows how long each endpoint held its GPUs, busy and idle. LiteLLM knows which team sent which tokens (table `LiteLLM_DailyTeamSpend`). Split each endpoint's busy GPU-hours across teams by their token share that day, in your own BI tool, with your own price. The join key is your `model_list`: `model_name` → the endpoint in `api_base`. The SQL is on [Usage → Cost per team](https://opod.io/docs/control-plane-operate/usage/#cost-per-team). The GPU-hours export (`GET /api/v1/usage/gpu-daily`, JSON or CSV) is new in 0.3.0. Use the same export to **reconcile**: on a day where LiteLLM saw fewer tokens for an endpoint than opod served, traffic went around LiteLLM or a row was lost. ## Troubleshooting | What you see | Cause | Fix | | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `401 missing_api_key` from opod | LiteLLM sent no key: `api_key` is empty or its env variable is not set | Set `OPOD_CHAT_SMALL_KEY` in LiteLLM's environment and restart it | | `401 invalid_api_key` "Invalid or revoked API key" | Wrong key, a key of another endpoint, or a revoked key | Mint a new key for this endpoint (step 2). A revocation reaches the leader within about a minute | | `401 key_expired` | The key was minted without `--no-expiry` and its 90 days passed | Mint a new key with `--no-expiry`, update LiteLLM's Secret, then revoke the old one | | `404` "this endpoint serves only X (requested Y)" | `model:` after `openai/` is not the endpoint's model id | Copy the `model` field of the endpoint exactly | | `404` with no model message | `api_base` is missing `/v1`, so LiteLLM calls the wrong path | End `api_base` with `/v1` | | Name not found (DNS error) | Wrong Service name or namespace, or LiteLLM runs outside the cluster | Use `opodcp-ep-..svc`; from outside, use your Gateway or Ingress address | | Connection timeout | A NetworkPolicy drops LiteLLM's traffic | Check that the policy's `namespaceSelector` and `podSelector` match LiteLLM's namespace and pod labels | | Rollouts fail at the probe step after you add a policy | The policy does not admit the API server | Add the API server's addresses (step 5) | | TLS or certificate error | Embedded TLS is on and LiteLLM does not trust the endpoint's certificate, or it calls `-front`, which the certificate does not name | Use `https://opodcp-ep-..svc:8080/v1` and mount `tls.crt` as `SSL_CERT_FILE` (step 3) | | `503` "no workers are awake for this model — waking …" with `Retry-After: 10` | The endpoint is scaled to zero, or its workers are starting | In 0.2.1, retry (`num_retries` in LiteLLM). In 0.3.0 a `floor: 0` plan holds the request for at least 60 s, so give LiteLLM a `timeout` above that | | `503` with `Retry-After` while the endpoint is busy | Every worker slot is taken and the admission hold ran out | Raise `admission.holdMs`, add workers, or let the autoscaler grow. See [Routing → Admission](https://opod.io/docs/control-plane-endpoints/routing/#admission) | | `503` with `Retry-After: 30` on an endpoint that requires keys | The leader's key list is older than the age bound you set | Check the control plane is up and the doctor row `auth-snapshots`. See [API keys](https://opod.io/docs/control-plane-endpoints/api-keys/) | | A stream stops in the middle when the endpoint scales in | In 0.2.1 a stopping worker stops at once | In 0.3.0, `autoscale.scaleIn: drain` (the default) lets a worker finish its requests, up to `drainSeconds` (120). See [Autoscaling](https://opod.io/docs/control-plane-endpoints/autoscaling/) | | LiteLLM refuses with `budget_exceeded` | The key or team spent its budget. LiteLLM refuses it before opod sees it | Raise the budget in LiteLLM or wait for `budget_duration` to reset it | | Streamed answers show 0 tokens in LiteLLM | `stream_options.include_usage` is not set | Add it to every `litellm_params` | ## Rules that keep it correct - **Turn off LiteLLM's shared-secret login.** Out of the box its admin UI accepts `admin` and the master key. Create a real admin user, then set `general_settings.disable_env_credential_login: true`. - **Choose what happens when LiteLLM's database is down:** serve without budgets, or refuse. That choice is in LiteLLM's settings, not opod's. - **Bound the overshoot.** Requests already running when a budget runs out are still answered. A `max_tokens` cap per key or model limits how far that goes. - **Know the licence.** LiteLLM's proxy is MIT: virtual keys, teams, budgets, rate limits and spend tracking are free. Some features, such as SSO for its admin UI past 5 users, need LiteLLM's enterprise licence. Check LiteLLM's current list. ## Related pages - [Gateways in front](https://opod.io/docs/control-plane-endpoints/gateways/): LiteLLM, Gateway API InferencePool and Vertex AI routes. - [API keys](https://opod.io/docs/control-plane-endpoints/api-keys/): Mint, require and revoke endpoint keys. - [Routing policy](https://opod.io/docs/control-plane-endpoints/routing/): Admission, request classes, fallback and front doors. - [Usage](https://opod.io/docs/control-plane-operate/usage/): Usage export, GPU-hours per day and cost per team. --- title: "Requirements" description: "What the cluster, the nodes, the database and the network need before you install the control plane, and what the chart brings itself." url: "https://opod.io/docs/get-started/requirements/" markdown_url: "https://opod.io/docs/get-started/requirements.md" section: "Get started" last_updated: "2026-11-02" --- # Requirements > What the cluster, the nodes, the database and the network need before you install the control plane, and what the chart brings itself. `opodcp preflight` checks the cluster rows on this page for you. See [Preflight](https://opod.io/docs/control-plane-install/preflight/). ## Kubernetes | Requirement | Severity in preflight | Note | | ------------------------------------- | --------------------- | ---------------------------------------------------------------------------------------------- | | Kubernetes 1.28 or newer | fatal | EKS, GKE Standard, AKS, k3s, kind | | Every node `Ready` | fatal on install | a warning on upgrade; zero Ready nodes stays fatal | | CoreDNS running | fatal | workers join their leader by Service DNS | | GPUs a device plugin advertises | warning | the chart brings the NVIDIA, AMD, Intel and Tenstorrent plugins when absent | | RuntimeClass `nvidia` on NVIDIA nodes | warning | k3s registers it when `nvidia-container-toolkit` is installed | | A default StorageClass | warning | needed only for `ha.postgres.provide`, `pvc://` job checkpoints, and the `0.2.1` SQLite volume | | Cluster-admin for the install | — | the chart creates a ClusterRole, PriorityClasses and device plugins | **GKE Autopilot is not supported.** Workers keep model weights in a `hostPath` cache (`/data/models`), and the vendor probes read the host driver tree. **Node labels are not your job.** The control plane writes `opod.io/gpu-vendor` on every node from what the node advertises (`nvidia.com/gpu`, `amd.com/gpu`, `gpu.intel.com/*`, the Tenstorrent resource, cloud accelerator labels). Without that label the telemetry probes schedule onto no node and no VRAM is measured. `opodcp infra up` sets the label too on clusters it builds. **Tainted GPU nodes.** A taint keyed by the node's own device resource (for example `nvidia.com/gpu=present:NoSchedule` on GKE) needs nothing: workers placed there tolerate exactly that key. A taint of your own (`sku=gpu:NoSchedule`) needs `workloads.tolerations`. Until then the node is measured but never placed on. See [Configuration](https://opod.io/docs/control-plane-install/configuration/). ## Database From `0.3.0` the control plane's only durable store is **your Postgres** (any Postgres-wire database). It keeps nothing on its own disk. Without a database it starts in **setup mode** and asks for one. `0.2.1` embeds SQLite on a volume instead. Size the database for usage rows if you do not connect a usage sink: about 330 bytes per request row with indexes, kept 30 days by default. At 5 requests a second sustained that is about 13 million rows, roughly 4 GB. ## Accelerators and engines The chart pins one worker image per engine and vendor, by digest. The planner refuses a pair it has no image for, by name, before anything is created. | Engine | NVIDIA | AMD | Intel | Tenstorrent | no GPU | | ------------------ | ------------------------------------------------------------ | ----------------------------------------------------- | -------------------------------------------------------------------------------- | ---------------- | ----------------------------------- | | llama.cpp (GGUF) | image | image (ROCm, RDNA) | image (SYCL, Arc / Pro B60) | — | CPU image, on a node the plan names | | vLLM (safetensors) | image | image (ROCm, RDNA; Instinct and RDNA4 too in `0.3.0`) | image (XPU, Xe2 and newer only) | image (tt-metal) | — | | SGLang | image | image (targets Instinct; does not run on Radeon) | image (XPU), in `0.3.0`; served on Arc A770, one card and a tensor-parallel gang | — | — | | TensorRT-LLM | NVIDIA's own image, when you set `engineImages.trtllmNvidia` | — | — | — | — | An image is not a proof. The console's **Engines** page marks each engine × vendor pair the release's hardware grid has not passed. Setting `engineImages.trtllmNvidia` is your acceptance of NVIDIA's NGC container licence. ## Nodes For clusters you bring, the control plane needs nothing on the host beyond the vendor driver and its container toolkit. A [KV cache tier](https://opod.io/docs/control-plane-endpoints/kv-tiers/) uses the node's host memory (`sizeGb`, at most 50 % of the node by default) and, for a disk tier, space on the model cache (`diskGb`, with 15 % of the volume kept free). The planner refuses a tier the node cannot hold (`E-KV-RAM`, `E-DISK`). For bare machines, `opodcp infra plan` runs a host gate before it installs k3s: | Check | Severity | Requirement | | --------------------------- | ------------------------------------ | -------------------------------------------------------- | | `os.linux` | fatal | Linux on x86_64 or aarch64 | | `os.cgroupv2` | fatal | cgroup v2 | | `priv.root` | fatal | root, or passwordless `sudo -n` | | `host.ram` | fatal | 16 GB on the server, 8 GB on an agent | | `host.disk.root` | warning | 40 GB free on `/` for images | | `host.disk.cache` | warning | 100 GB free for the model cache (default `/data/models`) | | `host.time` | warning | NTP synchronised | | `gpu.driver`, `gpu.toolkit` | fatal for NVIDIA, warning for others | driver present; NVIDIA container toolkit | | `net.server` | fatal | each agent reaches the server on port 6443 | ## Network - **Outbound only.** Pulls from `ghcr.io` (or your mirror) and from your model source. No inbound connection from outside the cluster is needed. - **Inside the cluster.** Workers dial their leader on port 8080. Leaders also serve a plain probe port, 8081 (`/healthz`, `/readyz`, `/loadz`, `/metrics`). On a default-deny CNI set `networkPolicy.enabled=true`. - **To reach the console:** port-forward, a NodePort (`service.type=NodePort`) or your Ingress or Gateway. ## Pod Security - The control plane's pod and every leader meet the `restricted` profile: non-root (uid 65532), seccomp `RuntimeDefault`, all capabilities dropped, no privilege escalation, no host namespaces. - Worker and job pods meet `baseline` except for one rule: they mount the node's model cache as a `hostPath`. Under `restricted` they also fail `require-run-as-nonroot`, because the upstream engine images run as root. - The vendor telemetry probes read the host driver tree through read-only `hostPath` mounts, as root. - A gang over RDMA adds `IPC_LOCK`, which `baseline` does not allow. Exempt the release namespace from `restricted`, or label it `baseline` and grant those exceptions to pods labelled `opod.io/role`. `opodcp preflight` detects Kyverno or Gatekeeper and prints this summary as its `policy.engine` row. ## Resources | Pod | Requests | Limits | Chart value | | ---------- | --------------- | ---------- | ----------------------------- | | `opodcp` | 100m CPU, 256Mi | 1Gi memory | `resources` | | leader | 100m CPU, 256Mi | none | `workloads.leader.resources` | | front door | 100m CPU, 192Mi | none | `workloads.gateway.resources` | | worker | 500m CPU, 2Gi | none | `workerResources` | --- title: "Releases and versions" description: "Which control plane release these docs describe, what changed from 0.3.3, 0.3.2, 0.3.0 and 0.2.1, and how to verify what you pull." url: "https://opod.io/docs/get-started/releases/" markdown_url: "https://opod.io/docs/get-started/releases.md" section: "Get started" last_updated: "2026-11-08" --- # Releases and versions > Which control plane release these docs describe, what changed from 0.3.3, 0.3.2, 0.3.0 and 0.2.1, and how to verify what you pull. These docs describe the control plane **`0.3.6`**, the newest published release (chart `oci://ghcr.io/opod-io/charts/opodcp --version 0.3.6`, image `ghcr.io/opod-io/opodcp:0.3.6`), and core **`v0.4.5`**, whose engine images the chart pins. Core **`v0.4.6`** is published (binaries and engine images); the chart pins its images in the release after 0.3.6. The `v0.3.5` tag published nothing: its release check failed on a jobs ordering race that 0.3.6 fixes. Where an older release differs, the page says so. The `v0.3.1` tag published only the control-plane image and no chart. The chart that ships with a release always carries the install guide for exactly that version: ```bash helm show readme oci://ghcr.io/opod-io/charts/opodcp --version 0.3.6 helm show values oci://ghcr.io/opod-io/charts/opodcp --version 0.3.6 ``` ## What changed from `0.3.4` | Area | `0.3.4` | `0.3.6` | | -------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Core | `v0.4.4` engine images | `v0.4.5` engine images | | Speculative decoding | none | `plan.speculative {method: ngram}`: the engine guesses the next tokens from the prompt and the model checks them in one step, with identical answers. vLLM, SGLang and llama.cpp on NVIDIA; a copy-heavy load ran 2.9–3.5× faster at 1 stream on the design-partner cell | | Jobs | two queued jobs created in one second could be placed in either order | a standard job is placed before a preemptible one, then the oldest first | Moving from `0.3.4` to `0.3.6` is a plain `helm upgrade`. ## What changed from `0.3.3` | Area | `0.3.3` | `0.3.4` | | ----------------------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Core | `v0.4.3` engine images | `v0.4.4` engine images | | Endpoint page, **Load** | in flight, queue, KV, TTFT, prefix hits | also the load samples the leader ranks on (how many pulled, the oldest age, any worker not ranked), how many requests named a conversation and how often its pin held, and a warning when an endpoint with front doors gets traffic and no caller names a conversation (needs a core v0.4.4 leader) | | `/loadz` (core) | no sample ages, no session counts | `load_samples` and `sessions` | | Adapter catalog | `aws`, `gcp`, `azure` listed as target; Kafka, KMS and `s3://` checkpoints listed as planned | the cloud adapters listed as available (they provision no nodes); the three planned adapters removed | Moving from `0.3.3` to `0.3.4` is a plain `helm upgrade`. ## What changed from `0.3.2` | Area | `0.3.2` | `0.3.3` | | -------------------- | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | Core | `v0.4.2` engine images | `v0.4.3` engine images | | A worker's readiness | ready when its engine lists the model; a TensorRT-LLM worker then took about 70 s to answer its first request | ready only after its engine answers a one-token warm-up request | | Load ranking | the worker's heartbeat sample, up to 5 s old; a front door had none | every router (the leader and each door) pulls each worker's load every 500 ms (`routing.loadRefreshMs`) | | Conversations | pinned per key | pinned per conversation (`X-Opod-Session`), across front doors by a signed route token; `plan.routing.session`, on by default | | Rollouts | a first pull of a large image could fail converge at 8 minutes | image pull time does not count against converge | Moving from `0.3.2` to `0.3.3` is a plain `helm upgrade`. From `0.3.0` it is the move in [Upgrade → From 0.3.0](https://opod.io/docs/control-plane-install/upgrade/#from-030). ## What changed from `0.3.0` | Area | `0.3.0` | `0.3.2` and later | | ------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- | | Chart, release, namespace | `charts/opod`, release `opod`, namespace `opod`, objects `opod-opodcp*` and `opod-ep-*` | `charts/opodcp`, release and namespace `opodcp`, objects `opodcp*` and `opodcp-ep-*` | | Core | `v0.4.0` engine images | `v0.4.2` engine images | | vLLM and SGLang gangs | `serving` minutes before the head answers; an SGLang gang across machines stops after about 30 s | `converging` until the head's API answers, then `serving`; SGLang gangs keep serving | | vLLM over Ray | the head ignores the plan's engine flags and reports no cached tokens | the head takes `max_model_len` and the other flags, and usage carries `cached_tokens` | | Session pins | no key the control plane issues is pinned | every key is pinned (`stickyTtlSeconds`) | Moving from `0.3.0` to `0.3.2` or later is an uninstall and an install against the same database, because helm cannot rename a release. See [Upgrade → From 0.3.0](https://opod.io/docs/control-plane-install/upgrade/#from-030). ## What changed from `0.2.1` | Area | `0.2.1` | `0.3.0` | | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | State store | embedded SQLite on a PersistentVolumeClaim | your Postgres, required (`ports.state.dsn` or `ports.state.dsnSecret`); nothing on the pod's disk; setup mode until it answers | | Connector settings (usage sink, events, logs, OIDC, notifier, …) | chart values under `ports.` | saved on the console's **Connectors** page into the database, credentials sealed with the install key; any `ports.` value except `state` fails the render | | Install key | none | `installKey.*`, minted once into `-opodcp-install-key` | | Changes to an endpoint | `/api/v1/rollouts`, **Rollouts** page | `/api/v1/runs`; every create, edit, rollout and delete is a run; the **Activity** page | | Console pages | **Data**, **Integrations** | **Connectors** | | Several clusters | one cell | fleet mode (`mode=fleet`), and a licence key summed across cells | | Machine tokens | none | `/api/v1/api-tokens`, `opodcp token` | | KV cache | vLLM's CPU tier; the routing knobs `kvWeight`, `kvSaturationPct`, `prefixAffinity`, `prefixBlockWeight` | also `plan.workload` sizing, cache isolation, CPU tiers on SGLang, llama.cpp and TensorRT-LLM, the `disk` and `auto` tiers, the per-node tier cap, `/kv`, `/kv/advice`, `/kv/tier-advice` | Moving from `0.2.1` to `0.3.0` moves the SQLite store into Postgres with `opodcp backup` and `opodcp restore`. See [Upgrade](https://opod.io/docs/control-plane-install/upgrade/). ## Engine images per release Each chart release pins, by digest, the engine and leader images that the matching core release built. `helm show values` lists them under `engineImages`. A running endpoint keeps the images its last rollout pinned: an upgrade of the control plane never re-pins a serving endpoint. Roll out the endpoint to take the new images. ## Verify what you pull Release images and the chart are signed with cosign keyless (Sigstore), and each image carries an SPDX SBOM attestation. Verify by digest: ```bash cosign verify \ --certificate-identity-regexp 'https://github.com/opod-io/' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com \ ghcr.io/opod-io/opodcp:0.3.6 cosign download attestation ghcr.io/opod-io/opod-worker-llamacpp-nvidia:v0.4.2 \ | jq -r .payload | base64 -d | jq .predicate.name ``` If verification fails, do not install. The control plane itself verifies every image it runs; see [Supply chain](https://opod.io/docs/control-plane-security/supply-chain/). ## Support Kubernetes 1.28 and newer is supported, following an N-2 policy. A release of the control plane states which leader versions it supports in `GET /api/v1/version` (`coreSupported`). --- title: "Docs for AI tools" description: "Every page of these docs as plain Markdown, an llms.txt index and one file per section, so an AI assistant or agent can read opod's docs fast and cheaply." url: "https://opod.io/docs/get-started/ai-tools/" markdown_url: "https://opod.io/docs/get-started/ai-tools.md" section: "Get started" last_updated: "2026-11-08" --- # Docs for AI tools > Every page of these docs as plain Markdown, an llms.txt index and one file per section, so an AI assistant or agent can read opod's docs fast and cheaply. ## In short Every docs page, blog post and legal page on opod.io has a plain Markdown copy. An AI tool reads it with no menus, scripts or styling, so a page costs it a fraction of the tokens of the HTML. Three ways in: | What | URL | Use it for | | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | | One page | the page URL without the trailing slash, plus `.md`: [`/docs/get-started/quickstart.md`](https://opod.io/docs/get-started/quickstart.md) | the page an answer needs | | The index | [`/llms.txt`](https://opod.io/llms.txt) | every page with a one-line description, so a tool can pick what to read | | One section | `/llms-
.txt`, for example [`/llms-core-cli.txt`](https://opod.io/llms-core-cli.txt) | every page of one section in one file | | All the docs | [`/llms-full.txt`](https://opod.io/llms-full.txt) | the whole docs set in one file; large, so prefer a section | A tool that sends `Accept: text/markdown` gets the Markdown at the page's own URL, with no `.md` needed. ## When you need it - You ask an assistant (Claude, ChatGPT, Cursor, Copilot) a question about opod and want it to answer from these docs, not from memory. - You build an agent or a script that installs or operates opod and must read the docs as it goes. - You load the docs into your own search or retrieval index. ## Do it 1. **Give your assistant the index** Paste this into the chat, or add it to your project's instructions file (`CLAUDE.md`, `AGENTS.md`, `.cursorrules`): ```text opod's docs are at https://opod.io/llms.txt. Read that index first, then fetch only the .md pages the question needs. ``` 2. **Or fetch one page yourself** ```bash curl -s https://opod.io/docs/get-started/quickstart.md ``` The same page, by content negotiation: ```bash curl -s -H 'Accept: text/markdown' https://opod.io/docs/get-started/quickstart/ ``` 3. **Or load a whole section** ```bash curl -s https://opod.io/llms-control-plane-install.txt -o opod-install.md ``` The section names are the docs sections in the sidebar: `get-started`, `design`, `core`, `core-cli`, `core-reference`, `control-plane`, `control-plane-install`, `control-plane-endpoints`, `control-plane-operate`, `control-plane-security` and `control-plane-reference`. `/llms.txt` links every one. ## Check it worked ```bash curl -sI -H 'Accept: text/markdown' https://opod.io/docs/get-started/quickstart/ | grep -iE '^(content-type|vary)' ``` ```text content-type: text/markdown; charset=utf-8 vary: Accept ``` A browser that asks for the same URL still gets the HTML page: it sends `text/html` and a wildcard, and a wildcard never selects Markdown. ## What a Markdown copy holds Each copy starts with front matter, then the page: ```yaml --- title: "Quickstart" description: "Install the control plane on a Kubernetes cluster with GPUs, create an endpoint and send it a chat request." url: "https://opod.io/docs/get-started/quickstart/" markdown_url: "https://opod.io/docs/get-started/quickstart.md" section: "Get started" last_updated: "2026-10-30" --- ``` | Field | Meaning | | ---------------------- | ----------------------------------------------------------------- | | `title`, `description` | the page's title and summary, as in search results | | `url` | the HTML page, the copy to link to | | `markdown_url` | this file | | `section` | the docs section (docs pages only) | | `date`, `author` | when a blog post was published, and by whom (blog only) | | `last_updated` | the date the page was last changed | | `status` | `planned` when the page describes a feature that is not built yet | | `draft` | `true` on a legal text that is a draft and not in force | The copy says what the page says, word for word, with the parts that only work in a browser turned into text: - Numbered steps become a numbered list, with each step's title in bold. - A note or a warning becomes a quote with its title in bold. - Tabs become one bold heading per tab, followed by that tab's content. Every tab is in the copy. - A feature marked planned on the page reads **(planned)**. - An interactive figure becomes a paragraph that says what it shows, with a link to the page where you can use it. - Links point at the HTML pages on `https://opod.io`. ## If it fails | What you see | Why | What to do | | ------------------------------------------ | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | An HTML page where you expected Markdown | the tool sent no `Accept: text/markdown`, or ranked HTML higher | add `.md` to the URL instead | | `404` on a `.md` URL | the URL kept its trailing slash (`/quickstart/.md`), or the page is not a docs, blog or legal page | drop the slash: `/docs/get-started/quickstart.md`. Other pages (pricing, about) have no copy; read their HTML | | The assistant answers from memory anyway | it did not fetch the index | name the URL in the prompt, or put the instruction in your project's instructions file | | `/llms-full.txt` is too large for the tool | it holds every docs page | load one section file instead | The Markdown copies are marked `noindex` (`X-Robots-Tag`), so search engines keep showing the HTML pages. Tools that fetch a URL read them as usual. --- title: "Why opod is built this way" description: "Every major design decision in opod on one screen — what it gives you, what it costs, and the decision record behind it — and the architecture told as a short story." url: "https://opod.io/docs/design/" markdown_url: "https://opod.io/docs/design.md" section: "Design decisions" last_updated: "2026-10-31" --- # Why opod is built this way > Every major design decision in opod on one screen — what it gives you, what it costs, and the decision record behind it — and the architecture told as a short story. These pages explain **why** opod is built the way it is. Each decision says what it gives you and what it costs. The other sections say how to use it. ## Every decision on one screen | Decision | What it gives you | What it costs | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------- | ----------------------------------------------------- | | [One leader per endpoint; workers join it](https://opod.io/docs/design/leader-worker/) | A failure stays in one model; routing on live load | One extra hop; one small pod per endpoint | | [Control plane off the request path](https://opod.io/docs/design/leader-worker/#the-request-path-must-not-depend-on-the-control-plane) | Endpoints serve through a control-plane outage | Changes and embedded scaling wait for it | | [Front doors and a cell door](https://opod.io/docs/design/leader-worker/#front-doors-and-the-cell-door) | No lost requests on a leader restart; one URL | Extra door pods; +0.6 ms at p50 through the cell door | | [Workers named by boot id](https://opod.io/docs/design/leader-worker/#workers-are-disposable-and-named-by-what-they-are) | A re-created worker is never mistaken for the old one | — | | [An embedded, inference-aware autoscaler](https://opod.io/docs/design/autoscaler/) | Scales on queue, KV and TTFT, inside measured VRAM | Freezes while the control plane is down | | [KEDA as an option, per endpoint](https://opod.io/docs/design/autoscaler/#why-keda-as-well) | Scaling and wake from zero survive an outage | One reserved card per endpoint; KEDA must stay up | | [Kubernetes is the only executor, never the truth](https://opod.io/docs/design/kubernetes-and-capacity/#kubernetes-is-the-only-executor-and-never-the-truth) | Healing and gang landing from Kubernetes; one API | Needs Kubernetes, or k3s from `infra up` | | [VRAM measured, never assumed](https://opod.io/docs/design/kubernetes-and-capacity/#vram-is-measured-never-assumed) | A plan that does not fit is refused before any pod | Unmeasured cards are allocated whole | | [Dedicated by default, shared by choice](https://opod.io/docs/design/kubernetes-and-capacity/#dedicated-by-default-shared-by-choice) | No noisy neighbour unless you ask | A card may sit partly empty | | [Advise, do not refuse](https://opod.io/docs/design/kubernetes-and-capacity/#advise-do-not-refuse) | Every shape the engine supports | You can build a slow endpoint on purpose | | [Identities, not names](https://opod.io/docs/design/kubernetes-and-capacity/#identities-not-names) | Never adopts or deletes what is not its own | Longer object names | | [Proven per engine and vendor, or refused by name](https://opod.io/docs/design/kubernetes-and-capacity/#every-engine-and-vendor-is-proven-or-refused-by-name) | No plan that fails at load | Untested combinations wait | | [No service pods; every dependency a port](https://opod.io/docs/design/install-and-delivery/#no-service-pods-every-dependency-is-a-port) | Usable at install; uses what you run | You provide Postgres | | [One deployer for every target](https://opod.io/docs/design/install-and-delivery/#one-deployer-for-every-target) | One chart, one render, everywhere | No cloud-specific shortcuts | | [Digest-pinned, signed images, never built on nodes](https://opod.io/docs/design/install-and-delivery/#images-are-pinned-by-digest-signed-and-never-built-on-your-nodes) | One known build per endpoint | A patch needs a rollout | | [Verified rollouts that give back what they took](https://opod.io/docs/design/install-and-delivery/#changes-are-verified-rollouts-and-every-run-gives-back-what-it-took) | A change is proven before it is promoted | Minutes per change | | [Usage facts, not prices](https://opod.io/docs/design/boundaries/#usage-facts-not-prices) | Clean facts for your own pricing | No money view | | [Governance on the gateway's layer](https://opod.io/docs/design/boundaries/#governance-on-its-own-layer-a-gateway-in-front) | A request path with no governance cost | No per-user limits without a gateway | | [Request content is not logged](https://opod.io/docs/design/boundaries/#request-content-is-not-ours-to-log) | A smaller privacy surface | Prompt logs live in your gateway | | [Core is Apache-2.0 and never knows the control plane](https://opod.io/docs/design/open-core-and-licence/#core-is-open-and-never-knows-the-control-plane-exists) | Read, run and keep the request path | Changes must fit a frozen contract | | [A licence never stops a running endpoint](https://opod.io/docs/design/open-core-and-licence/#a-licence-never-stops-a-running-endpoint) | A lapse can never take traffic down | — (no remote revocation, for us) | | [Training is a Job beside endpoints](https://opod.io/docs/design/open-core-and-licence/#training-is-a-job-beside-endpoints) | Idle cards used without double-booking | Not a training platform | Where a decision changed over time, these pages describe what the code does today. ## The architecture as a short story You own some GPUs. You want to serve a few open models behind an OpenAI-compatible API, and you do not want a model to fall over because something else did. So each model gets its own **endpoint**. An endpoint is one **leader**, a small process with no GPU, and the **workers** that join it, each one an inference engine on its cards. The leader is the only thing clients talk to. It checks the key, waits for a free slot, picks the least busy worker and streams the answer. Everything it needs to do that sits in files in its own pod, so it does not need anybody else while it serves. The **control plane** is the part that decides. It measures every card, keeps a **ledger** of what each worker holds, and refuses a plan that does not fit before anything starts. When you change a plan, it runs a **rollout** that proves the change with a real request before it lets the change stay. When traffic moves, its **autoscaler** adds or parks workers, or hands that job to KEDA when scaling must keep working without it. It does all of this through Kubernetes, which it uses to run things but never to remember what should run. The control plane is also careful about what it does **not** do. It does not price your usage, log your prompts, or hold per-user budgets: your own systems and your gateway do those. It installs no database of its own: it uses yours. And it never stops what is running because of a licence. The runtime under all of this, **core**, is open source. You can read it, run it alone with `opod up` and `opod join`, and keep it whatever you decide about the rest. ## Read next - [The leader/worker pattern](https://opod.io/docs/design/leader-worker/): Why one leader per model, what it costs, and how it compares with a shared router, a mesh or a Service per model. - [Why our own autoscaler, and KEDA](https://opod.io/docs/design/autoscaler/): Inference signals, VRAM-aware growth, sleep and scale to zero, and when KEDA is the better owner. - [Kubernetes, capacity and placement](https://opod.io/docs/design/kubernetes-and-capacity/): The executor, the measured ledger, dedicated cards, advice over refusal, identities. - [Install, images and rollouts](https://opod.io/docs/design/install-and-delivery/): Ports and adapters, one database, one deployer, pinned images, verified changes. - [What opod leaves to other layers](https://opod.io/docs/design/boundaries/): Prices, per-user governance and prompt logs, and why they are not here. - [Open core, licence and training](https://opod.io/docs/design/open-core-and-licence/): Apache-2.0 core, a licence that never stops serving, training as a Job. --- title: "The leader/worker pattern" description: "Why each endpoint has its own leader, why workers join it, why the control plane stays off the request path, and what that costs compared with a shared router, a mesh or a Service per model." url: "https://opod.io/docs/design/leader-worker/" markdown_url: "https://opod.io/docs/design/leader-worker.md" section: "Design decisions" last_updated: "2026-10-31" --- # The leader/worker pattern > Why each endpoint has its own leader, why workers join it, why the control plane stays off the request path, and what that costs compared with a shared router, a mesh or a Service per model. Every endpoint is one **leader** and the **workers** that join it. The leader is core's `opod up` process: it takes the OpenAI requests for one model and sends each to a worker. A worker is core's `opod join` process beside one inference engine on its GPUs. The control plane writes what the leader needs into files in the leader's pod, and then stays out of the way. ```text clients ──► leader of endpoint "chat" ──► worker 1 (vLLM, GPU 0) keys, admission, routing, worker 2 (vLLM, GPU 1) usage, streaming gang A (head + 2 parts) ▲ │ mounted files: plan, auth snapshot, policy opodcp ─────────┘ (writes them; never sees a request) ``` ## In short - **One leader per endpoint, one model per leader**. Two models are two endpoints with two leaders. - **Scale means more workers or gangs under the same leader**, never a second leader. - **The control plane is never on the request path**. The leader reads its plan, keys and policy from files Kubernetes keeps in its pod. With every control-plane replica down, endpoints keep serving. - **A failure stays inside one endpoint.** A bad leader, a bad plan or a bad image touches the model it serves and nothing else. ## What the leader does on every request All of it runs in the leader process, in memory, with no call to the control plane or a database: 1. **Checks the key** against the auth snapshot mounted from the endpoint's Secret. A revoked key arrives as a tombstone in the next snapshot. See [API keys](https://opod.io/docs/control-plane-endpoints/api-keys/). 2. **Admits the request by worker slots.** Each worker reports on its heartbeat how many requests its engine serves at once. The leader dispatches a request only while a worker has a free slot, and holds the rest in its own queue: `critical` before `standard` before `sheddable`, fair share inside a class. An engine's own queue is first-come and cannot rank requests; the leader's queue can. 3. **Picks a worker.** The score is the worker's in-flight requests plus its queue depth, read from heartbeats every 5 s. The policy can add KV-cache use (`kvWeight`, off by default) and prefix affinity, so a long shared prompt lands where it is already cached. A worker at its saturation threshold gets a request only when no other worker has room. See [Routing](https://opod.io/docs/control-plane-endpoints/routing/). 4. **Streams the answer** and records one usage row: tokens in and out, time to first token, which worker served. Usage records start only at the leader. **Figure: The request path of one endpoint.** Your app calls the leader, which routes each request to the least loaded live worker. The control plane only writes configuration and is not on the request path. Pick a failure and watch where requests go. The interactive figure is on the web page: ## Why this shape ### The request path must not depend on the control plane A control plane is a large program that changes often. It has a database, an upgrade, a leader election. If a request had to ask it anything, every one of those would be a way to lose traffic. So the request path needs only what the leader pod already holds: | The leader reads | From | Who writes it | | -------------------------------------------- | ----------------------------- | ----------------- | | the plan (model, workers, gangs) | a ConfigMap mounted as a file | the control plane | | keys, tombstones | a Secret mounted as a file | the control plane | | routing and admission policy (`policy.json`) | the same Secret | the control plane | | live load of each worker | worker heartbeats, every 5 s | the workers | The kubelet keeps those files in the pod whether or not the control plane runs. This is **static stability**: when the part that makes changes is down, the part that serves keeps the last good state and serves from it. What stops during an outage is change: new endpoints, plan edits, rollouts, and the embedded autoscaler. See [What survives an outage](https://opod.io/docs/get-started/architecture/#what-survives-an-outage). ### One model per leader gives every endpoint its own blast radius A leader knows one model, one set of workers and one set of keys. That makes several things simple: - **A failure is per endpoint.** A leader crash, a wrong flag, or an engine that leaks memory costs that endpoint. The other endpoints in the cell do not share a process with it. - **Policy is per endpoint.** Admission holds, request classes, routing weights and canary splits apply to one model's traffic, where their numbers mean something. - **Rollouts are per endpoint.** A new image or engine version is proven on one endpoint and rolled back on one endpoint. - **Load signals are per model.** "In flight", "queue" and "KV pressure" describe one model on one kind of worker, so the autoscaler can act on them directly. ### The leader is where scale-to-zero becomes possible The leader holds no GPU, so it stays up when every worker is parked. The URL keeps answering, and a request that arrives counts as demand that wakes a worker. Today a leader with nothing awake answers `503` with `Retry-After`, and that refusal is the wake signal. In 0.3.0 a plan with `floor: 0` raises the leader's admission hold to 60 s, so the client waits through the wake instead. See [Autoscaling → Tiers of idle](https://opod.io/docs/control-plane-endpoints/autoscaling/#tiers-of-idle). ### Gangs are workers too A model too big for one machine runs as a **gang**: one engine instance split across several pods. Every part runs `opod join` and heartbeats like any worker. The gang's **head** is a worker rank, never the leader. To the leader a gang is one routing target, ready only when every part reports. One lost part takes that gang out of rotation while the other gangs and workers keep serving. Several gangs of one model live under one leader, and the router picks the least loaded ready gang. With the LeaderWorkerSet controller, a gang lands and restarts as one unit. See [Gangs](https://opod.io/docs/control-plane-endpoints/gangs/). ### Workers are disposable, and named by what they are A worker holds no record. If its pod dies, the leader routes to the others and the reconciler replaces the pod. Each worker process mints a **boot id** when it starts and sends it on every heartbeat. A new boot id under the same node id is a new process: the leader drops the old process's placements and gang rows at once, instead of routing to a pod IP that no longer exists. A worker that gets `401` on a heartbeat (the leader restarted) re-registers with the token it holds, so a leader restart costs one registration per worker. ## Front doors and the cell door Two optional pieces cover the two weak spots of "one leader process per model". - **Front doors** (`plan.gateways.enabled`) are stateless copies of the leader's request path for one endpoint (`opod up --role gateway`). They check keys and route to the leader's workers themselves. There is still one leader: it alone owns the worker registry, join tokens and gangs. Doors push their usage rows to the leader, the single writer. With doors on, a leader restart costs no requests, from core v0.4.0. In v0.3.0 a door read the restarted leader's still-empty worker list as final and answered 503 until its next sync: 16 of 60 requests in one test. Now the leader marks that list as rebuilding, and the door keeps routing to the workers it knew. - **The cell door** (`door.enabled`) is one URL for many endpoints (`opod up --role door`). It reads `model`, looks up the endpoint by alias, and forwards the request unchanged. It picks no worker and holds no credential: the endpoint's leader still checks the key and routes. On the design-partner cell it added 0.6 ms at p50 and 1.4 ms at p95 over the direct path. See [Front doors and cell doors](https://opod.io/docs/core-reference/front-doors/). ## What it costs | Cost | Size | What we do about it | | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | A leader is one process per endpoint. When it restarts, the requests in flight on it are lost. | Kubernetes restarts it in about 10 s. Workers re-join through the Service name. | Front doors: `max(2, ceil(units/4))` door pods with anti-affinity, where a unit is one worker or one gang, so a restart costs no requests. | | Every request takes one extra hop: client → leader → worker. | about 0.2 ms per round trip across nodes, measured; about 8 ms more for each new TLS connection | Leaders and doors are placed by a fixed rule the control plane decides. | | Many endpoints means many leader pods. | one small pod per endpoint, no GPU | Doors hold no card and are not counted by the ledger, the licence or a quota. | | No leader routes to another endpoint. "Try model B when model A is busy" is not a leader feature. | — | The cell door's auto routes do it in your order; a gateway such as LiteLLM can too. | | The worker load the leader sees is one heartbeat old. | up to 5 s for queue and KV use | In-flight is the leader's own live count; a slot is granted only on completion. | | No worker is ever promoted to leader, and two leaders never run at once. | an outage of one endpoint is as long as one pod restart | This is a deliberate trade: no split-brain code, and nothing to fail over by hand. | ## Compared with other shapes Each of these is a reasonable design. They solve different problems, and some combine with opod. | Shape | What it does well | What it costs for self-hosted inference | With opod | | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **One central gateway or router for all models** | One URL, one place for keys, budgets and logs. Simple for clients. | One process or pool in front of every model: its failure or bad config touches them all. It usually sees requests, not the engines' slots, queues or KV caches. | Use it in front. LiteLLM holds per-user keys and budgets; each opod leader still picks the worker. See [Use with LiteLLM](https://opod.io/docs/get-started/litellm/). | | **A service mesh** (Istio, Linkerd) | mTLS, retries, traffic splits and telemetry for any service, with no code change. | Balances by connections or requests. It does not know that one worker's KV cache is full or that a gang is one target, and a long stream looks like one request. | Run it if you already do. The leader still decides which worker serves. | | **KV-aware inference routers** (llm-d's endpoint picker on the Gateway API, NVIDIA Dynamo's router) | Routing that reads queue, KV use and cached prefixes, designed for large fleets of one model, with prefill/decode split. Strong, actively developed projects. | More components to install and run (a gateway, a picker, their own control surfaces). They route; placement of models on measured VRAM, licences and rollouts are left to you. | In 0.3.0 a leader can join a Gateway API `InferencePool`: the gateway picks a leader, the leader picks a worker. The leader publishes vLLM-named metrics for the picker. See [Gateways → InferencePool](https://opod.io/docs/control-plane-endpoints/gateways/#gateway-api-inferencepool). | | **One Kubernetes Service per model** | Nothing to install. Every Kubernetes user knows it. | kube-proxy spreads connections, not requests, and knows nothing about load. A Service with no ready pod refuses the connection, so scale-to-zero needs something else in front. A multi-pod gang is not one target. | The leader's Service is exactly this, one level up: clients reach the leader by a stable Service name, and the leader does what a Service cannot. | ## Read more - [Architecture](https://opod.io/docs/get-started/architecture/): what runs where. - [Routing policy, doors and admission](https://opod.io/docs/control-plane-endpoints/routing/): every knob the leader reads. - [Core concepts](https://opod.io/docs/core/concepts/): the same pattern run by hand with `opod up` and `opod join`. --- title: "Why our own autoscaler, and KEDA" description: "Why opod scales endpoints with an embedded loop that reads inference signals and the VRAM ledger, what KEDA gives instead, and when to pick each." url: "https://opod.io/docs/design/autoscaler/" markdown_url: "https://opod.io/docs/design/autoscaler.md" section: "Design decisions" last_updated: "2026-10-31" --- # Why our own autoscaler, and KEDA > Why opod scales endpoints with an embedded loop that reads inference signals and the VRAM ledger, what KEDA gives instead, and when to pick each. opod ships its own autoscaler, and it can hand scaling to KEDA instead. Both read the same signals from the same place: each leader's `/loadz`. They differ in what they may change and in what survives a control-plane outage. This page says why both exist. The fields and the step-by-step setup are on [Autoscaling](https://opod.io/docs/control-plane-endpoints/autoscaling/). ## In short - **The embedded loop** (the default) changes the **plan**. Every grow is judged against the measured VRAM ledger, the licence and the team quota at the moment it happens. It can sleep an engine, park a whole gang and evict a preemptible job. It needs nothing installed. It stops while the control plane is down. - **KEDA** (`autoscaler.adapter=keda`) changes one **replica count**. It keeps scaling, and wakes endpoints from zero, while the control plane is down. It can own only endpoints whose replicas are interchangeable, and it holds one spare card per endpoint in reserve so that it never places outside what the control plane approved. - **Ownership is per endpoint.** Turn KEDA on and the endpoints it can drive go to it; the rest stay on the embedded loop and say why (`scaling.by`, `scaling.detail`). ## Why a generic autoscaler is not enough on its own A Kubernetes HorizontalPodAutoscaler adds pods when a number crosses a target. For GPU inference, three things are missing from that picture. **1. The right signals.** CPU use on a worker pod says nothing; the engine runs on the GPU. GPU utilisation is a weak signal too: a card can read 100% while it has room for more requests in its batch, or read low while its KV cache is full and requests queue. The signals that predict a slow answer are inference-specific, and the leader has them: | Signal (from `/loadz`) | Grows when | Why it matters | | -------------------------- | ------------------------------------------------- | -------------------------------------------------------------------- | | in-flight requests | above `targetInflight` per worker | the plain measure of demand | | queue depth | not empty (every slot busy) | a request is waiting now | | KV-cache pressure | the busiest worker is at or above `kvPressurePct` | a full cache stops the engine taking more requests, before any error | | time to first token, p95 | above `ttftBudgetMs` | what users feel; may only add workers, never remove them | | refused in the last minute | any, with the endpoint at zero | the wake signal | A shrink waits for `idleSeconds` of low demand and is held off by a queue, a KV cache at half the trigger, a dead engine or a breached TTFT budget. A trigger that could never fire is refused when the plan is written: `E-KV-SIGNAL` for an engine with no KV signal, `E-TTFT-SIGNAL` for embeddings or rerank, which never stream. **2. Capacity is VRAM, and it is shared.** A new worker needs a card with enough measured free memory, inside the licence and the team's GPU quota. A generic autoscaler adds a pod and lets the scheduler find out: on a full fleet that is a `Pending` pod, or a pod that lands on a card a neighbour needs. The embedded loop asks the placer first. When nothing fits, it does not grow: `scaling.ceiling` drops below `max`, `scaling.blocked` says why, and the alert `autoscale.no-capacity` fires after a minute. **3. Scaling a model is more than a replica count.** Some steps are not "one more identical pod": - **Sleep tier.** A vLLM engine on NVIDIA can sleep inside its running pod after `sleepSeconds` and wake in under a second. Its pod and its card stay. - **Pod-zero.** With `floor: 0`, the last worker's pod parks; the weights stay cached on the node. The leader stays up, so the URL answers and a request wakes the endpoint. - **Gangs as a unit.** Under `unit: gangs` a whole gang parks and wakes together; half a gang serves nothing. - **Prefill/decode pairs** grow and shrink by a whole pair. - **Growth onto other hardware.** From 0.3.0, `autoscale.growth` lists shapes to grow on in order (for example NVIDIA first, then AMD with a smaller budget), each judged when the plan is written. Proven on hardware for one case: a dedicated llama.cpp endpoint on NVIDIA grew onto a second NVIDIA machine, then onto an AMD machine, and parked back in reverse order when idle. A gang that grows onto Intel is not yet proven. - **Serving wins over preemptible jobs.** When the only free card holds a preemptible training job, the grow evicts that job and the job resumes from its checkpoint. None of these is a replica count of one Deployment, so none of them can be handed to an HPA as it is. **Figure: The autoscaler, minute by minute.** Workers running over 20 simulated minutes against the workers the traffic asks for, with the endpoint's awake, asleep, parked and waking states. The interactive figure is on the web page: ## Why the loop is embedded We put the autoscaler inside `opodcp` for a plain reason: the install promise. The chart installs no service pods by default, and KEDA needs an operator and an external-metrics API on the cluster. The control plane already ran a reconcile loop, and every decision it needed read one set of numbers per leader. So scaling became one more controller loop, and **scaling is a plan edit**: it is recorded as a run, judged by the same planner as a human edit, and visible in the plan's history. The rule "an unreadable `/loadz` makes no decision" keeps it safe: a leader the control plane cannot reach is left at its size, not scaled to zero. ## Why KEDA as well The embedded loop has one real weakness: **it is part of the control plane**. While every `opodcp` replica is down (an upgrade, a lost node, a database outage), the size of every embedded endpoint freezes. Running workers keep serving, but an endpoint parked at zero stays parked, and its requests get `503` once the leader's hold runs out. We fixed that by using KEDA rather than writing a second actuator. A bespoke design was drawn first and reviewed; it would have invented a contract KEDA already has. So: - **KEDA actuates.** One `ScaledObject` per endpoint, with `metrics-api` triggers on the leader's own `/loadz`: `in_flight`, `queue_depth`, `kv_busy_workers`, `ttft_p95_ms`, and `unavailable_1m` and `rpm_1m` to wake and to hold one worker. - **opod approves the capacity in advance.** KEDA never reads the ledger, the licence or the quota. So the control plane walks the placer for the endpoint and stores a **grant**: one `(node, GPU)` slot per worker, what runs plus `grantHeadroom` more (default 1). `maxReplicaCount` is the number of slots, and a node label pins the replicas to approved nodes. KEDA cannot start a worker on capacity nobody approved. - **The reservation is real.** The ledger and the team quota count every granted slot, so no other endpoint places there. The licence counts only slots with a worker running, so unused headroom does not spend the free tier. Headroom unused for two hours is given back. - **A rollout still proves the change.** A verified rollout on an endpoint KEDA parked at zero wakes it for the run with KEDA's own pause annotation, proves it serves, and hands it back. ## Side by side | Aspect | Embedded loop | KEDA | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | | Survives a control-plane outage | no: sizes freeze | yes: scale-out, scale-in and wake from zero, inside the last grant | | Needs on the cluster | nothing | KEDA's operator and a working external-metrics API. Today you bring your own KEDA; `substrate.keda.enabled` installs it from 0.3.0 | | Capacity check | every grow, against the ledger, licence and quota, when it happens | in advance, as a grant; the headroom card is held idle | | Growth speed | one worker at a time, 30 s after the last grow | in proportion to load, up to double every 15 s | | Shrink speed | one worker per `idleSeconds` | one pod a minute after a 300 s window | | Sleep tier, shared cards, several gangs, growth shapes (0.3.0), prefill/decode | yes | no; those endpoints stay on the embedded loop | | Node-zero (ask a node autoscaler for a GPU node) | no | from 0.3.0, opt-in with `cloud.nodeScaling`; built and tested, not yet proven against a real node provisioner | | A standard object your tools already read | the plan, through opod's API | a `ScaledObject` and an HPA, visible to `kubectl` and any KEDA tooling | KEDA is a mature, widely used CNCF project, and when it owns an endpoint it does the job better than our loop does in two ways: it keeps working without us, and it answers a burst in proportion. The embedded loop is better where the scaling step is not a replica count, and where you cannot spare a held card. ## What each choice costs - **Embedded:** an outage of the control plane freezes scaling, and an endpoint at zero cannot wake until it is back. Growth is deliberately slow (one worker per 30 s) so one burst does not climb to `max`. - **KEDA:** each owned endpoint keeps `grantHeadroom` cards (or VRAM budgets) reserved beside what runs. KEDA becomes a part that must stay up: if its operator stops, nothing grows and a parked endpoint does not wake. opod watches the lease KEDA's operator renews and raises `autoscale.scaler-unhealthy`, but only while the control plane itself runs. - **Both:** a wake from zero costs a pod start and a model load, often tens of seconds. A sleep tier (vLLM on NVIDIA) or `floor: 1` avoids it, at the price of a held card. ## Which to pick The short rule: **pick KEDA for endpoints that must wake or grow while the control plane is down; keep the embedded loop for everything that sleeps, shares a card, runs or grows to several gangs, or grows across vendors.** For a gang, KEDA only parks and wakes one (`max: 1`); a second gang needs machines of its own, and only the control plane places them (the release after 0.3.6). Mixed installs are normal. The full checklist is in [Autoscaling → Which should I pick](https://opod.io/docs/control-plane-endpoints/autoscaling/#which-should-i-pick). --- title: "Kubernetes, capacity and placement" description: "Kubernetes as the only executor but never the truth, a ledger of measured VRAM, dedicated cards by default, advice instead of refusal, identities instead of names, and proof per engine and vendor." url: "https://opod.io/docs/design/kubernetes-and-capacity/" markdown_url: "https://opod.io/docs/design/kubernetes-and-capacity.md" section: "Design decisions" last_updated: "2026-10-31" --- # Kubernetes, capacity and placement > Kubernetes as the only executor but never the truth, a ledger of measured VRAM, dedicated cards by default, advice instead of refusal, identities instead of names, and proof per engine and vendor. These decisions decide where a model runs and how opod knows it fits. Each one says what it gives you and what it costs. ## Kubernetes is the only executor, and never the truth **The decision.** opod runs every leader, worker, gang and job as a Kubernetes workload. There is no second way to deploy. On bare machines, `opodcp infra up` installs k3s for you over SSH, so you never run Kubernetes yourself. And Kubernetes holds no decision: the **plan** in opod's database is the desired state, and Kubernetes objects are rendered from it. **Why.** Kubernetes already restarts pods, schedules them, mounts Secrets, lands a multi-pod gang as one unit (LeaderWorkerSet) and scales replicas (KEDA). Rebuilding that would be a second, weaker Kubernetes. But Kubernetes does not know VRAM budgets, licences, team quotas or which revision was proven, so it cannot be the record. **What it gives you.** - Healing, rescheduling and gang landing that are Kubernetes' own, tested by everyone who runs it. - One product API. The console, the CLI and scripts all speak it; `kubectl` shows you what opod rendered. - A cluster you can inspect with the tools you know. Every object carries `opod.io/endpoint-id` and `opod.io/cell`. - A `helm upgrade` of opod does not restart serving pods. A changed pod template waits for a rollout, which proves it. **What it costs.** - You need Kubernetes 1.28 or later, or a machine that can take k3s. There is no "just a binary" install of the control plane. Core alone runs without Kubernetes (`opod up`, `opod join`), with no control plane. - A hand edit to an opod object is drift. The reconciler puts it back to the plan. **What we chose not to do.** A host executor beside Kubernetes was decided and then reversed the next day. The control plane reaches the cluster only through one interface (`controller.Executor`), so a second executor stays possible if a customer ever refuses Kubernetes. No custom operator or CRD spine either: the objects are plain Deployments, Services, LeaderWorkerSets and Jobs, written with Server-Side Apply. ## VRAM is measured, never assumed **The decision.** A probe DaemonSet per vendor reads every card every 20 s, and the control plane collects the reading: in 0.3.6 the probe pushes it, and from the release after 0.3.6 every control-plane replica reads each probe itself, so each replica holds every card. The **ledger** holds, per card, the measured size, what each worker claims, and what something outside opod already uses. The placer judges every plan against those numbers. A card nobody could measure is never treated as having room. **Why.** A card's nameplate is not its free memory. Drivers reserve some, other processes hold some, and one SKU id can ship with two memory sizes. A placer that guesses high overcommits the card, and the engine dies at load. **What it gives you.** - A plan that does not fit is refused **before any pod starts**, with the numbers: `E-FIT` names the need, the free memory and the largest card. - Memory used by something outside opod is seen and avoided. - Every number comes from the driver or the hardware, never from a table. NVIDIA reports through its own tool. AMD's `amdgpu` publishes size and use in sysfs. Tenstorrent maps its whole board memory through the PCI window. Intel reads its memory regions from the driver's own query. - An unhealthy card (uncorrected ECC errors, an active slowdown) is fenced for new placements. Nothing running is killed. **What it costs.** - A card is placeable only after its first reading: a fresh control plane waits for the telemetry probe, about two minutes. - Where a driver reports no size, the card is allocated whole and cannot be packed. For an Intel card that answers neither query, the remedy is a host setting (Resizable BAR). We keep **no table of capacities by device id**, on purpose: one wrong row would overcommit every card of that model. - Without the `opod.io/gpu-vendor` label on a node, no probe lands there, and every create on it is `E-FIT`. The control plane writes the label from device-plugin resources; on an unusual cluster, check it first. See [Placement and the VRAM ledger](https://opod.io/docs/control-plane-endpoints/placement/). **Figure: The VRAM ledger: place a model.** Five GPU cards as bars of measured memory: our workers, outside use, driver reserve, free memory, and where the selected model would go. Shared placement is NVIDIA only. The interactive figure is on the web page: ## Dedicated by default, shared by choice **The decision.** A worker owns its whole card unless its plan says `colocation: shared`. Shared workers are packed by VRAM budget, and only beside other shared workers. **Why.** Outside MIG, two processes on one GPU are isolated only by their budgets: a memory spike or a fault in one can stop the other. An endpoint with a strict latency target should not learn that by surprise. **What it gives you.** A safe default with nothing to read first, and many small models per card when you ask for it, with each budget checked against the measured card. **What it costs.** Shared is NVIDIA-only today (`E-SHARED-VENDOR` elsewhere). Isolation on a shared card is cooperative, not hard. A dedicated card may sit partly empty: that is the price of the guarantee. ## Advise, do not refuse **The decision.** When a plan is possible but slow or risky, opod accepts it and says so in the loudest advisory it has. It refuses only what cannot work. The clearest case: tensor parallelism across machines used to be refused on any fabric not proven fast. It is now allowed, with the cost stated: on plain ethernet, every all-reduce of every token crosses the network, and throughput is commonly an order of magnitude lower than one machine. **Why.** The refusal was right about physics and wrong about ownership. You know your fabric, and SGLang's own multi-node scheme *is* tensor parallel across nodes. A refusal that blocks a whole engine helps nobody. **What it gives you.** Every shape the engine supports is available. The advisory names the shapes that avoid the cost: pipeline parallel across nodes (one hop per token), tensor parallel inside one machine (none). A passed fabric proof turns the warning clean. **What it costs.** You can now build a slow endpoint on purpose, so read Preview's advisories. Some things stay refused because they are arithmetic or the engine: a tensor group wider than a node's devices (`E-TP-DOMAIN`), a tensor split on llama.cpp. The same rule applies elsewhere: with no KV store, an endpoint is created without the peer KV tier and warned; with no checkpoint store, a job runs with "no resume" stated. See [Gangs and parallelism](https://opod.io/docs/control-plane-endpoints/gangs/). ## Identities, not names **The decision.** Everything opod manages is tied to an **id**, never only to a name. Endpoint objects are named `opodcp-ep--` and selected by the label `opod.io/endpoint-id`. A worker process carries a boot id minted at start. Every delete, sweep and pod read is scoped by the id. **Why.** A name can come back as a new thing. Three bugs had one shape: a re-created worker kept the "ready" rows of a dead one; a control plane with a fresh database adopted another store's workloads and their dead join token; a router dialled a re-created worker at its old pod IP. **What it gives you.** - Re-creating an endpoint with an old name never adopts the old one's objects. - A second control plane pointed at the same namespace reports foreign objects (alert `endpoint.foreign-objects`) and never touches them. - A run that fails gives back what it took, newest first, and the cleanup finds our objects by id only. Nothing that is not ours is ever deleted. **What it costs.** Object names are longer and carry a suffix. The leader's Service is the one exception, `opodcp-ep-`, because clients and workers dial it by name. ## Every engine and vendor is proven, or refused by name **The decision.** opod says "supported" for an engine on a vendor only when it has served requests there through the control plane. Every combination without an image or without a path is refused when the plan is written, with a named code and the alternatives: `E-NO-ENGINE`, `E-IMAGE-FAMILY`, `E-SHARED-VENDOR`, `E-KV-OFFLOAD` and more. **Why.** A plan that is accepted and then fails at load costs an operator an afternoon. A refusal by name costs one read. **What it gives you.** A matrix you can trust: `supported`, `experimental`, `delegated` or `unsupported` per engine and vendor, and a separate **proven** mark. `GET /api/v1/compat/verified` lists the exact paths proven in your own cell, and `verifiedOnly: true` makes an auto plan refuse anything else. **What it costs.** NVIDIA has every feature; other vendors have fewer engines and fewer features, and the table says so cell by cell. Some combinations that may work are refused until they are proven. See [Mixed GPU vendors](https://opod.io/docs/control-plane-endpoints/mixed-silicon/) and [Images](https://opod.io/docs/core-reference/images/). --- title: "Install, images and rollouts" description: "Why the chart installs no service pods, why the database is the one thing you provide, why one deployer serves every target, and why images are pinned and changes are proven." url: "https://opod.io/docs/design/install-and-delivery/" markdown_url: "https://opod.io/docs/design/install-and-delivery.md" section: "Design decisions" last_updated: "2026-10-31" --- # Install, images and rollouts > Why the chart installs no service pods, why the database is the one thing you provide, why one deployer serves every target, and why images are pinned and changes are proven. These decisions decide what you install, what runs on your nodes, and how a change reaches a serving endpoint. ## No service pods: every dependency is a port **The decision.** `helm install opodcp` installs the control plane (one Deployment, with the console built into the binary), a preflight Job and RBAC. The control plane then creates its own per-vendor GPU probes. The chart installs **no** database, event bus, metrics stack, identity provider or registry. Every dependency is a **port**: a built-in default, plus an **adapter** you point at a service you already run. | Port | Built in | Yours, when you connect it | | -------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | | Events | in-memory fan-out with a journal in the database | NATS | | Metrics | `/metrics` for Prometheus to scrape | an OTLP push to your collector, beside `/metrics` | | Logs | JSON on stdout | OTLP or Splunk HEC | | Traces | none | an OTLP collector the leaders export to | | Identity | local users, a bootstrap admin from a Secret | any OIDC provider | | Secrets | Kubernetes Secrets | Vault KV v2 | | Usage | a buffer table in the database ([why only a buffer](https://opod.io/docs/design/boundaries/#usage-facts-not-prices)) | ClickHouse, Postgres or S3 (Parquet objects) | | Images | pulled from `ghcr.io` | your registry mirror | **The database is the one exception.** The control plane's only durable store is **your Postgres**. There is no volume of ours on any node. With no database, or one that does not answer, the control plane starts in **setup mode**: the console serves and asks for one, running endpoints keep serving, and creating an endpoint is refused with that sentence. Connector settings live in the database, and their credentials are sealed with the install key. A reinstall anywhere is `helm install` with the database address and the key; every connector comes back. **Why.** A platform team already runs Postgres, Prometheus and an identity provider, and does not want a second copy of each inside a vendor's chart. A bundled database on a node volume is also how state gets lost: one re-imaged node and it is gone. **What it gives you.** An install that starts in minutes and is usable at once, a control plane pod that is stateless, and telemetry that never blocks: with no sink connected the control plane installs, serves and buffers, and `opodcp doctor` says, per port, whether it is built in or connected. **What it costs.** - You must provide a Postgres. For a trial, `ha.postgres.provide=true` lets the chart run a CloudNativePG one, by your explicit choice. - Lose the install key and you lose the stored connector credentials (not the data). Keep a copy of the Secret `opodcp-install-key`; your cluster's Secret encryption (a KMS key on EKS, GKE or AKS) protects it at rest. - One replica is the default. If its node dies, Kubernetes waits about 5 minutes before it reschedules the pod. Leaders serve meanwhile; changes wait. More replicas are optional ([High availability](https://opod.io/docs/control-plane-install/high-availability/)). See [Connectors](https://opod.io/docs/control-plane-operate/connectors/). ## One deployer for every target **The decision.** EKS, GKE, AKS and bare metal get the same `opodcp` binary, the same chart and the same render. They differ only by Helm values and preflight rows. A cloud adapter (`cloud.provider`) may add preflight rows and defaults: registry, storage, workload-identity hints, node provisioning. It may never change how objects are rendered, the executor or the ledger. **Why.** The day "if this is AWS" reaches the render code, there are three products to test instead of one. **What it gives you.** One install guide, one upgrade path, and a proof on one target that holds on the others. Creating the cluster is ours only on bare metal (`opodcp infra up`, which installs k3s); on a managed cloud the cluster is yours, and opod starts at `opodcp preflight`. **What it costs.** Cloud-specific shortcuts are not taken. `onprem` adds no provider-specific behaviour. From `0.3.0` the `aws`, `gcp` and `azure` adapters add only defaults and preflight rows: a storage class, a registry mirror, a workload-identity hint and their `cloud..*` rows. They are built and not yet proven on a real EKS, GKE or AKS cluster. GKE Autopilot is not supported: workers keep weights in a `hostPath` cache and the probes read the host driver tree. See [Choose an install path](https://opod.io/docs/control-plane-install/) and [Preflight](https://opod.io/docs/control-plane-install/preflight/). ## Images are pinned by digest, signed, and never built on your nodes **The decision.** Every leader and worker runs an image pinned by digest (`repo@sha256:…`). The control plane resolves the digest when a plan is written and re-resolves it **only** in a rollout. Images are built upstream: per-vendor engine images from the official vendor base plus a thin opod layer. Nothing is compiled on a cluster node. The control plane verifies each pinned image's cosign signature offline (`images.verify`: `warn` by default, `enforce` to refuse). **Why.** A rolling tag means a pod restarted at 3 a.m. may run a build nobody tested. A build on a customer node means unknown compilers on machines that hold real data. **What it gives you.** "Which build is this endpoint on?" has one answer, in the plan. An autoscale step, a drift repair or a control-plane restart never moves an endpoint to a newer build. A tampered image is detectable. **What it costs.** A security patch reaches an endpoint only through a rollout, not by itself. A private registry or mirror needs a pull Secret (`imagePullSecrets`), which the control plane also uses to resolve digests and check signatures; without it the signature reads `unknown`. See [Supply chain](https://opod.io/docs/control-plane-security/supply-chain/). ## Changes are verified rollouts, and every run gives back what it took **The decision.** A change to a serving endpoint runs as a **saga**: a fixed list of steps, each with a proof, and one compensation. The steps are validate → prefetch → apply → converge → probe → fabric proof → smoke → canary → eval → promote. Every step is written to a journal before the next one runs. A failed step restores the previous plan revision. A control plane that restarts mid-run resumes it at the first step that has not passed. **Why.** "Applied" is not "serving". A new engine flag can make a pod Ready and still fail on the first real request. A rollout that does not prove the change only moves the failure to your users. **What it gives you.** - A change is proven with a real request before it is promoted, and an optional canary is judged against its siblings from real usage. - An endpoint parked at zero is woken for its rollout and proven, then handed back. - Every run (a create, a rollout, a scale, a delete) records what it takes the moment it takes it, and a run that ends without success gives it back, newest first. A half-formed gang does not keep a card. **What it costs.** A rollout takes minutes, not seconds: converge has an 8-minute budget, and a large model can use much of it. Rolling a parked endpoint pays its wake in GPU time. A pod template change waits for a rollout; it never rides a `helm upgrade` by itself. **Figure: A verified rollout, step by step.** Ten rollout steps from validate to promote, and the share of requests on the new revision at each step. The interactive figure is on the web page: See [Rollouts and runs](https://opod.io/docs/control-plane-endpoints/rollouts/). --- title: "What opod leaves to other layers" description: "Why opod exports usage facts but no prices, keeps usage only as a buffer, leaves per-user keys and budgets to a gateway such as LiteLLM, and never logs prompts or answers." url: "https://opod.io/docs/design/boundaries/" markdown_url: "https://opod.io/docs/design/boundaries.md" section: "Design decisions" last_updated: "2026-10-31" --- # What opod leaves to other layers > Why opod exports usage facts but no prices, keeps usage only as a buffer, leaves per-user keys and budgets to a gateway such as LiteLLM, and never logs prompts or answers. opod does one job: serve tokens on GPUs you own, and manage those GPUs. Several things people expect from an inference platform are left to the layer that already does them well. This page says which, why, and what you lose by it. ## Usage facts, not prices **The decision.** The control plane records what happened (requests, tokens in and out, GPU-seconds busy and idle, per endpoint, model, team and day) and exports it. It computes no cost, rating, showback, chargeback or invoice, and shows no currency anywhere. **Why.** A price is a business rule: list prices, discounts, internal transfer rates, amortised hardware. Every company already has a place where those rules live. A second set inside an inference product would be wrong in some way for every customer. **What it gives you.** Clean facts to join with your own prices. GPU-hours per day are a counter, so a day's total outlives the raw rows behind it. Cost per team is one join: opod's GPU-hours per endpoint with your gateway's tokens per team, labelled "allocated". See [Usage → Cost per team](https://opod.io/docs/control-plane-operate/usage/#cost-per-team). **What it costs.** No money view in the console. You write the join, or your BI tool does. ### Our store is a buffer, not a home Usage lives in **your** store (ClickHouse, Postgres, or Parquet objects in S3). The control plane's spool is a table in its database that gets each row there: it never deletes a row your sink has not taken, whatever the retention window says. With no sink connected, the control plane still installs and buffers, and says so loudly: the doctor's `usage` row reads `buffer` with "NO USAGE SINK IS CONNECTED", and the alert `usage.no-sink` fires once the buffer grows past what an outage explains. The cost: if your sink is down longer than the retention window, rows are held and the buffer grows, on purpose. Nothing unsent is ever dropped. ## Governance on its own layer: a gateway in front **The decision.** Keys per user, team and app; requests and tokens per minute; daily and monthly quotas; budgets and spend alerts; which team may use which model; PII and prompt-injection checks: these are a **gateway's** jobs. You run a gateway such as LiteLLM in front of opod for them. opod documents the setup and never ships, configures or reads the gateway. An opod key is an **endpoint access token**: it opens one endpoint (or one cell-door route), carries an expiry and a request class, and can be revoked. Overload is handled by request classes in the leader: `critical`, `standard` and `sheddable`, with fair share inside a class. **Why.** Earlier versions put per-key limits and a guardrail webhook in core's leader. A gateway does those jobs per user and per team, which a key-only limit cannot; and every check added to the leader is a cost on every token. We took them out. **What it gives you.** - A leader whose request path does no network call, disk read or shared counter for governance. - The gateway you choose, with its own user model, its guardrail plugins and its upgrades, separate from opod's. - Either side can be upgraded, moved or removed without the other. **What it costs.** With no gateway, opod has **no** per-user limits, quotas, budgets or prompt checks. One key can fill an endpoint up to what request classes shed. You must also close every other way in: require keys on the endpoint, and admit only the gateway with a NetworkPolicy. The [LiteLLM guide](https://opod.io/docs/get-started/litellm/) has every step. See [Gateways in front](https://opod.io/docs/control-plane-endpoints/gateways/). ## Request content is not ours to log **The decision.** opod never stores prompts or answers. Usage rows carry counts, ids and timings, never text. The plan field that would have turned content logging on was removed rather than left unimplemented. **Why.** Prompts and completions are the most sensitive data a customer has. Storing them makes a product responsible for retention, redaction, subject access and deletion, forever. That is not what opod is for. **What it gives you.** A smaller privacy surface to review: usage rows and events carry counts, ids and timings, never text, and no setting asks opod to keep a copy of requests. Operational logs (the control plane's records, the audit stream) still go to your sink: stdout, OTLP or Splunk. **What it costs.** If you need prompt and answer logs, you keep them in your gateway, where your own policy for them already lives. --- title: "Open core, licence and training" description: "Why core is Apache-2.0 and never knows the control plane exists, why a licence never stops a running endpoint, and why training runs as a Job beside endpoints." url: "https://opod.io/docs/design/open-core-and-licence/" markdown_url: "https://opod.io/docs/design/open-core-and-licence.md" section: "Design decisions" last_updated: "2026-11-01" --- # Open core, licence and training > Why core is Apache-2.0 and never knows the control plane exists, why a licence never stops a running endpoint, and why training runs as a Job beside endpoints. These decisions decide what you may do with opod's code, what a licence can and cannot do to your fleet, and where training fits. ## Core is open, and never knows the control plane exists **The decision.** Core (`opod`: the leader, the worker, the OpenAI-compatible gateway, the router, the engine drivers, sharding) is **Apache-2.0 with no usage limit**. Anyone may run, change and redistribute it, competitors included. Contributions use the DCO; there is no CLA. Core has no UI, no telemetry, no licence code, and no knowledge of the control plane, Kubernetes or any cloud. The control plane drives core only through a **frozen, additive-only contract**: the `/admin/v1` routes, the typed event and usage streams with cursors, the watched plan, auth and policy files, and a fixed list of environment variables. The wire types live in core's `pkg/` packages, which use only the Go standard library. A test on each side holds the contract: core's CI walks its real router, and the control plane's `make contract` boots a real `opod` binary and calls every route it relies on. The contract has one exception, made on purpose. In core v0.4.0 the usage stream (`GET /admin/v1/usage/stream`, feature `usage_stream`) leaves core with the usage table behind it. The leader pushes one OTLP log record per request instead (feature `usage_push`), and the control plane pulls only a leader without it, so a fleet that runs both versions loses no usage. Core's contract test records the retired key and holds it absent. **Why.** A licence that forbids competing is the first clause a customer's lawyer reads, and it blocks adoption. The runtime on the request path is also the part a buyer most needs to read and trust. What the control plane sells (the ledger, placement, rollouts, autoscaling, usage export, SSO and the console) does not depend on hiding the leader. **What it gives you.** - You can read and audit every line that touches a request. - You can run core by hand, with no control plane, on any machines: `opod up` and `opod join`. See [Core](https://opod.io/docs/core/). - No lock-in on the request path. If you stop using the control plane, your leaders and workers are still core, and still Apache-2.0. - The contract is frozen and additive-only, and tested from both sides, so a core release cannot quietly break the control plane. The one route ever retired, the usage stream, was retired by decision and with a replacement, not quietly. **What it costs.** - Anything the control plane wants from core must fit through the contract, or be added to it on purpose. Some cleanups wait on a contract change for that reason. - A competitor may build a product on core. That is the point of the licence, not a side effect. See [Core reference → Admin API](https://opod.io/docs/core-reference/admin-api/). ## A licence never stops a running endpoint **The decision.** The control plane is free, with every feature, up to **4 GPUs in total** across all your cells. A licence key raises that number. The key is a signed string checked **offline** against a public key in the binary: nothing calls us to start, serve or check it. A licence limits **new placements only**: - A placement beyond the licensed GPUs is refused `E-LICENCE`, with the remedy. Running workers are never stopped. - An expired key keeps its full ceiling for a 60-day grace period. After grace, new placements fall back to the free tier; everything that runs keeps running, and the console stays usable. - Nothing in the request path checks a licence. There is no remote kill. **Why.** A licence check in the serving path turns an expired invoice into a production outage. No customer should have to plan for that, and a vendor should never be able to cause it. **What it gives you.** Air-gapped installs that work, procurement answers that fit in one line, and a licence lapse that can never take traffic down. Only one number is licensed: GPUs. Endpoints, requests, tokens and users are not metered. **What it costs (for us, stated so you can trust it).** An offline key cannot be revoked remotely. A modified binary could skip the check; we rely on the licence agreement for that, not on code in your serving path. See [Licensing](https://opod.io/docs/control-plane/licensing/). **Figure: One key, several cells.** Bars of GPUs in use per cell against the licence key's ceiling. The interactive figure is on the web page: ## Training is a Job beside endpoints **The decision.** A training or offline run is a **Job**: a second kind of workload beside endpoints, with its own API (`/api/v1/jobs`), its own records and its own console page. It has no leader and no URL. It runs your container as a Kubernetes Job and claims GPUs from the **same ledger** as endpoint workers. Core never runs it. **Why.** Serving hardware sits partly idle at night. A separate training scheduler would need its own view of the cards and would double-book them. One ledger for both cannot. **What it gives you.** - Fine-tunes and batch scripts fill idle cards without colliding with serving. - `priority: preemptible` jobs give their card back when an endpoint create or an autoscale grow needs it, and resume from their checkpoint. Serving always wins. - Job GPU-seconds land in the same usage store and export as endpoints. **What it costs.** opod is not a training platform: it runs your training image and does not write training loops, queues or experiment tracking. Fair share and queues across many teams belong to a scheduler such as Kueue. A preemptible job must checkpoint to resume; without a checkpoint store it runs with "no resume" stated. See [Jobs and batches](https://opod.io/docs/control-plane-endpoints/jobs-batches/). --- title: "Opod core" description: "What opod core is, what it does, and what it leaves to other layers." url: "https://opod.io/docs/core/" markdown_url: "https://opod.io/docs/core.md" section: "Core" last_updated: "2026-11-01" --- # Opod core > What opod core is, what it does, and what it leaves to other layers. ## In short Opod core is the open-source runtime: one Go binary, `opod`, under Apache-2.0 with no usage limit. A leader (`opod up`) gives your machines one OpenAI-compatible URL; workers (`opod join`) run the engines that hold the models. Start with [Install](https://opod.io/docs/core/install/), then [First run](https://opod.io/docs/core/first-run/). ```bash opod up # on the first machine: the leader opod join "http://leader:8080?token=sk-orc-" # on each machine with a GPU ``` Core puts open-weight models on your own machines behind one OpenAI-compatible URL and one API key. Core has two roles: - A **leader** (`opod up`). It runs the gateway, the router, API keys, join tokens and the admin API `/admin/v1`. - A **worker** (`opod join`). It runs next to an inference engine (vLLM, SGLang, llama.cpp, Ollama, MLX-LM or TensorRT-LLM), reports what that engine holds, and serves requests the leader sends it. A client talks only to the leader. The leader picks a worker that holds the requested model and forwards the request. A model that is too big for one machine can be split across several workers as a **gang** (one model served by a group of processes on several machines). - [Install](https://opod.io/docs/core/install/): The installer, packages, and a build from source. - [First run](https://opod.io/docs/core/first-run/): One machine, one model, one request. - [Concepts](https://opod.io/docs/core/concepts/): Leader, worker, placement, gang, front door. - [Clusters](https://opod.io/docs/core/clusters/): Join workers, drain them, move models. - [CLI reference](https://opod.io/docs/core-cli/): Every `opod` command and flag. - [API reference](https://opod.io/docs/core-reference/): Gateway, admin API, streams, files, metrics. ## What core does | Area | What you get | | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Gateway | `POST /v1/chat/completions`, `/v1/embeddings`, `/v1/rerank`, `GET /v1/models`, and Anthropic Messages (`POST /v1/messages`) translated to the chat path. Streaming, tools, structured output and image input. | | Keys | API keys with one scope each (`user`, `admin`, `node`) and an optional expiry. Keys are stored as SHA-256 hashes. | | Routing | Placement by residency: a worker serves what its engine has loaded. The router picks the least-loaded worker that holds the model, with optional load-aware scoring, prefix-cache affinity and sticky sessions. | | Cluster | `opod join` registers a worker. Workers heartbeat every 5 seconds. Leader-to-worker calls are signed with HMAC-SHA256 per node. | | Models | A curated catalog embedded in the binary, plus any Hugging Face repo, Ollama tag or local GGUF. Admission control, eviction, pinning and live model moves. | | Sharding | Gangs on three backends: llama.cpp RPC (layer split), vLLM with Ray (tensor and pipeline parallel), and SGLang's own multi-node launcher. Several gangs of one model can serve in parallel. | | Observability | Prometheus `/metrics`, `/loadz` for an external autoscaler, OTLP traces and logs, and cursor-based usage and event streams. | | Management | A stable admin API (`/admin/v1`) and three watched files (plan, auth snapshot, policy snapshot) so an external manager can run a leader. | ## What core does not do Core is the runtime only. These are out of scope on purpose: - **A web UI, SSO, RBAC or teams.** Core is CLI-only, and `/` answers `404`. A console belongs to a manager such as the opod control plane. - **Per-key rate limits, quotas or model allowlists.** A key is an identity: who calls, with which scope, until when. Put limits in the gateway in front of the endpoint (LiteLLM, for example). Every request is recorded per key in the usage stream (from core v0.4.0, in the [usage push](https://opod.io/docs/core-reference/streams/#usage-push)). - **Cost or billing.** The usage records count tokens, never money. - **A usage database.** From core v0.4.0 the leader keeps no usage table. It pushes each record to an OTLP/HTTP receiver you run, such as an OpenTelemetry Collector, and holds a bounded queue (64 MiB by default) while the receiver is away. - **Proxying to model vendors.** Core serves your weights on your machines. It holds no vendor keys. - **Kubernetes objects.** `opod` is a process. Scheduling processes across a fleet is an orchestrator's job. - **Training and fine-tuning.** Core serves inference. It can serve a LoRA adapter you trained elsewhere. - **Telemetry.** Core never calls home. `opod update` is the only command that contacts GitHub, and only when you run it. The leader keeps its state in SQLite. A leader that fails is restarted, not replaced by a standby, and node traffic runs over your own network: the leader can require a certificate from every worker (`nodeMtls`) and signs every call it makes to one ([Security](https://opod.io/docs/core/security/)). ## Platforms | Platform | Leader | Worker | | -------------------------- | ------------ | --------------------------------------------------- | | macOS 13+ on Apple Silicon | yes | yes (Ollama, MLX-LM, llama.cpp) | | Linux x86_64 | yes | yes (vLLM, SGLang, TensorRT-LLM, llama.cpp, Ollama) | | Linux arm64 | yes | yes (Ollama, llama.cpp) | | Windows | through WSL2 | no | Worker container images exist for NVIDIA, AMD, Intel and Tenstorrent accelerators. See [Images](https://opod.io/docs/core-reference/images/). ## Licence Core is Apache-2.0. You may use it commercially, modify it, redistribute it and compete with it. Keep the licence and notice files, and state significant changes. Contributions use the Developer Certificate of Origin (`git commit -s`); there is no CLA. Source: [github.com/opod-io/opod-core](https://github.com/opod-io/opod-core). --- title: "Install" description: "Install the opod binary with the script, a .deb or .rpm package, or a build from source, and keep it up to date." url: "https://opod.io/docs/core/install/" markdown_url: "https://opod.io/docs/core/install.md" section: "Core" last_updated: "2026-10-30" --- # Install > Install the opod binary with the script, a .deb or .rpm package, or a build from source, and keep it up to date. ## In short Opod is one static binary, `opod`. The model catalog is embedded in it, so there are no other files to install. Every machine that serves a model also needs an inference engine, such as Ollama or vLLM. The leader itself needs no engine and no GPU. 1. **Install the binary** **Install script (macOS, Linux)** ```bash curl -fsSL https://raw.githubusercontent.com/opod-io/opod-core/main/installer/install.sh | sh ``` **Debian / Ubuntu** Replace `VERSION` with a version from [Releases](https://github.com/opod-io/opod-core/releases). ```bash curl -LO https://github.com/opod-io/opod-core/releases/latest/download/opod_VERSION_linux_amd64.deb sudo dpkg -i opod_VERSION_linux_amd64.deb ``` **Fedora / RHEL** ```bash sudo rpm -i https://github.com/opod-io/opod-core/releases/latest/download/opod_VERSION_linux_amd64.rpm ``` **From source** Requires Go 1.26 or newer (the version in `go.mod`). ```bash git clone https://github.com/opod-io/opod-core cd opod-core go build -o opod ./cmd/opod ``` 2. **Install an engine on each machine that serves a model** Opod drives an engine; it does not contain one. The simplest start is Ollama: ```bash brew install --cask ollama # macOS: the cask, not the formula curl -fsSL https://ollama.com/install.sh | sh # Linux ``` The other engines are in [Install an engine](#install-an-engine) below. 3. **Run the doctor** ```bash opod doctor ``` It checks the hardware, the listen port, the engine binaries, the engine, the data directory and the catalog. It prints a fix for each problem it finds. ## Check it worked ```bash opod version ``` ```text opod 0.21.0 (linux/amd64, go1.26.4) ``` `opod doctor` then reports each check on one line. On a Mac with Ollama installed but not started, it looks like this (shortened): ```text Opod doctor ============ ✔ hardware: darwin/arm64 · 8 cores · 24 GB RAM ✔ listen port :8080 available ✔ ollama binary at /opt/homebrew/bin/ollama ⚠ ollama engine not reachable: ollama unreachable at http://127.0.0.1:11434: … ⚠ → start it with: ollama serve ✔ data dir: /Users/you/.opod ✔ catalog: 48 entries ``` A `⚠` line is a warning, not a failure: `opod doctor` exits `0` either way. Read the lines. ## The install script The script: 1. Detects the OS and architecture. Supported: macOS arm64, Linux x86_64, Linux arm64. 2. Checks for `curl` and `tar`. 3. Checks whether Ollama is installed and prints the install command if it is not. On macOS it also detects the broken Homebrew `ollama` formula. 4. Downloads the release from GitHub Releases and verifies its SHA-256 against `checksums.txt`. From 0.3.0 it stops instead of installing when it cannot verify: no `checksums.txt`, no line for your platform, or neither `sha256sum` nor `shasum` on the machine. 5. Installs `opod` to the first writable directory of `~/.local/bin` and `~/bin`. With neither, it creates `~/.local/bin`; when your home directory is not writable, it uses `/usr/local/bin` with `sudo`. 6. Creates `~/.opod/catalog/` for your own catalog entries. 7. Prints the next steps, and tells you when the install directory is not on `PATH`. ### Script flags Pass flags after `sh -s --`: | Flag | Effect | | ------------------------ | ------------------------------------------------- | | `--help` | Print usage. | | `--version vX.Y.Z` | Install that version instead of the latest. | | `--install-dir PATH` | Install to that directory. | | `--no-engine` | Skip the Ollama check. | | `--dry-run` | Print what would happen. Write nothing. | | `join "URL?token=TOKEN"` | After the install, run `opod join` with that URL. | ```bash curl -fsSL https://raw.githubusercontent.com/opod-io/opod-core/main/installer/install.sh | sh -s -- --help curl -fsSL https://raw.githubusercontent.com/opod-io/opod-core/main/installer/install.sh | sh -s -- --version v0.1.1 curl -fsSL https://raw.githubusercontent.com/opod-io/opod-core/main/installer/install.sh | sh -s -- --install-dir ~/tools/bin --no-engine curl -fsSL https://raw.githubusercontent.com/opod-io/opod-core/main/installer/install.sh | sh -s -- --dry-run ``` ### Script environment variables | Variable | Same as | | -------------------- | ------------------------------------------------------------------------------------------------- | | `OPOD_VERSION` | `--version`. Also skips the GitHub API lookup, which has an anonymous limit of 60 calls per hour. | | `OPOD_INSTALL_DIR` | `--install-dir` | | `OPOD_SKIP_ENGINE=1` | `--no-engine` | ```bash curl -fsSL https://raw.githubusercontent.com/opod-io/opod-core/main/installer/install.sh | \ OPOD_VERSION=v0.1.1 OPOD_INSTALL_DIR=/opt/opod/bin OPOD_SKIP_ENGINE=1 sh ``` Install and join a cluster in one command: ```bash curl -fsSL https://raw.githubusercontent.com/opod-io/opod-core/main/installer/install.sh | \ sh -s -- join "http://leader.example.com:8080?token=sk-orc-" ``` Keep the quotes: `?` is a glob character in zsh. ## Packages (.deb and .rpm) Each release publishes packages for `amd64` and `arm64`. The package installs the binary at `/usr/bin/opod`. A catalog directory at `/usr/share/opod/catalog` is read if it exists (see [Catalog format](https://opod.io/docs/core-reference/catalog/)). ## Install an engine Pick one engine per worker: | Engine | Where | Notes | | --------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------- | | Ollama | macOS, Linux, CPU or GPU | The simplest default. On macOS use the cask (`brew install --cask ollama`), not the formula. | | vLLM | Linux with NVIDIA, AMD ROCm, Intel XPU or Tenstorrent | High-throughput serving. | | SGLang | Linux with NVIDIA, AMD Instinct or Intel XPU | Prefix cache shared across requests. | | llama.cpp `llama-server` | Anywhere, including CPU | GGUF files. Opod can launch it for you, and it is the engine for layer-split gangs. | | MLX-LM | macOS on Apple Silicon | | | TensorRT-LLM `trtllm-serve` | Linux with NVIDIA | One node only. | ## System requirements - macOS 13 or newer on Apple Silicon, or Linux x86_64 / arm64 (Ubuntu 22.04+, Debian 12+, Fedora 39+, RHEL 9+). - Linux with NVIDIA for vLLM: driver 535 or newer. - RAM: whatever the model needs. The leader alone needs little. - Disk: room for the model weights in the models directory (`~/.opod/models` by default). - Network: outbound HTTPS to the weight source (Hugging Face or the Ollama registry), unless you pre-place weights or use a mirror. ## Update ```bash opod update # download the latest release, verify SHA-256, replace the binary opod update --check # report only opod update --version v0.1.1 ``` After an update, restart a running leader with `opod down && opod up`. When the install directory needs root, `opod update` prints the exact command to run. A package install can also update through your package manager. Opod never checks for updates on its own. ## Uninstall ```bash rm -f ~/.local/bin/opod # or /usr/local/bin/opod for a root install rm -rf ~/.opod # state, keys, models, config — this deletes them ``` ## If it fails | Symptom | Cause | Fix | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | | `curl: (22) … 404` from the script | No release for this platform | Check [Releases](https://github.com/opod-io/opod-core/releases); pass `--version`. | | `command not found: opod` | Install directory not on `PATH` | `export PATH="$HOME/.local/bin:$PATH"` in your shell profile. | | The script warns that the Homebrew `ollama` formula is missing `llama-server`, and chat later fails with `500: error starting llama-server: llama-server binary not found` | The Homebrew `ollama` formula on Apple Silicon | `brew uninstall ollama && brew install --cask ollama` | | `checksum MISMATCH — refusing to install possibly-tampered binary` | Corrupt download or tampering | Run the script again. If it repeats, report it (see [Security](https://opod.io/docs/core/security/)). | | `could not resolve latest version from GitHub API` | The GitHub API's limit of 60 anonymous calls per hour | Set `OPOD_VERSION` to a release tag. | | `opod doctor` prints `⚠ ollama engine not reachable` | The engine is installed but not running | `ollama serve`, or on Linux `sudo systemctl start ollama`. | --- title: "First run" description: "Start a leader on one machine, serve a model, send the first request, and add a second machine." url: "https://opod.io/docs/core/first-run/" markdown_url: "https://opod.io/docs/core/first-run.md" section: "Core" last_updated: "2026-10-30" --- # First run > Start a leader on one machine, serve a model, send the first request, and add a second machine. ## In short This page starts a one-machine cluster: the leader and the engine on the same host. You send it a chat request, then add a second machine as a worker. You need `opod` and Ollama installed ([Install](https://opod.io/docs/core/install/)). It takes a few minutes, most of it the model download. 1. **Start the leader** By default a leader is **router-only**: it loads no model and serves from the workers that join it. On a single machine, tell it to serve a model itself with `OPOD_PULL_DEFAULT_MODEL=1`: ```bash # Ollama must be running (macOS: open -a Ollama; Linux: systemctl start ollama) OPOD_DEFAULT_MODEL=llama-3.2-1b OPOD_PULL_DEFAULT_MODEL=1 opod up ``` Expected output, shortened: ```text ▶ detected darwin/arm64 · 24 GB RAM · 8 cores ▶ no node-join token yet — run `opod token create --node` (or set OPOD_JOIN_TOKEN) before `opod join` on a worker ✔ default model: llama-3.2-1b ✔ engine: ollama at http://127.0.0.1:11434 First run. Pick a starter model to install — chat works as soon as it's done. Recommended for your hardware (24 GB RAM): llama-3.2-1b — Llama 3.2 1B Instruct (1.3 GB) Install llama-3.2-1b now? [Y/n/o=pick another] ✔ model ready: llama-3.2-1b Opod is ready. API: http://localhost:8080/v1 Health: http://localhost:8080/healthz Admin API key (shown once — store it now): sk-orc- Next steps: → Wire up Aider: opod connect aider → Wire up Cursor: opod connect cursor → See all clients: opod connect --list → Mint another admin key: opod token create ops --admin Quick test from the shell: curl http://localhost:8080/v1/chat/completions \ … Press Ctrl-C to stop. ``` After the key, `opod up` also lists every outbound network call this process can make, so you can check its privacy posture at a glance. The first `opod up` creates an **admin key**, prints it once and saves it to `~/.opod/admin.key` (mode `0600`). Later CLI commands on this host read that file, so you do not type the key. The key is minted only when the store holds **no key at all**: a later start names the file it is saved in (`Admin API key: saved in ~/.opod/admin.key`), and when that file is gone it says so and points at `opod token create ops --admin`. The store keeps hashes only, so a lost key cannot be recovered. > **Up to and including 0.2.1, the key is printed on every start** > > In 0.2.1, every `opod up` prints the admin key from `~/.opod/admin.key` to stdout. When the leader's output goes to a log (a service unit, a container), that log holds the admin key: treat it as a secret, or run the leader under a manager that sets `auth.admin_token`, which writes no key file. From 0.3.0 only the start that creates the key prints it; later starts print the file's path. Without `OPOD_DEFAULT_MODEL`, the leader picks the largest catalog model that fits the detected hardware and prints `auto-selected model: …`; with nothing that fits, it warns `no catalog entry fits this hardware; set router.default_model in config`. The model is pulled only with `OPOD_PULL_DEFAULT_MODEL=1` and a reachable engine. On an interactive terminal with no model installed yet, the first run asks before it pulls: `Y` (or Enter) installs the recommended model, `n` skips, `o` opens a picker. `--no-wizard` skips the prompt; with no terminal it pulls without asking. ### What the first run writes | File | Content | | ------------------- | -------------------------------------------------------------------------- | | `~/.opod/state.db` | The SQLite store: nodes, models, placements, keys (hashes), usage, events. | | `~/.opod/admin.key` | The admin key, mode `0600`. | | `~/.opod/opod.pid` | The leader's PID, read by `opod down`; removed on exit. | | `~/.opod/models/` | Weights pulled by opod (an Ollama engine keeps its own store). | The leader also writes its own node row, id `local`, which `opod node ls` shows. > **llama.cpp on one machine** > > With `OPOD_ENGINE=llamacpp OPOD_PULL_DEFAULT_MODEL=1 opod up`, opod launches `llama-server -hf ` for the default model when nothing listens on the llama.cpp endpoint (`http://127.0.0.1:8089`), and stops it on shutdown. A watchdog restarts it after three failed health checks in a row. 2. **Send a request** `opod up` stays in the foreground. Run the next commands in a second terminal. ```bash curl http://localhost:8080/v1/chat/completions \ -H "Authorization: Bearer sk-orc-" \ -H "Content-Type: application/json" \ -d '{"model":"auto","messages":[{"role":"user","content":"hi in 5 words"}]}' ``` `"model": "auto"` resolves to the leader's default model. Any catalog id the cluster holds works too. `GET /v1/models` lists them. Point an OpenAI-compatible tool at the same URL: ```bash export OPENAI_BASE_URL=http://localhost:8080/v1 export OPENAI_API_KEY=sk-orc- ``` `opod connect ` prints the exact settings for 15 tools. See [`opod connect`](https://opod.io/docs/core-cli/connect/). 3. **Give a teammate a key** Do not share the admin key. Mint a `user` key per person: ```bash opod token create alice --ttl 30d ``` The key is printed once. A `user` key can call `/v1/*` only. 4. **Add a worker: mint a join token on the leader** ```bash opod token create --node ``` A `node` key is the shared secret between the leader and a worker. Mint it only on a network you trust. 5. **Join from the new machine** Install opod and an engine on the new machine, then: ```bash opod join "http://leader.example.com:8080?token=sk-orc-" ``` The worker registers its hardware and engine, starts its own API on port `8081`, and heartbeats every 5 seconds. The leader must be able to reach the worker on that address. On a host with several interfaces, set `OPOD_ADVERTISE_ADDR=host:port`. 6. **Put a model on the worker** On the leader: ```bash opod node ls # find the worker's node id opod model add qwen-coder-7b --node n_abc123 # the worker pulls and loads it ``` The model is routable once the worker's next heartbeat reports it loaded. 7. **Stop** ```bash opod down # stop the leader and unload models from the local engine opod down --no-unload # stop only ``` Ctrl-C on `opod up` stops it without unloading, so a restart is fast. A worker stops on Ctrl-C or `SIGTERM`: it tells the leader it is leaving, lets running requests finish (10 seconds by default), then stops its engine. ## Check it worked ```bash opod status opod node ls curl -s http://localhost:8080/v1/models -H "Authorization: Bearer sk-orc-" ``` - `opod node ls` lists the leader as `local` and the new worker as `n_…`, both `ready`. - `GET /v1/models` lists `llama-3.2-1b` and `qwen-coder-7b` once the worker's next heartbeat reports the model loaded. - The chat request in step 2 answers `200` with `choices[0].message.content`. ## If it fails | Output | Fix | | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `⚠ engine (ollama) at http://127.0.0.1:11434 is not reachable` and a start command | Start the engine, then `opod status`. The leader still starts and serves from workers. | | `opod: config: parse ~/.opod/config.yaml: …` | Fix the YAML. | | `opod: server: listen tcp :8080: bind: address already in use` | Another process holds the port. `opod down`, or set `listen`. | | `opod: catalog: …` | A catalog override file is broken or unsigned under your signature policy. `opod doctor` names it. | | `401` `missing_api_key` or `invalid_api_key` on the chat request | Send `Authorization: Bearer` with the admin key from the banner, or from `~/.opod/admin.key`. | | The worker is not in `opod node ls` | The token is wrong or revoked, or the leader cannot reach the worker on port `8081`. See [Troubleshooting](https://opod.io/docs/core/troubleshooting/#a-worker-does-not-join). | ## Next - [Concepts](https://opod.io/docs/core/concepts/) explains placement, gangs and front doors. - [Clusters](https://opod.io/docs/core/clusters/) covers drain, remove and model moves. - [Configuration](https://opod.io/docs/core-reference/configuration/) lists every `config.yaml` field. --- title: "Concepts" description: "The terms opod core uses — leader, worker, engine, placement, gang, front door, cell door, keys and the watched files." url: "https://opod.io/docs/core/concepts/" markdown_url: "https://opod.io/docs/core/concepts.md" section: "Core" last_updated: "2026-11-01" --- # Concepts > The terms opod core uses — leader, worker, engine, placement, gang, front door, cell door, keys and the watched files. ## In short A **leader** is the one URL clients call; **workers** run the engines that hold the models and report what they hold every 5 seconds. The router sends each request to a worker whose engine has the model loaded. A model too big for one machine runs as a **gang** across several. This page defines each term the other pages use. ## Leader The **leader** is the process `opod up` starts. It is the one URL clients call. It holds: - the **gateway**: the OpenAI-compatible `/v1` routes and their key check; - the **router**: which worker serves each request; - the **store**: a SQLite database (`~/.opod/state.db`) with nodes, models, placements, keys, usage rows and events (from core v0.4.0 it keeps no usage rows: they are pushed out, see below); - the **admin API** `/admin/v1`, which the CLI and any external manager call. A leader listens on `:8080` by default. One leader serves one cluster. Leader failover is a process restart; there is no standby leader **(planned)**. ## Worker A **worker** is the process `opod join` starts on a machine with an engine. It registers with the leader, then sends a **heartbeat** every 5 seconds. The heartbeat carries the models its engine has loaded, the engine's load sample (KV-cache use, queue depth, tokens per second) and the state of the engine process. The worker runs its own HTTP API on `:8081`. The leader calls it to send inference requests, to load or unload a model, and to start processes for a gang. Every leader-to-worker call is signed with HMAC-SHA256 using that worker's token. A worker's **node id** stays the same across restarts. It comes from, in order: `OPOD_NODE_ID`, the id saved in `~/.opod/node.yaml` by the last join, `n_` plus `POD_NAME`, or a new random id `n_…`. The leader also lists itself as a node with the id `local`. ## Engine An **engine** is the inference server opod drives: Ollama, vLLM, SGLang, llama.cpp `llama-server`, MLX-LM or TensorRT-LLM `trtllm-serve`. Each node uses one engine, chosen by `engine.preferred` (or `OPOD_ENGINE`). See [Engines](https://opod.io/docs/core-reference/engines/). Some engines serve exactly one model per process (vLLM, SGLang, llama.cpp, TensorRT-LLM). Loading another model on such a worker stops the running one. Ollama holds several models and loads on request. ## Node states `opod node ls` shows the state the leader acts on, computed when it reads the row: | State | Meaning | | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | `joining` | Registered, not yet ready. | | `ready` | Takes new requests. | | `draining` | You drained it. No new requests or gang parts; running requests finish. It stays drained until you undrain it. | | `lost` | No heartbeat within the heartbeat bound (`router.heartbeat_max_age_seconds`, default 30 s; `0` means a 60 s bound). | | `engine-silent` | Heartbeats arrive, but the engine has not answered the worker within that bound. It gets no new requests until the engine answers again. | **Figure: A node's states, as the leader sees them.** A state diagram: no row, ready, draining, engine-silent and lost, with the events that move a node between them. The interactive figure is on the web page: ## Placement A **placement** says that a node serves a model. Placements come from residency: a model is placed on a worker when the worker's heartbeat reports that its engine has the model loaded. Three paths make the leader target a specific node: `opod model add --node`, `opod model move` and `opod shard create`. The router picks, for each request, a node that holds the requested model and takes new work. It prefers the leader's own engine when that holds the model, else the least-loaded live worker. A manager can switch on load-aware scoring, prefix-cache affinity and a speed rank through the [policy snapshot](https://opod.io/docs/core-reference/policy-snapshot/). ## Model ids A request's `model` field selects the backend: | `model` value | Served by | | ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | a catalog id, e.g. `qwen3-coder-30b` | its gang if it is sharded; else the leader's engine if it holds it; else the least-loaded live worker that does | | `auto` | the leader's default model (`router.default_model`) | | an engine-native name, e.g. `qwen2.5-coder:14b` | any node that reports it loaded; no catalog entry needed | | `:` | a LoRA adapter of that model (vLLM workers) | | `:nitro` | the same model, with the fallback chain sorted by throughput | | a vendor id such as `gpt-4o` | nothing; core does not proxy to vendors | ## Gang A **gang** is one complete serving copy of a model that is split across several machines: N parts plus one **coordinator** (the process that serves the API for the whole gang). The catalog entry's `sharding.engine` picks the scheme: llama.cpp RPC (layer split), vLLM on a Ray cluster (tensor and pipeline parallel), or SGLang's own launcher. A model can have several gangs; each serves whole requests, and the router picks the least-loaded ready one. See [Sharding](https://opod.io/docs/core/sharding/). ## Catalog The **catalog** is a set of model entries: where the weights come from, the size, the minimum hardware, the capabilities and the recommended engines. A curated catalog is embedded in the binary. Files in override directories add or replace entries. See [Catalog format](https://opod.io/docs/core-reference/catalog/). ## API keys Every caller authenticates with an API key `sk-orc-…`. A key has exactly one scope: | Scope | Can call | | ------- | ------------------------------------------------------ | | `user` | `/v1/*` | | `admin` | `/v1/*` and `/admin/v1/*` | | `node` | worker register and heartbeat; `opod join` presents it | Keys are identities. Core attaches no rate limit, quota or model allowlist to them. ## Front door and cell door `opod up --role gateway --leader URL` starts a **front door**: an extra copy of the gateway for one leader's endpoint. It serves `/v1` and the probes only. It mirrors the leader's worker list, routes to those workers itself, and pushes its usage rows to the leader. Run several behind a load balancer to spread client connections. `opod up --role door --routes FILE` starts a **cell door**: one URL in front of many leaders. It reads each request's `model`, looks up the endpoint in a routes file and forwards the request unchanged. It holds no key and no store. See [Front doors](https://opod.io/docs/core-reference/front-doors/). ## Standalone and managed A leader started by hand is **standalone**: its store is a durable SQLite file and you manage it with the CLI. A leader run by an external manager (a control plane, a systemd unit you template, a script) is **managed** when `OPOD_MANAGED=1`. Its store is then an in-memory cache, unless `OPOD_STORAGE_DSN` names a file. The manager steers it through three watched files, each re-read every 10 seconds: | File | Default path | Carries | | --------------- | ---------------------------- | ------------------------------------------------------------------------- | | plan | `/etc/opod/plan.json` | the endpoint's one model, its revision, adapters, gangs, workload context | | auth snapshot | `/etc/opod-auth/auth.json` | API keys as hashes, `requireKeys`, revocations, worker-certificate policy | | policy snapshot | `/etc/opod-auth/policy.json` | routing weights, access log, admission, wake rules, fallback target | A leader keeps serving from the last good copy of each file when the manager is down. See [Managed mode](https://opod.io/docs/core/managed-mode/). ## Usage and events Each request leaves a **usage row**: key, model, protocol, tokens, latency, time to first token, outcome and serving node. Fleet changes leave **lifecycle events** (`node.registered`, `model.loaded`, `shard.created`, …). Both are read by cursor from `/admin/v1/usage/stream` and `/admin/v1/events/stream`. See [Streams](https://opod.io/docs/core-reference/streams/). In core v0.4.0 the usage stream is replaced. The leader keeps no usage table: it holds each record in a queue in memory (64 MiB by default) and pushes it as an OTLP log record to `OPOD_USAGE_OTLP_ENDPOINT`, freeing it only when the receiver answers 2xx. Without a receiver, usage is not kept. Events are still read by cursor. See [Usage push](https://opod.io/docs/core-reference/streams/#usage-push). --- title: "Clusters" description: "Join workers, pin them to a GPU, drain and remove them, and move a model between workers without failing a request." url: "https://opod.io/docs/core/clusters/" markdown_url: "https://opod.io/docs/core/clusters.md" section: "Core" last_updated: "2026-10-30" --- # 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 1. **Mint a join token on the leader** ```bash opod token create --node ``` The key is printed once. Copy it. 2. **Join from the new machine** ```bash opod join "http://leader.example.com:8080?token=sk-orc-" ``` ```text ✔ joining cluster at http://leader.example.com:8080 as n_abc123 ``` The command stays in the foreground while the worker runs. 3. **Put a model on it** On the leader: ```bash 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: ```bash OPOD_JOIN_TOKEN=sk-orc- opod join https://leader.example.com ``` A URL without a scheme gets `http://`. Joining a non-local leader over plain `http` with a token prints a warning: use `https` (see [Security](https://opod.io/docs/core/security/)). ### What the worker does 1. Detects its hardware: OS, architecture, RAM, CPU cores and GPUs. 2. Picks the address the leader should dial: the LAN address on its default route, port `8081`, or `OPOD_ADVERTISE_ADDR` when set. ```bash OPOD_ADVERTISE_ADDR=192.0.2.51:8081 opod join "http://leader:8080?token=sk-orc-" ``` 3. Saves `~/.opod/node.yaml` with its node id, so the next join keeps the same id. 4. Starts its HTTP API and its heartbeat loop. Each heartbeat carries the engine's loaded models and load sample. 5. With `OPOD_LOAD_MODEL=`, loads that model itself once its engine answers. ```bash OPOD_LOAD_MODEL=llama-3.2-3b opod join "http://leader:8080?token=sk-orc-" ``` **Figure: From an empty leader to a served request.** A sequence diagram of every call between your CLI, the leader, a worker and its engine: token create, join, register, heartbeat, model load and a proxied chat request. The interactive figure is on the web page: ### One GPU and a memory budget per worker Several workers can share one machine or one card: ```bash opod join "http://leader:8080?token=sk-orc-" --gpu 1 --vram-budget 20 ``` - `--gpu 1` pins the worker's engine to device 1. It sets `CUDA_VISIBLE_DEVICES` and `HIP_VISIBLE_DEVICES` to `1` and `ONEAPI_DEVICE_SELECTOR` to `level_zero:1` for the engine, unless the variable is already set. - `--vram-budget 20` caps 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 from `OPOD_CARD_MIB`, else from `nvidia-smi`; without either, the budget is not applied. See [`opod join`](https://opod.io/docs/core-cli/join/) for the formula. The same values can come from `OPOD_GPU_INDEX` and `OPOD_VRAM_BUDGET_GB`. The flags win. ```bash OPOD_GPU_INDEX=1 OPOD_VRAM_BUDGET_GB=20 opod join "http://leader:8080?token=sk-orc-" ``` On a box that a manager measured, pass the card size so the budget applies without `nvidia-smi`: ```bash OPOD_CARD_MIB=49140 opod join "http://leader:8080?token=sk-orc-" --vram-budget 20 ``` ### Join with a certificate A worker with `OPOD_NODE_CERT` and `OPOD_NODE_KEY` can join with no token. ```bash 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.com ``` Its node id is read from the certificate's SPIFFE URI SAN `spiffe:///opod/node/`. The leader must have certificate checking on in its auth snapshot. See [Security](https://opod.io/docs/core/security/). ## List and inspect nodes ```bash opod node ls ``` ```text ID 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:40Z ``` `opod node show ` 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 ```bash 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 `503` with `Retry-After` and a message that names the drain. Other models keep serving. - The leader's own `local` node cannot be drained. Unload its models or stop the leader. - `remove` does not stop the worker process. If the worker still runs, its next heartbeat registers it again. ## Move a model to another worker ```bash opod model move llama-3.2-3b --from n_abc123 --to n_ghi789 ``` A 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: 1. **started** — the target loads the model while the source keeps serving. 2. **loaded** — the target's heartbeat shows it serving. 3. **flipped** — the router stops choosing the source. 4. **drained** — requests on the source finish (bounded by `placement.drain_timeout_seconds`). 5. **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`. **Figure: opod model move, over time.** Four lanes over time: the source's memory and requests and the target's memory and requests, with the move's stages marked (the target loads, the router flips, then the source unloads). The interactive figure is on the web page: ## Worker shutdown On `SIGINT` or `SIGTERM` a worker: 1. tells the leader it is leaving, so the router stops sending it requests at once; 2. lets requests already running finish, for at most `OPOD_DRAIN_SECONDS` (default `10`; `0` stops at once); 3. stops its engine. ```bash OPOD_DRAIN_SECONDS=60 opod join "http://leader:8080?token=sk-orc-" # let long answers finish ``` Give a container a termination grace period longer than `OPOD_DRAIN_SECONDS`. ## Check it worked ```bash opod node ls ``` ```text ID 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:43Z ``` The 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](https://opod.io/docs/core/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. --- title: "Models" description: "Find, install, load, unload, pin and remove models, add your own entries, serve LoRA adapters, and reclaim cache space." url: "https://opod.io/docs/core/models/" markdown_url: "https://opod.io/docs/core/models.md" section: "Core" last_updated: "2026-10-30" --- # Models > Find, install, load, unload, pin and remove models, add your own entries, serve LoRA adapters, and reclaim cache space. ## In short A model goes through three states: in the catalog, installed (weights on disk) and resident (in engine memory). `opod model add` installs it, `opod model load` makes it resident now, and `opod model remove` deletes it. On a cluster, `--node` installs it on named workers instead of the leader. 1. **Find the model** ```bash opod model search coder ``` 2. **Install it** ```bash opod model add qwen-coder-7b # on the leader's own engine opod model add qwen-coder-7b --node n_abc123 # or on a worker ``` 3. **Load it into memory (optional)** A model loads on its first request anyway. Load it now to skip the cold start: ```bash opod model load qwen-coder-7b ``` 4. **Send it a request** ```bash curl http://localhost:8080/v1/chat/completions \ -H "Authorization: Bearer sk-orc-" -H "Content-Type: application/json" \ -d '{"model":"qwen-coder-7b","messages":[{"role":"user","content":"hi"}]}' ``` ## Find a model ```bash opod model search # the whole catalog opod model search coder # by text opod model search vision # by capability opod model search --sort=released # newest first opod model search --since 2026-01-01 opod model info qwen-coder-14b # one entry in full opod catalog ls # catalog ids only, one per line ``` `--json` works on `search`, `info`, `ls` and `ps`. ## Install a model There are four ways to name a model: | Form | Example | Hardware check | | ------------------------------------- | ----------------------------------------------------------------------------------------- | -------------- | | catalog id | `opod model add qwen3.6-27b` | yes | | scheme prefix | `opod model add hf:bartowski/Phi-3-mini-GGUF`, `ollama:phi3:mini`, `file:/models/my.gguf` | no | | your own catalog file | `opod model add --file ./my-model.yaml` (`--from` up to core v0.4.5) | yes | | a file you drop in `~/.opod/catalog/` | `opod model add my-model` | yes | `--from` copies the file into `~/.opod/catalog/`, so the entry persists and appears in `search` and `info`. What `model add` does: 1. Checks the entry's `hardware.min_ram_gb` and `min_vram_gb` against this machine. It refuses when the floor is higher; `--force` overrides. 2. Sends a HEAD request (5 s) to the upstream — the Ollama registry or Hugging Face — and refuses on a `404`. A network problem only warns. `OPOD_SKIP_SOURCE_CHECK=1` skips the check for air-gapped mirrors: ```bash OPOD_SKIP_SOURCE_CHECK=1 opod model add llama-3.2-3b ``` 3. Records the model and pulls the weights into the engine. 4. For an entry with `sharding.required: true`, hands off to `opod shard create`. `--dry-run` prints the download size, RAM, engine and the source check, and pulls nothing. ### Install on specific workers ```bash opod model add llama-3.2-3b --node n_abc123 opod model add llama-3.2-3b --nodes n_abc123,n_def456 ``` The leader tells each worker to pull and load the model. The model is placed once the worker's heartbeat reports it. On a worker whose engine serves one model per process (vLLM, SGLang, llama.cpp, TensorRT-LLM), loading another model stops the current one, so the command refuses and names both models; `--force` replaces it. `--dry-run` does not work with `--node`. Without `--node`, `model add` installs to the leader's own engine. ## Memory lifecycle Installed is not the same as resident. A model on disk loads into engine memory on its first request. These commands control what is in memory now, on the leader's engine: ```bash opod model ps # resident models and free memory opod model load qwen-coder-14b # load now; refuse if it does not fit opod model load qwen-coder-14b --swap # evict least-recently-used models to make room opod model load nomic-embed-text --pin # never evicted, no idle unload opod model load qwen3-14b --priority 3 # restore order on the next start opod model unload qwen-coder-14b # drain, then release memory; weights stay ``` - **Admission.** A model's footprint is its weights plus about 20 %. The budget is total RAM minus a reserve (`placement.reserve_percent`, default 20). - **Swap.** `--swap` evicts only as many models as needed, least-recently-used first, never pinned ones. Each victim is drained (router stops sending to it; requests finish within `placement.drain_timeout_seconds`, default 30), unloaded and recorded as `model_evicted`. - **Restore.** Loaded and pinned models are remembered and restored in priority order on the next `opod up`. - **Exclusive.** `opod up --exclusive`, `placement.exclusive: true` or `OPOD_EXCLUSIVE=1` keeps one resident model per machine: every load evicts all other non-pinned models. For example `OPOD_EXCLUSIVE=1 opod up`. - **Unload** clears the model from the remembered set, so it stays unloaded after a restart. - **Shutdown.** `opod down` unloads by default. Ctrl-C on `opod up` keeps models warm; `--unload-on-exit` changes that. Live residency comes from Ollama. Engines without an unload call (vLLM, MLX-LM) are skipped; processes that opod launched are stopped at shutdown. The API returns `409` with `type: needs_swap` when `--swap` would make room, `409 blocked_by_pinned` when pinned models hold the memory, and `422 impossible` when the model is larger than the empty budget. ## Remove a model ```bash opod model remove qwen-coder-14b # prompts; weights are deleted opod model remove qwen-coder-14b --yes ``` `rm` is an alias. With no id, or an id that is not installed, `add`, `info`, `remove`, `load` and `unload` open an interactive picker. ## Pin a model version For Hugging Face weights, `OPOD_MODEL_REVISION` pins a commit sha, tag or branch, and `OPOD_MODEL_SHA256` names the digest the file must have. A pinned revision is cached under `@`, so two revisions coexist. Without a pin the revision is `main`, which moves. Set them on the process that pulls, usually the worker: ```bash OPOD_LOAD_MODEL=llama-3.2-3b \ OPOD_MODEL_REVISION=0cb88a4f764b7a12671c53f0838cd831a0843b95 \ OPOD_MODEL_SHA256=<64 hex characters> \ opod join "http://leader:8080?token=sk-orc-" ``` ## Signed catalog files A catalog file decides which weights get pulled. You can sign your own files with [minisign](https://jedisct1.github.io/minisign/): ```bash minisign -S -m my-model.yaml # writes my-model.yaml.minisig export OPOD_CATALOG_PUBKEY=~/.minisign/minisign.pub export OPOD_CATALOG_REQUIRE_SIGNED=1 # refuse unsigned files too ``` - With `OPOD_CATALOG_PUBKEY` set, a file that has a `.minisig` beside it must verify. A bad signature is always refused, and the error names the file. - Unsigned files still load unless `OPOD_CATALOG_REQUIRE_SIGNED=1`. - The check applies to every catalog directory and to `model add --file` (`--from` up to core v0.4.5). - The embedded catalog is never checked. ## LoRA adapters vLLM workers serve LoRA adapters as `:`. - At start: set `OPOD_ADAPTERS` on the worker to a JSON list: ```bash OPOD_ENGINE=vllm OPOD_ADAPTERS='[{"name":"sql","source":"org/sql-lora","rank":16}]' \ opod join "http://leader:8080?token=sk-orc-" ``` A request then names `"model": ":sql"`. - At runtime, on a leader with a [plan file](https://opod.io/docs/core-reference/plan-file/): `POST /admin/v1/adapters` with `{"name","source","rank"}` loads one on every worker that holds the plan's model; `DELETE /admin/v1/adapters/{name}` drops it. A leader with no plan file answers `409` (it has no single model to attach the adapter to): ```bash curl -s -X POST http://localhost:8080/admin/v1/adapters -H "Authorization: Bearer $ADMIN" \ -H 'Content-Type: application/json' -d '{"name":"sql","source":"org/sql-lora","rank":16}' curl -s -X DELETE http://localhost:8080/admin/v1/adapters/sql -H "Authorization: Bearer $ADMIN" ``` vLLM fixes its LoRA slots when it starts (`--enable-lora`, `--max-lora-rank`). A worker started with no adapters, or asked for a `rank` above its start value, answers `409` with both numbers. Restart that worker with the adapter in `OPOD_ADAPTERS`. A move does not carry adapters. There is no CLI command for adapters. ## Weights on disk Weights live in the models directory: `storage.models_dir`, default `~/.opod/models`. Every worker on a node shares it. - [`opod fetch`](https://opod.io/docs/core-cli/fetch/) makes one GGUF, or a safetensors snapshot, present in a directory. It takes a per-file lock, writes to a temporary file and renames it only when complete and verified. - [`opod cache`](https://opod.io/docs/core-cli/cache/) lists the cache and removes what no plan references. It only ever deletes files opod fetched, and is a dry run unless you pass `--apply`. ## Container images for a model `opod image recommend --vendor nvidia` names the worker image that serves a catalog model on that accelerator. See [`opod image`](https://opod.io/docs/core-cli/image/). ## Check it worked ```bash opod model ls # installed: STATUS ready opod model ps # resident in the leader's engine (Ollama only) curl -s http://localhost:8080/v1/models -H "Authorization: Bearer sk-orc-" ``` A model is served when `GET /v1/models` lists it. A model placed with `--node` appears there once the worker's next heartbeat reports it loaded. ## If it fails | Symptom | Fix | | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | | `opod: model … needs at least N GB RAM; this machine has M GB` | Pick a smaller model, or pass `--force` if you know it fits. | | `opod: source for … does not exist: …` | The upstream repo or tag is gone. Check the catalog entry's `source`, or use a scheme id such as `hf:owner/repo`. | | `opod: source type "ollama" in … is not compatible with engine vllm …` | Use an entry whose source suits the engine, or switch engines. | | `409` `needs_swap` from `model load` | Run it again with `--swap` to accept the evictions. | | `409` `blocked_by_pinned` | Pinned models hold the memory. Unload or unpin one. | | `422` `impossible` | The model is larger than the empty budget. Use a smaller quantization or another machine. | | `--node` refuses and names two models | The worker's one-model engine already serves another model. Add `--force` to replace it on purpose. | | A catalog file is refused with a signature error | Sign it again with `minisign -S -m FILE`, or check `OPOD_CATALOG_PUBKEY`. | --- title: "Sharding and gangs" description: "Split a model across several machines with llama.cpp RPC, vLLM on Ray, or SGLang, run several gangs of one model, and read the failure codes." url: "https://opod.io/docs/core/sharding/" markdown_url: "https://opod.io/docs/core/sharding.md" section: "Core" last_updated: "2026-10-30" --- # Sharding and gangs > Split a model across several machines with llama.cpp RPC, vLLM on Ray, or SGLang, run several gangs of one model, and read the failure codes. ## In short A **gang** is one complete serving copy of a model split across several machines: N parts plus one **coordinator**, the process that serves the API for the whole gang. Use a gang when a model is larger than any one worker. `opod shard create` forms it and the router sends the model's requests to its coordinator. Several gangs of one model add throughput. 1. **Have enough ready workers** ```bash opod node ls ``` Each worker that hosts a llama.cpp part needs `rpc-server` on `PATH` (see [Prerequisites](#prerequisites-for-llamacpp-rpc)). 2. **Create the gang** ```bash opod shard create llama-3.3-70b-sharded # opod picks the part count opod shard create llama-3.3-70b-sharded 2 # two parts on two picked workers opod shard create llama-3.3-70b-sharded --nodes n_a,n_b ``` ```text ▶ creating sharded model llama-3.3-70b-sharded on [n_a n_b] (this may take a few minutes)… ✔ sharded model ready: llama-3.3-70b-sharded ``` `opod model add` on an entry with `sharding.required: true` runs `shard create` for you. 3. **Send it a request** ```bash curl http://localhost:8080/v1/chat/completions -H "Authorization: Bearer $ADMIN" \ -H 'Content-Type: application/json' \ -d '{"model":"llama-3.3-70b-sharded","messages":[{"role":"user","content":"hi"}]}' ``` 4. **Remove it when done** ```bash opod shard remove llama-3.3-70b-sharded ``` ## Check it worked ```bash opod shard ls ``` ```text MODEL GANG ROLE NODE ADDRESS STATUS llama-3.3-70b-sharded g0 coordinator n_a 192.0.2.51:9001 ready llama-3.3-70b-sharded g0 rpc n_a 192.0.2.51:50052 ready llama-3.3-70b-sharded g0 rpc n_b 192.0.2.52:50052 ready ``` Every row reads `ready`, and the gang has a `coordinator` row. `GET /v1/models` lists the model. ## Backends The catalog entry's `sharding.engine` picks the scheme. An entry with no `engine` uses `llamacpp`. | `sharding.engine` | Scheme | What runs on each machine | Parallelism | | ----------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | | `llamacpp` | llama.cpp RPC, layer split | an `rpc-server` per part, plus one `llama-server --rpc` coordinator | layers only; `--tp` above 1 is refused | | `vllm` | a Ray cluster | a Ray daemon per part; `vllm serve … --distributed-executor-backend ray` on the head | `--tp` and `--pp` | | `sglang` | SGLang's own multi-node launcher | `python -m sglang.launch_server` on every machine with `--dist-init-addr`, `--nnodes`, `--node-rank`; rank 0 serves the API | `--tp` over the whole gang, `--pp` for stages | A create with `expert: true` (admin API only) on a `vllm` entry runs vLLM expert parallelism: one `vllm serve` per part with `--enable-expert-parallel` and vLLM's data-parallel ranks, no Ray. `pp` is refused for that shape. ### When a vLLM or SGLang gang is ready A vLLM or SGLang create returns as soon as every part is launched. The head's API comes up later, after every part has joined and the weights are loaded. On a 1.5B model across two machines that took 45 s (vLLM, pipeline 2) to 2 min 20 s (SGLang, tensor 2). From core v0.4.2, the coordinator row reads `starting` until the head answers `GET /v1/models`. The leader asks every 5 s and then stores `ready`. Until then the router does not send it requests, `/readyz` fails, `GET /v1/models` does not list the model, and a request gets `503` with "is not ready to serve yet". Wait for the row: ```bash opod shard ls # the coordinator row: starting → ready ``` On the design-partner cell (two RTX 3060 Ti machines, Qwen2.5-1.5B), the row read `starting` for about 2 min 20 s (SGLang, tensor 2) and 73 s (vLLM, pipeline 2), and then every request answered. Older cores get this wrong: - **Core v0.4.0** stores the row `ready` at launch. Requests get `503` until the head loads, while `/readyz` and the control plane say the gang serves. - **Core v0.4.1** waits for the head, but in the second before the row turns `ready` a request can get `502`, and `/v1/models` lists the model while it loads. - **Core v0.4.0 and v0.4.1:** an SGLang gang across machines stops serving about 30 s after it starts. The worker of every rank but 0 stops reporting when SGLang opens a placeholder health server on its engine port. The leader then reads the part as silent, and every request gets `503` "1 part(s) whose engine stopped answering". Use core v0.4.2. A llama.cpp gang is ready when its create returns: the create waits for the coordinator. Rules shared by every backend: - `tp × pp` must equal parts × devices per part. - `tp` must be a multiple of the devices inside one part. - With neither given: tensor parallel inside a machine, pipeline parallel across machines. - A tensor-parallel group wider than one machine is allowed and logged as a warning. Every all-reduce of every token then crosses the network; pipeline parallel is the cheap shape on ordinary Ethernet. ### Refused by name An SGLang pipeline (`pp > 1`) of a Llama-family model with tied word embeddings crashes SGLang's last stage. Opod reads the model's `config.json` first and refuses the create with `409` and `error.code: sglang_pp_tied_llama`. Use tensor parallel, one stage, or `sharding.engine: vllm`. **Figure: Splitting one model across cards and machines.** One model split by tensor parallel and pipeline parallel across cards and machines; each moving dot is one token's traffic on that link, and the verdict says what the split costs on the network. The interactive figure is on the web page: ## Prerequisites for llama.cpp RPC - `rpc-server` on `PATH` on every worker that hosts a part. The Homebrew bottle does not include it; build llama.cpp with `-DGGML_RPC=ON`, or use an `opod-worker-llamacpp-*` image, which carries the pair. - `llama-server` on `PATH` on the machine that runs the coordinator. - A catalog entry with `sharding.required: true`, and either `source.type: file` with a `source.path` the leader can read, or `source.type: huggingface` with a `source.file`. - Enough workers in state `ready`. The leader distributes the weights: it downloads a Hugging Face GGUF into its models directory, then uploads the file to each part's worker over `/v1/process/upload` after a SHA-256 check. A worker that already has the file is skipped. ## How a llama.cpp gang forms 1. The leader picks the workers, and refuses with `409` (and the numbers) when it cannot find enough. Nothing is torn down or started. 2. It starts `rpc-server -p ` on each part through the worker's `/v1/process/start` and waits for the port. Ports start at `sharding.rpc_port_base` (default `50052`). 3. It starts the coordinator, `llama-server -m --rpc , --port --metrics`, and waits for it. 4. It stores the gang's rows and a placement for the model. 5. The router sends every request for the model to a ready coordinator. If a part fails to start, every process the create started is stopped and the error is returned. ## Part count With no count, no `--nodes`, no `--tp` and no `--pp`, the CLI picks the shape: the smallest number of equal parts that fits the live workers' free memory. One part when the model fits one worker. Never more parts than live workers, or than the model's layers when the catalog records `architecture.layers`. It prints what it picked and why, and refuses with the numbers when nothing fits. Free memory is each worker's registered card memory (else RAM), minus the reserve, minus what it already holds. A worker's `--vram-budget` is not reported to the leader, so name the count yourself when workers share a card. Any shape you name is sent unchanged. The admin API never picks: a body without `nodes` or `shards` uses the catalog's `default_shards`. Without `--nodes`, parts go to the strongest workers: a worker with a card before one without, then the bigger card, then the bigger host. With `--nodes`, parts go where you name them, in that order. **Figure: How opod shard create picks the parts.** Model size against five live workers' free card memory: equal parts, strongest workers first, with the parts the CLI would pick and the coordinator. The interactive figure is on the web page: ## Where the coordinator runs The coordinator holds the KV cache, so it runs on the gang's worker with the most **card** memory (host RAM for a worker without a card). It runs on the leader only when the gang has no workers. To choose: - `OPOD_COORDINATOR_NODE=` on the leader pins it; `local` forces the leader. - `head` in `POST /admin/v1/shards/create` names the worker rank. `head: "local"` is refused. A one-part gang runs the whole model on that worker with no `rpc-server`; the coordinator override is ignored. ## Several gangs of one model A second gang is more throughput, not a bigger model. Each gang serves whole requests; the router picks the least-loaded gang whose coordinator is ready. In core v0.4.6 that choice is load alone: a conversation's pin, the prefix pin and the route token are not read for a gang. From core v0.4.7 gangs are ranked like workers: a later turn of a conversation, or a prompt whose lead a gang served, stays on that gang while it has a free slot. ```bash opod shard create llama-3.3-70b-sharded --nodes n_a,n_b # the default gang, g0 opod shard create llama-3.3-70b-sharded --gang g1 --nodes n_c,n_d # a second copy; g0 keeps serving opod shard remove llama-3.3-70b-sharded --gang g1 # only g1 ``` A create **without** `--gang` replaces every gang of the model. A remove without `--gang` removes them all. The API half is `DELETE /admin/v1/shards/{model_id}/{gang_id}`. Every judgement is per gang: one gang losing a part takes only that gang out of rotation. ## Uneven splits A llama.cpp gang can weight its split towards a bigger card with the `tensor_split` engine flag, for example `12,8`. The gang's flags reach the coordinator. vLLM and SGLang accept `pp_layer_partition`, but a multi-machine split with it is not proven on those engines. ## Failures and recovery - After a create succeeds, a crashed `rpc-server` or coordinator restarts up to 5 times, with back-off of 1, 2, 4, 8 and 16 seconds. Then the process is in state `crashloop` and stays there until you act, usually with another `shard create`. - A Ray-backed vLLM coordinator starts without automatic restart. - In managed mode, the leader re-forms a gang that its plan declares and that has had no parts left for 45 seconds, once free workers register. After a failed attempt it backs off 15 s, then 30 s, then 60 s, and records `shard.heal_failed`. After 3 failed attempts at the same gang shape it gives up (`final: true`) until the gang appears or the plan changes its shape. See [Plan file](https://opod.io/docs/core-reference/plan-file/#gang-healing). `POST /admin/v1/shards/create` errors carry `error.code`: | Status | `error.code` | Meaning | | ------ | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | `404` | — | No catalog entry for `model_id`. | | `409` | — or a reason code | The workers for the shape cannot be found, or the engine cannot run it. Nothing was touched; the gang being replaced keeps serving. | | `409` | `sglang_pp_tied_llama` | See above. | | `502` | `gang_part_lost` | A part's worker went away while the gang formed. The gang did not form; its parts were stopped. | | `502` | `gang_part_failed` | A part's process reported `failed` or `crashloop`. The message carries the engine's last lines. | | `502` | `gang_create_in_flight` | Another create of this gang (or the whole model) is running. Says nothing about the gang itself. | Key on `error.code`, not the message. ## If it fails | Symptom | Fix | | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | | `opod: cannot pick a shard count for … no split fits …` | Free memory on the workers, join more workers, or name the count yourself. | | `tp=2: llama.cpp RPC sharding is layer-wise only and has no tensor split …` | Drop `--tp`, or use an entry with `sharding.engine: vllm` or `sglang`. | | `409` `sglang_pp_tied_llama` | Use tensor parallel, one stage, or `sharding.engine: vllm`. | | `502` `gang_part_failed` | Read the engine lines in the message and `opod shard ls`; on llama.cpp, check `rpc-server` is on `PATH`. | | `502` `gang_create_in_flight` | Another create is running. Wait, then `opod shard ls`. | | A part shows `crashloop` | It crashed 5 times. Fix the cause, then run `opod shard create` again. | | The gang has parts but no `coordinator` row (an interrupted create) | `opod shard remove MODEL --gang ID --yes`, then create again. | ## What a gang reports `/loadz` takes a gang's KV-cache use, queue depth and token rate from its coordinator, because the parts run no engine of their own. One coordinator sample counts once in `reporting`. See [Probes](https://opod.io/docs/core-reference/probes/). ## Not supported - Moving or rebalancing a live gang. Rebuild it with `shard create`. - Changing the part count of a live gang. --- title: "Managed mode" description: "Run a leader and its workers under an external manager — the environment contract, the watched files, and what survives a manager outage." url: "https://opod.io/docs/core/managed-mode/" markdown_url: "https://opod.io/docs/core/managed-mode.md" section: "Core" last_updated: "2026-11-01" --- # Managed mode > Run a leader and its workers under an external manager — the environment contract, the watched files, and what survives a manager outage. ## In short Any program can manage opod: a control plane, a systemd unit you template, a CI job or a script. Core does not know which one runs it. A manager talks to core through four surfaces only: 1. **Process environment.** Variables set when it starts a leader or worker. See [Environment variables](https://opod.io/docs/core-reference/environment/). 2. **Watched files.** The plan, the auth snapshot and the policy snapshot, re-read every 10 seconds. No restart needed. 3. **The admin API** `/admin/v1`, with an admin key. The routes listed in `GET /admin/v1/capabilities` are the stable set. 4. **Streams.** Usage and lifecycle events, read by cursor. From core v0.4.0 usage is pushed instead: one OTLP log record per request to `OPOD_USAGE_OTLP_ENDPOINT` (see [Usage push](https://opod.io/docs/core-reference/streams/#usage-push)); events are still read by cursor. The request path stays inside core. A leader keeps serving from its last good files while the manager is down. ## Run a leader and a worker under a manager 1. **Write the three files** Write the plan, the auth snapshot and the policy snapshot where the leader will read them. A minimal plan names the one model: ```bash mkdir -p /etc/opod /etc/opod-auth echo '{"revision":1,"model":{"id":"qwen2.5-7b-instruct"}}' > /etc/opod/plan.json ``` The formats are in [Plan file](https://opod.io/docs/core-reference/plan-file/), [Auth snapshot](https://opod.io/docs/core-reference/auth-snapshot/) and [Policy snapshot](https://opod.io/docs/core-reference/policy-snapshot/). The auth and policy files may appear later. 2. **Start a managed leader** ```bash export OPOD_MANAGED=1 export OPOD_ADMIN_TOKEN=sk-orc- # the manager calls /admin/v1 with it export OPOD_JOIN_TOKEN=sk-orc- # workers join with it export OPOD_PLAN_FILE=/etc/opod/plan.json export OPOD_AUTH_FILE=/etc/opod-auth/auth.json export OPOD_POLICY_FILE=/etc/opod-auth/policy.json opod up --no-wizard ``` What `OPOD_MANAGED=1` changes: - The store is in memory unless `OPOD_STORAGE_DSN` names a file. Keys come from the auth snapshot, nodes from heartbeats, and the manager pulls usage and events by cursor. From core v0.4.0 the manager sets `OPOD_USAGE_OTLP_ENDPOINT` and `OPOD_USAGE_OTLP_HEADERS` and receives usage instead of pulling it. - The banner's `Mode:` line reads `managed`. What the tokens do: - `OPOD_ADMIN_TOKEN` (`auth.admin_token`) is seeded as an admin key at every start. With it set, no `admin.key` file is written. - `OPOD_JOIN_TOKEN` (`auth.join_token`) is seeded as a node key at every start, so workers holding it can join a leader whose store was wiped. It is empty by default: there is no built-in shared secret. 3. **Start a managed worker** ```bash export OPOD_JOIN_TOKEN=sk-orc- export OPOD_NODE_ID=n_slot-0 # a stable identity per slot export OPOD_ENGINE=vllm export OPOD_LOAD_MODEL=qwen2.5-7b-instruct export OPOD_ENGINE_FLAGS='{"max_model_len":"32768","gpu_memory_utilization":"0.85"}' export OPOD_ADVERTISE_ADDR=192.0.2.12:8081 export OPOD_PLAN_REVISION=7 # the plan revision this process serves opod join http://leader.internal:8080 ``` - `OPOD_LOAD_MODEL` makes the worker load that model itself once its engine answers. Repo and file come from the catalog; `OPOD_LOAD_REPO` and `OPOD_LOAD_FILE` override them. - `OPOD_REJECT_BEARER=1` makes the worker's API accept HMAC-signed calls only. - `OPOD_PLAN_REVISION` tells the leader which plan revision this process serves, for a traffic split between revisions. - `OPOD_WORKER_ROLE=prefill|decode` registers a disaggregated role. - `OPOD_DRAIN_SECONDS` bounds how long a stopping worker lets requests finish. In Kubernetes, a worker with no `OPOD_NODE_ID` and no saved `node.yaml` takes `n_` as its id. ## The plan file The plan says what this endpoint is. A leader with a plan serves **one model identity**: requests for any other model are refused with a pointer to the one it serves. The plan file is watched only when it exists at start. Without it the leader is unrestricted. See [Plan file](https://opod.io/docs/core-reference/plan-file/). ## The auth snapshot The auth snapshot carries the endpoint's keys as SHA-256 hashes. The leader never sees a plaintext key. Keys from the snapshot are stored with the prefix `k_cp_` + their id, and every usage row and event names them that way. A snapshot key that leaves the file is revoked. Keys you minted locally with `opod token create` are never touched. The auth file may appear after the leader starts; the leader keeps checking for it. `OPOD_AUTH_FILE=off` turns the watcher off. See [Auth snapshot](https://opod.io/docs/core-reference/auth-snapshot/). ## The policy snapshot The policy snapshot tunes routing, the access log, admission, the wake rules and an optional fallback URL. `OPOD_POLICY_FILE=off` turns the watcher off. See [Policy snapshot](https://opod.io/docs/core-reference/policy-snapshot/). ## Check it worked Ask the leader what it speaks, and whether it is ready: ```bash curl -s http://leader:8080/admin/v1/version -H "Authorization: Bearer $ADMIN" curl -s http://leader:8080/admin/v1/capabilities -H "Authorization: Bearer $ADMIN" opod version --features ``` ```bash curl -s -o /dev/null -w '%{http_code}\n' http://leader:8080/readyz # 200 once it can serve ``` `/admin/v1/capabilities` returns the contract version (`contract: "v1"`), the stable route list, a map of feature flags, and the engine drivers linked into the binary. Probe a feature flag rather than guessing from the version. The leader image carries the same list in the OCI label `io.opod.leader.features`, so a manager can read it from the registry before it runs the image. ## Probes for an orchestrator | Probe | Use | | -------------- | ---------------------------------------------------------------------------------- | | `GET /healthz` | Liveness. Always `200 ok` while the process serves HTTP. | | `GET /readyz` | Readiness. `200` when the leader can serve, or sleeps on purpose; `503` otherwise. | | `GET /loadz` | Load numbers for an autoscaler. | Set `OPOD_PROBE_LISTEN=:8081` to serve the probes and `/metrics` on a second, always-plain port, so a probe needs no certificate when the main listener speaks TLS. See [Probes](https://opod.io/docs/core-reference/probes/). ## What survives a manager outage | The manager is down | Effect on the leader | | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | no admin calls | serving continues; nothing changes | | files not rewritten | the leader keeps the last good plan, keys and policy | | a file is rewritten with bad JSON | a warning is logged and the last good copy is kept | | usage and events not pulled | rows accumulate in the store; the cursor replays them later | | usage push not answered (core v0.4.0) | records wait in memory, up to `OPOD_USAGE_QUEUE_MB` (64 MiB, about 440,000 records), and are sent when the receiver answers; past the cap the oldest are dropped and counted on `opod_usage_dropped_total`. A leader restart loses what was queued | By default a leader keeps serving from an old auth snapshot indefinitely. To make revocation win instead, set `auth.maxSnapshotAgeSec` in the policy snapshot and have the manager rewrite the auth snapshot (with a new `issuedAt`) more often than that. Past the bound, keyed requests get `503` with `Retry-After: 30`. ## If it fails | Symptom | Fix | | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | | Every request gets `404` `this endpoint serves only X (requested Y)` | The plan names model X. Send that id, or change the plan. | | A rewritten file has no effect and the log warns | The file is not valid JSON. The leader kept the last good copy. Fix the file; it is read again within 10 seconds. | | Keyed requests get `503` with `Retry-After: 30` | The auth snapshot is older than `auth.maxSnapshotAgeSec`. Rewrite it with a new `issuedAt`. | | A managed leader forgot its keys and nodes after a restart | Its store is in memory. Seed keys from the auth snapshot, or set `OPOD_STORAGE_DSN` to a file. | | Workers cannot join after the leader restarted | Set `OPOD_JOIN_TOKEN` on the leader so the same node key is seeded at every start. | | A worker logs `OPOD_PLAN_REVISION "x" is not a positive number — this worker joins the unversioned group` | Set a whole number above 0. | --- title: "Security" description: "How opod core authenticates callers and workers, how to encrypt the north side, what it stores, and every network call it can make." url: "https://opod.io/docs/core/security/" markdown_url: "https://opod.io/docs/core/security.md" section: "Core" last_updated: "2026-11-08" --- # Security > How opod core authenticates callers and workers, how to encrypt the north side, what it stores, and every network call it can make. ## In short Every caller needs an API key, and every leader-to-worker call is signed with a per-worker HMAC key. Opod core assumes a **trusted network** between its leader and workers (your LAN, or a VPN you run): it encrypts the north side when you give it a certificate, but it ships no mesh of its own. This page says what is protected, what is not, and how to lock a leader down. 1. **Give the leader a certificate** ```bash OPOD_TLS_CERT=/etc/opod/tls.crt OPOD_TLS_KEY=/etc/opod/tls.key opod up ``` 2. **Make workers trust exactly that certificate** ```bash OPOD_LEADER_CA=/etc/opod/ca.crt opod join "https://leader.example.com:8080?token=sk-orc-" ``` 3. **Give each person their own key, with an expiry** ```bash opod token create alice --ttl 30d opod token revoke k_abc # when alice leaves ``` 4. **Keep the admin key off logs** The admin key lives in `~/.opod/admin.key`. Do not paste it into tools; `opod token create ops --admin` mints another when you need one. ## Check it worked ```bash curl -s https://leader.example.com:8080/v1/models --cacert /etc/opod/ca.crt ``` ```text {"error":{"type":"missing_api_key","message":"Authorization header required"}} ``` A request with no key is refused with `401`. The same request with `-H "Authorization: Bearer sk-orc-"` answers `200`. `curl http://…` (plain) to the TLS port fails. ## API keys - Format: `sk-orc-` followed by 24 random bytes, base64url-encoded. - Stored as SHA-256 hashes. The plaintext appears once, when the key is created. - One scope per key: `user` (`/v1/*`), `admin` (`/v1/*` and `/admin/v1/*`) or `node` (worker register and heartbeat). - Optional expiry: `--ttl` or `--expires-at`. An expired key gets `401 key_expired`. - Revocable at any time with `opod token revoke`. A key is sent as `Authorization: Bearer sk-orc-…`. The gateway also accepts `X-Api-Key: sk-orc-…` (Anthropic style) and a `?key=` query parameter (for clients that cannot set headers, such as a browser `EventSource`). A query-string key can end up in access logs that record URLs. `auth.require_keys: false` (or `OPOD_REQUIRE_KEYS=0`) lets `/v1` requests through without a key, for local development only. `/admin/v1` always needs a key. ```bash OPOD_REQUIRE_KEYS=0 opod up # local development only ``` ### The admin key file The first standalone `opod up` saves the admin key to `~/.opod/admin.key` with mode `0600`, so CLI commands on that host work without typing it. Protect that file like an SSH key. A managed leader started with `OPOD_ADMIN_TOKEN` writes no key file. ## Leader and worker authentication - A worker joins with a `node` key (the join token) or a client certificate. - After the join, every call between leader and worker is signed with HMAC-SHA256 using that worker's token. The header is `X-Opod-Auth: v=1,id=,ts=,sig=`. The signed string is `v1`, the method, the path and the timestamp, joined by newlines. A signature older or newer than 5 minutes is refused, so keep clocks in sync (NTP). - The body is not signed, and the traffic is not encrypted by opod. - A worker also accepts a bearer token from the leader, for upgrades. `OPOD_REJECT_BEARER=1` on the worker accepts HMAC only. - The leader stores each worker's token in the `nodes` table. A stolen `state.db` lets an attacker act as a worker; encrypt the disk if you cannot trust the host. `opod node show` and `GET /admin/v1/nodes` include the token. ### Worker certificates A worker can be identified by a client certificate instead of a token: - On the worker: `OPOD_NODE_CERT` and `OPOD_NODE_KEY` (PEM). The node id comes from the certificate's SPIFFE URI SAN, `spiffe:///opod/node/`, read from the verified chain only. - On the leader, in the auth snapshot: `nodeMtls` (`off`, `allow` or `require`), `nodeCertCa` (the CA PEM) and `revokedCerts` (serial numbers, lowercase hex). | `nodeMtls` | Effect on register and heartbeat | | -------------- | ---------------------------------------------------------------------------------------------- | | `off` or empty | Certificates are ignored. The token is the credential. | | `allow` | A certificate signed by `nodeCertCa` authenticates the worker. Without one, the token is used. | | `require` | A join or heartbeat without such a certificate is refused. | The default is `off`. A worker that joins with a certificate and no token creates its own secret for HMAC and sends it to the leader over the TLS connection. ## Encrypt the north side Give the leader a certificate and it serves `/v1`, `/admin/v1`, the probes and the join path over HTTPS: ```bash OPOD_TLS_CERT=/etc/opod/tls.crt OPOD_TLS_KEY=/etc/opod/tls.key opod up ``` Workers trust exactly that certificate through `OPOD_LEADER_CA=/etc/opod/ca.crt`. Leader-to-worker traffic stays plain HTTP, HMAC-signed. A reverse proxy (Caddy, nginx) in front of the leader is a fine alternative. Two extra listeners trade encryption for convenience. Both are off by default: | Setting | Serves | Use it when | | ------------------------------------ | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `probe_listen` / `OPOD_PROBE_LISTEN` | `/healthz`, `/readyz`, `/loadz`, `/metrics` only, always plain | a scraper or autoscaler should read numbers without the CA. Nothing authenticated is routed there. | | `plain_listen` / `OPOD_PLAIN_LISTEN` | the **whole** API, always plain | a load balancer cannot originate TLS to each leader. Prompts, answers and keys cross the network in clear text: bind it only where a firewall or network policy decides who connects. A leader that cannot bind it does not start. | ```bash OPOD_TLS_CERT=/etc/opod/tls.crt OPOD_TLS_KEY=/etc/opod/tls.key \ OPOD_PROBE_LISTEN=:8081 opod up # probes and /metrics in plain on :8081 OPOD_PLAIN_LISTEN=:8082 opod up # the whole API in plain on :8082 — firewall it ``` ## Request data - Request and response bodies are not stored. A usage row holds metadata only: key id, user, model, protocol, token counts, latency, time to first token, outcome and node. - Spans carry serving facts only; no key, user or team is put on a span. - `/healthz`, `/readyz`, `/loadz`, `/gatewayz` and `/metrics` need no key. They carry no prompts and no key ids. - **Client address.** Behind a proxy, the leader takes the caller's address from `True-Client-IP`, then `X-Real-IP`, then the leftmost `X-Forwarded-For` entry; a value that is not an IP address is skipped. It uses that address only as a label, on the access log line and the request's span. It never trusts it: the loopback check on the bootstrap admin key and the audit actor read the TCP peer. Anyone can set these headers, so do not read the logged address as proof of who called. There is no trusted-proxy list. ## Weights and catalog supply chain - `opod fetch` and model loads can pin a Hugging Face revision (`OPOD_MODEL_REVISION`) and check a SHA-256 (`OPOD_MODEL_SHA256`). A mismatch removes the file and fails the load. - Catalog files in directories can be signed with minisign and verified with `OPOD_CATALOG_PUBKEY`; `OPOD_CATALOG_REQUIRE_SIGNED=1` refuses unsigned ones. See [Models](https://opod.io/docs/core/models/#signed-catalog-files). - `block_private_targets: true` (`OPOD_BLOCK_PRIVATE_TARGETS=1`) refuses outbound catalog-probe and similar calls to loopback, link-local and private addresses. For example `OPOD_BLOCK_PRIVATE_TARGETS=1 opod up`. - `trust_proxy_headers` is off by default: `X-Forwarded-Host` and `X-Forwarded-Proto` are ignored when the leader builds its public URL. Turn it on only behind a proxy you control. ## Container images Release images are signed keyless with cosign (Sigstore) and carry an SPDX SBOM as an attestation: ```bash cosign verify \ --certificate-identity-regexp 'https://github.com/opod-io/' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com \ ghcr.io/opod-io/opod-leader: ``` Pin images by digest. If verification fails, do not run the image. ## Every network call opod can make Opod sends no telemetry. With no OTLP endpoint configured, a leader calls only the engines and nodes you chose. | Direction | When | How to turn it off | | --------------------------------------------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------- | | to the engine endpoint | every inference request | choose another engine | | leader and workers | heartbeats every 5 s, model loads, requests; HMAC-signed | `opod node remove`, or do not join | | to Hugging Face (or `HF_ENDPOINT`) or the Ollama registry | when weights are pulled, and the HEAD check in `model add` | pre-place weights; set `HF_ENDPOINT` to a mirror; `OPOD_SKIP_SOURCE_CHECK=1` | | to `api.github.com` and GitHub Releases | only when you run `opod update` | do not run it | | to an OTLP collector (traces) | when `OPOD_OTLP_ENDPOINT` is set | unset it | | to an OTLP collector (logs) | when `OPOD_OTLP_LOGS_ENDPOINT` is set | unset it | | to the policy's `routing.fallbackUrl` | only when a manager set one and the leader has no serving capacity | remove it from the policy | ## Threat summary | Threat | Mitigation | | ------------------------------------ | ----------------------------------------------------------------------------------- | | A worker is compromised | Workers hold no admin scope. Each worker's calls are signed with its own token. | | A user key leaks | Revoke it. An expiry bounds its life. | | Node traffic is sniffed | North side: TLS listener. Leader to worker: signed, not encrypted — use a VPN. | | A leaked join token registers a node | Use worker certificates with `nodeMtls: require`; revoke serials in `revokedCerts`. | | The leader is compromised | The leader is the trust root. Rotate admin keys. | | Tampered weights or catalog | SHA-256 pins and signed catalog files. | ## If it fails | Symptom | Fix | | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | | `401` `missing_api_key` "Authorization header required" | Send `Authorization: Bearer sk-orc-…`, `X-Api-Key`, or `?key=`. | | `401` `invalid_api_key` "Invalid or revoked API key" | The key is wrong or revoked. Mint a new one. | | `401` `key_expired` | Renew it: `opod token renew ID --ttl 30d`. | | A worker cannot join a TLS leader: `x509: certificate signed by unknown authority` | Set `OPOD_LEADER_CA` on the worker to the leader's CA. | | Leader-to-worker calls refused after a reboot | Clock skew over 5 minutes. Fix NTP on both machines. | | `401 this endpoint requires a worker client certificate (nodeMtls=require) …` | Give the worker `OPOD_NODE_CERT` and `OPOD_NODE_KEY`, or set `nodeMtls` to `allow`. | | `403 certificate revoked (serial …)` | The serial is in `revokedCerts`. Issue the worker a new certificate. | ## Report a vulnerability Do not open a public issue. Open a private advisory at [github.com/opod-io/opod-core/security/advisories/new](https://github.com/opod-io/opod-core/security/advisories/new). Fixes ship on `main` and in the next release; older releases are not patched. --- title: "Troubleshooting" description: "Fixes for the common failures — the leader will not start, a worker will not join, a model is not found, or requests are slow." url: "https://opod.io/docs/core/troubleshooting/" markdown_url: "https://opod.io/docs/core/troubleshooting.md" section: "Core" last_updated: "2026-10-30" --- # Troubleshooting > Fixes for the common failures — the leader will not start, a worker will not join, a model is not found, or requests are slow. ## In short Run `opod doctor` first: it checks the hardware, the listen port, the engine binaries, the engine, the data directory and the catalog, and prints a fix for each failure. Then find the symptom below. Each row gives the exact message, the cause and the fix. ```bash opod doctor opod status ``` ## The leader does not start | Symptom | Cause | Fix | | ------------------------------------------------------------ | -------------------------------------- | -------------------------------------------------------------------------------------------------- | | `listen :8080: … address already in use` | Another process, or a second `opod up` | `opod status` shows the running one. Or `OPOD_LISTEN=:8090 opod up`. | | `engine (ollama) at http://127.0.0.1:11434 is not reachable` | The engine is not running | `ollama serve` (Linux: `sudo systemctl start ollama`). The leader still starts; it is router-only. | | `config: parse …/config.yaml` | Invalid YAML | Fix the file. `opod config path` prints its location. | | `catalog: …` signature error | A signed catalog file does not verify | Sign it again, remove it, or review `OPOD_CATALOG_PUBKEY`. | | `--role: "x" is not a role` | Bad `--role` or `OPOD_ROLE` | Use `leader`, `gateway` or `door`. | | `gateway: …` at start | A front door cannot reach its leader | Check `--leader` and `OPOD_ADMIN_TOKEN`. | | `OPOD_TRACE_SAMPLE_RATIO` error | Not a number from 0 to 1 | Fix or unset it, for example `OPOD_TRACE_SAMPLE_RATIO=0.1`. | ## A worker does not join - **Token revoked or expired.** Mint a new one on the leader: `opod token create --node`. - **Clock skew over 5 minutes.** HMAC signatures expire. Fix NTP on both machines. - **The leader cannot reach the worker.** The worker advertises the LAN address on its default route, port `8081`. In a container or on a host with several interfaces, set `OPOD_ADVERTISE_ADDR=host:port`. - **`bind: cannot assign requested address` on the worker or a llama.cpp gang process.** The advertised address is the NAT's or a forward's, not this machine's. From core v0.4.0, set `OPOD_BIND_ADDR=`. See [Behind NAT](https://opod.io/docs/core-cli/join/#behind-nat-or-a-port-forward). - **No token and no certificate.** `opod join` stops with `no join token … and no worker certificate`. Put the token in the URL or in `OPOD_JOIN_TOKEN`. - **A bad `OPOD_WORKER_ROLE` or `OPOD_KV_TIER`.** The worker refuses to start; use the values listed in [Environment variables](https://opod.io/docs/core-reference/environment/). ## A node shows `lost` or `engine-silent` - `lost`: no heartbeat within `router.heartbeat_max_age_seconds`. The process stopped or the network broke. - `engine-silent`: the worker heartbeats but its engine does not answer it. Check the engine on that machine. The node returns to rotation when the engine answers. `GET /admin/v1/nodes` shows each worker's `engine` state (`serving`, `starting`, `restarting`, `crash-looping`, `stopped`) with its restart count and last message. ## "model not found" - The `model` in the request must be a catalog id the cluster holds, `auto`, or an engine-native name a node reports. `GET /v1/models` lists what can be served now. - A model held only by drained or lost workers is not listed. - A leader with a plan serves one model only. A request for another is refused and the message names the model it serves. - Core does not proxy vendor ids such as `gpt-4o`. ## `503` with `Retry-After` The message says which cause applies: | Cause | Meaning | | ------------------- | ----------------------------------------------------------------------------------------------------- | | waking | No worker is serving yet; workers are starting or waking. Retry. | | drain | Every worker that holds the model is drained. | | admission | The endpoint is full and the request waited past its class budget, or the hold was full. | | stale auth snapshot | The policy sets `auth.maxSnapshotAgeSec` and the manager has not rewritten the auth snapshot in time. | ## `400` naming a field An engine that cannot do something is refused by name rather than ignored: - `tools` on an engine started without a tool-call parser for the model, or on Ollama; - `image_url` on a model without the `vision` capability, or on SGLang, llama.cpp or MLX-LM; - `n` or `best_of` above 1; - on `/v1/messages`: extended `thinking`, server tools, images by URL, `document` blocks, `mcp_servers`, `container`, `context_management`, or any unknown field. ## Slow requests - Read `/loadz`: `queue_depth` above 0 means demand exceeds capacity; `kv_used_pct` near 100 means the KV cache is full. Add a worker with the same model. - Turn on sticky sessions so a user's turns return to the worker that holds their prefix: `router.sticky_session_ttl_seconds` (default `0`, off). - On a GPU worker, check that the model is on the card. A plan that pins llama.cpp `ngl` low serves slowly and looks healthy. - A model too big for one box: split it with `opod shard create`. - Engine errors appear in the leader's stderr, as JSON log lines. ## A gang does not form Read `error.code` on the `502` or `409`: see [Sharding](https://opod.io/docs/core/sharding/#failures-and-recovery). `opod shard ls` shows each part's status; `GET /admin/v1/shards/processes` shows the process states (`running`, `starting`, `stopped`, `failed`, `crashloop`). ## Reset a leader ```bash opod down mv ~/.opod/state.db ~/.opod/state.db.bak # forgets nodes, models, keys and usage opod up # mints a new admin key ``` Workers must join again with a new node token, unless the leader seeds the same `OPOD_JOIN_TOKEN`. --- title: "CLI overview" description: "Every opod command at a glance, and the conventions all of them share — help, JSON output, prompts, pickers, keys and colour." url: "https://opod.io/docs/core-cli/" markdown_url: "https://opod.io/docs/core-cli.md" section: "Core CLI" last_updated: "2026-10-30" --- # CLI overview > Every opod command at a glance, and the conventions all of them share — help, JSON output, prompts, pickers, keys and colour. ## In short `opod` is one binary. `opod up` starts a leader and `opod join` adds a worker; every other command manages them. Every command prints its own help with `--help`. ```bash opod node ls --help opod version ``` ```text opod 0.21.0 (linux/amd64, go1.26.4) ``` `opod` is the only binary. Every capability is a command, and most commands call an `/admin/v1` route you can also script. ```bash opod [options] opod --help ``` ## Commands | Command | Does | | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | | [`opod up`](https://opod.io/docs/core-cli/up/) | Start a leader, a front door (`--role gateway`) or a cell door (`--role door`). | | [`opod down`](https://opod.io/docs/core-cli/up/#opod-down) | Stop the local leader and unload its engine's models. | | [`opod status`](https://opod.io/docs/core-cli/up/#opod-status) | Show the local leader, engine and installed models. | | [`opod join`](https://opod.io/docs/core-cli/join/) | Join a cluster as a worker. | | [`opod node`](https://opod.io/docs/core-cli/node/) | `ls`, `show`, `drain`, `undrain`, `remove`. | | [`opod model`](https://opod.io/docs/core-cli/model/) | `add`, `ls`, `ps`, `search`, `info`, `load`, `unload`, `move`, `remove`. | | [`opod shard`](https://opod.io/docs/core-cli/shard/) | `create`, `ls`, `remove` gangs. | | [`opod token`](https://opod.io/docs/core-cli/token/) | `create`, `ls`, `expire`, `renew`, `revoke` API keys. | | [`opod catalog`](https://opod.io/docs/core-cli/catalog/) | `ls` and `export` the embedded catalog. | | [`opod fetch`](https://opod.io/docs/core-cli/fetch/) | Download one GGUF or a safetensors snapshot into a models directory. | | [`opod cache`](https://opod.io/docs/core-cli/cache/) | `ls`, `prune` the weight cache; `kv-prune` a disk KV tier. | | [`opod image`](https://opod.io/docs/core-cli/image/) | `ls`, `show`, `recommend` the published container images. | | [`opod batch`](https://opod.io/docs/core-cli/batch/) | `run` an OpenAI batch file against any OpenAI-compatible URL. | | [`opod connect`](https://opod.io/docs/core-cli/connect/) | Print client settings for a tool; `disconnect` prints how to undo them. | | [`opod config`](https://opod.io/docs/core-cli/utilities/#opod-config) | `show`, `path`, `edit`. | | [`opod doctor`](https://opod.io/docs/core-cli/utilities/#opod-doctor) | Diagnose the local setup. | | [`opod update`](https://opod.io/docs/core-cli/utilities/#opod-update) | Install the latest or a pinned release. `upgrade` is an alias. | | [`opod completion`](https://opod.io/docs/core-cli/utilities/#opod-completion) | Print a bash, zsh or fish completion script. | | [`opod version`](https://opod.io/docs/core-cli/utilities/#opod-version) | Print the version, or the leader's feature keys. | | `opod help` | Print the command list. Also `--help` and `-h`. | ## Shared conventions **Help.** `--help` or `-h` anywhere in the arguments prints the command's usage, flags and examples, and exits `0`. The word `help` counts only as the first argument, so `opod model search help` searches for "help". A wrong flag prints the help to stderr and exits `2`. From core v0.4.6, a usage error is three lines on stderr instead — `opod: `, the command's usage line, and `opod --help for every flag` — and `opod help ` is `opod --help`. The commands that parse their flags by hand (`model`, `shard`, `node`, `token`, `join`) list them in a **Flags** section of their help. **Typos.** An unknown command or sub-command prints a "Did you mean …?" suggestion when one is close. **Aliases.** `ls` = `list` in `node`, `model`, `shard`, `token` and `image` (not in `catalog` or `cache`). `remove` = `rm` in `node`, `model` and `shard`. `image show` = `image info`, `image recommend` = `image for`. `model add --node` = `--nodes`. `upgrade` = `update`. `version` = `--version` = `-v`. **Flags.** Flags may come before or after positional arguments. Both `--flag value` and `--flag=value` work. **JSON.** `--json` prints machine-readable output on `status`, `model ls|ps|search|info`, `config show`, `cache ls|prune|kv-prune` and `image ls|show|recommend`. `node ls` has no `--json`; `node show` prints JSON always. **Prompts.** `model remove`, `node remove` and `shard remove` ask for confirmation. `--yes` or `-y` skips the prompt for scripts. Without a terminal they printed `opod: aborted`; from core v0.4.6 they say `no terminal to confirm opod node remove n_one on — run opod node remove n_one --yes` and exit `2`. **Pickers.** `model add`, `info`, `remove`, `load`, `unload` and `connect` open an interactive picker (type to filter, arrow keys, Enter) when the id is missing or unknown and the terminal is interactive. Without a terminal they printed `opod: no model selected`; from core v0.4.6 they name the fix — `no catalog entry "X" (try: opod model search X)`, `"X" is not installed on this host (see opod model ls)`, `model add needs a catalog id …` — and `model load` checks its flags before it would ask. **Colour.** Output is coloured on a terminal. `NO_COLOR=1` or `OPOD_NO_COLOR=1` turns colour off. Before, the `▶ ✔ ⚠` markers kept their colour codes in a pipe or a file; from core v0.4.6 each stream is coloured only when it is a terminal. **Warnings.** From core v0.4.6, every warning (`⚠ …`) goes to stderr, so `opod status > s.txt` or `opod doctor | grep` carries only the answer; before, `status`, `doctor`, `up`, `join`, `model add` and others printed them on stdout. **Secrets on a pipe.** A command that prints a key (`opod up` on first run, `opod token create`) warns on stderr when stdout is not a terminal, because the key may land in a log. The key still goes to stdout, so `key=$(opod token create …)` works. ## Where commands act Most commands run on the **leader host** and use its local state: | Reads or writes | Commands | | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | the local store (`storage.dsn`) and the local engine directly | `token *`, `model add` (without `--node`), `model ls`, `model remove`, `node ls`, `node show`, `status` | | the running leader's admin API, with `~/.opod/admin.key` | `model add --node`, `model load`, `model move`, `model ps`, `shard *` | | the leader first, then the store or engine if no leader answers | `node drain`, `node undrain`, `node remove`, `model unload` (from core v0.4.6: only when this host's own leader does not answer — a leader that answers with any error, even a 500 with no body, is final, and an `OPOD_BASE_URL` leader never falls back to this host's store) | | nothing but the local machine | `fetch`, `cache`, `catalog`, `image`, `doctor`, `completion`, `version` | The admin calls go to `http://localhost` with the key in `~/.opod/admin.key`. From 0.3.0 they go to the leader's own address — its `listen` host (an empty or `0.0.0.0` host is `localhost`), over `https` when it serves TLS, trusting its own certificate file; on 0.2.1 a `listen` with a host, or a TLS leader, breaks them. They fail with `no admin key on disk … is opod up running on this host?` elsewhere. From core v0.4.6, an admin call goes to `OPOD_BASE_URL` when it is set, with the key in `OPOD_TOKEN` when it is set — so these verbs reach a leader on another host — else to this host's leader with `~/.opod/admin.key`. Each failure says what to do: | What happened | What it prints | | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | the leader refused the key (401, 403) | `the leader at refused the admin key from () — run this on the leader's host, or set OPOD_TOKEN to an admin key` | | no key here | `no admin key: none at ~/.opod/admin.key and OPOD_TOKEN is not set — …`; from core v0.4.6, `… and neither OPOD_TOKEN nor OPOD_ADMIN_TOKEN is set — …` | | a certificate that is not the leader's own (from core v0.4.6) | `the leader at answered, but it presented a certificate that is not the one in — check tls_cert and OPOD_TLS_CERT on this host` | | nothing answered | `no leader answering at (): — start it with opod up, or set OPOD_BASE_URL to the leader's URL` | | the leader answered an error | ` : the leader answered HTTP : []`; a body that is not the leader's JSON (a proxy page) or an empty one says so | | the client budget ran out | `gave up after 45m0s waiting for at — the leader may still be working on it; check with opod status` | ```bash OPOD_BASE_URL=https://leader.example.com:8080 OPOD_TOKEN=sk-orc- opod shard ls ``` From core v0.4.6, three more rules hold. They matter most for a leader that a manager runs (`OPOD_MANAGED=1`, for example in a Kubernetes pod), which has no key file: - **The key.** After `OPOD_TOKEN`, an admin call uses the admin token the leader was started with (`OPOD_ADMIN_TOKEN`, or `auth.admin_token` in the config), and only then `~/.opod/admin.key`. - **The certificate.** Over TLS, the CLI accepts exactly the certificate in the leader's own `tls_cert` file, byte for byte, whatever names it carries. A certificate issued for the leader's service name, and not for `localhost`, now works. Any other certificate is an answer from a leader, never "no leader answering", so no command falls back to the store because of it. - **The store.** On a managed host with no `OPOD_STORAGE_DSN`, the leader's store lives only inside the running `opod up`. `opod node ls` and `opod node show` ask the running leader. Every command that would read or write the store itself (`model ls`, `token ls`, `token create`, …) refuses instead of opening an empty store: ```text opod: this host's leader is managed (OPOD_MANAGED=1): its store lives only inside the running `opod up`, so there is nothing on this host to read or change — `opod node ls`, `opod node show`, `opod shard ls` and `opod model ps` ask the running leader; make any other change through the leader's manager ``` Up to core v0.4.5, on such a host `node ls` printed `(no nodes registered yet …)` beside a serving worker, and `shard ls` printed `no admin key`. Calls that move weights (`shard create`, `model add`, `model load`) wait up to 45 minutes; other admin calls wait up to 5 minutes. ## Configuration file Every command reads `~/.opod/config.yaml` when it exists, then environment variables. `opod up --config PATH` reads another file. See [Configuration](https://opod.io/docs/core-reference/configuration/). ## Exit codes | Code | Meaning | | ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `0` | Success, or `--help`. | | `1` | The command failed; the message is on stderr, prefixed `opod:`. | | `2` | Usage error: missing argument, bad flag, unknown command or subcommand. From core v0.4.6 every one of them exits `2` with an `opod:` line; before, some exited `1` (`join` with no URL, `node show` with no id, `connect a b`, `connect --retries 9`, an unknown subcommand, a non-numeric `--tp`), `completion` with no shell printed its help and exited `0`, and `cache`, `fetch`, `catalog` and `batch` said `error:`. | | `75` | `opod batch run` stopped and can be resumed. | --- title: "opod up, down, status" description: "Start a leader, a front door or a cell door; stop the local leader; and check what is running." url: "https://opod.io/docs/core-cli/up/" markdown_url: "https://opod.io/docs/core-cli/up.md" section: "Core CLI" last_updated: "2026-10-30" --- # opod up, down, status > Start a leader, a front door or a cell door; stop the local leader; and check what is running. ## In short `opod up` starts a leader on this machine: the OpenAI-compatible gateway on `:8080`, the router, the keys and the admin API. With `--role gateway` it starts a front door for a leader, and with `--role door` a cell door for many leaders. `opod down` stops it and `opod status` shows it. ```bash opod up opod status opod down ``` ## opod up Start the local node. On first run it becomes the cluster leader. ```text opod up [--config PATH] [--auto-pull=false] [--no-wizard] [--exclusive] [--unload-on-exit] [--role gateway --leader URL] [--role door --routes FILE] ``` | Flag | Default | Effect | | ------------------ | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--config PATH` | `~/.opod/config.yaml` | The config file to read. | | `--auto-pull` | `true` | Allow the first run to pull the default model (`opod up --help` on 0.2.1 wrongly says it is off by default). Applies only when `router.pull_default_model` (`OPOD_PULL_DEFAULT_MODEL=1`) is on. | | `--no-wizard` | `false` | Skip the interactive first-run prompt. With `--auto-pull=false`, the start is fully quiet. | | `--exclusive` | `false` | One resident model per machine: a load evicts every other non-pinned model first. Same as `placement.exclusive` or `OPOD_EXCLUSIVE=1`. | | `--unload-on-exit` | `OPOD_UNLOAD_ON_EXIT=1` | On Ctrl-C, ask the engine to drop loaded models from memory. | | `--role ROLE` | `leader` | `leader`, `gateway` or `door`. `OPOD_ROLE` also sets it. A flag wins over the variable. | | `--leader URL` | — | The leader a `gateway` mirrors and pushes to, e.g. `http://leader:8080`. `OPOD_LEADER_URL` also sets it. | | `--routes FILE` | — | The routes file a `door` watches. `OPOD_DOOR_ROUTES` also sets it. | ```bash opod up OPOD_PULL_DEFAULT_MODEL=1 OPOD_DEFAULT_MODEL=llama-3.2-1b opod up # this machine serves a model too OPOD_ENGINE=llamacpp OPOD_PULL_DEFAULT_MODEL=1 opod up # launches llama-server if none runs opod up --config ~/.opod/staging.yaml opod up --role gateway --leader http://leader:8080 opod up --role door --routes /etc/opod-door/routes.json ``` ### What a leader does at start 1. Loads the config: defaults, then the YAML file, then environment variables. 2. Detects the hardware and prints it. 3. Opens the store (`storage.dsn`, default `~/.opod/state.db`; in memory when `OPOD_MANAGED=1` and `OPOD_STORAGE_DSN` is unset). 4. On the first standalone run, mints an admin key, prints it once and saves it to `~/.opod/admin.key`. Seeds `auth.join_token` and `auth.admin_token` as keys when they are set. 5. Loads the catalog. With no `router.default_model`, picks one that fits the hardware. 6. Probes the engine for 3 seconds. With `engine.preferred: llamacpp`, `pull_default_model` on and nothing on the llama.cpp endpoint, it launches `llama-server -hf ` for the default model. 7. Registers itself as node `local`. 8. With `pull_default_model` on and a reachable engine, runs the first-run prompt or pulls the default model. 9. Writes its PID to `/opod.pid`, prints the ready block and starts serving. From core v0.4.6, the PID file and the ready block (with the admin key shown once) come only after the port is bound, so a failed start prints no "ready" and no key. 10. Restores the models that were loaded or pinned before the last shutdown, in the background. The ready block lists the API URL, the health URL, the mode (`standalone` or `managed`) and every outbound call this node is configured to make. There is no check for an already-running leader: a second `opod up` on the same port fails with `address already in use`. From core v0.4.6, `opod up` checks before it starts anything: | Case | What it prints | Exit | | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ---- | | a leader already runs from this data directory (its PID is alive and `/healthz` answers) | `already running (pid N, http://localhost:8080) — stop it with opod down, or see it with opod status` | `1` | | the port is taken by another program | `port :8080 is in use — another program listens there; stop it, or set listen: in ~/.opod/config.yaml or OPOD_LISTEN` | `1` | | `--role gateway` with no `--leader` / `OPOD_LEADER_URL` | `--role gateway needs --leader (or OPOD_LEADER_URL) …`, the usage line | `2` | | `--role door` with no `--routes` / `OPOD_DOOR_ROUTES` | `--role door needs --routes …`, the usage line | `2` | | `--role door` whose routes file is not there yet | a warning — every model answers 404 until the file appears; the door re-reads it every 10 s | runs | A container that restarts in place may find a PID file that names itself; that is not a second leader, and `opod up` goes on. ### Roles - **`leader`**: the full process described above. - **`gateway`**: a front door for one leader's endpoint. It serves `/v1` and the probes only; no `/admin/v1`, no join surface, no engine. It mirrors the leader's worker list (and, from core v0.4.0, keeps every worker it knows while a restarted leader is still rebuilding that list), pushes its usage rows to the leader and polls the leader every 10 seconds for the door count. It needs `--leader` and an admin key in `OPOD_ADMIN_TOKEN`. It fails at start when it cannot reach its leader. - **`door`**: one URL for many endpoints. It opens no store, starts no engine and holds no key. It reads each request's `model`, finds the endpoint in the routes file (re-read every 10 seconds) and forwards the request unchanged. See [Front doors](https://opod.io/docs/core-reference/front-doors/). ### Signals `SIGINT` or `SIGTERM` stops the leader. It finishes in-flight HTTP requests (up to 30 seconds), flushes traces and logs, and stops engines it launched. It does not unload models from a separate engine unless `--unload-on-exit` is set. ## opod down Stop the local leader and release engine memory. ```text opod down [--no-unload] ``` | Flag | Effect | | ------------- | ------------------------------------ | | `--no-unload` | Leave models resident in the engine. | `opod down` reads `/opod.pid`, sends `SIGTERM` and waits up to 10 seconds for the process to exit. Then it asks the configured engine to unload every resident model. Engines with no unload call (vLLM, MLX-LM) are skipped with a note. A stale PID file is removed and reported. `opod down` stops a process started with `opod up`. Stop a worker (`opod join`) with Ctrl-C or `SIGTERM`. From core v0.4.6, `opod down` signals the PID only when it is opod (or answers as this host's leader), and says what it did: | Case | What it prints | Exit | | -------------------------- | -------------------------------------------------------------------------------------------------- | ---- | | no PID file | `opod is not running on this host (no PID file at …) — nothing to stop` | `0` | | the PID is not running | `pid N is not running — removed the stale PID file …; nothing to stop` | `0` | | the PID is another program | `pid N in … is not opod (it is "sleep") — removed the stale PID file; nothing stopped` (on stderr) | `0` | | stopped | `stopping opod (pid N)…`, then `opod (pid N) stopped` | `0` | | still running after 10 s | `pid N is still running after 10s — check opod status; force it with kill -9 N` (on stderr) | `1` | Before, it sent `SIGTERM` to whatever the PID file named and failed with exit `1` when nothing ran. ## opod status Show the local leader, its engine and the installed models. ```text opod status [--json] ``` It calls `GET /healthz` on `http://localhost` (3-second timeout), probes the engine and lists the models in the store. It exits `1` when the leader does not answer. ```json { "control_plane": { "url": "http://localhost:8080/healthz", "reachable": true, "status": "200 OK" }, "engine": { "name": "ollama", "endpoint": "http://127.0.0.1:11434", "reachable": true }, "models": [ { "id": "llama-3.2-1b", "status": "ready", "source": "ollama:llama3.2:1b" } ] } ``` In this output `control_plane` means the local leader. From core v0.4.6, `opod status` reports a leader as healthy only on a `2xx` (a `401` or `503` used to print ✔ and exit `0`), checks the engine whether or not the leader answers, and reads the models and nodes from the leader's admin API instead of this host's store (so it no longer creates `state.db`). Without an admin key here it says so on stderr. Warnings go to stderr, and it exits `1` unless the leader is healthy. The JSON names the leader `leader`: ```json { "leader": { "url": "http://localhost:8080/healthz", "reachable": true, "healthy": true, "status": "200 OK" }, "engine": { "name": "ollama", "endpoint": "http://127.0.0.1:11434", "reachable": true }, "models": [ { "id": "llama-3.2-1b", "status": "ready", "source": "ollama:llama3.2:1b" } ], "nodes": [ { "id": "local", "state": "ready" } ] } ``` `list_error` appears instead of the lists when the leader could not be asked (no admin key, or a refusal). --- title: "opod join" description: "Join a machine to a cluster as a worker, with a token or a certificate, pinned to one GPU and a memory budget if needed; what it does and how it fails." url: "https://opod.io/docs/core-cli/join/" markdown_url: "https://opod.io/docs/core-cli/join.md" section: "Core CLI" last_updated: "2026-10-30" --- # opod join > Join a machine to a cluster as a worker, with a token or a certificate, pinned to one GPU and a memory budget if needed; what it does and how it fails. ## In short `opod join` makes this machine a worker of a leader. It registers, heartbeats every 5 seconds, runs the leader's calls against the local engine, and stays in the foreground until you stop it. A node token in the URL (or in `OPOD_JOIN_TOKEN`) or a client certificate identifies it. ```bash opod join "http://leader:8080?token=sk-orc-" ``` ```text ✔ joining cluster at http://leader:8080 as n_abc123 ``` ## Usage ```text opod join "LEADER_URL[?token=TOKEN]" [--gpu INDEX] [--vram-budget GB] ``` `opod join` makes this machine a **worker**: it registers with a leader, serves the leader's calls on its own API, drives the local engine, and heartbeats until it is stopped. It runs in the foreground. Stop it with Ctrl-C or `SIGTERM`. ```bash opod join "http://leader.local:8080?token=sk-orc-" opod join "https://opod.example.com?token=sk-orc-" opod join "http://leader:8080?token=sk-orc-" --gpu 1 --vram-budget 20 OPOD_JOIN_TOKEN=sk-orc- opod join https://opod.example.com ``` Quote the URL: `?` is a glob character in zsh. A URL without a scheme gets `http://`. A trailing `/` is removed. ## Arguments and flags | Argument | Default | Effect | | ------------------ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `LEADER_URL` | — (required) | The leader's base URL. The query `?token=` is the join token; the whole query is dropped from the URL the worker stores and dials. | | `--gpu INDEX` | `$OPOD_GPU_INDEX` | Pin the worker's engine to one device. The engine processes see `CUDA_VISIBLE_DEVICES=INDEX`, `HIP_VISIBLE_DEVICES=INDEX` and `ONEAPI_DEVICE_SELECTOR=level_zero:INDEX`, each unless you already set it, and `OPOD_GPU_INDEX=INDEX`. | | `--vram-budget GB` | `$OPOD_VRAM_BUDGET_GB` | Cap the engine's GPU memory, a whole number of GB, so several workers can share one card. The engines see `OPOD_VRAM_BUDGET_GB`. For vLLM it becomes `--gpu-memory-utilization` (below). | A flag wins over its environment variable. The flags must come **after** the URL. Any other argument is refused (from core v0.4.6 the flags may also come before the URL and take `--gpu=1`, and each of these is a usage error, exit `2`): | Error | Cause | | --------------------------------------------------------------------------------------------- | --------------------------------- | | ``opod: usage: opod join "?token=" (run `opod join --help` for details)`` | No URL. | | `opod: --gpu needs a device index` | `--gpu` is the last word. | | `opod: --vram-budget needs a size in GB` | `--vram-budget` is the last word. | | `opod: --vram-budget must be an integer number of GB, got "20.5"` | Not a whole number. | | ``opod: unknown join argument "--foo" (see `opod join --help`)`` | Anything else. | These variables only reach the **engine processes the worker starts** (vLLM, SGLang, llama.cpp, rpc-server). An engine you started yourself, such as an Ollama service, does not see them; pin that engine yourself. ### How a budget becomes an engine setting For vLLM, the worker computes `--gpu-memory-utilization` at launch: ```text utilization = (budget_GB × 1024 − overhead_MiB) / card_MiB clamped to 0.05 … 0.95, two decimals ``` - `card_MiB` is `OPOD_CARD_MIB` when the manager set it, else what `nvidia-smi` reports for the first card. With neither (AMD and Intel hosts have no `nvidia-smi`), **the budget is not applied** and vLLM uses `0.85`. - `overhead_MiB` is `OPOD_ENGINE_OVERHEAD_MIB` when set, else core's measured figure for the engine (its largest one for a vendor not measured). - With no budget, vLLM gets `0.85`. SGLang gets `--mem-fraction-static` by the same formula only when a budget is set, with a 768 MiB overhead; with no budget the flag is left out and SGLang sizes its own pool. ## Credentials The worker presents, in this order: 1. the URL's `?token=`; 2. else `OPOD_JOIN_TOKEN`, or `auth.join_token` in this machine's `config.yaml`; 3. else its client certificate, `OPOD_NODE_CERT` and `OPOD_NODE_KEY`. With none of them, it exits: ```text opod: no join token (?token= in the URL, or OPOD_JOIN_TOKEN) and no worker certificate (OPOD_NODE_CERT/OPOD_NODE_KEY): one or the other identifies this worker ``` Mint a token on the leader with `opod token create --node`. A token in the URL is visible to anyone who can list processes. A container image or a service unit should pass it in `OPOD_JOIN_TOKEN` and leave the URL bare. Joining a leader that is not `localhost`, `127.0.0.1` or `::1` over `http` with a token prints, on stderr: ```text ⚠ joining leader.local over cleartext http — the join token will be sent unencrypted; prefer https for non-local leaders ``` The token has a second job: the worker hands it to the leader at register, and the leader signs every call back into the worker with it (HMAC, see [Worker API](https://opod.io/docs/core-reference/worker-api/#authentication)). A worker that joins with a **certificate only** mints its own random secret for that job (`sk-orc-cb-…`, 32 random bytes) and sends it over the mTLS-protected register. No operator handles it. For a TLS leader, set `OPOD_LEADER_CA` to the PEM certificate the worker must trust. The worker then trusts exactly that certificate. With `OPOD_NODE_CERT` and `OPOD_NODE_KEY`, it also presents its own client certificate; its SPIFFE SAN `spiffe:///opod/node/` is the worker's identity to a leader that runs node mTLS. The leader's policy (`off`, `allow`, `require`) comes from its [auth snapshot](https://opod.io/docs/core-reference/auth-snapshot/). **Binding.** The first `node` key that registers a node id owns it. Another `node` key that presents the same id is refused, so one leaked node token cannot impersonate every worker. A worker that registered with a certificate is bound to that certificate. ## Identity and address - **Node id:** `OPOD_NODE_ID`, else the `node_id` in `~/.opod/node.yaml` from an earlier run, else `n_`, else a new random `n_` plus 8 characters. Keep it stable: a new id per restart leaves a `lost` row behind on the leader each time. - **Address:** the IP of the interface that routes to the internet (found with a UDP dial that sends nothing), port `8081`. When that fails, the first non-loopback interface. `OPOD_ADVERTISE_ADDR=host:port` overrides it, for containers, overlay networks and hosts with several interfaces. When detection fails entirely, it warns and uses `0.0.0.0:8081`. - **`~/.opod/node.yaml`** (mode `0600`) records `node_id`, `leader_url`, `token`, `address` and `joined_at`. Only `node_id` is read back, by the next `opod join`. The file holds the token: protect it. From core v0.4.6 it no longer records the token. > **The address is also the bind address** > > The worker's API **listens** on the same `host:port` it advertises, and its gang processes (llama.cpp `rpc-server`, the `llama-server` coordinator) bind the same host. So `OPOD_ADVERTISE_ADDR` must be an address this machine owns, unless you also set `OPOD_BIND_ADDR`. An address that only exists on the far side of a NAT or a load balancer makes the worker fail to start its API, with `worker server exited` in the log. ### Behind NAT or a port forward From core v0.4.0, `OPOD_BIND_ADDR` names the address this machine owns. The worker listens there, and the leader binds the worker's llama.cpp gang processes (`rpc-server`, the coordinator) there, while it keeps dialling the advertised address. ```bash # The leader dials 203.0.113.7:18081, which the router forwards to 10.0.0.5:8081. OPOD_ADVERTISE_ADDR=203.0.113.7:18081 OPOD_BIND_ADDR=10.0.0.5:8081 \ opod join "http://leader:8080?token=sk-orc-" ``` - `OPOD_BIND_ADDR=host` with no port takes the advertised port. - Unset = the advertised address, as before. - `0.0.0.0` is taken only when you set it, and the worker warns: llama.cpp's `rpc-server` has no authentication, so a wildcard opens it on every interface. Firewall its ports. - Forward the gang ports too: `rpc-server` and the coordinator listen on ports the leader picks for each gang. - **Check it worked:** the join log reads `listening on OPOD_BIND_ADDR; the leader dials the advertised address`, and `opod node show ` carries `"BindHost"` in its `HardwareJSON`. SGLang's rendezvous and Ray's `--node-ip-address` still take the advertised host. ## Engine The worker drives the engine named by `engine.preferred` / `OPOD_ENGINE` (default `ollama`), at the endpoint from its own config or `OPOD__ENDPOINT`: ```bash OPOD_ENGINE=vllm OPOD_VLLM_ENDPOINT=http://127.0.0.1:8000 opod join "http://leader:8080?token=sk-orc-" ``` For vLLM, SGLang, llama.cpp and TensorRT-LLM the worker **starts the engine itself** when the leader asks it to load a model (`POST /v1/model/load`), and stops it at shutdown. For Ollama and MLX-LM, the engine must already run. See [Engines](https://opod.io/docs/core-reference/engines/). `OPOD_LOAD_MODEL=` makes the worker load that model by itself once its engine answers, with no call from the leader. `OPOD_LOAD_REPO` and `OPOD_LOAD_FILE` override the catalog's repo and file for that load. The model's pinned revision and digest come from `OPOD_MODEL_REVISION` and `OPOD_MODEL_SHA256`; gated repos need `HF_TOKEN`, and `HF_ENDPOINT` points at a mirror. Other worker-only variables — `OPOD_ENGINE_FLAGS`, `OPOD_ADAPTERS`, `OPOD_REJECT_BEARER`, `OPOD_DRAIN_SECONDS`, `OPOD_WORKER_ROLE`, `OPOD_KV_TIER`, `OPOD_KV_EVENTS`, `OPOD_SLEEP_MODE`, `OPOD_PLAN_REVISION`, `OPOD_ACCELERATOR`, `OPOD_CARD_MIB`, `OPOD_ENGINE_OVERHEAD_MIB` — are described in [Environment variables](https://opod.io/docs/core-reference/environment/#process-contract-worker). Three of them are checked at start and refuse a value the worker would not understand: | Error | Fix | | ---------------------------------------------------------------------- | --------------------------------- | | `opod: OPOD_WORKER_ROLE "x": use prefill or decode, or leave it unset` | Unset it for a whole worker. | | `opod: OPOD_KV_TIER "x": use cpu or peer, or leave it unset` | Unset it for VRAM only. | | `opod: OPOD_DRAIN_SECONDS="x": want whole seconds from 0 to 3600` | A whole number, at most one hour. | Valid values look like this: ```bash OPOD_WORKER_ROLE=decode OPOD_KV_TIER=peer OPOD_DRAIN_SECONDS=120 \ opod join "http://leader:8080?token=sk-orc-" ``` `OPOD_PLAN_REVISION` that is not a positive number only warns: `OPOD_PLAN_REVISION "x" is not a positive number — this worker joins the unversioned group`. When the catalog cannot be read, the worker still starts, with `catalog unreadable (…) — vLLM and SGLang start with no tool-call parser`. ## What happens 1. Reads `config.yaml` and the environment, then checks the flags and the variables above. 2. Detects the hardware: OS, architecture, CPU cores, RAM, GPUs and their memory. 3. Picks the node id and the address, and writes `~/.opod/node.yaml`. 4. Starts its API on the address (see [Worker API](https://opod.io/docs/core-reference/worker-api/)) and calls `POST /admin/v1/nodes/register` on the leader with its hardware, engine, role, KV tier, plan revision and a new boot id. 5. Heartbeats every 5 seconds with the models its engine has loaded, the engine's load and process state. 6. With `OPOD_LOAD_MODEL`, loads that model once the engine answers. Output: ```text ✔ joining cluster at http://leader:8080 as n_abc123 ▶ address: 192.0.2.51:8081 ▶ hardware: linux/amd64 · 64 GB RAM ``` After that it logs JSON lines, for example `registered with leader`. ## When the leader answers badly | Leader answer to a heartbeat | What the worker does | | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `404` (the leader forgot the node, for example after `opod node remove`) | Registers again at once. | | `401` or `403` | Registers again with the token it started with. A leader that is restarting answers `401` for a moment, so one refusal changes nothing. When **6 re-registers in a row** are refused (about 30 seconds), the worker exits with `join token refused 6 times in a row: the token this worker started with is dead (rotated, or minted by an endpoint that is gone) — exiting so a restart reads the current one`. | | Network error or `5xx` | Retries with backoff: 10 s, then 20 s between attempts, until the leader is back. | A failed first register only logs `register failed`; the heartbeat loop then registers again on its `404`. From core v0.4.6 the worker also says, in one line per kind on stderr, what the leader answered: `registered with leader … as n_… — it is placeable after its first heartbeat (≤5 s)` on stdout once it is in; `the leader at … refused the join token — mint one on the leader: opod token create --node`; `cannot reach the leader at … (…) — check the URL and the firewall`. The JSON log lines stay as they are. A stop the worker chose — 6 refused re-registers, or its port in use (`port … is in use — another opod join on this host? stop it, or give this worker another port with OPOD_ADVERTISE_ADDR (and OPOD_BIND_ADDR)`) — ends with `opod: worker stopped: ` and exit `1`; before, it printed `✔ worker shutdown complete` and exited `0`. In the release after core v0.4.8 the worker binds its port before it registers, so a taken port stops the join before the leader hears of it: the line is `opod: port … is in use — …` (no `worker stopped:`) with exit `1`, and no `registered with leader` line comes first. ## Stopping On `SIGINT` or `SIGTERM`: 1. The worker sends a **goodbye** heartbeat at once (nothing loaded, engine `stopped`, `worker shutting down`), with a 3-second deadline, so the leader takes it out of rotation now instead of after the heartbeat bound. 2. It lets the requests already running on it finish, for up to `OPOD_DRAIN_SECONDS` (default `10`, `0` = stop at once, at most `3600`). A gang part also waits while a peer still holds a connection to one of its ports. 3. It stops every engine process it started. ```text ✔ worker shutdown complete ``` Give a container a grace period longer than `OPOD_DRAIN_SECONDS`. --- title: "opod node" description: "List and inspect the cluster's nodes, drain and undrain them, and remove a node from the leader." url: "https://opod.io/docs/core-cli/node/" markdown_url: "https://opod.io/docs/core-cli/node.md" section: "Core CLI" last_updated: "2026-10-30" --- # opod node > List and inspect the cluster's nodes, drain and undrain them, and remove a node from the leader. ## In short `opod node` lists the machines the leader knows and takes them in and out of rotation. A drain stops new requests to a node and lets running ones finish; a remove makes the leader forget it. Run it on the leader host. ```bash opod node drain n_abc123 ``` ```text ✔ n_abc123 is draining (through the running leader): it gets no new requests and no new shard parts; requests already on it finish. A sharded model with a part on it stops serving. ▶ it stays drained across heartbeats and a worker restart — undo with `opod node undrain n_abc123` ``` ## Usage ```text opod node ls opod node show ID opod node drain ID opod node undrain ID opod node remove ID [--yes] ``` A node is one machine the leader knows: the leader itself (id `local`) and every worker that joined with `opod join`. Run these commands on the leader host, as the user that runs `opod up`: they read `~/.opod/config.yaml`, the store at `storage.dsn` (`~/.opod/state.db` by default) and the admin key in `~/.opod/admin.key`. | Sub-command | Aliases | How it reaches the leader's state | Works with no leader running | | ------------ | ------- | --------------------------------- | ---------------------------- | | `ls` | `list` | reads the store | yes | | `show ID` | — | reads the store | yes | | `drain ID` | — | admin API, else the store | yes | | `undrain ID` | — | admin API, else the store | yes | | `remove ID` | `rm` | admin API, else the store | yes | Node ids come from `opod node ls`. A worker's id is `OPOD_NODE_ID` if its manager set one, else the id saved in the worker's `~/.opod/node.yaml`, else `n_`, else a random `n_` plus 8 characters. See [`opod join`](https://opod.io/docs/core-cli/join/#identity-and-address). ## opod node ls ```bash opod node ls ``` ```text ID 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 node-a linux/amd64 192.0.2.51:8081 ready 2026-10-30T10:12:42Z n_def456 node-b linux/amd64 192.0.2.52:8081 draining 2026-10-30T10:12:41Z n_ghi789 node-c linux/amd64 192.0.2.53:8081 lost 2026-10-30T10:02:10Z ``` | Column | Meaning | | ---------- | ----------------------------------------------------------------------------------------------------------------------- | | `ID` | The node id. The leader's own row is always `local`; `opod up` writes it at start with the address `127.0.0.1`. | | `HOSTNAME` | What the worker reported at register. | | `OS/ARCH` | `GOOS/GOARCH` of the worker binary. | | `ADDRESS` | Where the leader dials the worker: its LAN address on port `8081`, or `OPOD_ADVERTISE_ADDR`. | | `STATE` | The state the leader acts on (below). | | `LAST HB` | The last heartbeat, RFC 3339. Workers heartbeat every 5 seconds. | With no nodes yet, it prints ``(no nodes registered yet — issue a join token: `opod token create --node`)``. There is no `--json`. For machine output, call `GET /admin/v1/nodes` (see [Admin API](https://opod.io/docs/core-reference/admin-api/)). From core v0.4.6, `opod node ls --json` prints the same rows as a list (`id`, `hostname`, `platform`, `address`, `state` — the live one — and `last_heartbeat`), and an extra argument is a usage error. ### States `STATE` is computed when the row is read, by the same rule the router uses to pick a worker. So a node reads `lost` here at the moment the leader stops sending it requests. | State | Stored or derived | Meaning | | --------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `joining` | stored | A pre-ready state the store and router understand. Core's own register writes `ready` directly, so you do not normally see it; a heartbeat moves a `joining` row to `ready`. | | `ready` | stored | In rotation. | | `draining` | stored | You drained it. It gets no new requests and no new gang parts. It stays `draining` even when its heartbeats stop. | | `lost` | derived, never stored | A `ready` or `joining` node whose last heartbeat is older than the heartbeat bound: `router.heartbeat_max_age_seconds`, default `30`; `0` means a 60-second bound. | | `engine-silent` | derived, never stored | The worker heartbeats, but its engine has not answered it for longer than the same bound (a 60-second bound when the setting is `0`). The worker is alive and nothing says what it serves, so it gets no new work. A drained node still reads `draining`. | A drain also survives a worker restart: a worker that registers again under a drained id stays `draining`. When a `lost` worker heartbeats again, it is back in rotation at once. You do nothing. ## opod node show ```bash opod node show n_abc123 ``` Prints the node's stored record as indented JSON, plus `loadedModels`: the models placed on it, from the heartbeat-reconciled placement rows. ```json { "ID": "n_abc123", "Hostname": "node-a", "OS": "linux", "Arch": "amd64", "RAMGB": 64, "Address": "192.0.2.51:8081", "WorkerToken": "sk-orc-", "BoundKeyID": "k_…", "HardwareJSON": "{\"Hostname\":\"node-a\",\"OS\":\"linux\",\"Arch\":\"amd64\",\"CPUCores\":16,\"RAMGB\":64,\"GPUs\":[{\"Name\":\"…\",\"VRAMGB\":48}],\"Engine\":\"vllm\"}", "LastHeartbeat": "2026-10-30T10:12:42.118Z", "State": "ready", "BootID": "…", "EngineSilentSince": "0001-01-01T00:00:00Z", "loadedModels": ["llama-3.2-3b"] } ``` The store record has no JSON tags, so its keys are the Go field names. `State` here is the **stored** value, not the derived one: a lost node still shows `ready`. `HardwareJSON` is what the worker registered, as a JSON string: `Hostname`, `OS`, `Arch`, `CPUCores`, `RAMGB`, `GPUs` (each `Name`, `VRAMGB`), and when set `Engine`, `Role`, `KVTier` and `PlanRevision` (and, from core v0.4.7, `KVEvents: true` for a worker started with `OPOD_KV_EVENTS=1`). `BootID` names the worker process; it changes on every worker restart. A zero `EngineSilentSince` means the engine answers. > **The output holds a secret, up to 0.3.0** > > `WorkerToken` is the secret the leader signs its calls to that worker with. Up to and including 0.2.1 it is printed whole: treat that output as a secret and do not paste it into a ticket. In 0.3.0 it is redacted to its prefix and last four characters (`sk-orc…6789`). `GET /admin/v1/nodes` still carries it whole in both, because front doors read it there to call the workers. `opod node show` with no id prints `opod: usage: opod node show `. An unknown id prints `opod: no such node: `. From core v0.4.6, `opod node show ` prints a short human summary (the live state, the last heartbeat, platform, RAM, address and what is loaded) and `--json` prints the record above; an unknown id says `no node (see opod node ls)`. ## opod node drain ```bash opod node drain n_abc123 ``` ```text ✔ n_abc123 is draining (through the running leader): it gets no new requests and no new shard parts; requests already on it finish. A sharded model with a part on it stops serving. ▶ it stays drained across heartbeats and a worker restart — undo with `opod node undrain n_abc123` ``` What happens: 1. The CLI calls `POST /admin/v1/nodes/{id}/drain` on the leader, so the change is on the leader's event stream. 2. The leader sets the node's state to `draining`. The router stops choosing it from the next request. 3. Requests already on the node finish. The worker keeps running and keeps heartbeating. 4. A gang with a part on that node stops serving, because a gang needs every part. A drain does not unload models and does not stop the worker. To move a model off the node with no failed request, use [`opod model move`](https://opod.io/docs/core-cli/model/#opod-model-move) before or instead. The leader's own node cannot be drained: ```text opod: the leader's own node cannot be drained — unload its models (`opod model unload `) or stop the leader (`opod down`) ``` From core v0.4.6, draining a node that is already draining says `… is already draining — nothing changed` and exits `0`; undraining one that is not drained says `… is not drained — nothing changed`. The check reads this host's store, so it applies on the leader's host. ## opod node undrain ```bash opod node undrain n_abc123 ``` ```text ✔ n_abc123 is back in rotation (through the running leader): the router may choose it from the next request on ``` It sets the stored state back to `ready`. A node that is still not heartbeating then reads `lost`. ## opod node remove ```bash opod node remove n_abc123 # asks: Remove node "n_abc123" from the cluster? … (y/N) opod node remove n_abc123 --yes # no prompt; -y is the same ``` The prompt accepts `y` or `yes`. Anything else, or a stdin that is not a terminal, answers no and the command exits with `opod: aborted`. Scripts pass `--yes`. Through a running leader (`DELETE /admin/v1/nodes/{id}`), the leader deletes the node row and its placements, and its router drops the node's cached connection, its cooldown and its sticky-session pins: ```text ✔ removed n_abc123 (through the running leader): its placements are gone and the router dropped its cached connection, cooldown and sticky pins ``` The worker process keeps running. Its next heartbeat gets `404`, and a worker that gets `404` registers again. So a node you remove while it runs comes back within about 5 seconds. Stop the worker first (Ctrl-C or `SIGTERM` on `opod join`) if you want it gone. ## Leader or store `drain`, `undrain` and `remove` call the running leader first. They fall back to writing the store directly only when **no leader answered** — not when the leader refused. The output names which path ran: | Output says | Meaning | | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `through the running leader` | The leader took the change. It is on the event stream, and for `remove` the router's in-memory state is cleared too. | | `written to the store — no leader answered` | No leader was reached. The row was changed in `state.db`; a leader started later reads it. On 0.2.1 a host with no `admin.key` also lands here while a leader runs; from 0.3.0 that case is refused, naming the leader that answered and the missing key. | A leader that answers with an error is final. The CLI prints its status and body, for example `opod: drain n_x: POST /admin/v1/nodes/n_x/drain: 404 Not Found: …`, and changes nothing. > **No admin key means no leader** > > The CLI reaches the leader with the key in `~/.opod/admin.key`, at `http://localhost`. When that file is missing (a managed leader writes none), the call never leaves the CLI, so it counts as "no leader answered" and the CLI writes the store, even when a leader is running. A running leader then does not see the change on its event stream, and after a store-only `remove` its router still holds the old connection. On such a host, use the admin API with an admin key instead. > > From core v0.4.6 this changes. The CLI also uses the admin token the leader was started with (`OPOD_ADMIN_TOKEN`), so on a managed leader the call goes through the leader. `node ls` and `node show` ask the running leader first too. On a managed host (`OPOD_MANAGED=1`) a command never writes or reads a store of its own: with no leader answering it refuses and says so. See [Core CLI](https://opod.io/docs/core-cli/#where-commands-act). With no leader and an unknown id, the store path prints `opod: drain n_x: no such node` (or `remove n_x: no such node`). ## Add a node ```bash opod token create --node # on the leader; the key is printed once opod join "http://leader:8080?token=sk-orc-" # on the new machine ``` Quote the URL: `?` is a glob character in zsh. See [`opod join`](https://opod.io/docs/core-cli/join/) and [Clusters](https://opod.io/docs/core/clusters/). --- title: "opod model" description: "Search the catalog, install models on the leader or on named workers, manage what is in engine memory, move a model between workers, and remove it." url: "https://opod.io/docs/core-cli/model/" markdown_url: "https://opod.io/docs/core-cli/model.md" section: "Core CLI" last_updated: "2026-10-30" --- # opod model > Search the catalog, install models on the leader or on named workers, manage what is in engine memory, move a model between workers, and remove it. ## In short `opod model` finds, installs and removes models, and controls what the leader's engine holds in memory. `add --node` installs a model on named workers; `move` hands a model from one worker to another without a failed request. Run it on the leader host. ```bash opod model add llama-3.2-3b --node n_abc123 ``` ```text ▶ placing llama-3.2-3b on n_abc123 (workers pull + load; this may take a few minutes)… ✔ placed llama-3.2-3b on n_abc123 ``` ## Usage ```text opod model add ID [--force] [--dry-run] [--node a,b,c] [--from FILE.yaml] opod model ls [--json] opod model ps [--json] opod model search [QUERY] [--sort=released] [--since YYYY-MM-DD] [--json] opod model info ID [--json] opod model load ID [--swap] [--pin] [--priority N] opod model unload ID opod model move ID --from NODE --to NODE opod model remove ID [--yes] ``` Run these on the leader host. Each sub-command reaches the leader's state in one of three ways, and that decides whether it needs `opod up` running: | Sub-command | Alias | Path | Needs a running leader | | ----------- | ------ | ------------------------------------------------------------- | ---------------------- | | `add` | — | the local engine and the store; with `--node`, the admin API | only with `--node` | | `ls` | `list` | the store | no | | `ps` | — | `GET /admin/v1/memory` | yes | | `search` | — | the catalog and the store | no | | `info` | — | the catalog and the store | no | | `load` | — | `POST /admin/v1/models/{id}/load` | yes | | `unload` | — | `POST /admin/v1/models/{id}/unload`, else the engine directly | no | | `move` | — | `POST /admin/v1/models/{id}/move` | yes | | `remove` | `rm` | the local engine and the store | no | The catalog these commands read is the merged one: the embedded entries plus your override directories. See [Catalog format](https://opod.io/docs/core-reference/catalog/). ## opod model add Install a model. | Flag | Effect | | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--force` | Skip the hardware floor check (`hardware.min_ram_gb`, `min_vram_gb`). With `--node`, also replace the model a one-model engine is serving on that worker. | | `--dry-run` | Print the plan. Pull nothing and save nothing. `--dryrun` is the same. Not with `--node`. | | `--node a,b,c` | Pull and load on these workers, through the leader. `--nodes` is the same; the flag may repeat. | | `--from FILE.yaml` | Install from your own catalog entry (below). | Flags may come in any order. `ID` is a catalog id, or one of these scheme prefixes, which skip the catalog and the hardware check: | Prefix | Example | Source | | --------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------- | | `hf:` | `hf:bartowski/Phi-3-mini-GGUF`, `hf:bartowski/Phi-3-mini-GGUF:Phi-3-mini-Q4_K_M.gguf` | A Hugging Face repo, optionally `:FILE` for one file. | | `ollama:` | `ollama:phi3:mini` | An Ollama library tag. Needs the Ollama engine. | | `file:` | `file:/models/my.gguf` | A GGUF already on disk. | ```bash opod model add llama-3.2-3b opod model add gpt-oss-120b --force opod model add qwen3.6-27b --dry-run opod model add hf:bartowski/Phi-3-mini-GGUF opod model add --file ./my-model.yaml # --from up to core v0.4.5 opod model add llama-3.2-3b --node n_abc123,n_def456 ``` With no id, or an id that is not in the catalog, an interactive terminal opens a picker. With no terminal, it exits `opod: no model selected`. ### On the leader's own engine (no `--node`) This path does not go through a running leader: the CLI talks to the configured engine and writes the store itself. 1. **Hardware floor.** It compares the entry's `min_ram_gb` with this machine's total RAM, and `min_vram_gb` with its largest GPU. On a machine with no discrete GPU (or Apple unified memory) only RAM is compared. A gap refuses: ```text opod: model gpt-oss-120b needs at least 80 GB RAM; this machine has 24 GB (override with `opod model add gpt-oss-120b --force` if you know what you're doing) ``` An entry with no floor (every scheme id) only warns: `no hardware floor known for … — proceeding without check`. 2. **Source check.** It sends a `HEAD` to the upstream (the Ollama registry or Hugging Face), with a 5-second limit. A `404` refuses: `opod: source for … does not exist: …`. Any other failure only warns: `could not verify source for … (…) — proceeding anyway`. `OPOD_SKIP_SOURCE_CHECK=1` skips the check (air-gapped mirrors). 3. **Sharded?** An entry with `sharding.required: true` hands off to [`opod shard create`](https://opod.io/docs/core-cli/shard/) with no count, which picks one and needs the running leader. 4. **Engine match.** The entry's source type must suit the engine: `opod: source type "ollama" in … is not compatible with engine vllm — switch engines or use a different scheme prefix`. 5. **Pull** through the engine, with a progress bar, then a row in the store: `✔ installed: llama-3.2-3b`. When the pull worked but the store write failed, it says `the weights for … are installed, but recording the … failed` and asks you to run `add` again once the store is healthy. ### On workers (`--node`) ```bash opod model add llama-3.2-3b --node n_abc123 ``` ```text ▶ placing llama-3.2-3b on n_abc123 (workers pull + load; this may take a few minutes)… ✔ placed llama-3.2-3b on n_abc123 ``` The CLI calls `POST /admin/v1/models` with `{"id", "nodes", "force"}`. The leader resolves the entry and calls each worker's `/v1/model/load`; the worker's engine pulls and loads it. Nothing is pulled on the leader. The model is routable once the worker's next heartbeat reports it loaded. The CLI waits up to 45 minutes. A worker whose engine serves one model per process (vLLM, SGLang, llama.cpp, TensorRT-LLM) would stop what it serves. The leader refuses that and names both models; the CLI adds `(replace it on purpose with opod model add … --node … --force)`. ### Dry run ```bash opod model add qwen3.6-27b --dry-run ``` ```text Dry-run plan for qwen3.6-27b Name … Download size 17.0 GB Min RAM 24 GB License apache-2.0 Released 2026-03-22 Engine ollama (would pull "…") Engine status reachable Hardware OK Source check upstream exists ETA ~5 min at 50 MB/s No weights pulled. Run `opod model add qwen3.6-27b` to proceed. ``` `Hardware` reads `OK`, the gap with `— would refuse without --force`, or `no floor known`. `Source check` reads `upstream exists`, `NOT FOUND — install would refuse`, or `could not verify`. The ETA assumes 50 MB/s. A sharded entry shows the next step (`opod shard create …`) instead of an engine. ### From your own entry (`--from`) ```bash opod model add --file ./my-model.yaml [--dry-run] [--force] # --from up to core v0.4.5 ``` 1. Reads and parses the file. It needs `id:` and `source.type:` (`ollama`, `huggingface` or `file`), else it stops: ``…: missing `source.type:` field — set to ollama, huggingface, or file``. 2. Applies the signature policy (below) to the file as given. 3. With `--dry-run`, prints the plan and stops. Nothing is saved. 4. Copies the file to `~/.opod/catalog/.yaml` (or to `catalog_dir` when `config.yaml` sets one), with its `.minisig` when there is one. An existing file of that name is not overwritten: it warns `… already exists — remove or rename it first` and installs once without saving. 5. Runs the install above. From then on the entry is like any catalog entry. From core v0.4.6, `model add` names a catalog YAML with `--file` (in `model move`, `--from` is the source node), and `add --node` says `placing … — Ctrl-C stops waiting, not the pull`, prints `… still placing … (Ns)` every 10 s on stderr while the workers pull, and ends with `next: opod node show `. ## opod model ls ```bash opod model ls ``` ```text ID STATUS SOURCE INSTALLED llama-3.2-1b ready ollama:llama3.2:1b 2026-10-30T10:01:12Z qwen-coder-7b ready ollama:qwen2.5-coder:7b 2026-10-30T10:20:40Z ``` The installed models in the store. `SOURCE` is `:`. With none: ``(no models installed — try `opod model add llama-3.2-3b`)``. `--json` prints the rows with Go field names: `ID`, `CatalogID`, `Source`, `Status`, `SizeBytes`, `InstalledAt`. A model placed on workers with `--node` is listed too, with `SOURCE` `node:,` (the workers named at placement time). What each worker actually holds is `opod node show ID` (`loadedModels`); what the cluster serves is `GET /v1/models`. ## opod model ps What is resident in the **leader's own engine** memory right now. Calls `GET /admin/v1/memory`. ```text MODEL RAM VRAM PINNED PRIO LAST USED qwen-coder-14b 9.0 GB 9.0 GB pinned 2 2026-10-30 10:20 llama-3.2-1b 1.3 GB 1.3 GB — 0 never Memory: 10.3 GB resident of 19.2 GB budget (24.0 GB total RAM) · 8.9 GB free Tip: `opod model load --swap` evicts least-recently-used models to make room. `--pin` protects a model. ``` The budget is total RAM minus `placement.reserve_percent`. With `placement.exclusive: true` (or `opod up --exclusive`) the summary adds `exclusive mode`. Only Ollama reports residency; for any other engine it prints `(engine cannot report residency — memory view requires Ollama)`. `--json` prints the leader's answer as is: `supported`, `exclusive`, `total_ram_bytes`, `budget_bytes`, `resident_bytes`, `free_bytes`, and `resident[]` with `catalog_id`, `size_bytes`, `vram_bytes`, `pinned`, `priority`, `last_used`. ## opod model search ```bash opod model search # the whole catalog opod model search coder # text match opod model search vision # capability match: vision, embedding, tools, … opod model search --sort=released opod model search --since 2026-01-01 opod model search gguf --json ``` | Argument / flag | Effect | | -------------------- | ----------------------------------------------------------------------------------------------------------------- | | `QUERY` | Case-insensitive substring of the id, the display name, a capability or a tag. One word; a second is ignored. | | `--sort=released` | Newest first. `--sort released` and `--sort-released` are the same. Entries with no date go last, smallest first. | | `--since YYYY-MM-DD` | Only entries released on or after that day. Entries with no date are left out. | | `--json` | The full entries, each with `installed`. | Without `--sort`, entries come smallest first. Any other flag is `opod: unknown flag: … (run opod model --help)`. ```text ID NAME SIZE RAM CAPABILITIES RELEASED INSTALLED qwen-coder-7b Qwen2.5 Coder 7B 4.7 GB 8G chat,code,fim 2024-11-12 ✓ … Tip: `opod model info ` for full details on one model. `opod model add ` to install. ``` From core v0.4.6, a search with no match says `no catalog model matches "X"` instead of printing an empty table; `--since` must be `YYYY-MM-DD` and `--sort` takes only `released`, each a usage error (exit `2`) otherwise. ## opod model info ```bash opod model info qwen-coder-14b opod model info qwen-coder-14b --json # the catalog entry as JSON ``` Prints the entry: status (installed or not, and when), source and its URL, size, quantization, context window, RAM and VRAM floor, capabilities, recommended engines, tags, sharding, licence and its URL, release date, and the fallback chains (`Fallback`, `Fallback (context-length)`, `Fallback (content-policy)`). Then an install line and copy-paste use snippets: an embeddings `curl` for an embedding model, else a chat `curl`, an image example for a vision model, and the environment lines for an OpenAI-shape tool. The snippets use `http://localhost:8080` and `sk-orc-...`; `opod connect` prints them with your real URL and key. From core v0.4.6 the snippets in `model info` use this host's real base URL (`OPOD_BASE_URL`, `external_url` or the listen address, as `opod connect` does) instead of a fixed `http://localhost:8080`, and a sharded model's install line is `opod shard create ` (it picks the part count). ## opod model load Bring an installed model into the leader engine's memory now, under memory admission. Calls `POST /admin/v1/models/{id}/load` and waits up to 45 minutes. | Flag | Default | Effect | | -------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------- | | `--swap` | off | Evict least-recently-used, non-pinned models to make room. Each is drained first and recorded. | | `--pin` | off | Exempt the model from eviction and from the engine's idle unload. | | `--priority N` | `0` | Restore order on the next `opod up`, higher first. `--swap` evicts lower priorities first. A value that is not a number is read as `0`. | ```text ▶ evicted llama-3.2-1b (freed 1.3 GB) ✔ loaded qwen-coder-14b (pinned — exempt from eviction and idle TTL) ``` A model that is already resident only has its desired placement updated: `✔ … is already resident — desired placement updated (pin=true)`. Loaded and pinned models are restored, by priority, on the next `opod up`. Refusals: | `error.type` | What the CLI prints | | ------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | `needs_swap` | The reason, each model `--swap` would evict with its size, then `rerun with opod model load … --swap to accept the eviction(s)`. | | `blocked_by_pinned` | The reason, and a pointer to `opod model ps` and to unpinning. | | `impossible` | The reason: the model does not fit even with everything else evicted. | Any other flag is `opod: unknown flag: …`. ## opod model unload ```bash opod model unload llama-3.2-3b ``` Through the running leader, it drains the model's in-flight requests, then drops it from engine memory: `✔ unloaded llama-3.2-3b (drained, weights still on disk; stays unloaded across restarts)`. The weights stay on disk, and the model is not restored on the next `opod up`. When the engine has no unload call, the leader answers "noop" and the CLI warns `… — restart the engine to free RAM`. With no leader answering, the CLI asks the engine directly (10-second limit), with no drain: `✔ unloaded … from ollama (weights still on disk)`. An engine with no online unload (vLLM, MLX-LM) gets the warning `… does not support online unload — restart the engine to free RAM`. From core v0.4.6, `model load` and `model unload` also accept a model id the leader lists (a model placed only on workers), `model ps --json` refuses an answer that is not JSON instead of passing it through, and `model remove` says when the engine kept the weights (`removed X from the store, but ollama did not delete its weights … — delete them with ollama rm …`) instead of printing `removed`. ## opod model move ```bash opod model move llama-3.2-3b --from n_abc123 --to n_def456 ``` Another worker takes over a whole model by overlap, so no request fails. All three arguments are required, and one model at a time. It needs the running leader and waits up to 45 minutes. ```text ▶ moving llama-3.2-3b from n_abc123 to n_def456: the target loads it while n_abc123 keeps serving (a cold target downloads the weights first — this can take a while)… 10:20:01 started admitted; loading on the target, the source keeps serving 10:21:37 loaded the target serves the model — both workers take requests 10:21:37 flipped the source is out of rotation: new requests go to the target 10:21:39 drained nothing is in flight on the source 10:21:40 finished the source unloaded the model ✔ llama-3.2-3b is now served by n_def456; n_abc123 let it go ▶ no KV cache moved: a conversation n_abc123 was serving recomputes its prompt on n_def456 at its next turn ``` | Step | Meaning | | ---------- | --------------------------------------------------------------------------------------------------------------------- | | `started` | Admitted. The target loads the model; the source keeps serving. When the target already serves it, nothing is loaded. | | `loaded` | The target serves the model. Both workers take requests. | | `flipped` | The source is out of rotation for this model. | | `drained` | Nothing is in flight on the source, or the drain timed out with N requests left. | | `finished` | The source unloaded the model. | | `aborted` | The move stopped, with the reason and the state it left. A target that never serves leaves the source serving. | The leader refuses a move up front when it cannot work: the target cannot hold the model beside what it has, runs a one-model engine that serves something else, or takes no new work; the source does not hold the model, or serves adapters of it; the model is sharded. The steps are also events (`model.move_*`). See [Clusters](https://opod.io/docs/core/clusters/#move-a-model-to-another-worker). | Error | Cause | | ------------------------------------------------------------------------ | ----------------------- | | `opod: a model id, --from and --to are all required` | A missing argument. | | `opod: one model at a time: got "a" and "b"` | Two ids. | | `opod: --from needs a node id` | `--from` with no value. | | `… a move needs the running leader — start it with opod up on this host` | No leader answered. | ## opod model remove ```bash opod model remove llama-3.2-3b # asks: Remove installed model "llama-3.2-3b"? Weights will be deleted from disk. (y/N) opod model remove llama-3.2-3b --yes # -y is the same ``` It asks the local engine to delete the model (a failure only warns and goes on), deletes the store row and forgets the leader's desired placement for it, so the next `opod up` does not try to restore it: `✔ removed: llama-3.2-3b`. This path writes the store directly; it does not go through a running leader. With no terminal on stdin and no `--yes`, it exits `opod: aborted`. An id that is not installed opens the picker on a terminal. ## Interactive picker `add`, `info`, `remove`, `load` and `unload` with no id, or an id that is not in the catalog (`add`, `info`) or not installed (`remove`, `load`, `unload`), open a picker on an interactive terminal. With no terminal they exit `opod: no model selected`. ## Catalog signatures With `OPOD_CATALOG_PUBKEY` set (a minisign public key, or a file that holds one), a catalog file that has `FILE.minisig` beside it must verify — for `--from` and for every catalog directory — and one that does not is refused. `OPOD_CATALOG_REQUIRE_SIGNED=1` refuses unsigned files too. The embedded catalog is never checked. A verified `--from` file prints `✔ signature verified against key …`. --- title: "opod shard" description: "Create, list and remove gangs (one model split across several workers), run several gangs of one model, and read the errors a create returns." url: "https://opod.io/docs/core-cli/shard/" markdown_url: "https://opod.io/docs/core-cli/shard.md" section: "Core CLI" last_updated: "2026-10-30" --- # opod shard > Create, list and remove gangs (one model split across several workers), run several gangs of one model, and read the errors a create returns. ## In short `opod shard` splits a model that is too big for one worker into a **gang** across several, and removes it again. With no count it picks the number of parts from the workers' free memory. It calls the running leader. ```bash opod shard create llama-3.3-70b-sharded --nodes n_a,n_b ``` ```text ▶ creating sharded model llama-3.3-70b-sharded on [n_a n_b] (this may take a few minutes)… ✔ sharded model ready: llama-3.3-70b-sharded ``` ## Usage ```text opod shard create MODEL [N] [--nodes a,b,c] [--tp N] [--pp N] [--gang ID] opod shard ls opod shard remove MODEL [--gang ID] [--yes] ``` A **gang** is one copy of a model split into parts across workers: a coordinator that serves requests and the parts it drives. A model may have several gangs; each serves whole requests, and the router picks the least loaded ready one. In core v0.4.6 that choice is load alone: a conversation's pin, the prefix pin and the route token are not read for a gang. From core v0.4.7 gangs are ranked like workers: a later turn of a conversation, or a prompt whose lead a gang served, stays on that gang while it has a free slot. See [Sharding and gangs](https://opod.io/docs/core/sharding/) for the backends and their rules. All three commands call the running leader's admin API, with the key in `~/.opod/admin.key`, at `http://localhost`. With no leader they fail with `opod: admin call: … (is opod up running?)`; from core v0.4.6 the message names the address, where it came from and the fix (`no leader answering at … — start it with opod up, or set OPOD_BASE_URL`), and `OPOD_BASE_URL` / `OPOD_TOKEN` reach a leader on another host ([Where commands act](https://opod.io/docs/core-cli/#where-commands-act)). | Sub-command | Alias | Admin route | | ----------- | ------ | ------------------------------------------------------- | | `create` | — | `POST /admin/v1/shards/create` | | `ls` | `list` | `GET /admin/v1/shards` | | `remove` | `rm` | `DELETE /admin/v1/shards/{model}` or `…/{model}/{gang}` | ## opod shard create | Argument / flag | Default | Effect | | --------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `MODEL` | — (required) | A catalog id. The entry's `sharding.engine` picks the backend: `llamacpp` (RPC parts), `vllm` (Ray, or expert parallel), `sglang` (its own launcher). | | `N` | picked (below) | The number of parts, `1` or more. `1` runs the whole model on one worker with no split. | | `--nodes a,b,c` | picked | Put the parts on these workers, in this order. Node ids from `opod node ls`. | | `--tp N` | `0` (not set) | Tensor-parallel size. vLLM and SGLang only. | | `--pp N` | `0` (not set) | Pipeline-parallel size. vLLM and SGLang only; pipeline is vLLM's default. | | `--gang ID` | none | Build this gang only; the model's other gangs keep serving. Without it, the create **replaces every gang** of the model. | Each flag also takes the `--flag=value` form. ```bash opod shard create llama-3.3-70b-sharded # the CLI picks the count opod shard create llama-3.3-70b-sharded 2 # 2 parts on picked workers opod shard create llama-3.3-70b-sharded --nodes n_a,n_b opod shard create llama-3.3-70b-sharded --nodes n_a # N=1: whole model on n_a opod shard create mimo-7b-ray --nodes n_a,n_b --tp 2 # vLLM tensor parallel across 2 machines opod shard create mimo-7b-ray --nodes n_a,n_b --pp 2 # vLLM pipeline parallel opod shard create llama-3.3-70b-sharded --gang g1 --nodes n_c,n_d # a second gang beside g0 ``` Output: ```text ▶ picked 2 part(s): the model needs 42.1 GB; the freest worker has 24.0 GB, so it does not fit in fewer parts; 2 parts of 21.1 GB fit on n_a (24.0 GB free), n_b (24.0 GB free) ▶ creating sharded model llama-3.3-70b-sharded on [n_a n_b] (this may take a few minutes)… ✔ sharded model ready: llama-3.3-70b-sharded ``` With `--tp` above 1 it also prints `tensor-parallel across machines (tp=N): all-reduce twice per layer over the network — expect it to be latency-bound`. A tensor group that crosses machines works, but every token pays for the network. From core v0.4.6 the last line names what was built — `✔ llama-3.3-70b-sharded ready: gang g1 on n_a, n_b (head n_a) — see opod shard ls` — read from the leader's own rows. A `--nodes` id the leader does not know is refused before anything starts; `--node` is the same flag as `--nodes`; a `--nodes`, `--gang`, `--tp` or `--pp` with no value, an unknown flag and a bad count are usage errors (exit `2`). Ctrl-C (or `SIGTERM`) during the wait prints `interrupted — the leader may hold a partial gang of …; clean it up with: opod shard remove … --gang …` and exits `130`; a failed create names the same cleanup. A line every 10 s on stderr says it is still creating. > **Numbers must be numbers** > > `--tp`, `--pp` and `N` must be whole numbers. `N` that is not (or is below 1) is refused: `opod: invalid shard count "x" (must be ≥1; 1 = whole model on one host)`. On 0.2.1 a `--tp` or `--pp` value that is not a number is read as `0` with no error, which means "not set". From 0.3.0 it is refused: `opod: --tp "two" is not a whole number`. ### When the CLI picks the shape With no `N`, no `--nodes`, no `--tp` and no `--pp`, the CLI picks the shape before it calls the leader: 1. It reads the model's size from the catalog. A model with no recorded size keeps the catalog's `default_shards` and says so. 2. It reads, from the leader's store, the workers that heartbeat within the bound, what they registered and what is placed on them, minus `placement.reserve_percent`. 3. It picks the **smallest number of equal parts** that fits the free memory: `1` when the model fits one worker; never more parts than live workers or than the model's layers. 4. It sends the picked workers as an explicit `--nodes` list, so the leader builds exactly what was printed. When nothing fits, it refuses and prints the numbers, for example: ```text opod: cannot pick a shard count for llama-3.3-70b-sharded: the model needs 42.1 GB and no split fits: 2 live worker(s) have 30.0 GB free in total (n_a 18.0 GB, n_b 12.0 GB); even 2 part(s) need 21.1 GB each and worker n_b has 12.0 GB — free memory, join more workers, or name the count yourself ``` With no live worker: `no live workers — join one (opod join) or name the count`. Any shape you name is sent unchanged, and the admin API itself never picks: a request body with no count means the catalog's `default_shards`. A leader with an in-memory store (managed mode) shows the picker no workers; give a count. ### Placement without `--nodes` The leader puts the parts on the strongest workers: a worker with a GPU before one without, then the biggest card, then the biggest host. Name `--nodes` to place them yourself. ### Coordinator The coordinator (llama.cpp's `llama-server --rpc …`) runs on the gang's worker with the most card memory. A worker with no card is chosen only when no candidate has one (then by host RAM), and the leader itself only when there are no workers. On the leader, `OPOD_COORDINATOR_NODE=` pins it; `local` forces the leader. It is ignored for one part. ### Prerequisites (llama.cpp) - `rpc-server` on `PATH` on every part's worker, and `llama-server` on the coordinator's machine. `opod doctor` reports whether both are present. - The catalog entry has `sharding.required: true`, and either a readable `source.path` or a Hugging Face `source.file`, which the leader downloads and distributes to the parts (SHA-256 checked). - Parts listen from port `50052` up and the coordinator on `9001`, unless the entry's `sharding.rpc_port_base` or `sharding.coordinator_port` says otherwise. `--tp` with the llama.cpp backend is refused, because RPC splits by layer only: ```text tp=2: llama.cpp RPC sharding is layer-wise only and has no tensor split (tensor-parallel needs a backend that has one — set sharding.engine=vllm or sharding.engine=sglang in the catalog) ``` ### Timeouts The CLI waits up to **45 minutes**, because a cold create can download and distribute tens of gigabytes. Interrupting the CLI cancels the request, and with it the create on the leader. An interrupted create can leave part rows behind with no coordinator. Check with `opod shard ls`, and if the gang has no `coordinator` row, run `opod shard remove MODEL --gang ID --yes` and create it again. ### Errors A failed create prints the leader's status and body: `opod: POST /admin/v1/shards/create: : {"error":{…}}`. Branch on `error.code` where it is set: | Status | `error.code` | Meaning | | ------ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `404` | — | `no catalog entry for `. | | `409` | — or a reason name | The workers cannot hold the shape, or the engine cannot run it. Nothing was changed. A named refusal carries its reason, for example `sglang_pp_tied_llama` (SGLang cannot run a pipeline of a Llama-family model with tied embeddings; use tensor parallelism or vLLM). | | `502` | `gang_part_lost` | A part's worker went away while the gang formed. Its parts were stopped; create again. | | `502` | `gang_part_failed` | A part's process failed to start. Its parts were stopped; read `opod shard ls` and the worker's logs. | | `502` | `gang_create_in_flight` | Another create of the same gang is running and decides the outcome. Wait, then read `opod shard ls`. | | `503` | — | The leader has no orchestrator (a gateway or a door). | ## opod shard ls ```bash opod shard ls ``` ```text MODEL GANG ROLE NODE ADDRESS STATUS llama-3.3-70b-sharded g0 coordinator n_a 192.0.2.51:9001 ready llama-3.3-70b-sharded g0 rpc n_a 192.0.2.51:50052 ready llama-3.3-70b-sharded g0 rpc n_b 192.0.2.52:50052 ready mimo-7b-ray g0 rank n_c 192.0.2.53:6379 ready mimo-7b-ray g0 rank n_d 192.0.2.54 ready mimo-7b-ray g0 coordinator n_c 192.0.2.53:9100 ready ``` | Column | Meaning | | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GANG` | The gang id. A row with none shows `g0`, the default gang. | | `ROLE` | `coordinator` (the process the router sends requests to), `rpc` (a llama.cpp RPC part), or `rank` (one node of a vLLM or SGLang gang; for vLLM on Ray, rank 0 is the Ray head and the coordinator row points at its vLLM server on port `9100`). | | `NODE` | The worker that runs the process. | | `ADDRESS` | Where the coordinator is dialled, or where a part listens. | | `STATUS` | `starting`, `ready`, `failed` or `stopped`. A vLLM or SGLang coordinator reads `starting` until its API answers (from core v0.4.2; see [When a vLLM or SGLang gang is ready](https://opod.io/docs/core/sharding/#when-a-vllm-or-sglang-gang-is-ready)). | With no gangs, it prints ``(no shards — create one with `opod shard create `)``. For machine output, call `GET /admin/v1/shards`; `GET /admin/v1/shards/processes` lists the supervised processes behind the rows. From core v0.4.6, `opod shard ls --json` prints the leader's list as it is, a field the leader leaves out reads `-`, and an answer that is not a shard list is an error instead of `(no shards …)`. `opod shard remove` of a model (or gang) with no rows says `no gang of … to remove — nothing changed` and exits `0`. ## opod shard remove ```bash opod shard remove llama-3.3-70b-sharded # every gang; prompts opod shard remove llama-3.3-70b-sharded --yes # no prompt; -y is the same opod shard remove llama-3.3-70b-sharded --gang g1 # one gang; the others keep serving ``` The prompt reads `Tear down sharded model "…"? The coordinator + every rpc-server will be stopped. (y/N)`, or, with `--gang`, `Tear down gang "g1" of "…"? Its coordinator + rpc-servers stop; the model's other gangs keep serving. (y/N)`. Only `y` or `yes` goes on. With no terminal on stdin, the answer is no and the command exits `opod: aborted`; scripts pass `--yes`. It stops the coordinator and every part, and deletes the rows: ```text ▶ removing llama-3.3-70b-sharded gang g1… ✔ removed llama-3.3-70b-sharded gang g1 ``` The model keeps its placement while any gang is left. > **Managed endpoints heal their gangs** > > On a leader that runs with a mounted [plan file](https://opod.io/docs/core-reference/plan-file/), a gang the plan declares is formed again by the leader once every part of it is gone and free workers have registered. To remove such a gang for good, change the plan, not the leader. --- title: "opod token" description: "Create, list, expire, renew and revoke API keys and node join tokens on the leader, with the key format and the errors a caller sees." url: "https://opod.io/docs/core-cli/token/" markdown_url: "https://opod.io/docs/core-cli/token.md" section: "Core CLI" last_updated: "2026-10-30" --- # opod token > Create, list, expire, renew and revoke API keys and node join tokens on the leader, with the key format and the errors a caller sees. ## In short `opod token` mints, lists, expires and revokes API keys. A key has one scope (`user`, `admin` or `node`) and an optional expiry, and it is printed once. The commands write the store directly, so they work with no leader running. ```bash opod token create alice --ttl 30d ``` ```text ✔ created alice (id=k_Xb3…, scope=user) expires: 2026-11-29T10:00:00Z (in 720h0m0s) Key (shown once — store it now): sk-orc- ``` ## Usage ```text opod token create [NAME] [--admin | --node] [--ttl DURATION | --expires-at DATE] opod token ls opod token expire ID [--in DURATION] opod token renew ID --ttl DURATION | --expires-at DATE opod token revoke ID ``` A token is an API key: an identity with a scope and an optional expiry. These commands write the leader's store (`storage.dsn`, `~/.opod/state.db` by default) **directly**. They need no running leader, and a running leader sees the change on the next request, because it looks the key up in the store on every request. Run them on the leader host. | Sub-command | Alias | Effect | | ----------- | ------ | --------------------------------------------- | | `create` | — | Mint a key and print it once. | | `ls` | `list` | List keys. Never shows the key itself. | | `expire ID` | — | Set the expiry to now, or to now plus `--in`. | | `renew ID` | — | Set a new expiry. | | `revoke ID` | — | Revoke for good. | ## Scopes | Scope | Flag | Can call | | ------- | --------- | ------------------------------------------------------------------------------------------------------------------ | | `user` | (none) | `/v1/*` — the OpenAI and Anthropic gateway. | | `admin` | `--admin` | `/v1/*` and `/admin/v1/*`. | | `node` | `--node` | The worker join path: `POST /admin/v1/nodes/register` and `…/heartbeat`. This is the join token a worker presents. | A key is an identity only: who calls, with which scope, until when. It carries no rate limit, no quota and no model allowlist. Put those in a gateway in front of the endpoint. ## opod token create | Argument / flag | Default | Effect | | ------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | `NAME` | `default`, or `node-join` with `--node` | The key's name. For `user` and `admin` keys the name is also the key's user id, which usage rows carry. A `node` key has no user id. | | `--admin` | — | Make an `admin` key. | | `--node` | — | Make a `node` key. | | `--ttl DURATION` | no expiry | Expire this long from now. | | `--expires-at DATE` | no expiry | Expire at this time: `YYYY-MM-DD` (midnight UTC at the start of that day) or RFC 3339. | Each flag also takes the `--flag=value` form. When both `--admin` and `--node` are given, the last one wins. When both `--ttl` and `--expires-at` are given, the last one wins. ```bash opod token create alice # user key, never expires opod token create alice-admin --admin opod token create alice --ttl 7d opod token create alice --expires-at 2027-01-01 opod token create --node # a worker join token named node-join opod token create rack-2 --node --ttl 24h # a named join token that expires ``` > **Put the name first** > > The first word that is not a flag is the name; later words are ignored. On 0.2.1, with `--node`, write the name **before** the flag (`opod token create rack-2 --node`): in `opod token create --node rack-2` the flag sets the name to `node-join` first, so `rack-2` is ignored. From 0.3.0 the name is kept in either order, and a node key with no name is `node-join`. The key is printed once: ```text ✔ created alice (id=k_Xb3…, scope=user) expires: 2026-11-06T10:00:00Z (in 168h0m0s) Key (shown once — store it now): sk-orc- ``` - The key is `sk-orc-` followed by 32 URL-safe base64 characters (24 random bytes). - The id is `k_` followed by 11 URL-safe base64 characters (8 random bytes). Commands that take an `ID` take this. - The store keeps only the SHA-256 of the key. A lost key cannot be shown again; mint a new one. When stdout is not a terminal (a pipe, a file, CI), the key is still printed to stdout, and a warning goes to stderr: `secret written to a non-terminal (pipe/redirect/CI) — it may be captured in logs or shell history; rotate it if that wasn't intended.` So `KEY=$(opod token create ci-bot | tail -1)` works, with that warning. > **Node tokens** > > A `node` key is the shared secret between the leader and its workers. Issue it only on a network you trust, and give it an expiry when you can. The first worker that registers a node id with a `node` key binds that id to the key: another `node` key cannot register or heartbeat under the same id. From core v0.4.6: - The key is the only line on **stdout**, so `key=$(opod token create ci)` holds just the key; `created …`, the expiry and the "shown once" note go to stderr, and a `--node` key adds `on the worker: opod join "?token="`. - An argument that starts with `-` and is not a flag is refused, with a did-you-mean: `unknown token create flag --admn — did you mean --admin?` (before, it became the key's name). A second name is refused too. - An expiry in the past is refused (`--ttl=-1h`, `--expires-at 2020-01-01`). - With `OPOD_MANAGED=1` and no `OPOD_STORAGE_DSN`, `create` refuses: the CLI's store would be in memory, and the key would be thrown away. ## Durations and dates `--ttl` and `--in` take Go durations (`30s`, `5m`, `2h`, `1h30m`) plus a whole number of days with `d` (`7d`; not `1.5d`, not `0d`). `--expires-at` takes `YYYY-MM-DD` or an RFC 3339 timestamp such as `2027-01-01T09:00:00-08:00`; both are stored in UTC. | Error | Cause | | --------------------------------------------------------------------- | ------------------------------------ | | `opod: --ttl requires a duration (e.g. 30m, 2h, 7d)` | `--ttl` is the last word. | | `opod: invalid --ttl: invalid days: "1.5d"` | Days must be a whole number above 0. | | `opod: invalid --ttl: time: invalid duration "…"` | Not a Go duration. | | `opod: invalid --expires-at: expected YYYY-MM-DD or RFC3339, got "…"` | Wrong date shape. | ## opod token ls ```bash opod token ls ``` ```text ID NAME SCOPE REVOKED EXPIRES CREATED k_Xb3… alice user no never 2026-10-30T10:00:00Z k_9Lq… node-join node no 2026-10-31T10:00:00Z 2026-10-30T10:00:00Z k_seed_1a2b3c… node-join (seeded) node no never 2026-10-30T09:58:01Z k_cp_team-a team-a user no never 2026-10-30T09:58:02Z ``` No hash and no key are shown. `EXPIRES` is RFC 3339 or `never`. An expired key still shows `REVOKED no`; compare `EXPIRES` with the clock. With no keys, it prints ``(no API keys — create one with `opod token create`)``. From core v0.4.6 the `REVOKED` column is `STATE` — `active`, `expired` or `revoked` — `EXPIRES` is wide enough for its value, and `--json` prints the same rows as a list. Ids tell you where a key came from: | Id prefix | Origin | | ------------ | ---------------------------------------------------------------------------------------------------------------- | | `k_` | `opod token create`, the first `opod up` (`initial-admin`), or `POST /admin/v1/tokens`. | | `k_seed_` | `auth.join_token` / `OPOD_JOIN_TOKEN`, seeded by `opod up` as `node-join (seeded)`. | | `k_seedadm_` | `auth.admin_token`, seeded by `opod up` as `manager-admin (seeded)`. | | `k_cp_` | A key from the mounted [auth snapshot](https://opod.io/docs/core-reference/auth-snapshot/). Its manager owns it. | ## opod token expire ```bash opod token expire k_abc # ✔ k_abc: expired immediately opod token expire k_abc --in 1h # ✔ k_abc: will expire at 2026-10-30T11:00:00Z (in 1h0m0s) ``` With no `--in`, the expiry is now. The next request with the key gets `401 key_expired`. Any other flag is `opod: unknown flag: …`. ## opod token renew ```bash opod token renew k_abc --ttl 30d # 30 days from NOW, not from the old expiry opod token renew k_abc --expires-at 2027-06-01 ``` ```text ✔ k_abc: renewed — expires 2026-11-29T10:00:00Z (in 720h0m0s) ``` `--ttl` counts from now, so a late renewal is predictable. A renew also brings an expired key back. It does not bring a revoked key back. With neither flag: `opod: renew needs --ttl or --expires-at`. There is no way to clear an expiry back to `never`; mint a new key instead. ## opod token revoke ```bash opod token revoke k_abc # ✔ revoked k_abc ``` Revocation is final. The next request with that key gets `401 invalid_api_key`. There is no un-revoke. An unknown id, for `expire`, `renew` or `revoke`, prints `opod: … api_key k_x not found` and exits `1`. From core v0.4.6 it prints `no key k_x (see opod token ls)`; `revoke` names the key (`revoked k_… (alice, scope user) — requests carrying it are refused now`) and says `already revoked — nothing changed` on a repeat (exit `0`); `renew` of a revoked key refuses, because a new expiry does not restore it; a new expiry in the past is refused and points at `opod token expire`. `revoke` asks no confirmation: it ends one key, and a new key replaces it. ## What a caller sees | Status | `error.type` | When | | ------ | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `401` | `missing_api_key` | No key in the request. The key is read from `Authorization` (`Bearer `, or the bare key), else `X-Api-Key`, else the `?key=` query parameter. Message: `Authorization header required`. | | `401` | `invalid_api_key` | The key is unknown or revoked. Message: `Invalid or revoked API key`. | | `401` | `key_expired` | Past its expiry. Message: `API key expired at `. | | `403` | `forbidden` | The key's scope does not allow the route, for example a `user` key on `/admin/v1/*`. Message: `Insufficient scope`. | With `auth.require_keys: false` (and no auth snapshot that sets `requireKeys`), `/v1` demands no key and treats every caller as `admin`; a valid key is still recorded on usage rows. `/admin/v1/*` always demands a key, whatever `require_keys` says. See [Security](https://opod.io/docs/core/security/). ## Over the API The same operations are `GET|POST /admin/v1/tokens`, `PATCH /admin/v1/tokens/{id}` (expiry only) and `DELETE /admin/v1/tokens/{id}`. See [Admin API](https://opod.io/docs/core-reference/admin-api/#tokens). --- title: "opod catalog" description: "List the model catalog embedded in the binary and export it as files you can read, copy or override." url: "https://opod.io/docs/core-cli/catalog/" markdown_url: "https://opod.io/docs/core-cli/catalog.md" section: "Core CLI" last_updated: "2026-10-30" --- # opod catalog > List the model catalog embedded in the binary and export it as files you can read, copy or override. ## In short The model catalog ships inside the `opod` binary. `opod catalog ls` prints its ids; `opod catalog export DIR` writes every entry out as a YAML file you can copy and edit. Both read the embedded set only and need no leader. ```bash opod catalog ls | head -3 ``` ```text bge-reranker-v2-m3-gguf deepseek-r1-8b deepseek-v4-flash-sharded ``` ## Usage ```text opod catalog ls opod catalog export DIR ``` The model catalog is a set of YAML entries, one per model. It ships inside the `opod` binary: it comes from core's own `pkg/catalog` package and is compiled in at build time, so it is always present and is never looked up on disk. These two commands read the **embedded set only**. They do not read `~/.opod/catalog/`, `$OPOD_CATALOG_DIR` or any other override directory, and they open no config file and no store. To see the catalog a leader actually uses, merged with your own entries, run [`opod model search`](https://opod.io/docs/core-cli/model/#opod-model-search). | Sub-command | Reads | Writes | Needs a leader | | ------------ | -------------------- | --------------------------- | -------------- | | `ls` | the embedded catalog | stdout | no | | `export DIR` | the embedded catalog | one file per entry in `DIR` | no | ## opod catalog ls Prints one catalog id per line, sorted by file name (each file is named after its id). ```bash opod catalog ls ``` ```text bge-reranker-v2-m3-gguf deepseek-r1-8b deepseek-v4-flash-sharded gemma4-12b … qwen3.6-27b step-3.7-flash-sharded ``` The list is plain text with no header, so it pipes well: ```bash opod catalog ls | wc -l # how many entries this binary carries opod catalog ls | grep -- -sharded # the entries that must be split across workers opod catalog ls | grep gguf # GGUF-only entries ``` Core v0.4.0 carries 48 entries. The number changes from release to release; `opod catalog ls | wc -l` is the answer for the binary you have. Use `opod model info ID` for one entry's details and `opod model search` to filter by name, capability or tag. ## opod catalog export Writes every embedded entry to `DIR`, one file per entry, named `.yaml`. The bytes are exactly the embedded file, comments included. ```bash opod catalog export ./catalog ls ./catalog | head -3 ``` ```text bge-reranker-v2-m3-gguf.yaml deepseek-r1-8b.yaml deepseek-v4-flash-sharded.yaml ``` It prints nothing on success. From core v0.4.6 it prints `✔ wrote 48 catalog entries to ./catalog — overrides go beside them (OPOD_CATALOG_DIR=./catalog)`; with no `DIR` it says `catalog export needs a directory` (exit `2`), and `opod catalog ls --json` prints the ids as a JSON list. What it does, step by step: 1. Creates `DIR` (and its parents) with mode `0755` if it does not exist. 2. Writes each entry with mode `0644`. A file of the same name is **overwritten** without a prompt. 3. Leaves every other file in `DIR` alone. It never deletes. It prints nothing on success and exits `0`. ### Why export - **Read the entries.** The YAML carries comments that explain each model's source, engine and limits. - **Start your own entry.** Copy one as a template, change `id`, `source` and `hardware`, then install it with `opod model add --file FILE.yaml` (`--from` up to core v0.4.5) or drop it into an override directory. - **Give a container a file copy.** A worker image exports the catalog to `/usr/share/opod/catalog`, one of the directories the merge reads. ### Override an entry Put a file with the same `id` in a directory that is read after the embedded set. The later source replaces the earlier entry whole, keyed by `id`: 1. the embedded catalog (least authoritative); 2. `/usr/local/share/opod/catalog`; 3. `/usr/share/opod/catalog`; 4. `$OPOD_CATALOG_DIR`; 5. `~/.opod/catalog/` (most authoritative). Only `*.yaml` and `*.yml` files directly inside a directory are read, never a subdirectory. When `catalog_dir` is set in `config.yaml`, that directory is read **alone**: no embedded catalog and no merge. See [Catalog format](https://opod.io/docs/core-reference/catalog/) for the schema. ```bash opod catalog export /tmp/cat cp /tmp/cat/llama-3.2-3b.yaml ~/.opod/catalog/llama-3.2-3b.yaml $EDITOR ~/.opod/catalog/llama-3.2-3b.yaml # change context_window, say opod model info llama-3.2-3b # now shows your entry ``` ### Signatures and exported files With `OPOD_CATALOG_PUBKEY` set, a file in an override directory that has `FILE.minisig` beside it must verify, and with `OPOD_CATALOG_REQUIRE_SIGNED=1` an unsigned file is refused too. A file that is byte for byte an embedded entry, under the same file name, counts as the embedded catalog: it needs no signature, even with `OPOD_CATALOG_REQUIRE_SIGNED=1`. Once you edit it, or rename it, the signature policy applies to it like any other file. ## Errors and exit codes | Situation | Output | Exit | | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---- | | No sub-command | The help text, on stderr. | `2` | | `export` with no `DIR` | The help text, on stderr. | `2` | | Unknown sub-command | `opod: unknown subcommand: catalog `, a "Did you mean" hint when one is close, and `Run opod catalog --help for usage.` | `1` | | `DIR` cannot be created or written | `error: ` | `1` | | An embedded entry fails to parse or has no `id` (a broken build) | `error: bundled catalog : …` | `1` | --- title: "opod fetch" description: "Download one GGUF file or a safetensors snapshot from Hugging Face into a models directory, exclusively, atomically and resumably, with no leader." url: "https://opod.io/docs/core-cli/fetch/" markdown_url: "https://opod.io/docs/core-cli/fetch.md" section: "Core CLI" last_updated: "2026-10-30" --- # opod fetch > Download one GGUF file or a safetensors snapshot from Hugging Face into a models directory, exclusively, atomically and resumably, with no leader. ## In short `opod fetch` downloads model weights into a models directory, exclusively and atomically: a per-file lock, a temporary file, and a rename only once the file is complete and verified. It needs no leader, so a manager runs it as a prefetch job before a worker starts on the node. ```bash opod fetch bartowski/Llama-3.2-3B-Instruct-GGUF Llama-3.2-3B-Instruct-Q4_K_M.gguf --dir /data/models opod fetch --snapshot Qwen/Qwen2.5-7B-Instruct@a09a354 --dir /data/models ``` ## Usage ```text opod fetch HF_REPO FILE [--dir DIR] [--revision REV] [--sha256 DIGEST] opod fetch --snapshot HF_REPO[@REV] [--dir DIR] [--revision REV] ``` `opod fetch` makes model weights present in a models directory. It needs no leader, no config file and no store. It is the same pull a worker runs before it starts an engine, so a manager can run it as a **prefetch** job on a node before any worker pod starts there, and the worker then finds the weights warm. | Form | Fetches | For | | ------------------------------------- | ---------------------------------------------------- | ------------ | | `opod fetch HF_REPO FILE` | One file, normally a `.gguf`. | llama.cpp | | `opod fetch --snapshot HF_REPO[@REV]` | The file set a safetensors engine loads from a repo. | vLLM, SGLang | ## Flags | Flag | Default | Effect | | -------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `--dir DIR` | `$OPOD_MODELS_DIR` | The models directory. Required one way or the other. | | `--revision REV` | `$OPOD_MODEL_REVISION` | A commit sha, tag or branch. Empty means `main`, which moves when the repo owner pushes. A revision with a `/` or `..` is refused. | | `--sha256 DIGEST` | `$OPOD_MODEL_SHA256` | The SHA-256 the file must have, hex. A mismatch removes the file and fails. One file only. | | `--snapshot HF_REPO[@REV]` | — | Fetch a snapshot instead of one file. | Flags may come before or after the positional arguments. `FILE` must be a bare file name: no `/` and no `..`. ```bash opod fetch bartowski/Llama-3.2-3B-Instruct-GGUF Llama-3.2-3B-Instruct-Q4_K_M.gguf --dir /data/models opod fetch bartowski/Llama-3.2-3B-Instruct-GGUF Llama-3.2-3B-Instruct-Q4_K_M.gguf \ --dir /data/models --revision 5ab33fa --sha256 6c1a2b… opod fetch --snapshot Qwen/Qwen2.5-7B-Instruct@a09a354 --dir /data/models ``` On success it prints the path of the weights on stdout, one line, and exits `0`. Logs go to stderr as text lines. From core v0.4.6 they are one human line per event (`▶ fetching file (url=…, to=…)`, `▶ already cached (path=…)`), a long download adds `▶ still fetching (done=12.3 of 40.1 GiB (30%))` every 30 seconds, and `--log-format json` gives structured lines for a log collector instead. ```text /data/models/Llama-3.2-3B-Instruct-Q4_K_M.gguf /data/models/Qwen-Qwen2.5-7B-Instruct@a09a354 ``` ### Revisions with `--snapshot` - A revision after `@` is the explicit one. It wins over `$OPOD_MODEL_REVISION`. - A revision after `@` that disagrees with a typed `--revision` is refused: `error: --snapshot names revision "a" and --revision names "b": say it once`. - `--snapshot repo@` (an empty revision) is refused: `error: --snapshot wants [@revision], got "repo@"`. - A snapshot takes no `--sha256`: one digest cannot describe a set of files. Pin the revision to a commit sha instead; each weight file is checked against the SHA-256 the Hub records for it. A typed `--sha256` is refused; a `$OPOD_MODEL_SHA256` in the environment is ignored for a snapshot. ## Where the weights go | What | Path | | ---------------- | ------------------------------------------------------------------ | | An unpinned file | `DIR/FILE` | | A pinned file | `DIR/@/FILE` | | A snapshot | `DIR/@/` (an unpinned snapshot is under `…@main/`) | The slug is the repo name with every character other than a letter, a digit, `-`, `.` or `_` replaced by `-`, and leading and trailing `-` removed: `Qwen/Qwen2.5-7B-Instruct` → `Qwen-Qwen2.5-7B-Instruct`. So two revisions of one model can be cached side by side. Beside each file opod writes a few small files of its own: | File | Purpose | | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `FILE.opod` | The **marker**: JSON with the repo, file, size, digest, fetch time and last-use time. [`opod cache prune`](https://opod.io/docs/core-cli/cache/) deletes only files that have one. | | `FILE.lock` | The per-file lock, present while a pull runs. | | `FILE.partial-…` | The download in progress. | | `.opod-snapshot.json` | In a snapshot directory: the manifest, written last. The directory counts as a complete snapshot only when it exists and every file it names is present at its size. | ## What happens For one file: 1. **Size.** A `HEAD` to the Hub (30-second limit) gives the file's size. With no answer (offline, a mirror without `HEAD`), the size is unknown. 2. **Already there?** A file that is present, not empty, and of the right size — or of any size when the size is unknown — counts as complete. With `--sha256`, its digest is checked (once; the marker remembers a match). opod records the use for least-recently-used pruning and prints the path. No download. 3. **Lock.** It creates `FILE.lock` exclusively. When another process holds it, it waits until that process finishes the file (then returns its result) or the lock goes away. A lock whose holder died is taken over at once. An old-style lock with no live holder is replaced after 6 hours. 4. **Download.** It writes to a `FILE.partial-…` sibling. When a partial is there from an earlier attempt, it resumes with an HTTP `Range` request; a server that ignores `Range` starts over. 5. **Check and rename.** Only when the byte count matches the server's, and the digest matches when one was given, is the partial renamed to `FILE`. A reader never sees a half file under the final name. 6. **Marker.** It writes `FILE.opod`. A marker that cannot be written only warns: `cache marker not written: this file will never be pruned`. For a snapshot: 1. It lists the repo at the revision through the Hub API and resolves the revision to a commit. 2. It chooses the files an engine loads, from the **top level** of the repo only: - one weight format: `.safetensors` when there is any, else PyTorch (`.bin`, `.pt`, `.pth`), never both; - `consolidated*.safetensors` is dropped when `model*.safetensors` exists (the same tensors twice); - training files are dropped: `training_args.bin`, `optimizer.bin`, `optimizer.pt`, `scheduler.pt`, `scaler.pt`, `rng_state.pth`; - side files by extension: `.json`, `.txt`, `.model`, `.tiktoken`, `.jinja`, `.py`; - nothing else: no subdirectories (`original/`, `onnx/`, `gguf/` hold the model in other formats), no READMEs, no images, no empty files, no `.gguf`. 3. It fetches each chosen file as above, with the same lock and the same atomic rename, and checks each weight file against the Hub's SHA-256. 4. It writes `.opod-snapshot.json` last. A vLLM or SGLang worker that finds a complete snapshot of its model at this path serves from it and does not pull at launch. ## Guarantees - **Exclusive.** One pull per file, whatever the number of callers. The others wait and share its result. - **Atomic.** No partial file under the final name, ever. - **Idempotent.** Run it twice and the second run downloads nothing. - **Resumable.** `SIGINT` or `SIGTERM` (what Kubernetes sends a deleted pod) cancels the pull cleanly: the lock is released and the partial is kept, so the next attempt resumes at once. - **Owned.** Only files opod fetched carry a marker, and only those can ever be pruned. ## Hub errors A refusal by the Hub fails by name, so a manager can say what to fix: | Error | Meaning | Fix | | ------------------- | ----------------------------------------------------------- | -------------------------------------------------------- | | `hub-token-missing` | No `HF_TOKEN`, and the repo is gated or private. | Set `HF_TOKEN`. | | `hub-token-refused` | The token is not accepted. | Mint a new token. | | `hub-access-denied` | The token is valid, but its account may not read this repo. | Accept the model's licence on the Hub with that account. | `HF_TOKEN` is the Hugging Face token, sent as `Authorization: Bearer`. `HF_ENDPOINT` points at a mirror (default `https://huggingface.co`). A digest mismatch reads `fetch: … the cached FILE hashes to sha256:…, not the sha256:… this version records` for a cached file, and removes a freshly downloaded one. ## Result file With `OPOD_FETCH_RESULT=PATH`, a successful fetch also writes one JSON line to `PATH` (mode `0644`), only once the weights are in place: ```json {"path":"/data/models/Qwen-Qwen2.5-7B-Instruct@a09a354","signature":{…}} ``` `signature` says whether the repository publishes a model-transparency signature (`model.sig`): `unsigned`, `unverified` or `unknown`. It is looked for, never verified, so it never reads as a pass. In Kubernetes, point `OPOD_FETCH_RESULT` at `/dev/termination-log` to read the result from the pod status. A failure to write the file only warns (`fetch result not written`); the fetch still succeeds. From core v0.4.6 the warning names the file, the error and where the weights are. The typed shape is `FetchResult` in core's [`pkg/adminapi`](https://github.com/opod-io/opod-core/tree/main/pkg/adminapi). ## Exit codes | Code | Meaning | | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `0` | The weights are in place. | | `1` | The fetch failed: `error: fetch: …` on stderr (`opod: fetch: …` from core v0.4.6). A Hub that does not answer says `cannot reach the Hub at (HF_ENDPOINT, or the default) … — check the address and the network, or unset HF_ENDPOINT`. | | `2` | Usage error (the usage text on stderr), a bad `--snapshot` argument, or no `--dir` and no `OPOD_MODELS_DIR` (`error: --dir or OPOD_MODELS_DIR required`). | --- title: "opod cache" description: "List a node's weight cache, prune what no plan references without touching files opod did not fetch, and keep a disk KV-cache tier under a size bound." url: "https://opod.io/docs/core-cli/cache/" markdown_url: "https://opod.io/docs/core-cli/cache.md" section: "Core CLI" last_updated: "2026-10-30" --- # opod cache > List a node's weight cache, prune what no plan references without touching files opod did not fetch, and keep a disk KV-cache tier under a size bound. ## In short `opod cache` lists and reclaims the space model weights take on a node. It only ever deletes files opod itself fetched (they carry a marker), and it is a dry run unless you pass `--apply`. `kv-prune` keeps a disk KV-cache tier under a size cap. It runs on the node with no leader. ```bash opod cache prune --dir /data/models # what would go opod cache prune --dir /data/models --apply # remove it ``` ```text would remove Llama-3.2-3B-Instruct-Q4_K_M.gguf 1.9 GB (last used 31h0m0s ago) would remove 1 item(s), 1.9 GB; kept 2 referenced or recent; left 1 file(s) this cache did not write (my-own-model.gguf) ``` ## Usage ```text opod cache ls [--dir DIR] [--json] opod cache prune [--dir DIR] [--keep a,b] [--min-age 24h] [--target-free GB] [--sweep 24h] [--apply] [--json] opod cache kv-prune --dir DIR --max-gb N [--keep a,b] [--every 10s] [--apply] [--json] ``` Models are pulled once per node into the models directory and shared by every worker on it. Nothing deletes from that directory on its own, so a node fills up. `opod cache` reclaims the space safely. It runs on the node, without a leader, a config file or a store. A manager runs `prune` as a job and passes the files its plans still reference. Two facts make a delete safe: - **A marker.** [`opod fetch`](https://opod.io/docs/core-cli/fetch/) and every worker pull write `FILE.opod` beside each file they fetch. A prune only ever considers files with a marker. Everything else on the volume is the owner's and is never touched, whatever it looks like. - **The download lock.** A prune takes the same per-file lock a download takes, so a prune and a pull never race. Whoever gets the lock goes first. ## opod cache ls What is cached, which entries opod fetched, their size and when each was last used. | Flag | Default | Effect | | ----------- | ------------------ | ------------------------ | | `--dir DIR` | `$OPOD_MODELS_DIR` | The models directory. | | `--json` | off | A JSON array of entries. | ```bash opod cache ls --dir /data/models ``` ```text Llama-3.2-3B-Instruct-Q4_K_M.gguf 1.9 GB opod last used 3h12m0s ago Qwen-Qwen2.5-7B-Instruct@a09a354/ (snapshot, 14 files) 14.2 GB opod last used 26h4m0s ago my-own-model.gguf 4.1 GB not ours last used never recorded ``` One line per entry: the name, the size in GiB, `opod` or `not ours`, and the last use. A file pinned to a revision is named `@/FILE` and listed by itself. A safetensors snapshot is **one** entry with the directory's total size, because an engine loads the whole directory. opod's own bookkeeping files (`*.opod`, `*.lock`, `*.partial-*`, `*.trash-*`) are not listed. A directory that is not a `@` revision directory is not looked into. ### JSON fields | Field | Meaning | | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | `path` | Absolute path. | | `file` | Name relative to `--dir`: `a.gguf`, `@/a.gguf`, or `@` for a snapshot. | | `repo` | The Hugging Face repo, from the marker. | | `size` | Bytes; for a snapshot, the sum of its files. | | `ours` | `true` when opod fetched it. Only these can be pruned. A snapshot is ours only when its manifest reads and **every** file in it has a marker. | | `fetchedAt`, `lastUsedAt` | From the marker. A worker or a fetch that finds the file records a use. | | `revision` | Set for anything under a revision directory. | | `snapshot`, `files` | A snapshot directory, and how many files it holds. | ## opod cache prune Remove cached entries that are opod's, that no one references, and that have not been used for a while. **A dry run unless you pass `--apply`.** | Flag | Default | Effect | | ------------------ | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--dir DIR` | `$OPOD_MODELS_DIR` | The models directory. | | `--keep a,b` | — | Entries that must survive, comma-separated (below). | | `--min-age D` | `24h` | Leave entries used more recently than this, so a rollback finds its weights warm. | | `--target-free GB` | `0` | Stop once the volume has this many GB free. `0` removes every prunable entry. | | `--sweep D` | `24h` | With `--apply`, also clear the leftovers of crashed pulls (temp files and locks nothing writes any more) older than this. `0` turns it off. Without `--apply` there is no sweep. | | `--apply` | off | Actually delete. | | `--json` | off | One JSON result object. | ### What `--keep` matches - A **bare file name** (`a.gguf`) keeps that file wherever it is cached: at the top and under every revision. - A **path under `--dir`** (`org-model@rev/a.gguf`) keeps exactly that entry. - A **snapshot** is kept by its directory name (`Qwen-Qwen2.5-7B-Instruct@a09a354`, bare or as a path) or by the path of any file inside it. Never by a bare file name, since every snapshot holds a `config.json`. The manager computes this list: every file a plan, a job, an in-flight prefetch or a staged model version on this node references. `prune` trusts it. ### Rules 1. Only entries with opod's marker are considered. A file opod did not fetch is never deleted, whatever the disk pressure; the summary names it. 2. Entries used within `--min-age` and entries on the keep list are kept. 3. The least recently used entries go first. 4. With `--target-free`, the prune stops as soon as the volume has that much free. 5. Each removal takes the file's download lock. A file a pull holds is left for the next run. A lock whose holder died is taken over. 6. A safetensors snapshot goes **whole**, under every one of its files' locks, or stays whole. The manifest is removed first, so an engine that starts mid-prune pulls for itself instead of loading a directory that is losing files. One file in it that opod did not write leaves the whole directory alone. 7. A removal renames the file to `.trash-…` and then unlinks it, so a reader that opened it a moment earlier keeps reading. ```bash opod cache prune --dir /data/models # what would go opod cache prune --dir /data/models --keep Qwen-Qwen2.5-7B-Instruct@a09a354 --apply opod cache prune --dir /data/models --target-free 100 --min-age 72h --apply ``` ```text would remove Llama-3.2-3B-Instruct-Q4_K_M.gguf 1.9 GB (last used 31h0m0s ago) would remove 1 item(s), 1.9 GB; kept 2 referenced or recent; left 1 file(s) this cache did not write (my-own-model.gguf) dry run: pass --apply to delete ``` With `--apply`, `would remove` reads `removed`, the last line is gone, and a sweep that cleared anything says `swept N leftover(s) of crashed pulls` on stderr. ### JSON result | Field | Meaning | | ------------------------- | ----------------------------------------------------------- | | `removed` | The entries removed, or that would be (same shape as `ls`). | | `freedBytes` | Bytes freed, or that would be. | | `kept` | Entries kept because referenced or recent. | | `skipped` | Files that are not opod's, by name. | | `dryRun` | `true` without `--apply`. | | `totalBytes`, `freeBytes` | The volume holding the cache, measured where the prune ran. | | `volumeErr` | Why the volume could not be measured, when it could not. | | `swept` | Leftovers cleared by `--sweep`. | > **A full node** > > On a node whose disk is full, the kubelet admits only pods of priority `system-cluster-critical` and above, so a prune job of normal priority cannot start on the node that needs it most. Give the prune job a priority class that is admitted under disk pressure. ## opod cache kv-prune Bound a disk KV-cache tier: the directory an engine writes KV blocks to (the `kv_tier_fs` engine flag). The engine never deletes from it, so something must. A manager runs this beside the engine, for as long as the engine writes the directory. | Flag | Default | Effect | | ------------ | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | `--dir DIR` | — | The tier directory. Required. | | `--max-gb N` | — | Cap on the tier's files, in GiB; decimals are allowed. Required. `0` removes everything but the `--keep` entries. | | `--keep a,b` | — | Top-level entries of `--dir` that are never touched. | | `--every D` | `0` (once) | Repeat at this idle interval until stopped (`SIGINT` or `SIGTERM`). While the tier grows or is being trimmed, the next pass follows within 1 second. | | `--apply` | off | Actually delete. | | `--json` | off | One JSON object per pass. | ```bash opod cache kv-prune --dir /data/kvtier/ep --max-gb 100 # one dry pass opod cache kv-prune --dir /data/kvtier/ep --max-gb 100 --every 10s --apply # keep it bounded ``` ```text /data/kvtier/ep: 103.40 GiB in the tier; removed 812 file(s), 13.42 GiB (walk 41 ms, remove 220 ms) ``` How a pass works: 1. It walks `--dir` and counts only the tier's own files: `*.bin` (blocks), `*.tmp` (blocks being written) and `config.json`. 2. When the total is above `--max-gb`, it removes the oldest files first until the total is at **90 %** of `--max-gb`, so the next burst does not trip the cap at once. - From core v0.4.7, with `--every`, a pass also counts the growth since the previous pass as already written (at most half of `--max-gb`). It trims when the total plus that growth is above `--max-gb`, down to 90 % less the growth, so a tier that a burst keeps filling is trimmed ahead of it. The growth is measured from one pass to the next, so in core v0.4.7 a burst that starts while the pruner is idle (one pass every `--every`) is not trimmed ahead: on NFS, two writers took a tier capped at 0.85 GiB to 1.07 GiB before the first trim, 10 s after the burst began. - From core v0.4.8, while idle the loop also reads the volume's free space every second (one `statfs` call, not a walk) and runs a pass at once when it has dropped by a twentieth of `--max-gb`. The same two-writer burst then peaked at 0.95–1.08 × the cap in four runs. Another writer on the same volume only brings a pass forward. - From core v0.4.7, a pass lists up to 32 directories at once. On a network filesystem (NFS) each listing is a round trip, and vLLM puts almost every block in its own directory: a one-at-a-time pass took 3.7 s for 3,362 blocks on NFS, long enough for two writers to take a 1 GiB tier to 2.28 GiB. 3. Entries named in `--keep` are never touched. With `--every`, a pass that removes nothing prints nothing (except with `--json`), and a failed pass prints `error: …` and the next pass tries again. A single pass that fails exits `1`. JSON per pass: `dir`, `dryRun`, `usedBytes` (before the pass), `removed` (files), `freedBytes`, `totalBytes` and `freeBytes` (the volume), `volumeErr`, `walkMs`, `removeMs`. A pass much longer than `--every` is how a burst outruns the cap. ## Exit codes | Code | Meaning | | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `0` | Done (or a dry run). | | `1` | An error: `error: …` on stderr. | | `2` | No `--dir` and no `$OPOD_MODELS_DIR` (`error: --dir or OPOD_MODELS_DIR required`), or, for `kv-prune`, no `--dir` or no `--max-gb` (`error: --dir and --max-gb are required`). | From core v0.4.6: - Every message starts with `opod:`, and `kv-prune` names the flag it lacks (`needs --dir, the tier directory` or `needs --max-gb, the tier's cap in GiB`). An extra argument is a usage error. - Sizes are labelled **GiB**, which is what they always were (bytes ÷ 2³⁰). - `ls` on an empty cache says `(no weights cached in )`. - `prune`'s dry run says it does not sweep crashed pulls; with `--apply` the sweep's count is on stdout with the summary, and a failed sweep is a warning. - `kv-prune` on a directory that does not exist warns (`… does not exist — nothing to prune`) and still exits `0` with its result — a sweep may find a tier already gone. With `--every` it prints a start line, waits for the directory the engine creates (warning every 10 minutes while it is missing, so a mistyped `--dir` shows), and prints an idle pass at most once a minute. - `--json` stays one object per line: a control plane reads the last line that starts with `{`. --- title: "opod image" description: "List the container images opod publishes, show one image's node requirements and limits, and find the image that serves a model, offline." url: "https://opod.io/docs/core-cli/image/" markdown_url: "https://opod.io/docs/core-cli/image.md" section: "Core CLI" last_updated: "2026-11-02" --- # opod image > List the container images opod publishes, show one image's node requirements and limits, and find the image that serves a model, offline. ## In short `opod image` answers which container image runs which engine on which accelerator, from a list embedded in the binary. `recommend` picks the image for a catalog model. It needs no registry, no config and no leader, so it gives the same answer everywhere. ```bash opod image recommend llama-3.1-8b --vendor nvidia ``` ```text llama-3.1-8b — weights: safetensors, min VRAM 20 GB IMAGE ENGINE VENDOR ARCH GANG PROVEN ★ opod-worker-vllm-nvidia vllm nvidia amd64 ray yes ``` ## Usage ```text opod image ls [--engine E] [--vendor V] [--json] opod image show IMAGE [--json] opod image recommend MODEL [--vendor V] [--json] ``` The list of published images is data embedded in the binary (`images/images.yaml` in the core repository). These commands read only that list and the embedded catalog. They open no config file, no store and no registry, so they give the same answer on a laptop, in CI and to an agent that plans a deployment. | Sub-command | Aliases | | ----------- | ------- | | `ls` | `list` | | `show` | `info` | | `recommend` | `for` | Every sub-command takes `--json`, anywhere on the line. **Vendors:** `nvidia`, `amd`, `intel`, `tt` (Tenstorrent), `cpu`. `tenstorrent` is accepted for `tt` and `none` for `cpu`. **Engines:** `llamacpp`, `mlx`, `ollama`, `sglang`, `trtllm`, `vllm`, and their aliases (`llama-cpp`, `sgl`, `tensorrt-llm`, `tt`, …). Only `llamacpp`, `vllm`, `sglang` and `trtllm` have images; `ollama` and `mlx` run on a host started with `opod up`. ## opod image ls | Flag | Default | Effect | | ------------ | ------- | ------------------------------------------------------------------- | | `--engine E` | all | Only worker images of this engine. An alias resolves to its engine. | | `--vendor V` | all | Only worker images for this vendor. | | `--json` | off | A JSON array of images. | A filter matches worker images only, since the leader has no engine and no vendor. ```bash opod image ls ``` ```text IMAGE ENGINE VENDOR ARCH GANG PROVEN opod-leader - - amd64,arm64 - yes opod-worker-llamacpp-nvidia llamacpp nvidia amd64 rpc yes opod-worker-llamacpp-amd llamacpp amd amd64 rpc yes opod-worker-llamacpp-intel llamacpp intel amd64 rpc yes opod-worker-llamacpp-cpu llamacpp cpu amd64,arm64 rpc yes opod-worker-vllm-nvidia vllm nvidia amd64 ray yes opod-worker-vllm-amd vllm amd amd64 - yes opod-worker-vllm-intel vllm intel amd64 - no opod-worker-vllm-tt vllm tt amd64 - yes opod-worker-sglang-nvidia sglang nvidia amd64 - yes opod-worker-sglang-amd sglang amd amd64 - no opod-worker-sglang-intel sglang intel amd64 - no nvcr-trtllm-nvidia trtllm nvidia amd64,arm64 - yes Tip: `opod image show ` for node requirements and limits. `opod image recommend ` to pick one. ``` | Column | Meaning | | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ARCH` | The platforms the image is published for. | | `GANG` | How a worker on this image joins a model split across nodes: `rpc` (a llama.cpp RPC part), `ray` (vLLM multi-node), `-` (the manifest names no scheme). | | `PROVEN` | `yes` once the image has served requests on the hardware it names. `no` means built and published, not yet run on that hardware. | > **SGLang gangs** > > The SGLang images read `-` in `GANG`, but they do form multi-node gangs, through SGLang's own launcher (`--dist-init-addr`, `--nnodes`, `--node-rank`; rank 0 serves). The manifest's `gang` field accepts only `rpc` and `ray`, so the column cannot say it. The image's own notes say the same. ```bash opod image ls --vendor amd --json opod image ls --engine vllm opod image ls --vendor tenstorrent ``` When nothing matches, it exits `1` with `opod: no image matches (vendors: …; engines with an image: …)`. With `--json`, an empty match prints `[]` and exits `0`. From core v0.4.6, a `--vendor` or `--engine` no image is built for is a usage error in both views, `no image is built for vendor "foo" (vendors: …)`, exit `2`; a real filter with no match prints `[]` and exits `1` under `--json` too, so the exit code says the same thing in both. `--engine` lists only engines with an image, an extra argument to `ls` is refused, and `image show` with part of a name (`vllm-nvidi`) suggests the full one. ## opod image show ```bash opod image show vllm-nvidia ``` ```text opod-worker-vllm-nvidia vLLM on CUDA. … pull ghcr.io/opod-io/opod-worker-vllm-nvidia:0.21.0 role worker engine vllm vendor nvidia hardware NVIDIA GPUs (CUDA) platforms amd64 weights safetensors gang ray — vLLM multi-node proven yes — has served on this hardware base vllm/vllm-openai:… dockerfile images/worker-vllm/Dockerfile The node must provide - … Limits - … Pin it by digest before deploying: crane digest ghcr.io/opod-io/opod-worker-vllm-nvidia: ``` `IMAGE` may be: - the full name: `opod-worker-vllm-nvidia`; - the name without `opod-` or `opod-worker-`: `vllm-nvidia`, `leader`; - a repository path: anything up to the last `/` is dropped, so `ghcr.io/opod-io/opod-worker-vllm-nvidia` works. Matching ignores case. An unknown name prints `opod: no image "…"` with a "Did you mean" hint when one is close, else ``opod: no image "…" (run `opod image ls`)``. The `pull` line names a tag only on a release binary, whose version is `X.Y.Z`. A dev build prints the repository with no tag and says so: releases are tagged `X.Y.Z` and there is no floating `latest`. The `gang` line reads `rpc — a part of a llama.cpp RPC split across nodes (label io.opod.llamacpp.rpc=true)`, `ray — vLLM multi-node`, or `one node only`. ### Upstream images `nvcr-trtllm-nvidia` is run exactly as NVIDIA publishes it (`upstream: true`). NVIDIA's container licence forbids a derived copy, so opod never rebuilds or pushes it, it has no Dockerfile, and its repository is `nvcr.io/nvidia/tensorrt-llm/release`, not ghcr. The manager copies the `opod` binary and entrypoint into it at start from the leader image. Pulling it means accepting NVIDIA's terms. ## opod image recommend | Argument / flag | Effect | | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `MODEL` | A catalog id from the **embedded** catalog, or a scheme id `opod model add` takes: `hf:/`, `file:`, `ollama:`. Override directories are not read, so the answer does not depend on the machine. | | `--vendor V` | Only that vendor's images. A vendor with no image is refused: `opod: no image is built for vendor "…" (vendors: …)`. | | `--json` | The recommendation as JSON. | ```bash opod image recommend llama-3.1-8b --vendor nvidia opod image recommend hf:Qwen/Qwen2.5-7B-Instruct --json opod image recommend llama-3.3-70b-sharded ``` ```text llama-3.1-8b — weights: safetensors, min VRAM 20 GB IMAGE ENGINE VENDOR ARCH GANG PROVEN ★ opod-worker-vllm-nvidia vllm nvidia amd64 ray yes ★ = the pick for that vendor: the model's first recommended engine with an image, proven hardware first. Every endpoint also runs one opod-leader. `opod image show ` lists what the node must provide. ``` How it decides, step by step: 1. **Weights.** The entry's source sets the format: a `.gguf` file → `gguf`; a Hugging Face repo with no file → `safetensors`; an Ollama-library entry → `ollama`, which no image pulls. 2. **Engines, in order.** It walks the entry's `recommended_engines`. A scheme id has none, so every engine with an image is tried. 3. For each engine it skips, with a reason under "Not offered": - an engine with no worker image (`ollama`, `mlx`): ``no worker image runs …; it serves on a host started with `opod up` ``; - for an entry that must be split, an engine other than its `sharding.engine`: `the entry is split across workers by …`; - an engine that does not load these weights: `vllm loads safetensors; this entry's weights are a GGUF file`; - with `--vendor`, an engine with no image for that vendor; - for an entry that must be split, an image with no gang scheme: `the entry must be split across workers and this image serves one node only`. 4. **Order and star.** Candidates keep the engine order; within an engine, proven images come before unproven ones. The first candidate of each vendor gets `★` (`"recommended": true` in JSON). When no image fits, it prints `No published image can serve this entry.` and still exits `0`. An id that is neither in the embedded catalog nor a scheme id exits `1` with ``opod: no catalog entry for "…" (try `opod model search`, or hf:/)``. It is a lookup, not a measurement. Whether the model fits a card is `min_vram_gb` (`opod model info ID`) and your decision. > **Sharded SGLang entries** > > Because the SGLang images carry no `gang` value, `recommend` skips them for an entry that must be split, even when that entry's `sharding.engine` is `sglang`. Read the image notes, or choose the image by hand. ## JSON fields `ls --json` prints an array of image objects; `show --json` prints one. | Field | Meaning | | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `name` | Image name. | | `repository` | `ghcr.io/opod-io/`; for an upstream image, its base without the tag. | | `tag` | This binary's version, on a release binary only. | | `role` | `leader` or `worker`. | | `engine`, `vendor` | Absent on the leader. | | `arch` | Platforms. | | `dockerfile` | Path in the core repository; empty for an upstream image. | | `base` | The upstream image, tag without digest. | | `weights` | `gguf`, `safetensors`, or both. | | `gang` | `rpc`, `ray`, or absent. | | `proven` | Boolean. | | `hardware` | Free text: the cards it is built for. | | `families` | GPU architecture generations, for example `nvidia:ampere`, `amd:rdna3`. Absent = unknown, not "none". The image carries the same tokens in its `io.opod.gpu.families` label from `0.3.0`; the published `0.2.1` images have no such label, so a control plane reads them as unknown. | | `requires` | What the node must provide (driver, runtime, device files). | | `upstream` | `true` for an image run as its vendor publishes it. | | `summary`, `notes` | One line, and the limits to know before choosing it. | `recommend --json` prints: ```json { "model": "llama-3.1-8b", "weights": "safetensors", "engines": ["vllm"], "sharded": false, "candidates": [ { "name": "opod-worker-vllm-nvidia", "…": "…", "recommended": true } ], "min_vram_gb": 20, "min_ram_gb": 32 } ``` `shard_by` is present when `sharded` is `true`. `skipped`, `min_vram_gb` and `min_ram_gb` are left out when empty or zero. ## Pin by digest There is no floating `latest` tag. Pin what you deploy: ```bash crane digest ghcr.io/opod-io/opod-worker-vllm-nvidia: docker buildx imagetools inspect ghcr.io/opod-io/opod-worker-vllm-nvidia: ``` See [Images](https://opod.io/docs/core-reference/images/) for each image's details and the container contract. --- title: "opod batch" description: "Run an OpenAI batch input file against any OpenAI-compatible URL at bounded concurrency, resumably, never sending a line twice." url: "https://opod.io/docs/core-cli/batch/" markdown_url: "https://opod.io/docs/core-cli/batch.md" section: "Core CLI" last_updated: "2026-10-30" --- # opod batch > Run an OpenAI batch input file against any OpenAI-compatible URL at bounded concurrency, resumably, never sending a line twice. ## In short `opod batch run` sends an OpenAI batch file (JSONL, one request per line) to any OpenAI-compatible URL at bounded concurrency. It keeps its progress in a work directory, so a stopped run resumes on the same directory and never sends a line twice. It needs no leader and no store. ```bash export OPOD_API_KEY=sk-orc- opod batch run --input requests.jsonl --base-url http://leader:8080 --dir ./run1 ``` ```json {"progress": {"total": 1000, "completed": 420, "failed": 3}} {"batch": {"total": 1000, "completed": 997, "failed": 3, "interrupted": 0, "state": "completed", "output": "run1/output.jsonl", "errors": "run1/errors.jsonl"}} ``` ## Usage ```text opod batch run (--input FILE|URL | --input-url PRESIGNED_URL) --base-url URL --dir WORKDIR [options] ``` `opod batch run` is a generic OpenAI batch client. It reads a file in OpenAI's batch line format (one JSON object per line with `custom_id`, `method`, `url`, `body`), sends each line to an OpenAI-compatible server, and writes OpenAI's batch output shape. It needs no leader and no store: point it at an opod leader or any other server. ## Flags | Flag | Default | Effect | | ----------------------- | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | | `--input FILE\|URL` | — | The input: a JSONL path, or an `http(s)` URL read with the key (for example an OpenAI files content URL). | | `--input-url URL` | `$OPOD_BATCH_INPUT_URL` | The input as a URL that carries its own authorization (a presigned GET). Read **without** the key. Give `--input` or `--input-url`, not both. | | `--base-url URL` | `$OPOD_BASE_URL` | The server, with or without `/v1`. Required. | | `--dir DIR` | — | Work directory: the progress record and the result files. Required. | | `--concurrency N` | `8` | Requests in flight at once. | | `--file-order` | off | Send lines in file order. By default lines that share a leading prompt are sent together, so the engine's prefix cache reuses it. | | `--model-map a=b[,c=d]` | — | Rewrite a line's `model`. Other models are sent as written. | | `--ca FILE` | `$OPOD_LEADER_CA` | PEM certificate an `https` base URL must be signed by. | | `--timeout D` | `10m` | Per-request timeout. | | `--ready-timeout D` | `0` | Wait up to this long for `GET /v1/models` to accept the key before the first line. `0` does not wait. | | `--drain D` | `20s` | After a stop, how long in-flight requests may finish. | | `--status-url URL` | — | An OpenAI batch object (`…/v1/batches/`), read with the key on `SIGTERM`. | | `--output-url URL` | `$OPOD_BATCH_OUTPUT_URL` | `PUT` `output.jsonl` here when the run ends. A URL that carries its own authorization. | | `--error-url URL` | `$OPOD_BATCH_ERROR_URL` | `PUT` `errors.jsonl` here when the run ends. | | `--progress-every D` | `5s` | How often a progress line is printed. `0` = never. | The key comes from `OPOD_API_KEY`, else `OPENAI_API_KEY`, and is sent as `Authorization: Bearer`. With neither set, requests go out with no key. `--base-url` may end in `/v1` or not; a line's `url` of `/v1/chat/completions` is joined to it without doubling the `/v1`. ```bash export OPOD_API_KEY=sk-orc- opod batch run --input requests.jsonl --base-url http://leader:8080 --dir ./run1 opod batch run --input requests.jsonl --base-url http://leader:8080/v1 --dir ./run2 \ --concurrency 32 --model-map gpt-4o-mini=llama-3.2-3b ``` More flags, one per line: ```bash opod batch run --input requests.jsonl --base-url https://leader.example.com --dir ./run3 \ --ca /etc/opod/ca.crt \ --file-order \ --timeout 2m \ --ready-timeout 10m \ --drain 1m \ --progress-every 30s # A managed job: presigned input and result URLs, and the batch's status URL for SIGTERM opod batch run --input-url "$OPOD_BATCH_INPUT_URL" --base-url http://leader:8080 --dir /work \ --output-url "https://bucket.example.com/out.jsonl?X-Amz-Signature=…" \ --error-url "https://bucket.example.com/err.jsonl?X-Amz-Signature=…" \ --status-url http://batch-api.example.com/v1/batches/batch_abc ``` ## Input lines Each non-blank line is one request in OpenAI's batch format: ```json {"custom_id": "q-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "llama-3.2-3b", "messages": [{"role": "user", "content": "hi"}]}} ``` Blank lines are skipped and not counted; line numbers stay the input's. A line longer than 64 MiB fails the whole run before anything is sent. A line that cannot be sent is not sent, and goes to `errors.jsonl` with code `invalid_request` and one of these messages: | Message | Cause | | ------------------------------------------------- | ------------------------------------------------------------------ | | `the line is not a JSON object: …` | Not JSON. | | `custom_id is required` | No `custom_id`. | | `method must be POST` | A `method` other than `POST` (an empty method is taken as `POST`). | | `url must be a path such as /v1/chat/completions` | `url` does not start with `/`. | | `body must be a JSON object` | `body` missing or not an object. | `--model-map` rewrites `body.model` before the line is sent; a bad map is refused at start: `error: --model-map "x": want alias=id[,alias=id]`. An `http(s)` `--input` (or `--input-url`) is downloaded once into the work directory as `input.jsonl` (temporary file, then rename), so a resume never reads a file that changed underneath it. `--input` sends the key with the download; `--input-url` does not, because a presigned URL is its own credential. ## The work directory The directory is the whole progress record. Run the same command on the same directory to resume. | File | Holds | | -------------- | ----------------------------------------------------------------------------------------------------------------- | | `sent.jsonl` | One `{"line":N}` per input line, written and synced **before** that line's request leaves. | | `output.jsonl` | One OpenAI output object per answered line (2xx). | | `errors.jsonl` | One object per failed line: a non-2xx answer, a transport error, a malformed line, or a line in flight at a kill. | Every result's id is `batch_req_`. One result line looks like this: ```json {"id": "batch_req_0", "custom_id": "q-1", "response": {"status_code": 200, "request_id": "…", "body": {…}}, "error": null} {"id": "batch_req_7", "custom_id": "q-8", "response": null, "error": {"code": "request_failed", "message": "…"}} ``` A non-2xx answer keeps the server's own status and body in `response`. The runner's own error codes are `invalid_request` (a malformed line), `request_failed` (a transport error or the per-request timeout), `interrupted` (in flight at a kill) and `cancelled` (cut off by a cancel). When a resume finds `input.jsonl` already in the directory, it uses it as is. **At most once.** A line recorded as sent but with no result was in flight when the previous run died. It is **not** sent again: it goes to `errors.jsonl` with code `interrupted`. Collect those `custom_id`s and submit them again if you want them retried. A lost work directory starts again from line 0. ## Output Progress lines and the final summary are JSON on stdout: ```json {"progress": {"total": 1000, "completed": 420, "failed": 3}} {"batch": {"total": 1000, "completed": 997, "failed": 3, "interrupted": 0, "state": "completed", "output": "run1/output.jsonl", "errors": "run1/errors.jsonl"}} ``` `state` is `completed`, `cancelled` or `interrupted`. With `--output-url` or `--error-url`, the summary also carries `written`. The results are uploaded even after a stop, so a stopped batch still returns what it finished. ## Signals and exit codes - `SIGINT` (Ctrl-C) cancels: no new line is sent, in-flight requests get `--drain`. - `SIGTERM` cancels only when the batch at `--status-url` is no longer `validating` or `in_progress`, or answers `401`, `403` or `404` (the batch is gone). Otherwise — including with no `--status-url`, or a status URL that does not answer — the run stops as **interrupted** and exits `75`, so a supervisor resumes it. A Kubernetes Job counts exit `0` as finished and never runs it again; `75` keeps it retrying. Uploads with `--output-url` and `--error-url` are one plain `PUT` each, with the body's length stated and no `Authorization` header (the URL is the credential). An empty result file is not uploaded; `written` says which were: `{"output": true, "errors": false}`. The upload has 10 minutes, even after a stop. A resumed run uploads again and replaces what an earlier attempt wrote. | Code | Meaning | | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `0` | Completed or cancelled. | | `1` | The run or the upload failed. | | `2` | Usage error: no input, both `--input` and `--input-url` (`error: give --input or --input-url, not both`), no `--dir` or no `--base-url`, a bad `--model-map`, or an unreadable `--ca` file. | | `75` | Interrupted; run again on the same `--dir`. | From core v0.4.6, every message starts with `opod:` (not `error:`) and names what is missing (`batch run needs --dir, the work directory it resumes from`). A run in which some lines failed still exits `0` — it completed, as an OpenAI batch does, and a Job would run it again on any other code — but stderr says `N of M line(s) failed — see /errors.jsonl`. A resumed run logs `resuming` with the lines done and the lines left. A `--ready-timeout` that runs out says which it was: `no server answering at … — check --base-url`, `… did not accept the key (401 …) — set OPOD_API_KEY (or OPENAI_API_KEY)`, or the status it answered. --- title: "opod connect, disconnect" description: "Print copy-paste settings that point a coding tool or SDK at your opod leader, and the steps to point it back. Neither command changes any file." url: "https://opod.io/docs/core-cli/connect/" markdown_url: "https://opod.io/docs/core-cli/connect.md" section: "Core CLI" last_updated: "2026-10-30" --- # opod connect, disconnect > Print copy-paste settings that point a coding tool or SDK at your opod leader, and the steps to point it back. Neither command changes any file. ## In short `opod connect CLIENT` prints the settings that point a tool (Cursor, Aider, the OpenAI SDK, `curl` and 11 more) at your leader, with your URL, model and key filled in. `opod disconnect CLIENT` prints how to undo them. Both only print text: they change no file. ```bash opod connect aider --model qwen-coder-14b ``` ```text # Aider → Opod (OpenAI API) aider \ --openai-api-base http://localhost:8080/v1 \ --openai-api-key sk-orc- \ --model openai/qwen-coder-14b … ``` ## Usage ```text opod connect CLIENT [--model ID] [--base-url URL] [--token KEY] [--retries N] opod connect --list opod disconnect CLIENT opod disconnect --list ``` Both commands only **print text** to stdout. They change no shell profile, editor setting or config file, and they call no leader. You copy what they print into the tool. ## opod connect | Flag | Default | Effect | | ---------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--list` | off | List the supported clients and exit. | | `--model ID` | `auto` | The model id written into the snippet. `auto` resolves, on the leader, to its default model (`router.default_model`). | | `--base-url URL` | see below | The opod base URL written into the snippet, without `/v1`. A trailing `/` is removed. | | `--token KEY` | see below | The API key written into the snippet. | | `--retries N` | `0` (off) | Ask the gateway to retry each candidate up to `N` times (`1` to `5`). Only the `curl` snippet carries it, as `-H "X-Opod-Num-Retries: N"`; the other clients have no per-request header setting, so the value is ignored for them. | Flags may come before or after the client name. `connect` takes exactly one client name. From core v0.4.6, a value flag with no value (`opod connect curl --retries`) is a usage error, `--retries needs a value`, where it used to take the client name as its value; and when the key is this leader's admin key (no `--token`, no `OPOD_TOKEN`), stderr says so — `give curl its own key instead: opod token create curl, then --token ` — because the snippet goes into another tool's config file. The base URL is the first of: 1. `--base-url`; 2. `$OPOD_BASE_URL`; 3. `external_url` in `config.yaml`; 4. `http://localhost` followed by `listen` (`http://localhost:8080` by default). The key is the first of: 1. `--token`; 2. `$OPOD_TOKEN`; 3. the admin key in `~/.opod/admin.key`, written by the first `opod up`. > **Do not hand out the admin key** > > With no `--token` and no `$OPOD_TOKEN`, the snippet carries the **admin** key, which can call `/admin/v1/*`. Give each person their own `user` key instead: > > ```bash > opod token create alice > opod connect cursor --token sk-orc- --model qwen-coder-14b > ``` ### Pick a client interactively With no client name, or a name that is not in the list, on an interactive terminal, `connect` opens a picker (arrow keys, Enter to choose, the typed name as the starting filter). With no terminal (a pipe, CI), it prints the help to stderr and exits `2`. ### Example ```bash opod connect aider --model qwen-coder-14b ``` ```text # Aider → Opod (OpenAI API) aider \ --openai-api-base http://localhost:8080/v1 \ --openai-api-key sk-orc- \ --model openai/qwen-coder-14b # Or set permanently in ~/.aider.conf.yml: # openai-api-base: http://localhost:8080/v1 # openai-api-key: sk-orc- # model: openai/qwen-coder-14b ``` ```bash opod connect continue --base-url http://leader.example.com:8080 --model llama-3.2-3b ``` ```text # Continue.dev → Opod (OpenAI API) # Add to ~/.continue/config.json under "models": { "title": "Opod · llama-3.2-3b", "provider": "openai", "model": "llama-3.2-3b", "apiBase": "http://leader.example.com:8080/v1", "apiKey": "sk-orc-" } ``` The `curl` snippet prints two smoke tests: the OpenAI shape (`POST /v1/chat/completions` with `Authorization: Bearer`) and the Anthropic shape (`POST /v1/messages` with `x-api-key` and `anthropic-version: 2023-06-01`). ```bash opod connect curl --retries 3 > smoke.sh && sh smoke.sh ``` ### Errors | Error | Cause | | -------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | | ``opod: no token available — set $OPOD_TOKEN, pass --token , or run `opod up` to create one`` | No `--token`, no `$OPOD_TOKEN` and no `~/.opod/admin.key`. | | `opod: --retries must be between 1 and 5 (got 9)` | `--retries` out of range. | | `opod: connect takes exactly one client name (got: a b)` | Two names. | ## Clients `opod connect --list` prints the same list with a one-line description of each. | Id | Client | Wire | | --------------- | ----------------------------- | -------- | | `cursor` | Cursor | OpenAI | | `aider` | Aider | OpenAI | | `continue` | Continue (VS Code, JetBrains) | both | | `zed` | Zed | OpenAI | | `cline` | Cline / Roo Code | both | | `openclaw` | OpenClaw | OpenAI | | `opencode` | OpenCode | both | | `open-webui` | Open WebUI | OpenAI | | `open-notebook` | Open Notebook | OpenAI | | `goose` | goose | OpenAI | | `plandex` | Plandex | OpenAI | | `openhands` | OpenHands | both | | `codex-cli` | Codex CLI | OpenAI | | `openai-sdk` | OpenAI Python / JS SDK | OpenAI | | `curl` | curl | raw HTTP | "Both" means the client can use the OpenAI shape or the Anthropic Messages shape. Opod serves `/v1/messages` on every chat model, so a tool that speaks Anthropic Messages points at the same base URL. Any other OpenAI-compatible tool works without a snippet: give it the base URL with `/v1` and a key. ```bash export OPENAI_BASE_URL=http://leader.example.com:8080/v1 export OPENAI_API_KEY=sk-orc- ``` ## opod disconnect ```bash opod disconnect aider # the unset commands for the variables connect set opod disconnect cursor # the settings steps to clear the override opod disconnect openai-sdk # remove base_url from code or env opod disconnect --list ``` ```text # Aider takes its base URL from CLI flags or env vars. # Reverse the Opod override: unset OPENAI_API_BASE unset OPENAI_API_KEY # Then run aider with your own vendor key: export OPENAI_API_KEY=sk-... # for OpenAI … ``` `disconnect` takes no flags other than `--list`, and exactly one client name. With no name it prints the help and exits `2`. An unknown name prints ``opod: disconnect: unknown client "x" (try `opod disconnect --list`)``. It never opens a picker. Afterwards the client talks to its vendor again with whatever key you give it. Nothing on the opod side changes: your keys and usage history stay on the leader, and `opod connect` points the client back at any time. --- title: "config, doctor, update, completion, version" description: "Show and locate the effective configuration, diagnose a node, update the binary, install shell completion, and print the version or the leader's feature keys." url: "https://opod.io/docs/core-cli/utilities/" markdown_url: "https://opod.io/docs/core-cli/utilities.md" section: "Core CLI" last_updated: "2026-10-30" --- # config, doctor, update, completion, version > Show and locate the effective configuration, diagnose a node, update the binary, install shell completion, and print the version or the leader's feature keys. ## In short These commands look after the binary and its settings: `config` shows the effective configuration, `doctor` checks the machine, `update` replaces the binary with a release, `completion` prints shell completion, and `version` prints the version and the feature list. ```bash opod config path opod version ``` ```text /home/opod/.opod/config.yaml opod 0.21.0 (linux/amd64, go1.26.4) ``` ## opod config ```text opod config [show [--json] | path | edit] ``` `opod config` with no sub-command is `opod config show`. | Sub-command | Does | | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `show` | The effective configuration. It asks the running leader (`GET /admin/v1/config`). When no leader answers, it prints the configuration this CLI loaded and says so. `--json` for JSON. | | `path` | Print the config file path: `~/.opod/config.yaml`. | | `edit` | Print the command to edit it, `$EDITOR` (else `vi`) and the path, then `(then restart opod for changes to take effect)`. It opens no editor. | ```bash opod config path # /home/opod/.opod/config.yaml opod config edit # Run: vi /home/opod/.opod/config.yaml # (then restart opod for changes to take effect) ``` The configuration is edited in the file or set with `OPOD_*` variables, never through the API, and a change takes effect on the next start. See [Configuration](https://opod.io/docs/core-reference/configuration/). The config file is always `~/.opod/config.yaml` in the home directory of the user that runs the command. `data_dir` (or `OPOD_DATA_DIR`) moves the store, the models and the admin key, but not the config file itself. ### From the running leader The leader returns a fixed view of the main fields, with the vLLM API key redacted: ```bash opod config show ``` ```text auth.require_keys true data_dir /home/opod/.opod engine.llamacpp_endpoint http://127.0.0.1:8089 engine.mlx_endpoint http://127.0.0.1:8080 engine.ollama_endpoint http://127.0.0.1:11434 engine.preferred ollama engine.vllm_api_key engine.vllm_endpoint http://127.0.0.1:8000 external_url listen :8080 log_level info observability.otlp_endpoint observability.otlp_status disabled (set OPOD_OTLP_ENDPOINT to a collector URL) observability.response_cache.DefaultTTLSeconds 0 observability.response_cache.Driver observability.response_cache.Enabled false observability.response_cache.MaxEntries 0 router.default_model llama-3.2-1b router.sticky_sessions true storage.dsn /home/opod/.opod/state.db storage.models_dir /home/opod/.opod/models storage.type sqlite Edit /home/opod/.opod/config.yaml or set OPOD_* env vars, then restart opod. ``` Keys are dotted and sorted. On 0.2.1 the response-cache block keeps its Go field names (`Enabled`, `Driver`, …), the edit hint names `/config.yaml`, and `--json` carries an empty `egress` object. From 0.3.0 the block reads `enabled`, `driver`, `max_entries`, `default_ttl_seconds`, the hint names the file `opod config path` prints, and `egress` is gone. `--json` prints the leader's object as is, with `edit_hint`. The view does not list every field: the full list is on [Configuration](https://opod.io/docs/core-reference/configuration/). ### With no leader It prints `(leader not reachable; showing config loaded by this CLI — secrets redacted)` on stderr, then the configuration the CLI loaded. In 0.3.0 that is the same redacted view the leader serves, in the same two forms: dotted, sorted keys, or the object as is with `--json`. Neither token is in it, and a database DSN's password reads `redacted` (on 0.2.1 the leader's view printed the DSN in clear too). > **Up to and including 0.2.1, the local fallback is not redacted** > > Despite the notice, the 0.2.1 fallback prints the whole configuration struct, with Go field names as keys, and `Auth.AdminToken` and `Auth.JoinToken` in clear when `config.yaml` or `OPOD_ADMIN_TOKEN` / `OPOD_JOIN_TOKEN` set them. Do not paste that output anywhere. A leader that answers with an error is final: `opod: config show: …`. ## opod doctor ```text opod doctor ``` Runs every check, prints a line for each, and a fix for each failure. It changes nothing. It always exits `0`: read the `⚠` lines. | # | Check | Pass | Fail and fix | | - | ---------------------------------------------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 1 | Hardware | `✔ hardware: linux/amd64 · 16 cores · 64 GB RAM`, then `✔ GPU: ( GB)` per GPU. | — | | 2 | The listen port is free | `✔ listen port :8080 available` | `⚠ listen port :8080 already in use`. A running leader holds it, which is normal. | | 3 | `ollama` on `PATH` | `✔ ollama binary at …` | `⚠ ollama not found in PATH — install: brew install ollama`. Needed only for the Ollama engine. | | 4 | `rpc-server` and `llama-server` on `PATH` | `✔ llama.cpp binaries present — …` | A note when both are missing (needed only for gangs and `engine.preferred: llamacpp`), or which one is missing and how to get it (`rpc-server` is not in the Homebrew bottle; build llama.cpp with `-DGGML_RPC=ON`). | | 5 | The configured engine answers within 2 seconds | `✔ ollama engine healthy at http://127.0.0.1:11434` | `⚠ … engine not reachable: …`, then the command that starts that engine. | | 6 | The data directory exists | `✔ data dir: …` | `⚠ data dir missing: …` | | 7 | The catalog loads | `✔ catalog: 48 entries`, plus the signature policy when `OPOD_CATALOG_PUBKEY` is set | A signature refusal names the file and says `sign the file (minisign -S -m ), remove it, or review OPOD_CATALOG_PUBKEY / OPOD_CATALOG_REQUIRE_SIGNED`. Any other error points at `OPOD_CATALOG_DIR`. | The signature policy reads ` (directory files: minisign signature verified when present)`, or ` (directory files: minisign signature required)` with `OPOD_CATALOG_REQUIRE_SIGNED=1`. From core v0.4.6, `opod doctor [--json]` reports every check as a row — `✔` ok, `✖` a problem with its fix on the next line, `▶` a note — and ends with `all checks passed` (exit `0`) or `N problem(s) found — each says its fix above` (exit `1`). Before, it always exited `0`. It also checks: | Check | Ok | Problem or note | | --------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | The config file | `✔ config: ~/.opod/config.yaml` | a file that does not parse is a problem (the other checks use the defaults); no file is a note: `opod up writes one on its first run` | | A leader on this host | `✔ leader: answering at http://localhost:8080` | a note: `start one with opod up — on a worker host this is expected` | | The listen port | `✔ listen port: :8080 is this host's opod leader (pid N)`, or `… is free` | a problem only when another program holds it: `stop it, or set listen: … or OPOD_LISTEN` | | The admin key | `✔ admin key: ~/.opod/admin.key` | a problem when a leader answers and there is no key here; else a note | | The engine | `✔ engine: ollama healthy at …` | an unknown engine name is a problem with the valid names (the report goes on; before, it stopped there) | On a managed leader's host (`OPOD_MANAGED=1`), from core v0.4.6: the admin key row is ok with `the leader's admin token (OPOD_ADMIN_TOKEN or auth.admin_token)` when the leader was started with one, the engine row is a note (`a managed leader (OPOD_MANAGED=1) runs no engine itself — its workers do`, then `opod node ls lists them …`), and the leader row finds a leader that serves TLS with a certificate for its service name. Up to core v0.4.5 such a host read `no leader answering`, `:8080 is in use by another program` and a missing admin key, all three false. Install hints follow the OS (`brew install …` on macOS, the project's installer or release on Linux), and a missing data directory says `opod up creates it, or: mkdir -p `. `--json` prints `{"checks": [{name, state, detail, fix}], "problems": N}`. > **A listen address with a host** > > The port check expects `listen` in the form `:PORT`. A `listen` with a host, such as `127.0.0.1:8080`, is reported as in use even when it is free. From core v0.4.0 a host:port is checked as it is. From core v0.4.6, `opod config path` prints the path alone on stdout and, when the file does not exist yet, `(not created yet — the defaults are in use; opod up writes it on its first run)` on stderr; `config edit` says the editor will create it; and `config show` without a leader names why it shows this CLI's own config (`no admin key at …` or `no leader answering at …`). `opod doctor` flags an engine endpoint on the leader's own port (MLX-LM's server also defaults to 8080). Shell completion offers `cache kv-prune`, and completing installed models no longer creates `state.db`. ## opod update ```text opod update [--check] [--version vX.Y.Z] [--force] [--yes] opod upgrade ``` `upgrade` is the same command. | Flag | Default | Effect | | ------------------ | ---------- | ------------------------------------------------- | | `--check` | off | Report whether an update exists. Install nothing. | | `--version vX.Y.Z` | the latest | Install that version instead of the latest. | | `--force` | off | Install even when already on that version. | What it does: 1. Unless `--version` names one, it asks GitHub for the latest release of `opod-io/opod-core` (`https://api.github.com/repos/opod-io/opod-core/releases/latest`). 2. When the binary is already on that version, it says `✔ already on the latest version (…)` and stops, unless `--force`. With `--check` it prints `update available: vA → vB` and stops. 3. Downloads `opod--.tar.gz` from the release. 4. Downloads the release's `checksums.txt` and checks the archive's SHA-256: `checksum verified (sha256)`. A `checksums.txt` that does not list the archive refuses the install. Up to and including 0.2.1, a release with **no** `checksums.txt` installs **unverified**, with the note `checksums.txt not available for … — skipping verification`. From 0.3.0 it refuses: `checksums.txt for … could not be read … refusing to install a binary nobody can verify`, and the installed binary stays as it was. Every published release ships `checksums.txt`. 5. Replaces the running binary, following symlinks, in place. When the install path is not writable, it prints the exact `sudo install -m 0755 …` command to finish. Then it prints `✔ installed vX.Y.Z at /usr/local/bin/opod` and reminds you to restart a running leader: `opod down` then `opod up`. A worker is restarted the same way it was started. Opod never checks for updates by itself. From core v0.4.6: | Case | What it does | | ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | the release is newer | `--check` prints `update available: vA → vB — install it with: opod update` and **exits `10`** (no update: `0`); without `--check` it asks `Replace … with vB? (y/N)` first, or takes `--yes`; with no terminal and no `--yes` it refuses and prints the exact command with `--yes` | | the release is older than this build | refused: `vB is older than this build (vA) — to downgrade on purpose: opod update --version vB --force`. Versions are compared as numbers; before, they were compared as text, and a build reading `0.21.0-dev` took `v0.4.5` as an update and installed it | | this is a development build (a `-dev` version, or a commit name from an image build) | `this is a development build (…); the latest release is vB`; it replaces itself only with `--force` or a named `--version` | | GitHub refuses the call | its message, not the raw JSON; a rate limit says when to try again and that `--version vX.Y.Z` goes around it | A build made without release flags now reads `0.0.0-dev`. ## opod completion ```text opod completion bash | zsh | fish ``` ```bash source <(opod completion bash) # in ~/.bashrc source <(opod completion zsh) # in ~/.zshrc opod completion fish | source ``` The scripts complete the commands and sub-commands, catalog ids after `model add` and `model info`, installed ids after `model load`, `unload` and `remove`, and client names after `connect`. They ask the binary for those lists at completion time, through the hidden helpers `opod completion __models`, `__installed` and `__clients`. With no shell named, it prints the help. ## opod version ```text opod version [--features] opod --version opod -v ``` Prints the version, OS, architecture and Go version: ```text opod 0.21.0 (linux/amd64, go1.26.4) ``` A development build reads `0.21.0-dev`; a release build has its version stamped at link time. `--features` prints the leader's feature keys, comma-separated and sorted, on one line — the same list `GET /admin/v1/capabilities` advertises. It reads the binary, not a running leader. The leader image carries this list in its OCI label `io.opod.leader.features`, so a manager can tell what a leader speaks from the image alone. See [Admin API](https://opod.io/docs/core-reference/admin-api/#capabilities). ```bash opod version --features | tr , '\n' | grep kv_ ``` --- title: "Reference overview" description: "An index of every opod core interface — configuration, environment, HTTP APIs, streams, files, metrics, engines, images and the catalog." url: "https://opod.io/docs/core-reference/" markdown_url: "https://opod.io/docs/core-reference.md" section: "Core reference" last_updated: "2026-11-01" --- # Reference overview > An index of every opod core interface — configuration, environment, HTTP APIs, streams, files, metrics, engines, images and the catalog. ## In short This section is the exact contract of opod core: every config field, environment variable, HTTP route, file format and metric, with its default. Use it when you script opod or write a manager for it. For the commands, see the [CLI reference](https://opod.io/docs/core-cli/). ```bash opod version --features | tr , '\n' | head -3 # what this binary speaks ``` This section is the exact contract of opod core: every field, route and variable, with its default. For the commands, see the [CLI reference](https://opod.io/docs/core-cli/). ## Configure - [config.yaml](https://opod.io/docs/core-reference/configuration/): Every field, default and override. - [Environment variables](https://opod.io/docs/core-reference/environment/): Leader, worker, shared and CLI-only variables. - [Engines](https://opod.io/docs/core-reference/engines/): Drivers, aliases, endpoints and engine flags. - [Catalog format](https://opod.io/docs/core-reference/catalog/): The model entry schema and override order. ## HTTP interfaces - [Gateway API](https://opod.io/docs/core-reference/gateway-api/): `/v1` routes, extensions, headers and errors. - [Admin API](https://opod.io/docs/core-reference/admin-api/): Every `/admin/v1` route and its body. - [Usage and event streams](https://opod.io/docs/core-reference/streams/): Cursor-based usage rows and lifecycle events, and the usage push that replaces the usage stream in the next release. - [Probes and load signals](https://opod.io/docs/core-reference/probes/): `/healthz`, `/readyz`, `/loadz`, `/gatewayz`. - [Worker API](https://opod.io/docs/core-reference/worker-api/): What a worker serves to its leader. ## Files a manager mounts - [Plan file](https://opod.io/docs/core-reference/plan-file/): The endpoint's one model, gangs and context. - [Auth snapshot](https://opod.io/docs/core-reference/auth-snapshot/): Keys as hashes, revocations, certificate policy. - [Policy snapshot](https://opod.io/docs/core-reference/policy-snapshot/): Routing, admission, wake and fallback. - [Door routes](https://opod.io/docs/core-reference/front-doors/): Front doors and the cell door's routes file. ## Operate - [Metrics, traces and logs](https://opod.io/docs/core-reference/metrics/): Prometheus series, spans and log export. - [Container images](https://opod.io/docs/core-reference/images/): Leader and worker images and their contract. ## Ports and paths at a glance | Item | Default | Set by | | ---------------------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | | Leader listener | `:8080` | `listen` / `OPOD_LISTEN` | | Worker listener | `:8081`; the worker binds and advertises the same address | `OPOD_ADVERTISE_ADDR`; `OPOD_BIND_ADDR` to bind another (from core v0.4.0) | | Probe listener (always plain HTTP) | off | `probe_listen` / `OPOD_PROBE_LISTEN` | | Plain listener | off | `plain_listen` | | llama.cpp RPC parts | from `50052` up | the catalog entry's `sharding.rpc_port_base` | | llama.cpp coordinator | `9001` | the catalog entry's `sharding.coordinator_port` | | vLLM on Ray: GCS / coordinator | `6379` / `9100` | fixed | | Data directory | `~/.opod` | `data_dir` / `OPOD_DATA_DIR` | | Config file | `~/.opod/config.yaml` | fixed (home directory of the user) | | Store | `/state.db` (SQLite) | `storage.dsn` | | Models directory | `/models` | `storage.models_dir`; `opod fetch` and `opod cache` take `--dir` / `OPOD_MODELS_DIR` | | Admin key file | `/admin.key`, mode `0600` | the first standalone `opod up` | | Worker record | `/node.yaml`, mode `0600` | `opod join` | | Catalog overrides | `~/.opod/catalog/`, `$OPOD_CATALOG_DIR` | see [Catalog format](https://opod.io/docs/core-reference/catalog/) | | Plan file | `/etc/opod/plan.json` | `OPOD_PLAN_FILE` | | Auth snapshot | `/etc/opod-auth/auth.json` | `OPOD_AUTH_FILE` (`off` = no watcher) | | Policy snapshot | `/etc/opod-auth/policy.json` | `OPOD_POLICY_FILE` (`off` = no watcher) | ## Timings at a glance | Item | Value | | --------------------------------------------------------- | -------------------------------------------------------------------------------- | | Heartbeat interval | 5 s; the engine is asked with a 2 s limit on each beat | | Heartbeat bound (`lost`, `engine-silent`) | 30 s (`router.heartbeat_max_age_seconds`; `0` = 60 s) | | Worker heartbeat retry after an error | 10 s, then 20 s | | Worker exits after refused re-registers | 6 in a row | | Worker drain on stop | 10 s (`OPOD_DRAIN_SECONDS`, 0 to 3600) | | Watched-file re-read (plan, auth, policy) | 10 s | | Gang heal: look / absent before heal / back-off / give up | 15 s / 45 s / 15, 30, 60 s / after 3 failures | | HMAC clock window | ±5 min | | CLI admin call limit | 5 min; 45 min for `shard create`, `model add --node`, `model load`, `model move` | | `opod down` wait for the leader to exit | 10 s | | Source check before `model add` | 5 s `HEAD` | | Stale auth snapshot answer | `503`, `Retry-After: 30` | ## Versioning The admin contract version is `v1` (`GET /admin/v1/version`). Routes marked stable on the [Admin API](https://opod.io/docs/core-reference/admin-api/) page only gain fields. Feature keys on `/admin/v1/capabilities` are only added. The wire types live in core's own Go packages [`pkg/adminapi`, `pkg/nodeapi` and `pkg/catalog`](https://github.com/opod-io/opod-core/tree/main/pkg) (module `github.com/opod-io/opod-core`). `pkg/` exists so a manager can decode the wire; it is not a supported public API, and it carries no client. What changed in each release is in the [changelog](https://github.com/opod-io/opod-core/blob/main/CHANGELOG.md). --- title: "config.yaml" description: "Every field of the opod configuration file, its default, and the environment variable that overrides it." url: "https://opod.io/docs/core-reference/configuration/" markdown_url: "https://opod.io/docs/core-reference/configuration.md" section: "Core reference" last_updated: "2026-10-30" --- # config.yaml > Every field of the opod configuration file, its default, and the environment variable that overrides it. ## In short `~/.opod/config.yaml` is optional: every field has a default, and every field has an environment variable that wins over it. Write only the fields you change. `opod config show` prints the effective values. ```yaml # ~/.opod/config.yaml listen: ":8090" engine: preferred: vllm router: default_model: qwen2.5-7b-instruct ``` No configuration file is required. Every field has a default. Precedence, lowest to highest: 1. built-in defaults; 2. the YAML file: `~/.opod/config.yaml`, or `opod up --config PATH`; 3. environment variables. The file is YAML. Unknown keys are ignored, so a file written by an older opod still loads. A leading `~/` in a path field is expanded to the home directory. When `data_dir` changes, `storage.dsn` and `storage.models_dir` follow it unless they are set explicitly. `opod config show` prints the effective values with secrets redacted. ## Full reference ```yaml listen: ":8080" # OPOD_LISTEN external_url: "" # OPOD_EXTERNAL_URL — public URL in the ready block and in `opod connect` tls_cert: "" # OPOD_TLS_CERT — with tls_key, the main listener speaks TLS tls_key: "" # OPOD_TLS_KEY probe_listen: "" # OPOD_PROBE_LISTEN — e.g. ":8081": probes + /metrics, always plain HTTP plain_listen: "" # OPOD_PLAIN_LISTEN — e.g. ":8082": the WHOLE API, always plain HTTP data_dir: "~/.opod" # OPOD_DATA_DIR — state.db, admin.key, node.yaml, opod.pid log_level: "info" # OPOD_LOG_LEVEL — debug | info | warn | error catalog_dir: "" # a path = read ONLY that directory (see Catalog format) max_body_bytes: 0 # OPOD_MAX_BODY_BYTES — /v1/chat/completions body cap; 0 = 32 MiB trust_proxy_headers: false # OPOD_TRUST_PROXY_HEADERS — honour X-Forwarded-Host/-Proto block_private_targets: false # OPOD_BLOCK_PRIVATE_TARGETS — refuse outbound probes to private addresses storage: type: "sqlite" # the only store today dsn: "~/.opod/state.db" # OPOD_STORAGE_DSN models_dir: "~/.opod/models" # no environment variable auth: require_keys: true # OPOD_REQUIRE_KEYS — false lets /v1 through without a key (development only) admin_token: "" # OPOD_ADMIN_TOKEN — seeded as an admin key at every start join_token: "" # OPOD_JOIN_TOKEN — seeded as a node key at every start; a worker's join token engine: preferred: "ollama" # OPOD_ENGINE — ollama | vllm | sglang | mlx | llamacpp | trtllm, or an alias ollama_endpoint: "http://127.0.0.1:11434" # OPOD_OLLAMA_ENDPOINT vllm_endpoint: "http://127.0.0.1:8000" # OPOD_VLLM_ENDPOINT mlx_endpoint: "http://127.0.0.1:8080" # OPOD_MLX_ENDPOINT llamacpp_endpoint: "http://127.0.0.1:8089" # OPOD_LLAMACPP_ENDPOINT sglang_endpoint: "http://127.0.0.1:30000" # OPOD_SGLANG_ENDPOINT trtllm_endpoint: "http://127.0.0.1:8000" # OPOD_TRTLLM_ENDPOINT router: default_model: "" # OPOD_DEFAULT_MODEL — what model "auto" means; empty = picked at first start pull_default_model: false # OPOD_PULL_DEFAULT_MODEL — true = the leader serves that model itself heartbeat_max_age_seconds: 30 # OPOD_HEARTBEAT_MAX_AGE_SECONDS — 0 = a 60 s bound sticky_sessions: true # kept for old files; the TTL below decides sticky_session_ttl_seconds: 0 # OPOD_STICKY_SESSION_TTL_SECONDS — >0 pins (user, model) to its last worker latency_fallback_p95_seconds: 0 # OPOD_LATENCY_P95_SECONDS — >0 tries a faster fallback first placement_allowed_fails: 0 # OPOD_PLACEMENT_ALLOWED_FAILS — circuit breaker: errors before a cooldown placement_cooldown_seconds: 0 # OPOD_PLACEMENT_COOLDOWN_SECONDS — both must be > 0 hedge_replicas: 0 # >1 allows per-request hedging (at most 3) observability: otlp_endpoint: "" # OPOD_OTLP_ENDPOINT — OTLP/HTTP traces; empty = off response_cache: enabled: false driver: "" # memory | sqlite; empty = memory; anything else turns the cache off with a warning max_entries: 0 # memory only; 0 = 1000 default_ttl_seconds: 0 # 0 = 24 h placement: exclusive: false # OPOD_EXCLUSIVE — one resident model per machine reserve_percent: 0 # OPOD_PLACEMENT_RESERVE_PERCENT — % of RAM held back from admission; 0 (or ≥ 100) = 20 drain_timeout_seconds: 0 # OPOD_PLACEMENT_DRAIN_TIMEOUT_SECONDS — eviction drain bound; 0 = 30 s surfaces: managed: false # OPOD_MANAGED — run by an external manager ``` ## Field notes ### Listeners - `listen` serves everything: `/v1`, `/admin/v1`, the join path and the probes. - With both `tls_cert` and `tls_key`, that listener speaks TLS. Workers trust it through `OPOD_LEADER_CA`. - `probe_listen` serves only `/healthz`, `/readyz`, `/loadz` and `/metrics`, always plain HTTP. - `plain_listen` serves the whole API in plain HTTP for a load balancer that cannot originate TLS. Prompts and keys cross it in clear text. A leader that cannot bind it does not start. ### `max_body_bytes` Caps the body of `/v1/chat/completions`, the route that carries inline images. `0` uses the built-in 32 MiB ceiling. Other routes have fixed caps: 8 MiB for `/v1/embeddings` and `/v1/rerank`, 1 MiB for the rest, including `/admin/v1`. ### `catalog_dir` Empty: the embedded catalog plus the override directories (see [Catalog format](https://opod.io/docs/core-reference/catalog/)). A path: that directory alone, merged over nothing else from disk. ### `auth` - `require_keys: false` is for local development. `/admin/v1` needs a key either way. - `admin_token` and `join_token` are seeded into the store at every start and are idempotent. Neither has a built-in default. ### `router` - `heartbeat_max_age_seconds`: a worker whose last heartbeat is older gets no new requests. Workers heartbeat every 5 seconds. - `sticky_session_ttl_seconds`: pins a `(user, model)` pair to the worker that served it last, so the engine's prefix cache is reused. A key with no user id pins as itself from core v0.4.1 (v0.4.0 never pins it). Off by default. From core v0.4.0, a policy snapshot's `routing.stickyTtlSeconds` overrides it live; `0` there keeps this value. - `latency_fallback_p95_seconds`: when the model's recent p95 latency exceeds this, the router tries the catalog `fallback` chain first. - `placement_allowed_fails` and `placement_cooldown_seconds`: after that many consecutive engine errors from a worker, the router parks it for the cooldown. Both must be above 0. - `hedge_replicas`: above 1, a request that asks for hedging (`opod.hedge: true` or `X-Opod-Hedge: 1`) goes to that many least-loaded workers at once and the first answer wins. The maximum is 3. ### `observability.response_cache` Caches **embeddings** responses by a SHA-256 of the canonical request body. A request can opt out with `Cache-Control: no-cache` or `no-store`, and scope its entries with `opod.cache.namespace` in the body. The response carries `X-Opod-Cache: hit` or `miss`. `GET /admin/v1/cache/stats` and `DELETE /admin/v1/cache` manage it. Caching chat completions **(planned)**. ### `placement` The memory lifecycle of the leader's own engine. See [Models](https://opod.io/docs/core/models/#memory-lifecycle). ### `surfaces.managed` `true` (or `OPOD_MANAGED=1`; `off`, `0`, `false` and `no` mean false) makes the store an in-memory cache unless `OPOD_STORAGE_DSN` names one, and the ready block prints `Mode: managed`. ## Files in the data directory | File | Written by | Holds | | ------------- | ------------------------------ | --------------------------------------------------------------------- | | `config.yaml` | you | this file | | `state.db` | the leader | SQLite store: nodes, models, placements, keys, usage, events, audit | | `admin.key` | the first standalone `opod up` | the admin key, mode `0600` | | `opod.pid` | `opod up` | the leader's PID, read by `opod down` | | `node.yaml` | `opod join` | `node_id`, `leader_url`, `token`, `address`, `joined_at`, mode `0600` | | `catalog/` | you | catalog overrides | | `models/` | pulls and `opod fetch` | weights (`storage.models_dir`) | --- title: "Environment variables" description: "Every environment variable opod reads, who reads it (leader, worker or CLI), and what it does." url: "https://opod.io/docs/core-reference/environment/" markdown_url: "https://opod.io/docs/core-reference/environment.md" section: "Core reference" last_updated: "2026-11-01" --- # Environment variables > Every environment variable opod reads, who reads it (leader, worker or CLI), and what it does. ## In short Every setting can come from an environment variable. A variable wins over `config.yaml`, which wins over the built-in default. Some variables override a config field; others are the contract a manager sets on a leader or worker process and have no YAML form. ```bash OPOD_LISTEN=:8090 OPOD_LOG_LEVEL=debug opod up ``` Opod reads three groups of variables. Environment wins over `config.yaml`, which wins over the defaults. A boolean in the contract tables is true for `1` or `true`; the config overrides accept any Go boolean (`1`, `t`, `true`, `0`, `false`, …). ## Overrides of config.yaml fields | Variable | Overrides | Notes | | ------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `OPOD_LISTEN` | `listen` | Default `:8080`. | | `OPOD_TLS_CERT` / `OPOD_TLS_KEY` | `tls_cert` / `tls_key` | Both set: the listener speaks TLS. | | `OPOD_PROBE_LISTEN` | `probe_listen` | Second, always-plain listener for the probes and `/metrics`. | | `OPOD_PLAIN_LISTEN` | `plain_listen` | Second, always-plain listener for the whole API. Clear text. | | `OPOD_DATA_DIR` | `data_dir` | | | `OPOD_STORAGE_DSN` | `storage.dsn` | Also gives a managed leader a durable store. | | `OPOD_LOG_LEVEL` | `log_level` | `debug`, `info`, `warn`, `error`. | | `OPOD_EXTERNAL_URL` | `external_url` | | | `OPOD_MAX_BODY_BYTES` | `max_body_bytes` | | | `OPOD_TRUST_PROXY_HEADERS` | `trust_proxy_headers` | | | `OPOD_BLOCK_PRIVATE_TARGETS` | `block_private_targets` | | | `OPOD_ENGINE` | `engine.preferred` | | | `OPOD_OLLAMA_ENDPOINT`, `OPOD_VLLM_ENDPOINT`, `OPOD_SGLANG_ENDPOINT`, `OPOD_MLX_ENDPOINT`, `OPOD_LLAMACPP_ENDPOINT`, `OPOD_TRTLLM_ENDPOINT` | `engine.*_endpoint` | | | `OPOD_VLLM_API_KEY` | — | Bearer token sent to a vLLM server. The older `VLLM_API_KEY` is read too; the prefixed one wins. | | `OPOD_REQUIRE_KEYS` | `auth.require_keys` | | | `OPOD_ADMIN_TOKEN` | `auth.admin_token` | Seeded as an admin key at every start. A front door uses it to call its leader. | | `OPOD_JOIN_TOKEN` | `auth.join_token` | Leader: seeded as a node key at every start. Worker: the token `opod join` presents when the URL has none. | | `OPOD_DEFAULT_MODEL` | `router.default_model` | | | `OPOD_PULL_DEFAULT_MODEL` | `router.pull_default_model` | `1` = the leader serves the default model itself. | | `OPOD_HEARTBEAT_MAX_AGE_SECONDS` | `router.heartbeat_max_age_seconds` | Default 30; `0` = 60 s. | | `OPOD_STICKY_SESSION_TTL_SECONDS` | `router.sticky_session_ttl_seconds` | | | `OPOD_LATENCY_P95_SECONDS` | `router.latency_fallback_p95_seconds` | | | `OPOD_PLACEMENT_ALLOWED_FAILS` / `OPOD_PLACEMENT_COOLDOWN_SECONDS` | `router.placement_allowed_fails` / `placement_cooldown_seconds` | | | `OPOD_OTLP_ENDPOINT` | `observability.otlp_endpoint` | URL or bare `host:port`. In core v0.4.6 only the host and port are used and spans go to `/v1/traces`. From core v0.4.7 a path is kept as a prefix: `/v1/traces` is added unless the path ends in it (`https://gw.example.com/otel` → `…/otel/v1/traces`). Headers: `OPOD_OTLP_HEADERS`. | | `OPOD_EXCLUSIVE` | `placement.exclusive` | | | `OPOD_PLACEMENT_RESERVE_PERCENT` | `placement.reserve_percent` | `0`–`99`; another value is ignored. `0` = the default, 20 %. | | `OPOD_PLACEMENT_DRAIN_TIMEOUT_SECONDS` | `placement.drain_timeout_seconds` | `0` = the default, 30 s. | | `OPOD_MANAGED` | `surfaces.managed` | `off`, `0`, `false`, `no` mean off; anything else non-empty means on. | Each variable is the same as its `config.yaml` field. For example, a leader on another port, with TLS, debug logs, a second plain probe port and traces: ```bash OPOD_LISTEN=:8443 \ OPOD_TLS_CERT=/etc/opod/tls.crt OPOD_TLS_KEY=/etc/opod/tls.key \ OPOD_PROBE_LISTEN=:8081 OPOD_PLAIN_LISTEN=:8082 \ OPOD_LOG_LEVEL=debug \ OPOD_OTLP_ENDPOINT=otel-collector.example.com:4318 \ OPOD_EXTERNAL_URL=https://opod.example.com \ opod up ``` A one-machine leader that serves a model itself, with its data elsewhere: ```bash OPOD_DATA_DIR=/srv/opod OPOD_STORAGE_DSN=/srv/opod/state.db \ OPOD_ENGINE=vllm OPOD_VLLM_ENDPOINT=http://127.0.0.1:8000 OPOD_VLLM_API_KEY= \ OPOD_DEFAULT_MODEL=qwen2.5-7b-instruct OPOD_PULL_DEFAULT_MODEL=1 \ opod up ``` Router, placement and safety knobs: ```bash OPOD_HEARTBEAT_MAX_AGE_SECONDS=20 \ OPOD_STICKY_SESSION_TTL_SECONDS=600 \ OPOD_LATENCY_P95_SECONDS=8 \ OPOD_PLACEMENT_ALLOWED_FAILS=3 OPOD_PLACEMENT_COOLDOWN_SECONDS=30 \ OPOD_EXCLUSIVE=1 OPOD_PLACEMENT_RESERVE_PERCENT=10 OPOD_PLACEMENT_DRAIN_TIMEOUT_SECONDS=60 \ OPOD_MAX_BODY_BYTES=33554432 OPOD_TRUST_PROXY_HEADERS=1 OPOD_BLOCK_PRIVATE_TARGETS=1 \ opod up ``` Other engines take their own endpoint variable: `OPOD_OLLAMA_ENDPOINT=http://127.0.0.1:11434`, `OPOD_SGLANG_ENDPOINT=http://127.0.0.1:30000`, `OPOD_MLX_ENDPOINT=http://127.0.0.1:8080`, `OPOD_LLAMACPP_ENDPOINT=http://127.0.0.1:8089`, `OPOD_TRTLLM_ENDPOINT=http://127.0.0.1:8000`. Keys and the managed switch: `OPOD_REQUIRE_KEYS=0` (development only), `OPOD_ADMIN_TOKEN=sk-orc-`, `OPOD_JOIN_TOKEN=sk-orc-`, `OPOD_MANAGED=1`. ## Process contract: leader These have no YAML equivalent. They are what a manager sets on a leader process. | Variable | What it does | | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `OPOD_PLAN_FILE` | The plan the leader serves within. Default `/etc/opod/plan.json`. Absent file = standalone, no restriction. | | `OPOD_AUTH_FILE` | The auth snapshot. Default `/etc/opod-auth/auth.json`. `off` = no watcher. | | `OPOD_POLICY_FILE` | The policy snapshot. Default `/etc/opod-auth/policy.json`. `off` = no watcher. | | `OPOD_COORDINATOR_NODE` | Pin the llama.cpp gang coordinator to a node id. `local` = the leader. | | `OPOD_OTLP_LOGS_ENDPOINT` | Send the leader's own log records to an OTLP/HTTP collector (URL or `host:port`), beside stderr. The queue is bounded and never blocks a request. Empty = off. In core v0.4.6 only the host and port are used and records go to `/v1/logs`; from core v0.4.7 a path is kept as a prefix, by the rule of `OPOD_OTLP_ENDPOINT`. | | `OPOD_OTLP_HEADERS` | From core v0.4.7. Headers sent on every trace and log export (`OPOD_OTLP_ENDPOINT`, `OPOD_OTLP_LOGS_ENDPOINT`), `k=v,k=v` (the `OTEL_EXPORTER_OTLP_HEADERS` form), for a collector that wants a token. Example: `Authorization=Bearer `. A value may contain `=` but not `,`, and is sent as written (no percent-decoding). Unset = no headers. A part that is not `k=v` turns that export off with a warning (`tracing disabled`, `log export disabled`); the leader still starts. So does an endpoint that is not a usable URL. The start line names the headers, never their values. | | `OPOD_USAGE_OTLP_ENDPOINT` | New in core v0.4.0. The OTLP/HTTP logs URL the leader pushes one usage record per request to, for example `http://otel-collector.example.com:4318/v1/logs`. It must be a full `http://` or `https://` URL; a bare `host:port` is refused: the leader logs `usage push not started`, keeps serving and sends nothing. A record leaves the leader's queue only on a 2xx. Empty = records are held in the queue, the oldest are dropped at the cap, and nothing is sent. See [Usage push](https://opod.io/docs/core-reference/streams/#usage-push). | | `OPOD_USAGE_OTLP_HEADERS` | New in core v0.4.0. Headers for that push, `k=v,k=v` (the `OTEL_EXPORTER_OTLP_HEADERS` form). A value may contain `=`, so a base64 token works. Example: `Authorization=Bearer sk-orc-`. A part that is not `k=v` is refused the same way: `usage push not started`. | | `OPOD_USAGE_QUEUE_MB` | New in core v0.4.0. The usage queue's size in MiB, each record's encoding plus its slot. Default `64`, about 440,000 records. Past it the oldest record is dropped and counted on `opod_usage_dropped_total`. A value that is not a positive whole number is a warning, and the default is used. | | `OPOD_TRACE_SAMPLE_RATIO` | Share of the traces the leader starts that it records, `0` to `1`, when `OPOD_OTLP_ENDPOINT` is set. Unset = `1`. A request with a `traceparent` follows its caller's decision. Any other value stops the start. | | `OPOD_ROLE` | `leader` (default), `gateway` or `door`. | | `OPOD_LEADER_URL` | The leader a `gateway` mirrors and pushes to. Required with `OPOD_ROLE=gateway`. | | `OPOD_GATEWAY_ID` | This front door's name in the leader's door count. Unset = the hostname. | | `OPOD_DOOR_ROUTES` | The routes file a `door` watches. Required with `OPOD_ROLE=door`. | | `OPOD_VERTEX` | `1` = also serve a Vertex AI custom container's predict and health routes. These routes take no key. | | `AIP_PREDICT_ROUTE` | Vertex predict route. Default `/v1/vertex:predict`. | | `AIP_HEALTH_ROUTE` | Vertex health route. Default `/v1/vertex/health`. | A managed leader, then a front door and a cell door: ```bash OPOD_MANAGED=1 OPOD_PLAN_FILE=/etc/opod/plan.json \ OPOD_AUTH_FILE=/etc/opod-auth/auth.json OPOD_POLICY_FILE=/etc/opod-auth/policy.json \ OPOD_COORDINATOR_NODE=n_abc123 \ OPOD_OTLP_ENDPOINT=otel-collector.example.com:4318 OPOD_TRACE_SAMPLE_RATIO=0.1 \ OPOD_OTLP_LOGS_ENDPOINT=otel-collector.example.com:4318 \ OPOD_OTLP_HEADERS='Authorization=Bearer ' \ OPOD_USAGE_OTLP_ENDPOINT=http://otel-collector.example.com:4318/v1/logs OPOD_USAGE_QUEUE_MB=128 \ opod up --no-wizard OPOD_ROLE=gateway OPOD_LEADER_URL=http://leader:8080 OPOD_GATEWAY_ID=door-1 \ OPOD_ADMIN_TOKEN=sk-orc- opod up OPOD_ROLE=door OPOD_DOOR_ROUTES=/etc/opod-door/routes.json opod up ``` The `OPOD_USAGE_*` lines need a leader from core v0.4.0; v0.3.0 ignores them and serves usage on the [usage stream](https://opod.io/docs/core-reference/streams/#usage-stream). A leader in a Vertex AI custom container: ```bash OPOD_VERTEX=1 AIP_PREDICT_ROUTE=/v1/vertex:predict AIP_HEALTH_ROUTE=/v1/vertex/health opod up ``` ## Process contract: worker | Variable | What it does | | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `OPOD_ACCELERATOR` | The vendor the worker runs on: `nvidia`, `amd`, `intel`, `tt` or `none`. Unset = what the worker detects. | | `OPOD_ENGINE_FLAGS` | JSON map of engine flags, e.g. `{"tp":"2","max_model_len":"32768"}`. Only allow-listed keys are used: see [Engines](https://opod.io/docs/core-reference/engines/#engine-flags). | | `OPOD_ADAPTERS` | JSON list of LoRA adapters `[{"name","source","rank"}]`, served as `:`. | | `OPOD_REJECT_BEARER` | `1` = the worker API accepts HMAC-signed calls only. | | `OPOD_KV_EVENTS` | `1` = vLLM or SGLang publishes prefix-cache events on localhost and the worker reports block hashes on its heartbeat, so the leader can route by what a worker holds. From core v0.4.7, on the head worker of a vLLM Ray or SGLang gang the leader starts the gang's engine with the publisher, and the head's blocks are scored for the gang. | | `OPOD_SLEEP_MODE` | `1` = vLLM starts with sleep mode on. | | `OPOD_WORKER_ROLE` | `prefill` or `decode` for disaggregated serving. Unset = a whole worker. Any other value stops the start. | | `OPOD_DRAIN_SECONDS` | How long a stopping worker lets running requests finish, in whole seconds from `0` to `3600`. `0` = stop at once. Unset = `10`. Any other value stops the start. | | `OPOD_KV_TIER` | `cpu` or `peer`: the tier below VRAM the engine keeps KV cache in. With `peer`, the leader counts a prefix a sibling holds as a hit for this worker. Any other value stops the start. | | `OPOD_PLAN_REVISION` | The plan revision this process serves (a positive number). The leader splits traffic per revision. A bad value is ignored with a warning. | | `OPOD_ADVERTISE_ADDR` | The `host:port` the leader should dial. The worker's API also **binds** to it, so it must be an address this machine owns — unless `OPOD_BIND_ADDR` is set. | | `OPOD_BIND_ADDR` | From core v0.4.0. The `host[:port]` the worker listens on, and the host its llama.cpp gang processes (`rpc-server`, the `llama-server` coordinator) bind, when the advertised address is not one this machine owns (NAT, a port forward). No port = the advertised port. Unset = the advertised address. `0.0.0.0` only when set, with a warning. Example: `OPOD_BIND_ADDR=10.0.0.5`. See [Behind NAT](https://opod.io/docs/core-cli/join/#behind-nat-or-a-port-forward). | | `OPOD_NODE_ID` | A stable node id across restarts. | | `POD_NAME` | Without `OPOD_NODE_ID` and `node.yaml`, the id becomes `n_`. | | `OPOD_LEADER_CA` | PEM certificate the worker trusts for a TLS leader. Exactly that one. | | `OPOD_NODE_CERT` / `OPOD_NODE_KEY` | Client certificate and key the worker presents. Its SPIFFE SAN `spiffe:///opod/node/` is the worker's identity. With it, a join needs no token. | | `OPOD_VRAM_BUDGET_GB` | The share of the card this worker may use. Same as `--vram-budget`. | | `OPOD_CARD_MIB` | The card's memory in MiB, as the manager measured it. Used to turn the budget into the engine's memory setting. Unset = ask `nvidia-smi`; without an answer the budget is not applied. | | `OPOD_ENGINE_OVERHEAD_MIB` | What the engine holds on its card outside its KV pool, in MiB, for the card's vendor. A budgeted vLLM or SGLang launch takes it off the budget before it divides by the card. Unset = core's measured figure for the engine (for vLLM, its largest one, for a vendor not measured); SGLang uses 768 MiB. Feature `engine_overhead`. | | `OPOD_GPU_INDEX` | The device index the worker is pinned to. Same as `--gpu`. | | `OPOD_LOAD_MODEL` | The catalog id the worker loads itself once its engine answers. | | `OPOD_LOAD_REPO` / `OPOD_LOAD_FILE` | Override the catalog's repo and file for that load. | | `OPOD_FETCH_RESULT` | A path `opod fetch` writes one JSON result line to. | A vLLM worker pinned to one card with a budget, a stable id and LoRA adapters: ```bash OPOD_ENGINE=vllm OPOD_ACCELERATOR=nvidia \ OPOD_NODE_ID=n_slot-0 OPOD_ADVERTISE_ADDR=192.0.2.51:8081 \ OPOD_GPU_INDEX=0 OPOD_VRAM_BUDGET_GB=20 OPOD_CARD_MIB=49140 OPOD_ENGINE_OVERHEAD_MIB=1024 \ OPOD_LOAD_MODEL=qwen2.5-7b-instruct \ OPOD_ENGINE_FLAGS='{"max_model_len":"32768"}' \ OPOD_ADAPTERS='[{"name":"sql","source":"org/sql-lora","rank":16}]' \ OPOD_KV_EVENTS=1 OPOD_SLEEP_MODE=1 OPOD_DRAIN_SECONDS=60 \ OPOD_REJECT_BEARER=1 OPOD_PLAN_REVISION=7 \ opod join "http://leader:8080?token=sk-orc-" ``` A prefill worker with a CPU KV tier, joining a TLS leader with a certificate instead of a token: ```bash OPOD_WORKER_ROLE=prefill OPOD_KV_TIER=cpu \ OPOD_LEADER_CA=/etc/opod/ca.crt OPOD_NODE_CERT=/etc/opod/node.crt OPOD_NODE_KEY=/etc/opod/node.key \ opod join https://leader.example.com:8080 ``` A worker that loads a GGUF from another repo than the catalog's, and a prefetch that reports its result: ```bash OPOD_LOAD_MODEL=llama-3.2-3b OPOD_LOAD_REPO=bartowski/Llama-3.2-3B-Instruct-GGUF \ OPOD_LOAD_FILE=Llama-3.2-3B-Instruct-Q4_K_M.gguf \ opod join "http://leader:8080?token=sk-orc-" # a prefetch that writes its result line for the manager OPOD_FETCH_RESULT=/dev/termination-log \ opod fetch bartowski/Llama-3.2-3B-Instruct-GGUF Llama-3.2-3B-Instruct-Q4_K_M.gguf --dir /data/models ``` In Kubernetes, `POD_NAME` comes from the downward API (`fieldRef: metadata.name`). ## Process contract: both | Variable | What it does | | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | `OPOD_CATALOG_DIR` | A catalog directory merged over the embedded catalog. `~/.opod/catalog` still wins over it. | | `OPOD_CATALOG_PUBKEY` | A minisign public key (the base64 line, or a file holding it). A catalog file with a `.minisig` beside it must verify. | | `OPOD_CATALOG_REQUIRE_SIGNED` | `1` = an unsigned catalog file in a directory is refused too. Needs `OPOD_CATALOG_PUBKEY`. | | `OPOD_SKIP_SOURCE_CHECK` | `1` = never HEAD-check a model's upstream. | | `HF_TOKEN` | Hugging Face token for gated repositories. | | `HF_ENDPOINT` | Hugging Face base URL, for a mirror. Default `https://huggingface.co`. | | `OPOD_MODEL_REVISION` | Pin the Hub revision. Cached under `@`. Empty = `main`. | | `OPOD_MODEL_SHA256` | Expected SHA-256 of the model file. A mismatch removes the file and fails the load. | ```bash OPOD_CATALOG_DIR=/etc/opod/catalog \ OPOD_CATALOG_PUBKEY=/etc/opod/minisign.pub OPOD_CATALOG_REQUIRE_SIGNED=1 \ OPOD_SKIP_SOURCE_CHECK=1 \ HF_TOKEN=hf_ HF_ENDPOINT=https://hf-mirror.example.com \ OPOD_MODEL_REVISION=a09a354 OPOD_MODEL_SHA256=<64 hex characters> \ opod join "http://leader:8080?token=sk-orc-" ``` ## CLI only | Variable | Read by | What it does | | ----------------------------------------------------------------------- | -------------------------------- | ---------------------------------------------------------- | | `OPOD_TOKEN` | `opod connect` | The key put in snippets, before `~/.opod/admin.key`. | | `OPOD_BASE_URL` | `opod connect`, `opod batch run` | The base URL. | | `OPOD_API_KEY`, then `OPENAI_API_KEY` | `opod batch run` | The key sent with each request. | | `OPOD_BATCH_INPUT_URL`, `OPOD_BATCH_OUTPUT_URL`, `OPOD_BATCH_ERROR_URL` | `opod batch run` | Defaults for `--input-url`, `--output-url`, `--error-url`. | | `OPOD_MODELS_DIR` | `opod fetch`, `opod cache` | Default `--dir`. | | `OPOD_UNLOAD_ON_EXIT` | `opod up` | `1` sets the default of `--unload-on-exit`. | | `NO_COLOR`, `OPOD_NO_COLOR` | every command | Any value turns colour off. | | `EDITOR` | `opod config edit` | The editor it names. Default `vi`. | ```bash OPOD_TOKEN=sk-orc- OPOD_BASE_URL=http://leader.example.com:8080 opod connect cursor OPOD_API_KEY=sk-orc- OPOD_BASE_URL=http://leader:8080 opod batch run --input requests.jsonl --dir ./run1 OPOD_BATCH_INPUT_URL="https://bucket.example.com/in.jsonl?X-Amz-Signature=…" \ OPOD_BATCH_OUTPUT_URL="https://bucket.example.com/out.jsonl?X-Amz-Signature=…" \ OPOD_BATCH_ERROR_URL="https://bucket.example.com/err.jsonl?X-Amz-Signature=…" \ opod batch run --base-url http://leader:8080 --dir /work OPOD_MODELS_DIR=/data/models opod cache ls OPOD_UNLOAD_ON_EXIT=1 opod up OPOD_NO_COLOR=1 opod node ls EDITOR=nano opod config edit ``` The container images' entrypoint reads a few more (`OPOD_ROLE=worker`, `OPOD_MODELS_DIR`, `POD_IP`, `OPOD_ENGINE_START`). See [Images](https://opod.io/docs/core-reference/images/#entrypoint-contract). ## Read by the engine launch The engine processes a worker starts inherit the worker's environment. A few variables change the launch line itself: | Variable | What it does | | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `CUDA_VISIBLE_DEVICES`, `HIP_VISIBLE_DEVICES`, `ONEAPI_DEVICE_SELECTOR` | Set from `--gpu` / `OPOD_GPU_INDEX`. A value already in the environment wins. | | `NCCL_SOCKET_IFNAME`, `GLOO_SOCKET_IFNAME` | The network interface the collective libraries of a multi-node vLLM gang use. Opod never names an interface itself: set them on the worker. When only `NCCL_SOCKET_IFNAME` is set, a vLLM expert-parallel rank also exports it as `GLOO_SOCKET_IFNAME`, so both libraries use one interface. | | `PYTHONHASHSEED` | With the vLLM engine flag `kv_tier_fs` (a disk KV tier), the launch exports `PYTHONHASHSEED=0` unless it is already set, so every process that shares the directory names a prefix with the same file. | --- title: "Gateway API (/v1)" description: "The OpenAI-compatible and Anthropic-compatible routes a leader serves, how to authenticate, the opod request extensions, and the error codes." url: "https://opod.io/docs/core-reference/gateway-api/" markdown_url: "https://opod.io/docs/core-reference/gateway-api.md" section: "Core reference" last_updated: "2026-11-08" --- # Gateway API (/v1) > The OpenAI-compatible and Anthropic-compatible routes a leader serves, how to authenticate, the opod request extensions, and the error codes. ## In short The gateway is the OpenAI-compatible API a leader serves to clients: chat, embeddings, rerank and the model list, plus Anthropic Messages. Any OpenAI SDK works with the base URL `http://leader:8080/v1` and an `sk-orc-…` key. A front door serves the same routes. ```bash curl http://localhost:8080/v1/chat/completions -H "Authorization: Bearer sk-orc-" \ -H 'Content-Type: application/json' \ -d '{"model":"auto","messages":[{"role":"user","content":"hi"}]}' ``` The gateway is the part of the leader clients call. A front door (`--role gateway`) serves the same routes. ## Routes | Method | Path | Notes | | ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET` | `/v1/models` | The models a request can be answered for now: installed on the leader, or held by a worker that takes new work. A model held only by drained or lost workers is not listed. A model whose workers sleep is listed: a request for it wakes them. | | `POST` | `/v1/chat/completions` | OpenAI chat, streamed or not. Tools, `tool_choice`, `response_format` and image input. | | `POST` | `/v1/embeddings` | OpenAI embeddings, on embedding models. | | `POST` | `/v1/rerank` | `{model, query, documents, top_n, return_documents}` → `results`, most relevant first, each `{index, relevance_score, document.text}`. Needs a reranker on vLLM, SGLang or llama.cpp (started with `--reranking`). | | `POST` | `/v1/messages` | Anthropic Messages, translated to the chat path. | | `POST` | `/v1/messages/count_tokens` | Anthropic token count. | Not served: `/v1/completions`, audio, images generation, files and batches. `/` answers `404`. With `OPOD_VERTEX=1` the leader also serves a Vertex AI custom container: `POST AIP_PREDICT_ROUTE` (default `/v1/vertex:predict`; `{instances, parameters}` → `{predictions}`, or a chat body passed through) and `GET AIP_HEALTH_ROUTE` (default `/v1/vertex/health`). These two take no key, because Vertex authenticates the caller. Each instance is served as its own request; when one fails, the whole predict answers with that instance's status and body, and the header `X-Opod-Vertex-Instance` names its index. The leader also answers Vertex's gRPC `PredictionService` on its own port (`ChatCompletions`, `StreamRawPredict`, `RawPredict`). ## Authentication Send the key in one of these forms, checked in this order: ```text Authorization: Bearer sk-orc- X-Api-Key: sk-orc- ?key=sk-orc- ``` An `Authorization` header without the `Bearer ` prefix is taken as the bare key. Any scope works on `/v1`. With `auth.require_keys: false` and no auth snapshot that requires keys, `/v1` accepts requests without a key. | Status | `error.type` | Cause | | ------ | ----------------- | -------------------------------------------------------------------------------------------------- | | `401` | `missing_api_key` | No key in the request. Message: `Authorization header required`. | | `401` | `invalid_api_key` | Unknown or revoked key. | | `401` | `key_expired` | The key's expiry has passed. | | `500` | `auth_error` | The leader could not read its key store to look the key up. The message carries the store's error. | | `503` | — | The policy bounds the auth snapshot's age and the snapshot is older. `Retry-After: 30`. | ## Response headers | Header | Value | | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `X-Opod-Request-Id` | `req_` + 16 hex characters, on every `/v1` response. The same id is on the usage row. | | `X-Opod-Cache` | `hit` or `miss` on `/v1/embeddings` when the response cache is on. | | `X-Opod-Fallback` | The fallback URL, when the policy's `routing.fallbackUrl` answered because the leader had no capacity. | | `X-Opod-Endpoint` | On a cell door's auto route: the alias of the endpoint that answered. | | `X-Opod-Session-Route` | From core v0.4.3, with the policy's `routing.session.signedRoute` on: a signed token naming the worker that answered this conversation. Send it back on the next turn (with the same `X-Opod-Session`) and any front door of the endpoint routes the turn to that worker. A token that does not verify (expired, another model, the worker restarted) is ignored. From core v0.4.7 a gang's answer carries one too: it names the gang and its head worker, and is ignored once the head restarted or the gang re-formed on another head. | | `Retry-After` | On a `503`: when to try again. | ## Request extensions Opod reads these optional extensions. A body field wins over the header. | Body field | Header | Effect | | ---------------------------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `user` (OpenAI) | `X-Opod-Session: ` | From core v0.4.3: the conversation this request belongs to (up to 128 bytes, kept only as a hash). Its turns stay on one worker, apart from the key's other conversations. The header wins over `user`. | | `opod.fallbacks: ["id", …]` | `X-Opod-Fallbacks: id,id` | Models to try, in order, when the primary fails. Replaces the catalog chain for this request. | | `opod.num_retries: N` | `X-Opod-Num-Retries: N` | Retry each candidate up to `N` times. Capped at 5. | | `opod.retry_backoff_ms: N` | `X-Opod-Retry-Backoff-Ms: N` | Wait between retries. Capped at 5000. | | `opod.hedge: true` | `X-Opod-Hedge: 1` | Send to several least-loaded workers at once; the first answer wins. Needs `router.hedge_replicas` above 1 (at most 3). | | `opod.sort: "latency"` or `"throughput"` | `X-Opod-Sort` | Reorder the fallback chain by measured latency or throughput. Unknown values are ignored. | | `opod.cache.namespace` | — | Scope the response-cache entry (embeddings). | | — | `X-Opod-Class: standard` | Lower this request's admission class (`critical`, `standard`, `sheddable`). A request can lower its key's class, never raise it. | | — | `X-Opod-Probe: 1` | Serve the request but count it in no load signal. For health provers. | | — | `Cache-Control: no-cache` | Bypass the embeddings response cache. | A model id ending in `:nitro` is the same as `opod.sort: "throughput"`. A request that carries overrides is recorded in the audit log. ```json { "model": "qwen3-coder-30b", "messages": [{"role": "user", "content": "hi"}], "opod": {"fallbacks": ["qwen-coder-14b"], "num_retries": 2} } ``` ## Chat completions - **Pass-through.** Every body field opod does not model (`seed`, `logprobs`, `top_k`, `user`, …) reaches a vLLM, SGLang, llama.cpp or MLX-LM engine unchanged, and `logprobs` come back. `model`, `messages`, `stream`, `stream_options` and `cache_salt` stay opod's. - **`n` or `best_of` above 1** is refused `400`. - **Tools.** `tools` and `tool_choice` go to the engine; `tool_calls` come back, streamed or merged, with `arguments` as a string. The next turn's assistant `tool_calls` and each `tool_call_id` go back to the engine. Opod never runs a tool. vLLM, SGLang and TensorRT-LLM need a tool-call parser, which the worker adds from the catalog's `tool_parser`. An engine that cannot do tools (Ollama, or an engine started with no parser) refuses with `400 unsupported_request` naming the field. - **Structured output.** `response_format` (`json_object` or `json_schema`) goes to the engine; for Ollama it becomes Ollama's `format`. - **Images.** `image_url` content parts reach the engine. A model without the `vision` capability, or an engine not proven to take images (SGLang, llama.cpp, MLX-LM), is refused `400` naming `image_url`. - **Streaming.** Server-sent events. A client that hangs up mid-stream still leaves a usage row with outcome `cancelled`. - **Cached tokens.** From core v0.4.1, the answer's `usage` carries `prompt_tokens_details.cached_tokens` when the engine reported a prefix-cache count, streamed (in the final chunk) or not, as OpenAI's does. Example: `"usage": {"prompt_tokens": 1838, "completion_tokens": 1, "total_tokens": 1839, "prompt_tokens_details": {"cached_tokens": 1824}}`. In v0.4.0 the count reaches the usage row only. - **Cache isolation.** On engines that key their prefix cache by `cache_salt` (vLLM, SGLang, TensorRT-LLM), the leader adds a salt per team or per key, according to the policy's `routing.cacheIsolation`. ## Anthropic Messages `POST /v1/messages` works on every chat model. The leader translates it to the chat path and back, so every engine serves it and the usage row says protocol `anthropic`. Translated: `system`, text and base64 image blocks, `tool_use`, `tool_result`, `tools`, `tool_choice` (with `disable_parallel_tool_use`), `stop_sequences`, `max_tokens` (required), `temperature`, `top_p`, `top_k`, `metadata.user_id`, and streaming. Refused with `400` in Anthropic's error envelope: extended `thinking`, server tools (a tool whose `type` is not `custom`), images by URL or file id, `document` and other block kinds the chat path cannot carry, `mcp_servers`, `container`, `context_management`, and any field the translator does not know. ## Model routing | `model` | Goes to | | --------------------- | --------------------------------------------------------------------------------------------------------- | | a catalog id | its gang if sharded; else the leader's engine if it holds it; else the least-loaded live worker that does | | `auto` | the default model (`router.default_model`) | | an engine-native name | a node that reports it loaded | | `:` | a LoRA adapter of the model | | `:nitro` | the model, chain sorted by throughput | With a plan file, the leader serves its one model (and that model's engine-native aliases and declared adapters). A request for any other model is refused, and the message names the model it serves. An unknown adapter suffix is refused, listing the adapters the plan declares. ## Errors Errors use an OpenAI-style envelope on `/v1`: `{"error": {"message": "…", "type": "…"}}`. On `/v1`, `type` carries the machine-readable cause (for example `model_not_found` or `worker_unreachable`); a cell door adds `code` and `param` in OpenAI's exact shape. `/v1/messages` uses Anthropic's envelope. Branch on `type` (and `code` where present), never on the message. | `error.type` | Status | Cause | | --------------------------------------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `invalid_request` | `400` | The body is not valid, or a field is missing or wrong. The message names it. | | `unsupported_request` | `400` | A field the engine cannot serve, named in the message. | | `missing_api_key`, `invalid_api_key`, `key_expired` | `401` | See Authentication. | | `model_not_found` | `404` | No catalog entry, placement or alias by that name. | | `not_found` | `404` | A plan-file leader refused another model: `this endpoint serves only (requested )`. | | `request_too_large` | `413` | The body is over the cap. | | `rerank_not_supported`, `embeddings_not_supported` | `501` | The engine has no such route. For embeddings on TensorRT-LLM this arrives from core v0.4.3; v0.4.2 and earlier answer `502` with the engine's `404`. | | `upstream_error` | `502` | The engine was reached and failed, or its stream broke. | | `engine_unreachable` | `502` | The engine is not reachable; the message carries its name, endpoint and the command to start it. | | `upstream_`, or the engine's own `type` | as the engine | The engine answered with a status the caller must see as is (a rate limit, not ready, a bad request); passed through, with `Retry-After: 10` on `429` and `503`. | | `worker_unreachable`, `gang_unreachable` | `503` + `Retry-After: 10` | The worker (or the gang's coordinator) picked for the request went away. Retry. | | `unavailable` | `503` + `Retry-After` | No capacity now: workers waking, every holder drained, or the admission hold shed the request. | | `store_error`, `encode_error` | `500` | An internal failure; the message says which. | | `auth_error` | `500` | The key lookup failed in the leader's key store. See Authentication. | Errors the leader writes before a request reaches a handler (the plan check, admission, a malformed body at the dispatcher) carry a `type` derived from the status: `invalid_request` (4xx), `authentication_error` (401), `permission_error` (403), `not_found` (404), `rate_limit_exceeded` (429), `unavailable` (503), `server_error` (other 5xx). By status: | Status | Meaning | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | `400` | Bad request, or a field the engine cannot serve (named in the message). | | `401` | Missing, invalid or expired key. | | `404` | `model_not_found`. | | `413` | `request_too_large`: the body is over the cap — 32 MiB for chat (`max_body_bytes`), 8 MiB for embeddings and rerank, 1 MiB for other routes. | | `501` | `rerank_not_supported` on Ollama and MLX-LM. | | `502` | The engine failed. `engine_unreachable` carries the engine name, endpoint and the command to start it. | | `503` + `Retry-After` | No capacity now: workers waking, every holder drained, or the admission hold shed the request. | --- title: "Admin API (/admin/v1)" description: "Every /admin/v1 route a leader serves, the request and response bodies, which routes are stable, and the capability flags." url: "https://opod.io/docs/core-reference/admin-api/" markdown_url: "https://opod.io/docs/core-reference/admin-api.md" section: "Core reference" last_updated: "2026-11-08" --- # Admin API (/admin/v1) > Every /admin/v1 route a leader serves, the request and response bodies, which routes are stable, and the capability flags. ## In short The admin API, `/admin/v1`, is how the CLI and any external manager drive a leader: nodes, models, gangs, keys, streams and capabilities. Every route needs an `admin` key (worker register and heartbeat also take a `node` key). The routes that `GET /admin/v1/capabilities` lists are the stable contract. ```bash curl -s http://localhost:8080/admin/v1/version -H "Authorization: Bearer $ADMIN" ``` The admin API is how the CLI and any external manager drive a leader. Front doors (`--role gateway`) and cell doors do not serve it. ## Authentication Every route needs a key. All routes need `admin` scope, except `POST /admin/v1/nodes/register` and `POST /admin/v1/nodes/heartbeat`, which also accept a `node` key. `auth.require_keys: false` does not open `/admin/v1`. ```bash ADMIN="sk-orc-" curl -s http://localhost:8080/admin/v1/nodes -H "Authorization: Bearer $ADMIN" ``` A key without `admin` scope gets `403 forbidden` ("Insufficient scope"). Errors have the shape `{"error": {"message": "…", "type": "…", "code": "…"}}`; `code` appears only where there is a machine-readable cause. Request bodies are capped at 1 MiB. Every state-changing admin call (any method but `GET` and `HEAD`, except the heartbeat) is recorded in the event stream as `admin.call`, with the actor, the status and the caller's address. ## Stable routes Routes marked **stable** below are the contract version `v1`. They are never removed, renamed or given another method, and their responses only gain fields. One exception was made by decision: `GET /admin/v1/usage/stream` leaves in core v0.4.0, replaced by the [usage push](https://opod.io/docs/core-reference/streams/#usage-push). `GET /admin/v1/capabilities` returns the list. Other routes may change between releases. ## Discovery | Method | Path | Stable | Response | | ------ | ------------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `GET` | `/admin/v1/version` | yes | `{"version": "0.21.0", "contract": "v1"}` | | `GET` | `/admin/v1/capabilities` | yes | `{contract, routes: [{method, path}], features: {name: true}, engines: [{id, aliases, native}]}` | | `GET` | `/admin/v1/status` | | `{role, engine: {name, endpoint, reachable, error}, nodes, models_installed}` | | `GET` | `/admin/v1/config` | | Effective configuration, secrets redacted. Read-only. | | `POST` | `/admin/v1/healthcheck` | yes | Sends one real completion (the prompt `ping`, streamed, 30-second bound) through the router and reports whether it answered, how fast, and which engine. Optional body `{"model", "max_tokens"}`: `model` defaults to `router.default_model`, `max_tokens` to `5`. | ### Capabilities `features` lists the mechanisms this binary ships, so a manager can probe for one instead of guessing from the version. `opod version --features` prints the same keys. The 89 keys of core v0.4.3: ```text adapters_runtime admission_classes admission_hold admission_kv_bound anthropic_messages auth_file auth_snapshot_age auth_tombstones boot_id cache_prune cache_salt card_mib door engine_liveness engine_overhead engine_ttft engines events_stream fetch_snapshot gang_devices_per_rank gang_load gateway_spend grpc_vertex heartbeat_no_report kv_block_events kv_cpu_tier_hits kv_peer_hits kv_readback kv_tier_fs kv_tier_load load_pull load_signals loadz loadz_ttft lora model_move model_revision mtls node_drain openai_passthrough otlp_logs pd_handoff pd_roles placement_drain plain_listen plan_file plan_heal_gangs policy_file probe_header probe_port registry_rebuilding request_wake rerank resident_models response_format router_only_ready routing_load_aware routing_weights self_load session_routing shard_create_error_codes shard_expert shard_groups shard_head shard_heal_failed_event shard_sglang shards slot_admission sticky_ttl_policy stream_boot tier_ghost tls_listener tool_calls tool_parsers trace_sample_ratio ttft usage_push vertex vision vllm_metric_aliases vram_budget wake_no_resume worker_devices worker_drain worker_engine worker_goodbye worker_readyz worker_sleep worker_unload ``` Core v0.4.7 adds `gang_kv_events` (a vLLM Ray or SGLang gang publishes its prefix-cache events from its head) and `otlp_headers` (`OPOD_OTLP_HEADERS` on trace and log exports; an endpoint keeps its URL path). `kv_cpu_tier_hits`, `sticky_ttl_policy` and `registry_rebuilding` joined in core v0.4.0; `load_pull` and `session_routing` in v0.4.3. `kv_block_salt`, `prefix_depth`, `routing_token_weight` and `worker_slow` arrive in the core release after v0.4.8. In core v0.4.0, `usage_stream` leaves this list and `usage_push` joins it: the leader pushes its usage records over OTLP instead of serving them by cursor. It is the one key ever taken out. Probe for `usage_push` before you rely on the push; a leader without it serves the usage stream. See [Usage push](https://opod.io/docs/core-reference/streams/#usage-push). `registry_rebuilding` also joins the list in core v0.4.0. A leader that boots with no workers in its store (a managed leader keeps them in memory, so that is every restart) marks `GET /admin/v1/nodes` with the header `X-Opod-Registry: rebuilding` until 15 seconds (three worker heartbeats) after the first worker registers again, and at most 2 minutes after boot. The clock starts at that first worker, not at boot, because workers reach a new leader only once its Service routes to it. Until then the list may still miss live workers, or the models they hold. A front door that reads the mark adds what the list names and removes nothing. `engines[].native` is the catalog source field the engine serves a model by: `ollama_name`, `repo`, `path` or `id`. ## Nodes | Method | Path | Stable | Notes | | -------- | ------------------------------ | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET` | `/admin/v1/nodes` | yes | Every node with its live `state`, `heartbeat_age_seconds`, `cooldown_until`, resident `placements`, `slots`, `in_flight`, the last engine `load` sample and the engine process state. Includes each worker's token. After a boot with an empty registry the answer carries `X-Opod-Registry: rebuilding` until 15 s after the first worker registers again (feature `registry_rebuilding`, core v0.4.0). | | `POST` | `/admin/v1/nodes/register` | yes | Worker registration (node or admin key). | | `POST` | `/admin/v1/nodes/heartbeat` | yes | Worker heartbeat (node or admin key). | | `POST` | `/admin/v1/nodes/{id}/drain` | yes | No new requests or gang parts; in-flight finishes. Survives heartbeats and re-registers. `local` is refused. | | `POST` | `/admin/v1/nodes/{id}/undrain` | yes | Back in rotation. | | `POST` | `/admin/v1/nodes/{id}/sleep` | yes | The worker's engine drops its GPU working set and keeps the process (vLLM sleep mode). Engines without one answer `501`. | | `POST` | `/admin/v1/nodes/{id}/resume` | yes | Wake it. A request for a sleeping model also wakes a worker: the leader holds the request up to 3 seconds. | | `DELETE` | `/admin/v1/nodes/{id}` | | Forget a node and its placements. | ## Models | Method | Path | Stable | Notes | | -------- | ------------------------------ | ------ | -------------------------------------------------------------------------------------------------------------- | | `GET` | `/admin/v1/models` | yes | Installed models. | | `GET` | `/admin/v1/catalog` | | The merged catalog as loaded at start, as JSON entries. A file added to an override directory needs a restart. | | `POST` | `/admin/v1/models` | | Install. Body below. | | `DELETE` | `/admin/v1/models/{id}` | | Uninstall; a sharded model's gangs are torn down. | | `POST` | `/admin/v1/models/{id}/load` | yes | Load under admission control. Body below. | | `POST` | `/admin/v1/models/{id}/unload` | | Drain, then drop from engine memory. Engines without unload answer `status: "noop"`. | | `POST` | `/admin/v1/models/{id}/move` | yes | Move a whole model between workers by overlap. Body below. | | `GET` | `/admin/v1/memory` | | Live engine residency, free memory, and the desired set (what `opod model ps` prints). | **Install** — `POST /admin/v1/models`: ```json { "id": "llama-3.2-3b", "nodes": ["n_abc123"], "force": false } ``` `id` may be a catalog id or a scheme id (`hf:…`, `ollama:…`, `file:…`). `nodes` pulls and loads on those workers. `200 {"status": "ready", "id", "kind"}` where `kind` is `sharded`, `node` or `local`. `404` for an unknown id or a source that does not exist; `409` when a one-model worker serves another model (send `"force": true`); `502` for an upstream failure. **Load** — `POST /admin/v1/models/{id}/load`: ```json { "swap": false, "pin": false, "priority": 0 } ``` An empty body means the defaults. `200 {"status": "loaded", "id", "plan"}`. `409` with `error.type` `needs_swap` (retry with `swap: true`; `plan` lists the victims) or `blocked_by_pinned`; `422 impossible` when the model exceeds the empty budget; `404` when not installed. **Move** — `POST /admin/v1/models/{id}/move`: ```json { "from": "n_abc123", "to": "n_def456", "ready_timeout_seconds": 1800, "drain_timeout_seconds": 30 } ``` Synchronous. `200 {model, from, to, steps[], note?}`; `404` unknown model or node; `409` a refusal before anything changed (the reason is the message); `502 {error, steps[]}` a move that aborted, where the last step says what serves now. ## Adapters | Method | Path | Stable | Notes | | -------- | --------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `POST` | `/admin/v1/adapters` | yes | `{"name", "source", "rank"}`: load a LoRA adapter on every worker that holds the plan's model. Answered per worker (`207` when only some took it). `409` on a leader with no plan file. | | `DELETE` | `/admin/v1/adapters/{name}` | yes | Drop one. | ## Tokens | Method | Path | Notes | | -------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | `GET` | `/admin/v1/tokens` | `[{id, name, scope, user_id, expires_at?, revoked, created_at}]`. No hash, no plaintext. | | `POST` | `/admin/v1/tokens` | Create. Body `{name, scope, user_id?, expires_at?, ttl_seconds?}`; `scope` is `admin`, `user` (default) or `node`. Returns `plaintext` once. | | `PATCH` | `/admin/v1/tokens/{id}` | Change expiry only: `{"ttl_seconds": N}` (`0` or less = never) or `{"expires_at": "RFC 3339" \| null}`. | | `DELETE` | `/admin/v1/tokens/{id}` | Revoke. | ```bash curl -s -X POST http://localhost:8080/admin/v1/tokens \ -H "Authorization: Bearer $ADMIN" -H "Content-Type: application/json" \ -d '{"name":"ci-bot","scope":"user","ttl_seconds":604800}' ``` ## Shards | Method | Path | Stable | Notes | | -------- | --------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET` | `/admin/v1/shards` | yes | Every gang part and coordinator: `ID`, `ModelID`, `GangID`, `Role` (`coordinator` or `rpc`), `NodeID`, `Address`, `ProcessID`, `Status`, `ConfigJSON`, `CreatedAt`, `LastSeen`. | | `GET` | `/admin/v1/shards/processes` | | Process state of the parts the leader supervises: `running`, `starting`, `stopped`, `failed`, `crashloop`. | | `POST` | `/admin/v1/shards/create` | yes | Form a gang. Body below. | | `DELETE` | `/admin/v1/shards/{model_id}` | yes | Tear down every gang of the model. | | `DELETE` | `/admin/v1/shards/{model_id}/{gang_id}` | yes | Tear down one gang. `404` when the model has no such gang. | **Create** — `POST /admin/v1/shards/create`: ```json { "model_id": "llama-3.3-70b-sharded", "shards": 2, "nodes": ["n_a", "n_b"], "tp": 0, "pp": 0, "devices": 1, "head": "n_a", "gang": "g1", "flags": { "ctx": "8192" }, "expert": false } ``` | Field | Meaning | | ---------- | -------------------------------------------------------------------------------------------------------- | | `model_id` | Catalog id. Required. | | `shards` | Part count. Without it and without `nodes`: the catalog's `default_shards`. The API never picks a count. | | `nodes` | Workers for the parts, in order. | | `tp`, `pp` | Tensor- and pipeline-parallel sizes (vLLM, SGLang). | | `devices` | GPUs per part (`0` = 1). `tp × pp` must equal parts × devices. | | `head` | The worker that runs the coordinator. `local` is refused. | | `gang` | Build this gang only; empty replaces every gang of the model. | | `flags` | Engine flags for the gang's coordinator, same allow-list as `OPOD_ENGINE_FLAGS`. | | `expert` | vLLM expert parallelism; `pp` must be unset. | `200 {"status": "ready", "model_id"}`. For `404`, `409` and `502` with `error.code` see [Sharding](https://opod.io/docs/core/sharding/#failures-and-recovery). ## Streams and events | Method | Path | Stable | Notes | | ------ | ------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET` | `/admin/v1/usage/stream` | yes | Usage rows by cursor: `?after=` (default `0`) and `?limit=` (default `500`, 1 to 1000; another value is the default). See [Streams](https://opod.io/docs/core-reference/streams/). Leaves core in core v0.4.0, replaced by the [usage push](https://opod.io/docs/core-reference/streams/#usage-push). | | `GET` | `/admin/v1/events/stream` | yes | Lifecycle events by cursor, with the same `?after=` and `?limit=`. See [Streams](https://opod.io/docs/core-reference/streams/#event-stream). | | `GET` | `/admin/v1/events` | | Server-sent events: push on change, for live views. | ## Front doors | Method | Path | Notes | | ------ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `POST` | `/admin/v1/usage/push` | A front door's usage rows, deduplicated by the row id the door mints. Also the door's heartbeat, with its `in_flight` and `rpm_1m`. Body (at most 1 MiB): `{gateway, rows: [{id, ts, api_key_id, user_id, model, protocol, prompt_tokens, completion_tokens, latency_ms, ttft_ms, outcome, node_id}], in_flight, rpm_1m}`; the row fields mean what they mean on the [usage stream](https://opod.io/docs/core-reference/streams/#usage-stream). From core v0.4.0 the leader adds the door's rows to its own usage queue for the [usage push](https://opod.io/docs/core-reference/streams/#usage-push), and a row may also carry `cached_tokens`, `class` and `operation`. | | `GET` | `/admin/v1/spend` | The snapshot each door polls: `{ts, doors, gateways, lag_bound_ms}`. | | `GET` | `/admin/v1/gateways` | `{doors, live_for_s, lag_bound_s, dedup_window, leader_is_door, gateways}`: `gateways` lists the doors the leader has heard from, each `{gateway, live, last_push_s, last_push_ts}`, including one that stopped pushing. | ## Response cache | Method | Path | Notes | | -------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET` | `/admin/v1/cache/stats` | `{"enabled": true, "stats": {…}}`: driver and counters. With no response cache configured: `200 {"enabled": false}`. | | `DELETE` | `/admin/v1/cache` | Flush. `?namespace=NAME` for one namespace, `?all=1` for everything; without either: `400`. Answers `{"status": "flushed", "namespace", "all"}`. With no response cache configured it answers `200` with an error body, `{"error": {"message": "cache_disabled", "type": "invalid_request"}}`: check the body, not only the status. | --- title: "Usage and event streams" description: "Read a leader's usage rows and lifecycle events by cursor, receive the usage push that replaces the usage stream from core v0.4.0, and subscribe to live notifications." url: "https://opod.io/docs/core-reference/streams/" markdown_url: "https://opod.io/docs/core-reference/streams.md" section: "Core reference" last_updated: "2026-11-01" --- # Usage and event streams > Read a leader's usage rows and lifecycle events by cursor, receive the usage push that replaces the usage stream from core v0.4.0, and subscribe to live notifications. ## In short A leader keeps two durable logs, usage rows and lifecycle events, and serves them by cursor. A collector stores the last id it committed and asks for the rows after it, so a restart loses nothing; deduplicate by id. Both need an admin key. ```bash curl -s "http://localhost:8080/admin/v1/events/stream?after=0&limit=100" -H "Authorization: Bearer $ADMIN" ``` From core v0.4.0 the leader keeps no usage rows: it **pushes** one OTLP log record per request to a receiver you name, and `GET /admin/v1/usage/stream` is gone. See [Usage push](#usage-push). The event stream stays. A leader keeps two durable logs in its store and serves them by cursor. A collector stores the last id it committed and asks for what comes after it. A replay after a crash re-reads rows the collector already has, so deduplicate by id; no row is lost. Both routes need an admin key. ## Usage stream > **Replaced in core v0.4.0** > > This section describes core v0.3.0 and earlier. In core v0.4.0 the usage table and this route leave core, and the feature key `usage_stream` with them; the leader advertises `usage_push` instead. A manager that finds `usage_stream` and not `usage_push` talks to an older leader and pulls this route as before. ```text GET /admin/v1/usage/stream?after=ID&limit=N ``` | Parameter | Default | Meaning | | --------- | ------- | ----------------------------------------- | | `after` | `0` | Return rows with an id greater than this. | | `limit` | `500` | Page size, 1 to 1000. | ```json { "events": [ { "id": 1042, "type": "usage", "ts": "2026-10-30T10:12:44.123Z", "data": { "api_key_id": "k_8sT2…", "user_id": "alice", "model": "qwen3-coder-30b", "protocol": "openai", "prompt_tokens": 812, "completion_tokens": 233, "latency_ms": 4120, "ttft_ms": 310, "outcome": "ok", "cost_usd": 0, "node_id": "n_abc123" } } ], "next": 1042, "more": false, "boot": 1761818000 } ``` | Field | Meaning | | ----------------- | --------------------------------------------------------------------------------------------------------------------------------- | | `next` | The last id in this page. Pass it as `after` for the next page. | | `more` | `true` when more rows wait; ask again at once. | | `boot` | The leader process's start time (Unix seconds). | | `data.api_key_id` | The key. Keys from an auth snapshot appear as `k_cp_`. | | `data.protocol` | `openai`, `anthropic`, `vertex`, `grpc-vertex`, … | | `data.ttft_ms` | Time to the first usable byte of a **streamed** answer. Absent or `0` on a non-streamed answer. | | `data.outcome` | `ok`, `error` or `cancelled`. A caller who hangs up mid-stream still leaves a row. | | `data.node_id` | The worker that served it. Empty = answered locally or never dispatched. A gang request is recorded under `shard::`. | | `data.cost_usd` | Deprecated and always `0`. Opod records tokens, not money. | The rows are raw facts. Summaries and breakdowns are the consumer's job. A front door's rows reach the leader through `POST /admin/v1/usage/push` and appear in this stream too. > **Cursor ids and restarts** > > Ids are monotonic within a store and never reused. A managed leader with an in-memory store starts again from 1 after a restart: compare `boot` with the last value you saw, and when it changed, start from `after=0`. ## Usage push The usage push is new in core v0.4.0 (feature `usage_push`). The leader keeps no usage table. Each finished request, its own or one a front door pushed to it, becomes one record in a queue in memory. An exporter sends the oldest records to `OPOD_USAGE_OTLP_ENDPOINT` as OTLP/HTTP log records and frees them only on a 2xx. Any OTLP/HTTP logs receiver works: an OpenTelemetry Collector, or a control plane. ```bash OPOD_USAGE_OTLP_ENDPOINT=http://otel-collector.example.com:4318/v1/logs \ OPOD_USAGE_OTLP_HEADERS="Authorization=Bearer sk-orc-" \ OPOD_USAGE_QUEUE_MB=64 \ opod up ``` | Variable | Default | Meaning | | -------------------------- | ------- | --------------------------------------------------------------------------------------------------------- | | `OPOD_USAGE_OTLP_ENDPOINT` | empty | The OTLP/HTTP logs URL, a full `http://` or `https://` URL. Empty = records are held and nothing is sent. | | `OPOD_USAGE_OTLP_HEADERS` | empty | `k=v,k=v`, sent on every push. | | `OPOD_USAGE_QUEUE_MB` | `64` | The queue's size in MiB, about 440,000 records. | **Standalone core needs a receiver to keep usage at all.** With no endpoint set, records only wait in the queue, and past the cap the oldest go. Run a collector beside the leader to keep them. ### What one push carries One push is one `ExportLogsServiceRequest` in protobuf (`Content-Type: application/x-protobuf`), at most 1 MiB of records. Every record has the event name `opod.usage`. The names are spelled once in core (`pkg/adminapi/usagelog.go`). | Attribute | Where | Meaning | | --------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `service.name` | resource | `opod-leader`. | | `opod.leader.boot` | resource | The leader process's start time (Unix seconds). | | `opod.usage.seq` | record | A sequence that starts at 1 on every boot. | | `opod.request.id` | record | The `X-Opod-Request-Id` the caller saw. | | `gen_ai.request.model` | record | The model. | | `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens` | record | Prompt and completion tokens. | | `opod.api_key.id` | record | The key. Keys from an auth snapshot appear as `k_cp_`. | | `user.id` | record | The key's user id. | | `opod.protocol` | record | `openai`, `anthropic`, `vertex`, `grpc-vertex`, … | | `opod.outcome` | record | `ok`, `error` or `cancelled`. | | `opod.node.id` | record | The worker that served it, as `data.node_id` on the stream. | | `opod.latency_ms` | record | End-to-end latency. | | `opod.ttft_ms` | record | Time to the first usable byte of a streamed answer. | | `opod.gateway` | record | The front door that served it. Absent = the leader. | | `gen_ai.usage.cache_read.input_tokens` | record | Prompt tokens the engine served from its prefix cache. `0` = none reported. vLLM, SGLang, llama.cpp and TensorRT-LLM report it (read on the design-partner cell, 2026-11-01); Ollama does not. | | `opod.request.class` | record | The admission class that ranked the request. Absent when the policy has no classes. | | `gen_ai.operation.name` | record | What the request did: `chat`, `embeddings` or `rerank`. How it was spoken is `opod.protocol`. | The record's time is the request's time. A string attribute with an empty value is left off: on the receiver, absent and empty read the same. **Deduplicate on (`opod.leader.boot`, `opod.usage.seq`).** The leader resends a batch whose answer it did not get, so a receiver that stores each key once takes a resend safely. The record carries no money field. ### What the answer does | Receiver answers | Effect on the leader | | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 2xx | The batch is freed and counted on `opod_usage_sent_total`. Records a partial success names as rejected are counted on `opod_usage_dropped_total{reason="rejected"}`. | | `400` | The receiver will never take the batch (OTLP): it is freed and counted as `rejected`. | | any other status, or a network error | Nothing is freed. The leader backs off from 1 s to 30 s and sends the same records again. Counted on `opod_usage_export_errors_total`. | ### What can be lost - **A full queue.** Past `OPOD_USAGE_QUEUE_MB` the oldest record is dropped, counted as `reason="full"`. A record bigger than the whole queue is refused, `reason="refused"`. A receiver sees the loss as a gap in one boot's `opod.usage.seq`. - **A leader restart.** What was queued is lost. The receiver sees a new `opod.leader.boot`, not a count. The queue and its losses are on `/metrics`; see [Metrics](https://opod.io/docs/core-reference/metrics/#usage-push). ## Event stream ```text GET /admin/v1/events/stream?after=ID&limit=N ``` Same parameters and paging as the usage stream. The event stream stays in core v0.4.0. Each event: ```json { "id": 77, "type": "node.drained", "subject": "n_abc123", "ts": "2026-10-30T10:15:02Z", "data": { "by": "admin" } } ``` `subject` is the node, model or path the event is about. `data` is free-form per type. New types are added over time: ignore types you do not know. | Type | When | | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `node.registered` | A worker registered. | | `node.reincarnated` | A worker registered with a new boot id under the same node id; the old process's placements and gang rows were dropped. | | `node.drained`, `node.undrained` | Drain state changed. | | `node.removed` | A node was removed by an admin. | | `node.forgotten` | The leader dropped a node that had been silent too long. | | `node.engine_silent`, `node.engine_reporting` | A worker's engine stopped or resumed answering it. | | `node.cert-refused` | The leader refused a join on its worker certificate. `data.reason` is `revoked` (the certificate's serial is on the auth snapshot's revoked list) or `id-mismatch` (the certificate names another node than the one claimed, in `data.claimed`); `data.serial` is the certificate's serial. | | `model.added`, `model.removed` | Install or uninstall. | | `model.loaded`, `model.unloaded` | Engine memory changed. | | `model.move_started`, `model.move_loaded`, `model.move_flipped`, `model.move_drained`, `model.move_finished`, `model.move_aborted` | Steps of a model move. | | `shard.created`, `shard.removed` | A gang formed or was torn down. | | `shard.healed`, `shard.heal_failed` | The leader re-formed a gang its plan declares, or failed to; `heal_failed` carries the gang, the plan revision, `error.code` and the reason. | | `shard.stale` | A gang lost a part: its worker restarted (new boot id) or the part's process went down. `data.reason` says which. | | `worker.sleep`, `worker.resume` | Sleep tier changes. | | `worker.slow`, `worker.slow_cleared` | Arrives in the core release after v0.4.8. The router started or stopped ranking a worker down for latency (`routing.slowFactor`). Subject: the node id or the gang key; `data`: `model`, `factor`, `metric`. Turning the factor off clears every one. | | `plan.updated` | The plan file changed revision or model. | | `auth.updated` | A new auth snapshot was applied. | | `policy.updated` | A new policy snapshot was applied. | | `policy.wake_marks` | The set of sleepers that must not be resumed in place changed. | | `routing.fallback`, `routing.fallback_failed` | The policy's fallback URL answered, or failed. | | `admin.call` | A state-changing admin call: actor, status and caller address. | ## Live notifications (SSE) ```text GET /admin/v1/events ``` Server-sent events for live views. Each event is one line of JSON under a topic: ```text event: hello data: {"ok":true} event: nodes data: {"topic":"nodes","id":"n_abc123"} ``` Topics: `models`, `nodes`, `shards`, `usage`, `audit`. A comment line `: keepalive` is sent every 25 seconds so proxies keep the connection open. Re-read the related view when an event arrives. The key can be passed as `?key=` because a browser `EventSource` cannot set headers. These notifications are not durable; use the cursor streams for anything you must not miss. --- title: "Probes and load signals" description: "The unauthenticated /healthz, /readyz, /loadz and /gatewayz endpoints, what each field means, and how an external autoscaler should read them." url: "https://opod.io/docs/core-reference/probes/" markdown_url: "https://opod.io/docs/core-reference/probes.md" section: "Core reference" last_updated: "2026-11-08" --- # Probes and load signals > The unauthenticated /healthz, /readyz, /loadz and /gatewayz endpoints, what each field means, and how an external autoscaler should read them. ## In short A leader publishes `/healthz` (liveness), `/readyz` (readiness) and `/loadz` (load numbers for an autoscaler), with no key. Opod scales nothing itself: an external scaler reads `/loadz` and adds or removes workers. `OPOD_PROBE_LISTEN` serves the probes on a second, always-plain port. ```bash curl -s http://localhost:8080/loadz | jq '{queue_depth, kv_used_pct, in_flight}' ``` Opod scales nothing itself. A leader publishes the numbers an external scaler needs, and routes across the workers it has. These endpoints need no key and carry no prompts, keys or key ids. With `OPOD_PROBE_LISTEN=:8081` (or `probe_listen`), `/healthz`, `/readyz`, `/loadz` and `/metrics` are also served on a second listener that is always plain HTTP, whatever TLS the main listener speaks. Nothing authenticated is routed to that port. ## GET /healthz Liveness. Answers `200` with body `ok` while the process serves HTTP. A worker serves its own `/healthz` on `:8081`. ## GET /readyz Readiness: can this leader serve a request now? | Answer | When | | ------------------------------------------------------- | ----------------------------------------------------------------------- | | `200`, body `ready` | The leader's own engine is healthy. | | `200 {"status":"ready","mode":"router-only"}` | No local engine, and at least one live worker has a ready placement. | | `200 {"status":"ready","mode":"shard-coordinator"}` | A gang has a ready coordinator and every part on a live node. | | `200 {"status":"ready","mode":"sleeping-workers"}` | Every live worker sleeps on purpose. A request wakes one. | | `200 {"status":"ready","mode":"sleeping"}` | The plan scales to zero (autoscale floor `0`) and everything is parked. | | `200 {"status":"ready","mode":"waking"}` | Same plan; workers are registered but none serves yet. | | `503 {"status":"degraded","engine":"…","placements":0}` | Nothing can serve, and the plan does not sleep by design. | The sleeping and waking modes answer `200` on purpose: the leader must stay in its load balancer so a request can reach it and get the honest `503` + `Retry-After` that wakes the workers. ## GET /loadz One JSON object, aggregated over the workers that hold the leader's model. The typed shape is `Load` in core's [`pkg/adminapi`](https://github.com/opod-io/opod-core/tree/main/pkg/adminapi). ```json { "plan_revision": 7, "plan_model": "qwen2.5-7b-instruct", "in_flight": 9, "queue_depth": 3, "kv_used_pct": 71, "kv_busy_workers": 1.6, "tokens_per_s": 412.5, "prefix_hit_pct": 38, "rpm_1m": 240, "unavailable_1m": 0, "last_request_unix": 1761818000, "workers": 3, "reporting": 3, "ttft_p50_ms": 180, "ttft_p95_ms": 640, "ts": 1761818001 } ``` | Field | Meaning | For a scaler | | ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | `queue_depth` | Requests accepted and waiting, summed over workers. | The leading signal: above 0 means demand exceeds capacity. | | `kv_used_pct` | The busiest worker's KV-cache use. | The ceiling: grow before the cache fills. | | `kv_busy_workers` | Mean KV-cache use × the units a scaler adds: how many workers' worth of cache is in use. From core v0.4.6 a gang counts once, whatever its part count (one 2-part gang at a full cache reads 1); up to v0.4.5 each part counted (it read 2). Always present. | The proportional form, for `ceil(metric ÷ target)`. | | `in_flight` | Requests being served now. | Smooth growth signal. | | `unavailable_1m` | `/v1` requests answered `5xx` in the last minute, chiefly `503 waking`. | The wake signal for an endpoint at zero workers. | | `rpm_1m` | Requests in the last minute. | Keeps one worker alive under a trickle. | | `last_request_unix` | The last request's time. | Idle detection. | | `workers`, `reporting` | Workers that can take a request now / whose sample is under 30 s old. Drained, lost and sleeping workers are not counted. | `reporting < workers`: the numbers are partial; prefer no decision. | | `ttft_p50_ms`, `ttft_p95_ms` | Time to first token over the last minute (at most 4096 answers), streamed answers only, measured from arrival at the leader. Always present; `0` = not measured, never "instant". | What a user feels. A good secondary target. | | `tokens_per_s`, `prefix_hit_pct` | Throughput and prefix-cache hits. | Reporting. | | `plan_revision`, `plan_model` | What the mounted plan says. | Confirms which revision the leader observes. | | `engines_unhealthy`, `engine_issue` | Workers holding a card while their engine is not serving (crash-looping, restarting, stopped), and the worst one's last message. Omitted when 0. | Do not count these as capacity. | | `prefix_index` | `{workers_reporting, blocks}` of the prefix-cache block index, and from core v0.4.0 `cpu_blocks` (blocks in the workers' CPU tiers; omitted at 0). Omitted when nothing reports. | Reporting. | | `kv_capacity_tokens`, `kv_used_tokens`, `preemptions_total`, `evictions_total` | What the engines say they allocated and did, summed. Omitted while no engine states them. | Sizing: rising preemptions mean the pool is too small. | | `prefix_hit_tokens_total`, `prefix_query_tokens_total` | From core v0.4.1. The engines' prefix-cache counters, summed over the samples that state them (vLLM): prompt tokens served from the cache, and prompt tokens looked up. Omitted while no engine states them. | Their ratio is `prefix_hit_pct`; two reads give the hit rate over the window between. | | `tier_hit_tokens_total`, `tier_query_tokens_total`, `tier_load_bytes_total`, `tier_store_bytes_total`, `tier_alloc_failures_total` | The engines' host-memory KV tier counters, summed over the samples that state them: tokens the tier served, tokens looked up in it, bytes loaded from and stored to it, and allocations that failed. Omitted while no engine states them. | Reporting: hits ÷ queries is the tier's hit rate. | | `tier_used_pct` | The fullest host KV tier's fill (a maximum, like `kv_used_pct`). Omitted while no engine states it. | A full tier evicts. | | `tier_ghost` | What a host KV tier would have served, measured from the engines' cache events: `{block_size, stored_blocks, returns: [{max_depth_blocks, blocks}]}`. `stored_blocks` counts the blocks the engines computed; each `returns` bucket counts evicted blocks that were computed again, by how many evictions passed before they came back. Buckets ascend. A tier of T blocks would have served every bucket whose `max_depth_blocks` ≤ T. Omitted when no worker publishes cache events. | Sizing a tier. | | `engine_ttft_p50_ms` | The engines' own median time to first token. | `ttft_p50_ms` minus it is what the leader and network add. | | `admission_bound` | `slots` or `kv`: which bound the admission gate holds the model to. Omitted when unbounded. | `kv` with a growing queue: the KV pool is the limit. | | `auth_snapshot` | The mounted [auth snapshot](https://opod.io/docs/core-reference/auth-snapshot/) in force: `revision`, `issued_at`, `age_s`, `max_age_s` (the policy bound, `0` = none), `stale`, `keys`, `revoked_keys`. Omitted on a leader with no snapshot. | `stale: true` means keyed `/v1` traffic is refused until a fresher snapshot arrives. | | `load_samples` | From core v0.4.4. Per worker the picker ranks: `source` (`pull`, or `heartbeat` for a worker whose core has no `/v1/load`), `age_ms` and `ranked` (`false` once a pulled sample is older than three `loadRefreshMs` intervals). The same map is on `/gatewayz`. Omitted before any pull answers. | `ranked: false` for a worker: it is scored on its in-flight count alone until a fresh sample lands. | | `sessions` | From core v0.4.4. Over the last minute: `requests_1m` (requests that named a conversation with `X-Opod-Session` or the `user` field), `pin_hits_1m` (landed on the worker their pin named), `pin_moves_1m` (the pinned worker was saturated, full or gone, so the pin moved) and `route_tokens_1m` (echoed route tokens that verified). Absent while `routing.session` is off. Each door counts its own. | `requests_1m` 0 while `rpm_1m` is not: no caller sends a session, so behind front doors a conversation does not keep its worker. | | `slow_workers` | Arrives in the core release after v0.4.8. The workers this router ranks down for latency under `routing.slowFactor`: `worker` (node id, or `shard::`), `model`, `factor`, `metric` (`ttft_per_1k_tokens` or `inter_token_gap`), `samples`. Each door lists its own. Omitted when none is. | A listed worker serves less until its answers are normal again; look at its card's power, clocks and link. | | `spec_draft_tokens_total`, `spec_accepted_tokens_total`, `spec_accept_pct` | From core v0.4.5, while an engine speculates (`plan.speculative`): the tokens its proposer offered and the ones the model kept, summed over the workers (vLLM and llama.cpp count them), and the engines' own recent acceptance rate, 0–100, averaged (SGLang states a rate and no counters). Absent when nothing speculates. | Kept ÷ offered is the acceptance rate; a low one means speculation costs more than it saves for this traffic. | CPU and memory are not useful for GPU workers and are not published. For a gang, the engine signals come from the gang's coordinator; one coordinator sample counts once in `reporting`. ### Rules for a reader 1. Poll every 10 seconds or so. The numbers are one-minute aggregates or gauges, never counters to difference. 2. An unreadable `/loadz` is not a reason to act. A leader restarting must not cause a scale-in. 3. Never scale in while `queue_depth > 0`. Give scale-in a stabilisation window. 4. Treat `unavailable_1m > 0` as activation, separately from the value you scale on. ### Probes are not customers Mark a health-check request with `X-Opod-Probe: 1`. It is served like any request but counted in none of `in_flight`, `rpm_1m`, `unavailable_1m` or the idle clock, so it cannot wake what a scaler parked. ## GET /gatewayz The front-door view. Not part of the stable contract. On a **leader**: | Field | Meaning | | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `role` | `leader`. | | `doors`, `doors_reporting` | Doors counted (the leader's own front included, so never 0), and how many pushed inside the liveness window. | | `doors_in_flight`, `doors_rpm_1m` | The endpoint's totals across doors. | | `in_flight_per_door`, `rpm_1m_per_door` | The totals divided by the doors, rounded up. Compare these with a per-door target. | | `live_for_s` | How long a silent door still counts. | | `spend_lag_bound_s` | How old a door's view of the door count may be. | | `gateways` | The doors heard from: `[{gateway, live, last_push_s, last_push_ts}]`, sorted by name. | | `admission` | What the admission gate promises across doors. See below. | | `load_samples` | Per worker node id, the sample this process's picker ranks it on: `source`, `age_ms`, `ranked` for a `pull` entry; `source` and `why` for a `heartbeat` entry, which gains `ranked` from core v0.4.4. `/loadz` carries the same map from core v0.4.4. It is this process's own: the leader's map does not include the doors'. | `admission` on a leader: | Field | Meaning | | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `classes` | `true` when the policy lists admission classes; `false` = every request is `standard`. | | `scope`, `slot_scope` | Always `per_door`. Each door ranks only the requests it holds and counts only the requests it dispatched. Doors do not coordinate. | | `flow_share_skew_max` | The door count. A flow that reaches every door can be served up to this many times as often as a flow of its class that reaches one door. | | `class_order_across_doors` | `true` only with one door. With more, a lower class held at one door can be served while a higher class waits at another. | | `worker_slots_overcommit_max` | The door count. A worker can be sent up to this many times its slots at once; the excess waits in its engine's queue. | | `governed_by` | `worker_slots`. | | `models` | Per model id: `slots` (governed slots across workers that take requests now), `in_flight` (requests holding a slot), `stranded` (in flight on a worker that left the pool; they hold none of its slots), `held` (requests waiting), `ungoverned_workers` (workers or gangs serving with no slot count, so admission is unbounded), `servable` (`false` = no worker can serve). | | `ungoverned_workers` | Node ids of live workers that report no slot count. | With one door every bound is exact. On a **front door** (`--role gateway`): | Field | Meaning | | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `gateway` | This door's id (`OPOD_GATEWAY_ID`, default the hostname). | | `registry_fresh`, `registry_age_s` | Whether the mirrored worker list is under 30 s old, and its age. `false` with age `0` = the door never reached the leader. | | `usage_queued`, `usage_sent`, `usage_dropped` | The usage push backlog: rows waiting, rows the leader took, rows dropped. The queue holds 20,000 rows; above that the oldest are dropped and counted. | | `spend_age_s`, `spend_lag_bound_s` | How old the door's spend snapshot is, and the bound the leader published. Older than the bound: its door count is stale. | | `doors` | The door count from the last spend snapshot. | | `admission` | As on a leader, computed with this door count. | | `load_samples` | This door's own picker samples, as on a leader. | | `registry_error`, `usage_error`, `spend_error` | The last error of the registry mirror, the usage push and the spend poll. Omitted when empty. | A cell door (`--role door`) answers `/gatewayz` with its routes instead: `role` (`door`), `routes_file`, `routes_loaded`, `routes_revision`, `routes`, `auto_routes`, `routes_age_s`, `routes_error`, `aliases` and `auto_aliases`. ## Worker probes A worker serves both on its own port (`:8081`), without a key: - `/healthz`: `200 ok` while the process serves HTTP. - `/readyz`: `503 not joined: …` until the leader accepted the worker's heartbeat; `503 engine: …` when its engine does not answer; from core v0.4.3, `503 engine warming up: …` until the engine has answered one generation; else `200 ok`. `/readyz?join=only` skips the engine check. --- title: "Metrics, traces and logs" description: "The Prometheus series a leader exposes on /metrics, the OpenTelemetry spans it emits, and how its logs are written and exported." url: "https://opod.io/docs/core-reference/metrics/" markdown_url: "https://opod.io/docs/core-reference/metrics.md" section: "Core reference" last_updated: "2026-11-08" --- # Metrics, traces and logs > The Prometheus series a leader exposes on /metrics, the OpenTelemetry spans it emits, and how its logs are written and exported. ## In short A leader serves Prometheus metrics at `GET /metrics` with no key; every series starts with `opod_`. With `OPOD_OTLP_ENDPOINT` set it also exports OTLP traces. Point your scraper at the leader, or at `probe_listen` when the main port speaks TLS. ```bash curl -s http://localhost:8080/metrics | grep '^opod_requests_total' ``` ## Prometheus metrics `GET /metrics` on the main listener (and on `probe_listen` when set). No key. All opod series start with `opod_`. ### Requests | Series | Type | Labels | Meaning | | ---------------------------------- | --------- | ------------------------------ | ------------------------------------------------------------------------------ | | `opod_requests_total` | counter | `model`, `protocol`, `outcome` | Inference requests. | | `opod_request_duration_seconds` | histogram | `model`, `protocol`, `outcome` | End-to-end duration. Buckets 0.1 s to 300 s. | | `opod_time_to_first_token_seconds` | histogram | `model` | Time to the first usable token, streamed answers only. Buckets 0.05 s to 60 s. | | `opod_request_tokens_total` | counter | `model`, `direction` | Tokens served; `direction` is `prompt` or `completion`. | ### Nodes and models | Series | Type | Labels | Meaning | | ------------------- | ----- | ------------------ | ----------------------------------------------------------------------------------------------------- | | `opod_node_up` | gauge | `node`, `hostname` | 1 when the node heartbeated recently. | | `opod_model_loaded` | gauge | `model`, `node` | 1 when the model is loaded on the node. | | `opod_worker_slots` | gauge | `node` | Requests a worker's engine serves at once, from its heartbeat. Absent for a worker that reports none. | Series of a node the leader forgets are deleted. ### Router | Series | Type | Labels | Meaning | | -------------------------------------- | --------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `opod_router_picks_total` | counter | `path`, `outcome` | Dispatch decisions. `path`: `local`, `worker`, `shard`, `fallback-to-local`. `outcome`: `ok`; `none-reachable` (`worker`, `shard`); `store-error`, `no-workers`, `all-workers-stale` (`fallback-to-local`); and, for each worker skipped on the `worker` path, `error` (no node or no address), `draining`, `stale-heartbeat`, `engine-stopped` or `cooldown`. | | `opod_router_inflight` | gauge | `node` | In-flight requests per node, as the router sees them. | | `opod_router_fallback_total` | counter | `op`, `reason` | Fallback activations. `op`: `chat`, `embed`, `rerank`. `reason`: `primary-error` (a fallback model answered after the primary failed), `per-request` (the same, on a chain the request named), `retry` (a retry of one candidate, `opod.num_retries`), `next-worker` (the same model on another worker, after the first gave nothing), `context-length` or `content-policy` (the error's class swapped in that class's fallback list). | | `opod_router_attempt_duration_seconds` | histogram | `model`, `outcome` | Per-attempt duration. | | `opod_router_cooldowns_active` | gauge | — | Workers in the circuit breaker's cooldown. | | `opod_router_sticky_hits_total` | counter | `outcome` | Sticky-session outcomes: `hit`, `miss`, `expired`. | | `opod_router_hedge_total` | counter | `outcome` | Hedged replicas: `win`, `cancelled`, `error`. | | `opod_pd_handoff_total` | counter | `outcome` | Prefill/decode handoffs: `split`, `retried`, or why not split (`penalty`, `penalty-unknown`, `engine`, `prefill-failed`, `no-prefill`, `pair-failing`: every prefill worker is held back as failing with this decode worker). | | `opod_pd_handoff_seconds` | histogram | `prefill`, `decode` | Prefill/decode handoff time per pair of worker node ids: from the decode call's start to its first streamed event (the KV pull, the decode engine's slot wait and its first token). Only a streamed split that the decode engine served is observed; a non-streamed or `retried` request is not. Arrives in the core release after v0.4.8. | | `opod_pd_transfer_bytes_total` | counter | `node` | KV bytes this worker's engine moved for handoffs since it started (vLLM's NIXL connector, `vllm:nixl_bytes_transferred`). Per worker, not per pair: vLLM does not name the peer. Absent when the engine does not say. Arrives in the core release after v0.4.8. | | `opod_pd_transfer_seconds_total` | counter | `node` | Seconds this worker's engine spent in KV transfers, summed (`vllm:nixl_xfer_time_seconds`). `rate(opod_pd_transfer_bytes_total) / rate(opod_pd_transfer_seconds_total)` is its transfer speed. Read it on decode workers: in vLLM's default pull mode the prefill worker reports 0. Absent when the engine does not say. Arrives in the core release after v0.4.8. | | `opod_pd_transfers_total` | counter | `node` | KV transfers this worker's engine completed. Absent when the engine does not say. Arrives in the core release after v0.4.8. | | `opod_pd_kv_fetch_requests` | gauge | `node`, `stage` | Requests on this worker waiting on a remote KV load, by stage: `waiting_to_start`, `in_progress` (the transfer), `loaded` (the KV is in place and the request waits for the decoder). A high `in_progress` is a slow transfer; a high `loaded` is a busy decoder. Absent when the engine does not say. Arrives in the core release after v0.4.8. | ### Admission | Series | Type | Labels | Meaning | | ----------------------------------- | --------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------- | | `opod_admission_held_total` | counter | `outcome` | Requests the admission hold handled: `served`, `shed_deadline`, `shed_cap`, `shed_evicted`, `cancelled`. | | `opod_admission_held` | gauge | `class` | Requests waiting for capacity now. | | `opod_admission_shed_total` | counter | `class`, `reason` | Held requests shed with `503`: `deadline`, `cap`, `evicted`, `unavailable`. | | `opod_admission_slot_waits_total` | counter | `class` | Requests dispatched only after waiting for a free slot. | | `opod_admission_wait_seconds` | histogram | `class` | Wait at the admission gate; 0 when a slot was free. | | `opod_admission_in_flight` | gauge | `model`, `class` | Requests dispatched and not yet complete. | | `opod_admission_slots` | gauge | `model` | Slots the model can serve at once across its workers, lowered to what the KV pool holds when the plan states a context. | | `opod_admission_ungoverned_workers` | gauge | `model` | Workers serving the model that report no slot count. While any serves, admission is unbounded. | `class` is `critical`, `standard` or `sheddable`. ### Usage push These series are new in core v0.4.0, with the [usage push](https://opod.io/docs/core-reference/streams/#usage-push). They are on the leader; a front door's records ride its push to the leader and are counted there. | Series | Type | Labels | Meaning | | -------------------------------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `opod_usage_queue_bytes` | gauge | | Bytes of encoded usage records the leader holds until a receiver takes them. `OPOD_USAGE_QUEUE_MB` is the cap. | | `opod_usage_queue_records` | gauge | | Usage records the leader holds until a receiver takes them. | | `opod_usage_sent_total` | counter | | Usage records a receiver acknowledged with a 2xx. | | `opod_usage_export_errors_total` | counter | | Pushes that failed: a network error or any status other than 2xx. The records stay queued and are sent again, except after a `400`. | | `opod_usage_dropped_total` | counter | `reason` | Usage records lost. `full`: the oldest, dropped to make room at the cap. `refused`: one record bigger than the whole queue. `rejected`: the receiver answered that it will never take them (a `400`, or a partial success). | A receiver that is down shows as `opod_usage_queue_records` growing and `opod_usage_sent_total` flat. Alert on `increase(opod_usage_dropped_total[10m]) > 0`: from that moment usage is being lost. With no `OPOD_USAGE_OTLP_ENDPOINT` the queue fills to its cap and then drops; the leader says so once at start. ### Response cache | Series | Type | Labels | | ------------------------- | ------- | ------ | | `opod_cache_hits_total` | counter | `path` | | `opod_cache_misses_total` | counter | `path` | On 0.2.1, `opod_callback_sent_total` (labels `sink`, `outcome`) and `opod_callback_queue_depth` (label `sink`) are declared but never incremented: no series appears. They are gone from 0.3.0. ### vLLM-named aliases For an inference gateway whose endpoint picker reads vLLM's metric names, `/metrics` also carries three gauges with a `model_name` label set to the plan's model: | Alias | Value | | --------------------------- | ------------------------------------------------------------------------------ | | `vllm:num_requests_waiting` | Requests the engines report queued, summed over workers and gang coordinators. | | `vllm:num_requests_running` | Leader in-flight requests minus the queue above, floored at 0. | | `vllm:kv_cache_usage_perc` | KV-cache use as a fraction 0–1, the **mean** over reporting samples. | The worker part is recomputed at most once a second. ### Grafana The repository ships three dashboards in `dashboards/`: cluster overview, per model and per node. Each binds to a Prometheus data source chosen at import. ## Traces Set `observability.otlp_endpoint` or `OPOD_OTLP_ENDPOINT` to an OTLP/HTTP collector, for example `http://localhost:4318`. Empty means no tracing and no overhead. W3C `traceparent` propagation is always on. A collector that wants a token, or sits behind a path, works from core v0.4.7: `OPOD_OTLP_HEADERS=Authorization=Bearer ` is sent on every trace and log export, and a URL path is kept as a prefix (`https://gw.example.com/otel` posts to `…/otel/v1/traces` and `…/otel/v1/logs`). In core v0.4.6 the leader sends no header and uses the host and port only. See [Environment](https://opod.io/docs/core-reference/environment/). ```text http.request └── router.Chat (covers the whole stream) ├── router.Chat.attempt (one per candidate or retry) │ └── .Chat (ollama, vllm, sglang, mlx, llamacpp, trtllm) └── … http.request └── router.Embed └── router.Embed.attempt └── .Embed ``` | Span | Attributes | | ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `router.Chat`, `router.Embed` | `opod.model.requested`, `opod.fallback.chain_length`, `opod.fallback.source` (where the chain came from, e.g. `catalog`), `opod.fallback.used_at`, `opod.model.served`, `opod.stream.events`; `opod.sort` with a sort override; `opod.latency.reordered` and `opod.latency.front` when the latency fallback moved a faster model first; `opod.retry.num_retries` and `opod.retry.backoff_ms` with a retry override; `opod.fallback.classifier` (the error class) when a typed fallback chain was considered | | `router.Chat.hedged` | `opod.model.requested`, `opod.hedge.replicas`, `opod.hedge.candidates`, `opod.hedge.winner` (the node that answered first). With fewer than 2 candidates the request falls through to `router.Chat`. | | `router.Chat.attempt` | `opod.attempt`, `opod.model.candidate`, `opod.is_fallback`, `opod.engine`, `opod.node_id`, and when recording `opod.gang.id`, `opod.class` | | `.Chat` | `opod.engine`, `opod.model`, `opod.engine.endpoint`, `opod.messages`, `http.status_code`, `opod.tokens.prompt`, `opod.tokens.completion`, `opod.tokens.cached` | Spans carry no key, user or team. Every engine call carries the trace on through the worker into the engine, so an engine that exports its own spans (vLLM with `--otlp-traces-endpoint`) joins the caller's trace. A cell door starts no span and passes `traceparent` through. `OPOD_TRACE_SAMPLE_RATIO` (0–1, default 1) samples the traces the leader starts, by trace id. A request with a `traceparent` follows its caller's decision. ## Logs The leader and workers write JSON log lines (`slog`) to stderr. `log_level`: `debug`, `info` (default), `warn`, `error`. `OPOD_OTLP_LOGS_ENDPOINT` also sends the leader's own records to an OTLP/HTTP collector, beside stderr, under the same `log_level`. Records carry `service.name=opod` and `service.version`. The queue holds 2048 records; a slow or absent collector costs the oldest queued records, never a request. A bad endpoint, or (from core v0.4.7) an `OPOD_OTLP_HEADERS` part that is not `k=v`, is a warning at start, not a failure. The same holds for traces from that release: an unusable trace endpoint or header logs `tracing disabled` and the leader still starts. Engine output is not exported; collect it from the host or the container. The policy snapshot's `logging.accessLog` switches the leader's access log on or off at runtime. --- title: "Plan file" description: "The JSON plan a manager mounts for a leader — every field the leader reads, what each one changes, how the file is watched, and how the leader heals declared gangs." url: "https://opod.io/docs/core-reference/plan-file/" markdown_url: "https://opod.io/docs/core-reference/plan-file.md" section: "Core reference" last_updated: "2026-10-30" --- # Plan file > The JSON plan a manager mounts for a leader — every field the leader reads, what each one changes, how the file is watched, and how the leader heals declared gangs. ## In short The plan file is a JSON document a manager writes to say what one endpoint is: its one model, its revision, adapters, request size and gangs. A leader that finds it at start serves that model only and re-reads the file every 10 seconds. Without it, the leader is unrestricted. ```json { "revision": 7, "model": { "id": "qwen2.5-7b-instruct" } } ``` The plan says what one endpoint is: its one model, how it scales, the adapters it serves, the request size it is sized for, and its gangs. A manager writes it; the leader reads it and serves within it. | Setting | Value | | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Path | `OPOD_PLAN_FILE`, default `/etc/opod/plan.json` | | Watched | only when the file **exists when the leader starts**. Without it the leader is standalone and unrestricted, and a file created later is not picked up until a restart. | | Re-read | every 10 seconds, when the file's modification time is newer than the last good read. No restart. | | Bad JSON | logged (`plan file unreadable — keeping last good plan`) and ignored; the last good plan stays in force and the file is read again every 10 seconds until it parses. | | Unknown fields | ignored, so the plan can carry a manager's own data. | | Event | a change of `revision` or `model.id` records `plan.updated` with the revision, and logs `plan file applied`. | ## Fields the leader reads ```json { "revision": 7, "model": { "id": "qwen2.5-7b-instruct" }, "autoscale": { "floor": 0, "max": 4 }, "adapters": [ { "name": "sql" }, { "name": "support" } ], "workload": { "inputTokens": 4000, "outputTokens": 1000, "maxContext": 8192 }, "shardGroups": [ { "id": "g0", "parts": [ {}, {} ], "parallelism": { "tensor": 1, "pipeline": 2, "expert": false }, "devicesPerPart": 1, "flags": { "ctx": "8192" }, "parked": false } ] } ``` | Field | Type | Effect | | ----------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `revision` | integer | Shown as `plan_revision` on `/loadz`, so you can see which revision a leader observes. | | `model.id` | string | The endpoint's **one model** (below). Empty = no model restriction. | | `autoscale.floor`, `autoscale.max` | integers | With `max > 0` and `floor == 0`, zero serving capacity is a healthy, parked state: `/readyz` answers `200` with mode `sleeping` or `waking` instead of `503 degraded`. | | `adapters[].name` | strings | The LoRA adapters this endpoint serves. Empty names are skipped. Empty list = no adapter check. | | `workload.maxContext` | integer | The longest request a worker must hold, in tokens. When `0`, `inputTokens + outputTokens` is used. | | `workload.inputTokens`, `workload.outputTokens` | integers | Used only when `maxContext` is `0`. | | `shardGroups[]` | array | The gangs the endpoint declares (below). | ### One model per endpoint With `model.id` set, the leader serves that model only. It passes: - the catalog id itself; - any engine-native name of it (for example the Ollama tag an engine reports); - `:` for a LoRA adapter, when `adapters` names it or names none. Anything else is refused before routing, with `404` and `error.type` `not_found`: ```text this endpoint serves only qwen2.5-7b-instruct (requested llama-3.2-3b) this endpoint serves only qwen2.5-7b-instruct with adapters sql, support (requested qwen2.5-7b-instruct:legal) ``` ### Workload and the KV bound With a workload context, admission counts no more requests at once per worker than that worker's KV-cache pool holds at that context; `/loadz` then reports `admission_bound: kv`. No workload means no KV bound, and admission holds a worker to its engine's slots only. A change of the context re-checks every held request at once. ## Gangs | Field | Effect | | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | `shardGroups[].id` | The gang id. Empty = `g0`, the default gang. | | `shardGroups[].parts` | One entry per part. **Only the count is read**; the objects can carry the manager's own data. A gang with no parts is skipped. | | `shardGroups[].parallelism.tensor`, `.pipeline` | Tensor- and pipeline-parallel sizes, as for `opod shard create --tp/--pp`. | | `shardGroups[].parallelism.expert` | `true` for a vLLM expert-parallel gang. | | `shardGroups[].devicesPerPart` | GPUs per part. | | `shardGroups[].flags` | Engine flags (string to string) passed to the gang's coordinator when the leader forms it, for example `ctx`. | | `shardGroups[].parked` | `true` = scaled to zero on purpose. The leader does not form it. | ### Gang healing A leader with a plan heals the gangs the plan declares. This is what lets an endpoint recover a gang while its manager is down: an autoscaler restores the worker pods, and the leader forms the gang on them. The rule is narrow on purpose: 1. Every **15 seconds** the leader looks at each declared gang that is not parked. 2. It acts only on a gang with **no parts at all**. A gang that lost one part is left alone: re-creating it would take down the parts still serving. 3. The gang must have been completely absent for **45 seconds**, so a manager that is doing its job always wins the first race. 4. Enough free workers must have registered for the gang's part count. 5. It runs the same create as `POST /admin/v1/shards/create`, with the plan's parts, parallelism, devices and flags. It does not choose where parts run: the parts are already on the nodes the manager placed them on. After a **failed** heal it backs off that gang: **15 s**, then **30 s**, then **60 s**. Each failure records `shard.heal_failed` with the gang, the plan revision, the create's `error.code`, the reason, the attempt number and `final`. After **3 failed attempts** at the same gang shape, the last event carries `final: true` and the leader stops trying that gang. The back-off and the give-up reset when: - a heal succeeds, or the gang appears by any other path; - the plan changes that gang's shape (parts, parallelism, devices or flags); - the gang leaves the plan's active set (parked or removed) and later comes back. A new `revision` alone does **not** reset them, since an autoscaler writes a revision for every scale. A gang that gave up is the manager's to fix: park it, change its shape, or form it by hand. While a heal runs, it holds the gang's create guard. A manager's own create of the same gang in that window gets `502 gang_create_in_flight`; read `shard.heal_failed` on the event stream for the leader's verdict. ## Revisions and traffic split Workers state the plan revision they were started for with `OPOD_PLAN_REVISION`. The policy snapshot's `routing.revisions` then splits traffic between revision groups, which is how a manager runs a canary. See [Policy snapshot](https://opod.io/docs/core-reference/policy-snapshot/#routing). ## Write it safely Write the file atomically (a temporary file, then a rename), or let a ConfigMap mount do it. Create the file **before** the leader starts: a leader that started without one never watches the path. --- title: "Auth snapshot" description: "The JSON auth file a manager mounts — API keys as hashes, revocations, request classes, worker-certificate policy — and exactly how the leader applies it." url: "https://opod.io/docs/core-reference/auth-snapshot/" markdown_url: "https://opod.io/docs/core-reference/auth-snapshot.md" section: "Core reference" last_updated: "2026-10-30" --- # Auth snapshot > The JSON auth file a manager mounts — API keys as hashes, revocations, request classes, worker-certificate policy — and exactly how the leader applies it. ## In short The auth snapshot is a JSON file of SHA-256 key hashes that a manager writes and a leader reads every 10 seconds. It gives a leader its endpoint keys with no plaintext key on the leader, and it turns key enforcement on or off. A key that leaves the file is revoked. ```bash printf '%s' 'sk-orc-' | sha256sum # the "hash" a key entry carries ``` ```json {"revision": "1", "issuedAt": "2026-10-30T10:00:00Z", "requireKeys": true, "keys": [{"id": "team-search-1", "name": "team-search", "hash": "<64 hex characters>", "scope": "user"}]} ``` The auth snapshot gives a leader its endpoint keys without any plaintext key reaching it. A manager writes it, typically from a Kubernetes Secret mounted into the leader's pod; the leader reads it. Nothing else is on the request path, so the leader keeps serving from the last snapshot it read when the manager is down. | Setting | Value | | ----------- | ------------------------------------------------------------------------------------------------------------------------ | | Path | `OPOD_AUTH_FILE`, default `/etc/opod-auth/auth.json` | | Off | `OPOD_AUTH_FILE=off`: no watcher at all | | Re-read | every 10 seconds, when the file's modification time is newer than the last good read | | Typed shape | `AuthSnapshot` and `SnapshotKey` in core's [`pkg/adminapi`](https://github.com/opod-io/opod-core/tree/main/pkg/adminapi) | - The file may appear after the leader starts; the watcher waits for it. - A file that is not valid JSON is logged (`auth file unreadable — keeping last good snapshot`) and ignored. The last good snapshot stays in force, and the file is read again every 10 seconds until it parses. - A snapshot that changes something records an `auth.updated` event with `requireKeys`, `keys`, `created`, `updated`, `revoked` and `revokedKeys` (and, in 0.3.0, `refused`), and logs `auth snapshot applied`. A re-issue that only moves `issuedAt` records nothing. ```json { "revision": "42", "issuedAt": "2026-10-30T10:00:00Z", "requireKeys": true, "keys": [ { "id": "team-search-1", "name": "team-search", "hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "scope": "user", "expiresAt": "2027-01-01T00:00:00Z", "class": "standard", "team": "search" } ], "revokedKeys": ["old-456"], "nodeMtls": "allow", "nodeCertCa": "-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----\n", "revokedCerts": ["4a3f9c01"] } ``` ## Fields | Field | Type | Meaning | | ---------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `revision` | string | A name for this version. A change of it counts as a change for the event and the log. | | `issuedAt` | RFC 3339 | When the manager wrote the snapshot. Its **age** is measured from here, not from the file time (the file time changes only when the content does, so a quiet fleet would look stale forever). Empty or not RFC 3339 = age unknown, and no age bound is enforced; a bad value logs a warning. | | `requireKeys` | bool | `true` = `/v1` demands a key. It is OR-ed with `auth.require_keys` in `config.yaml`: a snapshot can turn keys **on** at runtime, but `false` does not turn off a `require_keys: true` config (the default). | | `keys[]` | array | The endpoint's keys (below). | | `revokedKeys[]` | strings | Key ids the leader refuses even when a row for them is still in `keys`. | | `nodeMtls` | string | Worker certificate policy on register and heartbeat: `off` (or empty, or anything else), `allow`, `require`. | | `nodeCertCa` | PEM | One or more CA certificates a worker certificate must chain to. Public material; rotate it here with no restart. | | `revokedCerts[]` | strings | Certificate serial numbers to refuse even though the CA signed them. Lowercase hex, no separators. | ### Key fields | Field | Required | Meaning | | ----------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | yes | The key id. The leader names the key `k_cp_` in its store, usage rows and events; an id that already starts with `k_cp_` is used as is. A manager strips the prefix to find its own key again. | | `hash` | yes | Lowercase hex SHA-256 of the plaintext key (`sk-orc-…` or any string the callers present). | | `name` | no | Display name. | | `scope` | no | `user` (default), `admin` or `node`. | | `expiresAt` | no | RFC 3339 expiry. The caller then gets `401 key_expired`. Up to and including 0.2.1, a value that does not parse is ignored and the key does not expire. In 0.3.0 the entry is **refused**: a new key is not created, a known key keeps its stored row, and the log says `auth snapshot: key refused — expiresAt is not RFC 3339`. | | `class` | no | How this key's requests rank when the endpoint is full: `critical`, `standard` (default) or `sheddable`. A request may lower its own class with the `X-Opod-Class` header, never raise it. | | `team` | no | Requests of every key with the same team share one fair-share flow inside their class. Empty = the key is its own flow. Also the unit of prefix-cache isolation by default. | A key with no `id` or no `hash` is skipped. A key carries no rate limit, quota or model allowlist: those belong to the gateway in front of the endpoint. Fields from older snapshots (`rpmLimit`, `tpmLimit`, `quotaDailyTokens`, `allowedModels`) are ignored. Compute a hash: ```bash printf '%s' 'sk-orc-' | sha256sum | cut -d' ' -f1 ``` ## How the leader applies it Each read runs these steps, under one lock: 1. **Tombstones first.** Every id in `revokedKeys` is mapped to `k_cp_`. A key in `keys` whose id is also a tombstone is skipped. 2. **New keys.** A key id the store has not seen is written as a new row `k_cp_` with its hash, name, scope and expiry. Its `class` and `team` are held in memory only. 3. **Known keys.** Up to and including 0.2.1, a key id the store already has keeps the hash, name, scope and expiry it was first written with: to rotate a key or move its expiry, publish it under a **new id** and drop the old one. In 0.3.0 a known id follows the file: a changed hash, name, scope or expiry is written to its row and counted as `updated`, and the old hash stops working at that read. 4. **Keys that left the file** are revoked: every non-revoked `k_cp_` row whose id is no longer in `keys`. 5. **Tombstones** revoke their key. A tombstone for an id the store has never seen still creates a revoked row, so that id can never be created later. 6. **Revocation is final.** The leader never un-revokes an id it has seen revoked, whether by a tombstone or by leaving the file. A key that comes back under the same id stays refused; mint a new id. 7. **Keys minted locally** with `opod token create` (ids without `k_cp_`) are never touched. 8. `requireKeys`, the classes and teams, and the certificate policy take effect for the next request, register or heartbeat, with no restart. A tombstone list is an append: any process with write access to the mounted Secret can deliver a revocation correctly while the manager is down, where rebuilding the whole key list could not. ## Worker certificates `nodeMtls` decides how the leader treats a worker's client certificate on `POST /admin/v1/nodes/register` and `…/heartbeat`: | Mode | Behaviour | | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `off` | Certificates are ignored. The join token is the credential. | | `allow` | A worker that presents a certificate signed by `nodeCertCa` is authenticated by it, as scope `node`, and the token is not needed. A worker without one falls back to its token. | | `require` | A register or heartbeat with no such certificate is refused: `401 this endpoint requires a worker client certificate (nodeMtls=require) and the call presented none`. | - `allow` or `require` with no `nodeCertCa`, or a `nodeCertCa` with no parsable certificate, falls back to `off` with a warning in the log. - A certificate whose serial is in `revokedCerts` is refused with `403 certificate revoked (serial …)` and a `node.cert-refused` event, even while the worker's pod is still up. - Any other certificate error is `403 client certificate: …`. - The worker's identity is the node id in its SPIFFE SAN, `spiffe:///opod/node/`. A worker that registered with a certificate is bound to it: only that certificate (or an admin key) can act as that node id. Certificates are only seen when the leader serves TLS. See [Security](https://opod.io/docs/core/security/). ## Staleness By default a leader serves from whatever snapshot it holds, for as long as it holds it: availability wins over revocation. To make revocation win, set `auth.maxSnapshotAgeSec` in the [policy snapshot](https://opod.io/docs/core-reference/policy-snapshot/#auth) and re-issue the auth snapshot, with a fresh `issuedAt`, more often than that bound. Past the bound, while keys are required, every `/v1` request gets `503` with `Retry-After: 30` and this message, until a fresher snapshot arrives: ```text this endpoint's auth snapshot was issued 6m12s ago (at 2026-10-30T10:00:00Z), past its limit of 300s (policy auth.maxSnapshotAgeSec): API keys are refused until a fresher snapshot arrives; retry later ``` It is a `503`, not a `401`, on purpose: the key may be fine, and the caller should retry, not rotate it. The snapshot in force, its age and whether it is stale are on [`/loadz`](https://opod.io/docs/core-reference/probes/) as `auth_snapshot`. ## Write it safely - Write the file atomically (a temporary file, then a rename), or let the Secret mount do it. A half-written file fails to parse and is skipped; the next read picks up the complete one. - Keep `revision` meaningful: it is what the log and the event name. - Re-issue on a period shorter than `auth.maxSnapshotAgeSec` when you set one. --- title: "Policy snapshot" description: "The JSON policy file a manager mounts — load-aware routing, traffic split by revision, cache isolation, admission and request classes, wake rules and fallback." url: "https://opod.io/docs/core-reference/policy-snapshot/" markdown_url: "https://opod.io/docs/core-reference/policy-snapshot.md" section: "Core reference" last_updated: "2026-10-30" --- # Policy snapshot > The JSON policy file a manager mounts — load-aware routing, traffic split by revision, cache isolation, admission and request classes, wake rules and fallback. ## In short The policy snapshot is a JSON file a manager writes to tune how a leader routes and admits requests: routing weights, admission holds, the access log, wake rules and a fallback URL. Every field is optional. The leader re-reads it every 10 seconds and keeps the last good copy. ```json { "revision": "1", "routing": { "prefixAffinity": true } } ``` The policy snapshot tunes how a leader routes and admits requests. Path: `OPOD_POLICY_FILE`, default `/etc/opod-auth/policy.json`. `OPOD_POLICY_FILE=off` turns the watcher off. Like the auth snapshot, it is checked every 10 seconds, applied when it changes, and a file that is not valid JSON keeps the last good policy. A new policy records a `policy.updated` event. The typed shape is `PolicySnapshot` in core's [`pkg/adminapi`](https://github.com/opod-io/opod-core/tree/main/pkg/adminapi). Every field is optional; a zero value keeps the default behaviour. ```json { "revision": "12", "routing": { "kvWeight": 4, "kvSaturationPct": 90, "prefixAffinity": true, "prefixBlockWeight": 0.5, "speedRank": true, "cacheIsolation": "team", "revisions": [ { "revision": 6, "weight": 9 }, { "revision": 7, "weight": 1 } ], "fallbackUrl": "https://backup.example.com/v1", "fallbackModel": "qwen2.5-7b-instruct", "fallbackKey": "sk-…" }, "logging": { "accessLog": true }, "auth": { "maxSnapshotAgeSec": 600 }, "admission": { "holdMs": 5000, "maxHeld": 256, "classes": [ { "name": "critical", "holdMs": 10000 }, { "name": "standard", "holdMs": 5000 }, { "name": "sheddable", "holdMs": 1000, "maxShare": 0.25 } ] }, "wake": { "noResumeInPlace": ["n_slot-3"] } } ``` ## routing | Field | Default | Effect | | ------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `kvWeight` | `0` | Score a worker as in-flight + queue depth + `kvWeight` × (KV used ÷ 100). A full cache counts as `kvWeight` extra requests. `0` = in-flight only. | | `kvSaturationPct` | `0` (off) | A worker at or above this KV use goes behind every worker with headroom, and gets new requests only when none has any. | | `prefixAffinity` | `false` | Pin a prompt prefix to the worker that served it last, in a bounded table with the sticky TTL. | | `prefixBlockTier` | `gpu` | From core v0.4.0 (feature `kv_cpu_tier_hits`). `cpu-lower` credits a leading block a worker's CPU tier holds beyond its card's at 0.8 of a card block. The worker must report its CPU tier: a vLLM worker with `OPOD_KV_EVENTS=1` and `--kv-offloading-size` does, by starting vLLM with `self_describing_kv_events`. | | `prefixDepthKiB` | `0` | Arrives in the core release after v0.4.8 (feature `prefix_depth`). How much of a prompt's leading text the prefix match reads, in KiB: 256-byte links to 4 KiB, then one at each doubling distance and at this depth; the block index tokenizes as deep, at 4 bytes a token (never fewer than 2,048 tokens). `0` = 256; `4` = the 4 KiB chain; above 1024 is read as 1024. | | `loadRefreshMs` | `0` | From core v0.4.3 (feature `load_pull`, ADR-109). How often the leader and every front door pull each worker's load to rank on. `0` = 500 ms; below 100 is read as 100. A pulled sample older than three intervals is not ranked on. | | `tokenWeight` | `0` | Arrives in the core release after v0.4.8 (feature `routing_token_weight`, ADR-122). Each request also weighs its estimated uncached prompt tokens until its first streamed event (a non-streamed answer: the answer), or until it fails or is cancelled. The estimate is prompt bytes ÷ 4, or the block index's count when that is more, minus the leading blocks the worker holds. The score gains `tokenWeight` × tokens ÷ 1000, so `tokenWeight` is what 1,000 uncached prompt tokens weigh against one request in flight. `0` = requests only. | | `slowFactor` | `0` (off) | Arrives in the core release after v0.4.8 (feature `worker_slow`, ADR-122). Per model, each router keeps a worker's last 20 answers (none older than 2 min): TTFT per 1,000 uncached prompt tokens and the gap between tokens. A worker whose median of either is more than `slowFactor` × its siblings' median counts as that ratio of extra requests in flight. It is never refused, and it is cleared when normal answers bring the ratio back. A model with one worker is never judged. `/loadz` lists it under `slow_workers`. | | `session` | none | From core v0.4.3 (feature `session_routing`, ADR-109). `{ttlSec, signedRoute, turnPriority}`: how long a conversation stays on its worker (`0` = `stickyTtlSeconds`), whether answers carry a signed route token any door honours, and whether a later turn of an active conversation leaves the hold first. A request names its conversation with `X-Opod-Session` or the OpenAI `user` field. | | `stickyTtlSeconds` | `0` | From core v0.4.0 (feature `sticky_ttl_policy`). The sticky TTL in seconds, for session pins and prefix pins, applied live: pins placed afterwards expire by it, pins already placed keep theirs. `0` = the start value, `router.sticky_session_ttl_seconds`. | | `prefixBlockWeight` | `0` (off) | Each leading block of the request that a worker's engine reported holding takes this much off that worker's score. Needs workers started with `OPOD_KV_EVENTS=1`. | | `speedRank` | `false` | Rank an unsaturated worker by expected time: (score + 1) × its measured seconds per completion token. A worker with fewer than 10 answers takes its peers' median; one pick in 20 goes to the least-sampled worker. | | `cacheIsolation` | `team` | Whose requests may share a prefix cache: `team`, `key` or `none`. The leader adds a `cache_salt` (an HMAC of the team or key id) on engines that support one (vLLM, SGLang, TensorRT-LLM). From the core release after v0.4.8 (feature `kv_block_salt`) the block index carries the salt too. | | `revisions[]` | none | Split traffic between plan revisions. `weight` is a share, normalised: `[{6, 9}, {7, 1}]` sends 10 % to revision 7. A group with no live worker is skipped and its share goes to the others. | | `fallbackUrl` | none | An OpenAI-compatible base URL used **only** when the leader has no serving capacity. The response carries `X-Opod-Fallback`. The forwarded request carries `X-Opod-Forwarded-By` (the leader's `router.default_model`) and the caller's `traceparent`. | | `fallbackModel` | none | The model sent to the fallback. | | `fallbackKey` | none | The bearer sent to the fallback. | ## logging | Field | Effect | | ----------- | ----------------------------------------------------------------------- | | `accessLog` | `true` or `false` switches the leader's access log. Absent = unchanged. | ## auth | Field | Default | Effect | | ------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `maxSnapshotAgeSec` | `0` | When above 0, refuse keyed traffic once the auth snapshot's `issuedAt` is older than this, with `503` and `Retry-After: 30`. `0` = keep serving from the snapshot held. | ## admission Admission decides what a full endpoint does with the next request. A worker states how many requests its engine serves at once (llama.cpp slots, SGLang's running-request limit, vLLM `--max-num-seqs`). The leader dispatches only into a free slot and holds the rest. | Field | Default | Effect | | ----------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `holdMs` | `0` | How long a request waits for a slot before `503` + `Retry-After`. With `0`, a request that finds **no** worker able to serve is shed at once, and one that finds every slot busy waits, bounded by `maxHeld` and the client's own timeout. | | `maxHeld` | `0` = 64 | Cap on requests waiting at once, across every class. Past it the next one is shed at once with `503` + `Retry-After`. | | `classes[]` | none | Turn on request classes. Without it, every request is `standard`, first come first served. | With classes, the leader keeps one queue per class, dispatches strictly in class order (`critical`, then `standard`, then `sheddable`) and shares fairly per flow (key or team) inside a class. When the hold is full, the lowest class is shed first. | Class field | Effect | | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | `critical`, `standard` or `sheddable`. | | `holdMs` | This class's wait budget. `0` = shed at once. | | `maxHeld` | Cap on this class's waiting requests. `0` = only the global cap. | | `maxShare` | Fraction (0–1] of the model's slots this class may occupy at once: `max(1, floor(maxShare × slots))`. `0` = the class default: `critical` 1, `standard` 1, `sheddable` 0.25. | A worker that reports no slot count is **ungoverned**: while one serves, admission for the model is unbounded. `opod_admission_ungoverned_workers` and `/gatewayz` name them. ## wake | Field | Effect | | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `noResumeInPlace[]` | Node ids of sleeping workers the leader must **not** resume for a request, because their card is no longer theirs. A request that finds only such sleepers waits in the admission hold while the manager re-places the worker. Changes record `policy.wake_marks`. | Without marks, a request for a model whose workers sleep resumes one and is held through the wake (up to 3 seconds), then served. --- title: "Front doors and cell doors" description: "Run extra gateway copies for one endpoint with --role gateway, or one URL for many endpoints with --role door and its routes file." url: "https://opod.io/docs/core-reference/front-doors/" markdown_url: "https://opod.io/docs/core-reference/front-doors.md" section: "Core reference" last_updated: "2026-11-08" --- # Front doors and cell doors > Run extra gateway copies for one endpoint with --role gateway, or one URL for many endpoints with --role door and its routes file. ## In short A **front door** (`opod up --role gateway`) is an extra copy of one leader's gateway: it checks keys and routes to that leader's workers itself, so several of them spread client connections. A **cell door** (`opod up --role door`) is one URL in front of many leaders: it reads each request's `model` and forwards it, unchanged, to that endpoint. ```bash OPOD_ADMIN_TOKEN=sk-orc- opod up --role gateway --leader http://leader:8080 opod up --role door --routes /etc/opod-door/routes.json ``` Opod has two kinds of door. Both are `opod up` with a `--role`. | Aspect | Front door (`--role gateway`) | Cell door (`--role door`) | | ------------- | ----------------------------------------------------- | ------------------------------------- | | Serves | one leader's endpoint | many endpoints, chosen by `model` | | Routes to | that leader's workers, itself | the endpoint's leader, unchanged | | Checks keys | yes, like the leader | no; the endpoint's leader checks them | | Store, engine | none of its own | none | | Needs | `--leader` / `OPOD_LEADER_URL` and `OPOD_ADMIN_TOKEN` | `--routes` / `OPOD_DOOR_ROUTES` | ## Front door ```bash OPOD_ADMIN_TOKEN=sk-orc- opod up --role gateway --leader http://leader:8080 ``` A front door is an extra copy of the gateway for one endpoint. Run several behind a load balancer when one leader process should not carry every client connection. - It serves `/v1` and the probes only. No `/admin/v1`, no join surface, no engine. The worker registry, join tokens and gang calls stay with the leader. - It mirrors the leader's worker list and gangs (`GET /admin/v1/nodes`, which includes the worker tokens it needs to sign calls, and `GET /admin/v1/shards`) and routes to those workers itself. - It pushes its usage rows to the leader with `POST /admin/v1/usage/push`. The leader is the single writer of usage; rows are deduplicated by an id the door mints. The push also carries the door's `in_flight` and `rpm_1m`. From core v0.4.0 the leader adds the door's rows to its own queue for the [usage push](https://opod.io/docs/core-reference/streams/#usage-push), so they reach the receiver with the leader's. - It polls `GET /admin/v1/spend` every 10 seconds for the live door count. - It fails at start when it cannot reach its leader, rather than serving `503`s that look like an outage. - `OPOD_GATEWAY_ID` names the door in the leader's count (default: the hostname). - Its `/loadz` and its own time-to-first-token describe only its own traffic. Scale doors on the leader's `/gatewayz`, which totals all of them. See [Probes](https://opod.io/docs/core-reference/probes/#get-gatewayz). ## Cell door ```bash opod up --role door --routes /etc/opod-door/routes.json ``` A cell door is a name lookup, not a router. For each request it reads `model`, finds the endpoint in the routes file and forwards the request there unchanged, streaming included. It chooses no worker. On a plain route it retries nothing and falls back to nothing. It holds no credential: `Authorization` goes through as received and the endpoint's leader checks it. - `GET /v1/models` lists the models whose endpoint accepts the caller's key. - An unknown model answers OpenAI's `404 model_not_found`. - The door's own errors use OpenAI's envelope, `{"error": {"message", "type", "param", "code"}}`: | Status | `error.type` | Cause | | ------ | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | `400` | `invalid_request_error` | The body is not JSON, or not a JSON object when the door must rewrite `model`. | | `400` | `invalid_request_error` | An auto route: the request carries `tools` and no candidate has `tools: true`. | | `404` | `invalid_request_error` (`code: model_not_found`) | No route for the `model`, or no `model` in the body. | | `502` | `upstream_unavailable` | The endpoint did not answer the door (a plain route, or the last candidate of an auto route). The door does not retry. | An auto route moves to the next candidate when one is unreachable, answers `429` or `5xx`, or answers `400` for a context-length error. The last candidate's answer goes to the client as it is. - It serves `GET /v1/models`, `GET /v1/models/{id}`, every `POST /v1/…` (forwarded), and `/healthz`, `/readyz` and `/gatewayz`. Every other path is `404`. - It opens no store, starts no engine and mints no admin key. - It re-reads the routes file every 10 seconds. A file that repeats an alias is refused, and the last good file stays in force. ### Routes file The typed shape is `DoorRoutes` in core's [`pkg/adminapi`](https://github.com/opod-io/opod-core/tree/main/pkg/adminapi). ```json { "revision": "2026-10-30.1", "routes": [ { "alias": "qwen-coder", "upstream": "https://coder.internal:8080", "model": "qwen3-coder-30b", "ca": "-----BEGIN CERTIFICATE-----\n…" }, { "alias": "llama-3.2-3b", "upstream": "http://small.internal:8080" }, { "alias": "chat", "pick": "least-loaded", "maxHops": 1, "candidates": [ { "alias": "big", "upstream": "https://big.internal:8080", "model": "qwen3-30b", "tools": true }, { "alias": "small", "upstream": "http://small.internal:8080", "model": "llama-3.2-3b" } ] } ] } ``` | Route field | Meaning | | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `alias` | The name a client sends as `model`. Unique in the file. | | `upstream` | The endpoint's base URL: `scheme://host:port`, no `/v1`. | | `model` | When set and different from `alias`, the door rewrites the request's `model` to it and changes nothing else. Empty = the alias is the model id. | | `ca` | PEM certificates trusted for an `https` upstream — exactly these, never the system roots. Empty = system roots, or plain `http`. | | `candidates[]` | Makes this an **auto route**: the door picks one candidate and falls back down the list on an unavailable answer. `upstream`, `model` and `ca` of the route are then unused. | | `pick` | `first` (default): the first candidate that can take the request. `least-loaded`: by each candidate's `/loadz`. | | `maxHops` | How many fallbacks one request may take. Default 1, at most `len(candidates) - 1`. | | Candidate field | Meaning | | ------------------------- | ------------------------------------------------------------------------------------------------- | | `alias` | The candidate's own name. The response's `X-Opod-Endpoint` header names the one that answered. | | `upstream`, `model`, `ca` | As for a plain route. | | `tools` | The candidate's model can call tools. A request that carries `tools` skips candidates without it. | The `revision` the door serves from appears on its `/gatewayz`. --- title: "Engines" description: "The six engine drivers opod links, their names, aliases and default endpoints, how a worker launches them, and the engine flags a plan may set." url: "https://opod.io/docs/core-reference/engines/" markdown_url: "https://opod.io/docs/core-reference/engines.md" section: "Core reference" last_updated: "2026-10-30" --- # Engines > The six engine drivers opod links, their names, aliases and default endpoints, how a worker launches them, and the engine flags a plan may set. ## In short An engine is the inference server a node drives: Ollama, vLLM, SGLang, llama.cpp, MLX-LM or TensorRT-LLM. Each node uses one, chosen by `engine.preferred` or `OPOD_ENGINE`, and finds it at its default endpoint unless you name another. `OPOD_ENGINE_FLAGS` passes allow-listed flags to the engine launch. ```bash OPOD_ENGINE=vllm OPOD_VLLM_ENDPOINT=http://127.0.0.1:8000 \ opod join "http://leader:8080?token=sk-orc-" ``` An engine is the inference server a node drives. Each node uses one, chosen by `engine.preferred` / `OPOD_ENGINE`. Any alias resolves to the same driver. `GET /admin/v1/capabilities` lists the drivers linked into a binary. | Id | Aliases | Default endpoint | Endpoint override | One model per process | `cache_salt` | | ---------- | -------------------------------- | ------------------------ | ------------------------ | --------------------- | ------------ | | `ollama` | — | `http://127.0.0.1:11434` | `OPOD_OLLAMA_ENDPOINT` | no | no | | `vllm` | `tt-openai`, `tenstorrent`, `tt` | `http://127.0.0.1:8000` | `OPOD_VLLM_ENDPOINT` | yes | yes | | `sglang` | `sgl` | `http://127.0.0.1:30000` | `OPOD_SGLANG_ENDPOINT` | yes | yes | | `llamacpp` | `llama-cpp`, `llamacpp-rpc` | `http://127.0.0.1:8089` | `OPOD_LLAMACPP_ENDPOINT` | yes | no | | `mlx` | `mlx-lm` | `http://127.0.0.1:8080` | `OPOD_MLX_ENDPOINT` | no | no | | `trtllm` | `tensorrt-llm`, `trtllm-serve` | `http://127.0.0.1:8000` | `OPOD_TRTLLM_ENDPOINT` | yes | yes | - **One model per process.** Loading another model on such a worker stops the running engine and starts it again for the new model. `model add --node` and `model move` refuse that unless forced. - **`cache_salt`.** The engine keys its prefix cache by a request's salt, so the leader can isolate caches per team or key (`routing.cacheIsolation`). - **Native name.** Ollama serves a catalog model by `source.ollama_name`; the others by `source.repo`, else `source.path`. - **vLLM API key.** `OPOD_VLLM_API_KEY` is sent as a bearer to a vLLM server started with one. - The MLX default port is the leader's default port too. Move one of them when both run on one Mac. When the engine is down, a request gets `502 engine_unreachable` with the engine name, its endpoint and how to start it: | Engine | Start hint | | ---------- | ------------------------------------------------------------------------------------------ | | `ollama` | `ollama serve` | | `llamacpp` | `llama-server -m /path/to/model.gguf --port 8089` | | `mlx` | `mlx_lm.server --port 8080` | | `vllm` | start vLLM and make `OPOD_VLLM_ENDPOINT` match | | `sglang` | `python -m sglang.launch_server --model-path ` and make `OPOD_SGLANG_ENDPOINT` match | | `trtllm` | `trtllm-serve --port 8000` and make `OPOD_TRTLLM_ENDPOINT` match | ## Who starts the engine - **Ollama and MLX-LM** run on their own. Start them before opod; opod talks to them. - **llama.cpp on the leader.** With `engine.preferred: llamacpp`, `router.pull_default_model` on and nothing listening on the endpoint, `opod up` launches `llama-server -hf ` for the default model, watches its health every 30 seconds, restarts it after three failures in a row, and stops it at shutdown. - **On a worker,** a model load (`OPOD_LOAD_MODEL`, `model add --node`, a gang) launches vLLM, SGLang, llama.cpp or TensorRT-LLM as a supervised child process. A crashed child restarts with back-off; the worker reports the engine state (`serving`, `starting`, `restarting`, `crash-looping`, `stopped`) on its heartbeat. - **Device and memory.** The child sees `CUDA_VISIBLE_DEVICES` and friends from `--gpu`, and a memory setting derived from `--vram-budget`. - **llama.cpp offload.** On a worker with an accelerator, llama.cpp is started with all layers on the GPU (`--n-gpu-layers 999`) unless the plan sets `ngl`. - **Tool parsers.** For a model with the `tools` capability, a vLLM, SGLang or TensorRT-LLM launch adds the parser the catalog's `tool_parser` names (vLLM `--enable-auto-tool-choice --tool-call-parser NAME`, SGLang `--tool-call-parser NAME`, TensorRT-LLM `--tool_parser NAME`), unless `extra` already names one. ## Engine flags A manager sets per-worker engine flags with `OPOD_ENGINE_FLAGS`, a JSON object whose values are strings, numbers or booleans. Only these keys are used; the rest of the command line stays the worker's decision. The same keys go in a gang's `flags`. | Engine | Key | Becomes | | ------------ | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | vLLM | `tp` | `--tensor-parallel-size`; `auto` = the largest power of 2 not above the GPU count | | vLLM | `gpu_memory_utilization` | `--gpu-memory-utilization` (0.05–0.95); overrides the budget-derived value | | vLLM | `max_model_len` | `--max-model-len` | | vLLM | `max_num_seqs` | `--max-num-seqs` | | vLLM | `kv_cache_dtype` | `--kv-cache-dtype` | | vLLM | `kv_tier_fs` | An absolute directory for a disk KV tier below the host tier (needs `--kv-offloading-size` in `extra`). Bound it with `opod cache kv-prune`. | | vLLM, SGLang | `pp_layer_partition` | Layers per pipeline stage (`VLLM_PP_LAYER_PARTITION` / `SGLANG_PP_LAYER_PARTITION`) | | llama.cpp | `ctx` | `-c` | | llama.cpp | `ngl` | `--n-gpu-layers` | | llama.cpp | `parallel` | `-np` | | llama.cpp | `kv_cache_type` | `-ctk` / `-ctv` | | llama.cpp | `kv_unified` | `true` → `--kv-unified`, `false` → `--no-kv-unified` | | llama.cpp | `tensor_split` | `--tensor-split` (uneven shares per device, e.g. `12,8`) | | SGLang | `tp` | `--tp-size` | | SGLang | `mem_fraction_static` | `--mem-fraction-static`. From core v0.4.6, when SGLang refuses to start because the share is too small (`Raise --mem-fraction-static above 0.532 …`, common with a speculative draft model on a small card), the worker's engine error starts with the value to set: `set the engine flag mem_fraction_static to 0.54 or more …`. Core never raises it by itself: more for the static share is less KV cache for requests | | SGLang | `max_model_len` | `--context-length` | | SGLang | `max_running_requests` | `--max-running-requests` | | SGLang | `kv_cache_dtype` | `--kv-cache-dtype` | | TensorRT-LLM | `tp` | `--tp_size` | | TensorRT-LLM | `max_num_seqs` | `--max_batch_size` (always set) | | TensorRT-LLM | `max_model_len` | `--max_seq_len` | | TensorRT-LLM | `kv_cache_free_gpu_memory_fraction` | the KV cache memory fraction | | TensorRT-LLM | `kv_cache_dtype` | `kv_cache_config.dtype` in the config file | | all four | `extra` | Raw extra arguments, plain tokens only | ```bash OPOD_ENGINE=vllm \ OPOD_ENGINE_FLAGS='{"max_model_len":32768,"max_num_seqs":64,"kv_cache_dtype":"fp8"}' \ opod join http://leader:8080 ``` An invalid JSON value is ignored as a whole (no flags). ## Slots Each worker reports how many requests its engine serves at once: llama.cpp slots, SGLang's running-request limit, vLLM `--max-num-seqs`. When the engine does not state it, the worker reports what it put on the launch line. The admission gate uses these slots. See [Policy snapshot](https://opod.io/docs/core-reference/policy-snapshot/#admission). ## Capability limits | Feature | Engines | | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | Tool calls | vLLM, SGLang, TensorRT-LLM (with a parser), llama.cpp. Ollama is refused by name. | | Image input | Needs a model with the `vision` capability. SGLang, llama.cpp and MLX-LM are refused by name, because they are not proven to take images. | | Rerank | vLLM, SGLang, llama.cpp started with `--reranking`. Ollama and MLX-LM answer `501 rerank_not_supported`. | | Unload | Ollama unloads in place. A worker stops the vLLM, SGLang, llama.cpp or TensorRT-LLM process it launched. | | Sleep mode | vLLM (`OPOD_SLEEP_MODE=1`). Others answer `501`. | | LoRA adapters | vLLM. | | Gangs | llama.cpp RPC, vLLM with Ray, SGLang multi-node. TensorRT-LLM is one node only. | --- title: "Container images" description: "The leader and worker images opod publishes, what each one needs from the node, the entrypoint's environment contract, labels and verification." url: "https://opod.io/docs/core-reference/images/" markdown_url: "https://opod.io/docs/core-reference/images.md" section: "Core reference" last_updated: "2026-11-02" --- # Container images > The leader and worker images opod publishes, what each one needs from the node, the entrypoint's environment contract, labels and verification. ## In short Opod publishes one container image per engine and accelerator, plus `opod-leader` for leaders and doors, at `ghcr.io/opod-io/`, free to pull. One entrypoint configures every image from environment variables. `opod image ls` prints the same list offline. ```bash opod image ls --vendor nvidia ``` Each image runs one engine on one accelerator. It is built from the official upstream image plus a thin opod layer: the `opod` binary and an entrypoint script. Images are published to `ghcr.io/opod-io/` and pull without credentials. There is no floating `latest` tag: pin a digest. `opod image ls`, `opod image show IMAGE` and `opod image recommend MODEL` print this table and each image's limits from data embedded in the binary. See [`opod image`](https://opod.io/docs/core-cli/image/). ## Images | Image | Engine | Vendor | Platforms | Gang | Proven | Base | | ----------------------------- | ------------ | ----------- | ------------ | --------------------------------------------- | ------------------------------------------- | ---------------------------------------------------------------- | | `opod-leader` | — | — | amd64, arm64 | — | yes | `debian:bookworm-slim` | | `opod-worker-llamacpp-nvidia` | llama.cpp | NVIDIA | amd64 | `rpc` | yes | `ghcr.io/ggml-org/llama.cpp:full-cuda` + RPC pair | | `opod-worker-llamacpp-amd` | llama.cpp | AMD | amd64 | `rpc` | yes | `ghcr.io/ggml-org/llama.cpp:full-rocm` + RPC pair | | `opod-worker-llamacpp-intel` | llama.cpp | Intel | amd64 | `rpc` | yes | `ghcr.io/ggml-org/llama.cpp:full-intel` (SYCL) + RPC pair | | `opod-worker-llamacpp-cpu` | llama.cpp | CPU | amd64, arm64 | `rpc` | yes | `ghcr.io/ggml-org/llama.cpp:full` + RPC pair | | `opod-worker-vllm-nvidia` | vLLM | NVIDIA | amd64 | `ray` | yes (`0.2.1`) | `vllm/vllm-openai` (v0.33.0 in `0.3.0`) | | `opod-worker-vllm-amd` | vLLM | AMD | amd64 | — | yes (`0.2.1`) | `rocm/vllm` in `0.2.1`; `vllm/vllm-openai-rocm` in `0.3.0` | | `opod-worker-vllm-intel` | vLLM | Intel | amd64 | — | no | `intel/vllm` (XPU) in `0.2.1`; `vllm/vllm-openai-xpu` in `0.3.0` | | `opod-worker-vllm-tt` | vLLM | Tenstorrent | amd64 | — | yes | Tenstorrent `tt-inference-server` | | `opod-worker-sglang-nvidia` | SGLang | NVIDIA | amd64 | `sglang` † | yes | `lmsysorg/sglang` (CUDA) | | `opod-worker-sglang-amd` | SGLang | AMD | amd64 | `sglang` † | no | `lmsysorg/sglang` (ROCm) | | `opod-worker-sglang-intel` | SGLang | Intel | amd64 | — (`sglang` in the release after core v0.4.7) | no (`yes` in the release after core v0.4.7) | `lmsysorg/sglang` (XPU) | | `nvcr-trtllm-nvidia` | TensorRT-LLM | NVIDIA | amd64, arm64 | — | yes | `nvcr.io/nvidia/tensorrt-llm/release`, run unmodified | **Gang** says how a worker on the image joins a split model: `rpc` (llama.cpp RPC parts), `ray` (vLLM multi-node), or `sglang` (SGLang's own launcher; rank 0 serves the group). † The `sglang` value is new in 0.3.0: on 0.2.1 the column reads `—` for SGLang, and `opod image recommend` offers no image for a model that SGLang must split. The Intel SGLang image also gangs with the same launcher, by tensor parallel only (see its note below); core v0.4.2's manifest still reads `—` for it. **Proven** means the image has served requests on the hardware it names. `0.3.0` moves the NVIDIA, AMD and Intel vLLM images to vLLM's own v0.33.0 images. On 2026-11-02 the NVIDIA one served on one RTX 3060 Ti and the AMD one on one RX 7900 XTX. The Intel one has not served on its new base. ### Notes per image - **llama.cpp.** Upstream llama.cpp images ship without the RPC backend. Every `opod-worker-llamacpp-*` image adds a built RPC pair (`rpc-server` and a `llama-server` with `--rpc`) in `/opt/llama-rpc`, and says so with the label `io.opod.llamacpp.rpc=true`. A llama.cpp image without that label is single-node only. - **llama.cpp AMD** carries Instinct (gfx908, gfx90a, gfx942) and Radeon (gfx1030, gfx1100–1102, gfx1150–1151, gfx1200–1201) targets in one binary. - **vLLM AMD.** In `0.2.1` it is AMD's `rocm/vllm` RDNA build, for Radeon and Radeon Pro only; Instinct needs a rebuild on the CDNA base. vLLM's docs mark `rocm/vllm` deprecated and AMD has retired its fork, so from `0.3.0` the image is built on vLLM's own `vllm/vllm-openai-rocm`: one build for Instinct (gfx90a, gfx942, gfx950) and Radeon RX 7000 / RX 9000 (gfx1100, gfx1101, gfx1200, gfx1201, plus gfx1150 and gfx1151). It does not cover RDNA2 (RX 6000). The node's amdgpu driver must run ROCm 10.0 userspace; it has served on amdgpu 6.10.5. - **vLLM Intel** targets Xe2/Xe3 (Arc B-series, Arc Pro B60) and Max. It does not run on Arc A-series; use `opod-worker-llamacpp-intel` there. From `0.3.0` it is built on vLLM's own `vllm/vllm-openai-xpu`. - **vLLM Tenstorrent.** The image tag must match the tt-metal and vLLM commits of the model spec being served. It needs `/dev/hugepages-1G` and a mounted model spec. The image carries the `0.10.0-55fd115-aa4ae1e` build, so generate the spec with `tt-inference-server` 0.10.1. - **SGLang NVIDIA** needs NVIDIA driver 580 or newer (CUDA 13). **SGLang AMD** is Instinct only (MI200/MI300, MI350); a Radeon card serves through llama.cpp or vLLM. - **SGLang Intel** is upstream's XPU build. Upstream targets Arc B-series and Arc Pro B-series (Xe2). On 2026-11-07 it served through opod workers on Arc A770 (Xe-HPG) cards: one card, and a model split by tensor parallel 2 across two A770 machines on plain ethernet. Both used the default `triton` attention backend, bf16 weights and no engine flags. No Xe2 card has served yet. Pipeline parallel has not run on Intel. Core v0.4.2's `opod image ls` still prints `no` for this image; the release after core v0.4.3 prints `yes`. - **TensorRT-LLM** is NVIDIA's image, unmodified: its licence forbids distributing a changed copy. A worker pod copies `opod` and the entrypoint in from the leader image with an init container. Pulling it is your acceptance of NVIDIA's terms. One node only. ## Entrypoint contract Every image uses one entrypoint script. It knows nothing about Kubernetes or any manager: it is plain opod configured by environment. | Variable | Role | Meaning | | ----------------------------------------------------------------------------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `OPOD_ROLE` | all | `leader` (default), `gateway`, `door` or `worker`. `worker` runs `opod join`; the others run `opod up` with that role. | | `OPOD_LISTEN`, `OPOD_JOIN_TOKEN`, `OPOD_REQUIRE_KEYS`, `OPOD_PULL_DEFAULT_MODEL`, `OPOD_ENGINE` | leader | Optional. | | `OPOD_LEADER_URL` | gateway, worker | Required. | | `OPOD_ADMIN_TOKEN` | gateway | Required: the registry and spend reads need an admin key. | | `OPOD_GATEWAY_ID` | gateway | Default: the hostname. | | `OPOD_DOOR_ROUTES` | door | Required. | | `OPOD_JOIN_TOKEN` | worker | Required unless `OPOD_NODE_CERT` is set. | | `OPOD_ENGINE` | worker | `llamacpp` (default), `vllm`, `sglang` or `trtllm`; anything else exits `2` with `unknown engine`. The entrypoint also sets that engine's endpoint variable to its default port when unset (`OPOD_LLAMACPP_ENDPOINT` `http://127.0.0.1:8089`, `OPOD_VLLM_ENDPOINT` and `OPOD_TRTLLM_ENDPOINT` `http://127.0.0.1:8000`, `OPOD_SGLANG_ENDPOINT` `http://127.0.0.1:30000`). | | `OPOD_ENGINE_START` | worker | A shell command that starts the engine, for a vendor image whose engine has its own launcher (the Tenstorrent image sets it). The entrypoint runs it beside `opod join`; opod then only connects to the engine. When either process exits, the container exits `1` so it is restarted. On a stop, the engine is stopped after `opod join` has drained. Unset = the worker launches the engine on a model load. | | `OPOD_LOAD_MODEL` (+ `OPOD_LOAD_REPO`, `OPOD_LOAD_FILE`) | worker | The catalog model the worker loads. | | `OPOD_MODELS_DIR` | worker | Default `/data/models`. Mount a volume there. | | `OPOD_ENGINE_FLAGS` | worker | JSON engine flags. | | `POD_IP`, `POD_NAME` | worker | From the Kubernetes downward API. `POD_IP` sets `OPOD_ADVERTISE_ADDR=$POD_IP:8081` and `POD_NAME` sets `OPOD_NODE_ID=n_$POD_NAME`, each only when that variable is unset. | | `OPOD_LEADER_CA` | gateway, worker | Also used for the wait below: `curl --cacert` against a TLS leader. | | `OPOD_DATA_DIR` | all | Default `/var/lib/opod`. | | `OPOD_CATALOG_DIR` | all | Default `/usr/local/share/opod/catalog`. | | `HF_HOME`, `LLAMA_CACHE` | all | Default `/hf` and `/llamacpp`. | | `OPOD_BASE_ENV_FILE` | all | `0.2.1` only, **removed in `0.3.0`**: no base image needs it once the Intel vLLM worker runs on `vllm/vllm-openai-xpu`. In `0.2.1` it names a script (and its arguments) the entrypoint sources once before it starts anything, such as Intel's oneAPI `setvars.sh`. Default `/usr/local/share/opod/base-env`; absent = nothing is sourced. A file that names a missing script stops the container. | | `OPOD_ENDPOINT_MODEL` | leader | Printed in the entrypoint's start line only. It changes nothing. | Run a leader, a worker, a front door and a cell door from the images (replace `` with a release tag, and pin by digest in production): ```bash docker run -d --name leader -p 8080:8080 -v opod-leader:/var/lib/opod \ -e OPOD_ROLE=leader -e OPOD_JOIN_TOKEN=sk-orc- -e OPOD_REQUIRE_KEYS=1 \ -e OPOD_ENDPOINT_MODEL=llama-3.2-3b \ ghcr.io/opod-io/opod-leader: docker run -d --name worker --gpus all --network host -v /data/models:/data/models \ -e OPOD_ROLE=worker -e OPOD_LEADER_URL=http://192.0.2.10:8080 -e OPOD_JOIN_TOKEN=sk-orc- \ -e OPOD_ENGINE=llamacpp -e OPOD_LOAD_MODEL=llama-3.2-3b -e OPOD_MODELS_DIR=/data/models \ -e OPOD_ADVERTISE_ADDR=192.0.2.51:8081 \ ghcr.io/opod-io/opod-worker-llamacpp-nvidia: docker run -d --name front -p 8090:8080 \ -e OPOD_ROLE=gateway -e OPOD_LEADER_URL=http://192.0.2.10:8080 \ -e OPOD_ADMIN_TOKEN=sk-orc- -e OPOD_GATEWAY_ID=front-1 \ ghcr.io/opod-io/opod-leader: docker run -d --name door -p 8095:8080 -v /etc/opod-door:/etc/opod-door:ro \ -e OPOD_ROLE=door -e OPOD_DOOR_ROUTES=/etc/opod-door/routes.json \ ghcr.io/opod-io/opod-leader: ``` The worker binds its API to `OPOD_ADVERTISE_ADDR`, so it runs with `--network host` here: `192.0.2.51` must be an address of the host. From core v0.4.0, a container on a bridge network can instead set `OPOD_BIND_ADDR=0.0.0.0` and publish the port (`-p 8081:8081`); the worker warns, because llama.cpp's `rpc-server` would then listen on every interface of the container. Overrides of the image defaults, for example a different data and catalog directory, an engine launched by its own script and a vLLM worker with flags: ```bash -e OPOD_DATA_DIR=/srv/opod -e OPOD_CATALOG_DIR=/srv/opod/catalog -e OPOD_ENGINE=vllm -e OPOD_ENGINE_FLAGS='{"max_model_len":"32768"}' -e OPOD_LOAD_MODEL=llama-3.2-3b -e OPOD_LOAD_REPO=bartowski/Llama-3.2-3B-Instruct-GGUF -e OPOD_LOAD_FILE=Llama-3.2-3B-Instruct-Q4_K_M.gguf -e OPOD_ENGINE_START='/opt/start-engine.sh --port 8000' -e OPOD_LEADER_CA=/etc/opod/ca.crt -e OPOD_LISTEN=:8080 -e OPOD_PULL_DEFAULT_MODEL=false ``` The entrypoint: - writes `config.yaml` with `data_dir` and `storage.models_dir` (models_dir has no environment variable); - exports the embedded catalog to `/usr/local/share/opod/catalog` when that directory is missing, and sets `OPOD_CATALOG_DIR`; - sets `HF_HOME` and `LLAMA_CACHE` under the models directory; - sets `HOME` to the data directory when the container has no writable home (non-root, restricted pods); - for a front door and a worker, waits for the leader: `GET $OPOD_LEADER_URL/healthz` every 5 seconds, 120 times (10 minutes), then exits `1`; - starts a leader, a front door and a cell door with `opod up --config /config.yaml --no-wizard`, `OPOD_LISTEN` defaulting to `:8080`; a leader's `OPOD_PULL_DEFAULT_MODEL` defaults to `false`, and a front door's is forced to `false`; - starts a worker with `opod join "$OPOD_LEADER_URL"`; the token stays in `OPOD_JOIN_TOKEN`, never on the command line; - forwards `SIGTERM` to the opod process and waits, so a stopping worker says goodbye and drains. Front doors and cell doors hold no weights; their models directory defaults to `/models`. Every [worker environment variable](https://opod.io/docs/core-reference/environment/#process-contract-worker) also applies. ## Labels | Label | On | Value | | ------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `io.opod.leader.features` | `opod-leader` | The leader's feature keys, comma-separated and sorted — the output of `opod version --features`. A manager can read what a pinned leader speaks before running it. | | `io.opod.llamacpp.rpc` | `opod-worker-llamacpp-*` | `true` when the image carries the RPC pair. | Read labels from the registry without pulling: ```bash crane config ghcr.io/opod-io/opod-leader@sha256: | jq '.config.Labels' ``` ## Verify Release images are signed keyless through Sigstore and carry a package-level SPDX SBOM attestation: ```bash cosign verify \ --certificate-identity-regexp 'https://github.com/opod-io/' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com \ ghcr.io/opod-io/opod-leader: cosign verify-attestation --type spdxjson \ --certificate-identity-regexp 'https://github.com/opod-io/opod-core/' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com \ ghcr.io/opod-io/opod-worker-vllm-nvidia@sha256: | jq -r .payload | base64 -d ``` Images built outside the release workflow are not signed. ## Never build on cluster nodes Images are built once, pushed, and pinned by digest. Every upstream base is itself pinned by digest in the Dockerfiles, so a build is reproducible from its commit. --- title: "Catalog format" description: "The YAML schema of a catalog entry, where opod looks for catalog files and in which order, and how to add or override a model." url: "https://opod.io/docs/core-reference/catalog/" markdown_url: "https://opod.io/docs/core-reference/catalog.md" section: "Core reference" last_updated: "2026-10-30" --- # Catalog format > The YAML schema of a catalog entry, where opod looks for catalog files and in which order, and how to add or override a model. ## In short A catalog entry is one YAML file that describes a model: where the weights come from, its size, the hardware it needs and the engines that serve it. The curated entries are embedded in the binary; a file in an override directory adds an entry or replaces one by `id`. Copy an entry with `opod catalog export`, edit it, and install it. ```bash opod catalog export /tmp/cat cp /tmp/cat/llama-3.2-3b.yaml ~/.opod/catalog/my-model.yaml # then change id: to my-model opod model add my-model ``` A catalog entry describes one model: where its weights come from, how big it is, what hardware it needs and which engines serve it. The curated catalog is embedded in the binary from core's [`pkg/catalog`](https://github.com/opod-io/opod-core/tree/main/pkg/catalog). `opod catalog ls` lists it; `opod catalog export DIR` writes it out. ## Where opod looks Every source that exists is merged by `id`, and a later source wins: 1. the catalog embedded in the binary; 2. `/usr/local/share/opod/catalog`; 3. `/usr/share/opod/catalog` (packages; a worker image's exported copy); 4. `$OPOD_CATALOG_DIR`; 5. `~/.opod/catalog` (most authoritative). Nothing else is read: not `./catalog`, not a directory beside the binary. Only files at the top level of a directory are read; `.yaml` and `.yml` both work. `catalog_dir` in `config.yaml` is a different switch: with a path set, that one directory is read **alone**. ## Add or override a model ```bash cat > ~/.opod/catalog/my-model.yaml <<'EOF' id: my-model display_name: My Model 7B Q4 source: type: huggingface repo: my-org/my-model-GGUF file: my-model-Q4_K_M.gguf size_bytes: 4400000000 quant: q4_k_m context_window: 32768 capabilities: [chat, tools] recommended_engines: [llamacpp, ollama] hardware: min_ram_gb: 8 tags: [small, apache-2.0] license: apache-2.0 EOF opod model add my-model ``` Or `opod model add --file ./my-model.yaml` (`--from` up to core v0.4.5), which copies the file into `~/.opod/catalog/`. To change a curated entry, write a file with the same `id` into an override directory. ## Schema Unknown fields are ignored. | Field | Type | Meaning | | ---------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | string | Unique id used in the CLI, the API and requests. Kebab-case; match the file name. | | `display_name` | string | Human-readable name. | | `source` | object | Where the weights come from. See below. | | `size_bytes` | int | Weight size on disk. Used by the picker, admission and the part-count picker. | | `quant` | string | Quantization label (`q4_k_m`, `q8_0`, `f16`, …). Display only. | | `context_window` | int | Maximum tokens, input plus output. | | `trained_context` | int | The trained window when `context_window` needs rope scaling the engine must be told to apply. `0` = `context_window` is the trained one. | | `capabilities` | list | `chat`, `tools`, `vision`, `audio`, `embedding`, `rerank`. `vision` gates image input. `audio` is a discovery tag. | | `recommended_engines` | list | Engine ids that can serve the model, in preference order: `ollama`, `vllm`, `sglang`, `mlx`, `llamacpp`, `trtllm`. `opod image recommend` walks this list. | | `hardware.min_ram_gb` | int | RAM floor (unified memory on Apple Silicon). For a sharded entry, the combined requirement. `model add` refuses below it unless `--force`. | | `hardware.min_vram_gb` | int | GPU memory floor. Optional. | | `tags` | list | Free-form search tags. Entries with a non-permissive licence carry `restricted-license`. | | `sharding` | object | Set when the model must be split. See below. | | `architecture` | object | The model's shape. See below. | | `tool_parser` | map | Per engine id, the tool-call parser that engine needs for this model, e.g. `{vllm: hermes, sglang: qwen25, trtllm: qwen3}`. Without a key, that engine starts with no parser and refuses requests with `tools`. llama.cpp and Ollama need none. | | `license` | string | Licence identifier (SPDX where possible). | | `license_url` | string | Licence text URL. | | `released` | string | Release date, `YYYY-MM-DD`. Used by `--sort=released` and `--since`. | | `fallback` | list | Models to try, in order, when this one fails. | | `fallback_on_context_length` | list | Used instead of `fallback` when the failure is a context-length error. | | `fallback_on_content_policy` | list | Used instead of `fallback` when the failure is a content-policy refusal. | ### source | Field | When | Meaning | | ------------- | ------------- | ------------------------------------------------------------------------------------------------------- | | `type` | always | `ollama`, `huggingface` or `file`. | | `ollama_name` | `ollama` | The tag passed to `ollama pull`, e.g. `llama3.2:1b`. | | `repo` | `huggingface` | The Hugging Face repo, e.g. `bartowski/Llama-3.3-70B-Instruct-GGUF`. | | `file` | `huggingface` | One GGUF file in the repo, for llama.cpp. Leave it out for a safetensors repo served by vLLM or SGLang. | | `path` | `file` | A local path to a GGUF or a safetensors directory. | ### sharding | Field | Meaning | | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | | `required` | `true` = `opod model add` hands off to `opod shard create`. | | `default_shards` | Part count when the API is given neither a count nor `nodes`. No default: with `0` such a create fails with `shard count must be at least 1`. | | `engine` | `llamacpp` (default), `vllm` or `sglang`. Picks the gang backend. | | `rpc_port_base` | llama.cpp: each part's `rpc-server` binds from this port up. Default (`0` or absent) `50052`. | | `coordinator_port` | llama.cpp: the coordinator's `llama-server` port. Default (`0` or absent) `9001`. | ### architecture Optional. A placer validates a split against it: tensor parallel must divide `heads`, pipeline parallel must not exceed `layers`, expert parallel needs `experts`. The part-count picker never splits into more parts than `layers`. Unknown values are never refused. | Field | Meaning | | -------------------------------------------------------------------- | --------------------------------------------------------------------------- | | `params` | Parameter count. | | `layers` | Transformer layers. | | `heads`, `kv_heads` | Attention heads and KV heads. | | `experts` | Mixture-of-experts experts; `0` = dense. | | `head_dim` | Attention head dimension. `0` = assume 128. | | `kv_lora_rank`, `qk_rope_head_dim`, `qk_nope_head_dim`, `v_head_dim` | Multi-head latent attention (DeepSeek-style) shape. | | `sliding_window`, `sliding_layers` | Layers that keep only the last `sliding_window` tokens. | | `state_layers`, `state_bytes` | Hybrid layers with a fixed per-sequence state instead of a per-token cache. | These let a reader size the KV cache: one token is 2 × layers × kv_heads × head_dim × bytes per element, adjusted for the attention layouts above. ## Signed files See [Models → Signed catalog files](https://opod.io/docs/core/models/#signed-catalog-files). A file that is byte for byte an embedded entry needs no signature. ## Example: a sharded entry ```yaml id: llama-3.3-70b-sharded display_name: Llama 3.3 70B (sharded, manual GGUF) source: type: file path: /var/lib/opod/models/llama-3.3-70b-q4_k_m.gguf size_bytes: 42949672960 quant: q4_k_m context_window: 131072 capabilities: [chat, tools] recommended_engines: [llamacpp] hardware: min_ram_gb: 48 tags: [sharded, large, restricted-license] license: llama-3-community sharding: required: true default_shards: 2 engine: llamacpp rpc_port_base: 50052 coordinator_port: 9001 architecture: params: 70600000000 layers: 80 heads: 64 kv_heads: 8 ``` --- title: "Worker API" description: "The HTTP routes a worker serves to its leader, how the leader authenticates to them, their bodies and errors, and what the register and heartbeat carry." url: "https://opod.io/docs/core-reference/worker-api/" markdown_url: "https://opod.io/docs/core-reference/worker-api.md" section: "Core reference" last_updated: "2026-11-08" --- # Worker API > The HTTP routes a worker serves to its leader, how the leader authenticates to them, their bodies and errors, and what the register and heartbeat carry. ## In short Each worker serves an HTTP API on port `8081` (or `OPOD_ADVERTISE_ADDR`) that only its leader calls, signed with HMAC. You need it only for debugging or to write a manager. `/healthz` and `/readyz` need no signature. ```bash curl -s http://192.0.2.51:8081/readyz ``` A worker serves an HTTP API on its address: port `8081` on its LAN address, or `OPOD_ADVERTISE_ADDR`, which is also where it binds unless `OPOD_BIND_ADDR` names another address. Only its leader calls it. You do not call it in normal operation; this page is for debugging and for people writing a manager. The typed shapes are in core's [`pkg/nodeapi`](https://github.com/opod-io/opod-core/tree/main/pkg/nodeapi). The server sets a 30-second limit on reading request headers. A trace context (`traceparent`) from the leader is continued into the worker's call to its engine; the worker exports no spans of its own. ## Authentication Every route except `/healthz` and `/readyz` needs one of: - **An HMAC signature** from the leader, in the `X-Opod-Auth` header: ```text X-Opod-Auth: v=1,id=,ts=,sig= ``` `sig` is hex HMAC-SHA256, keyed by the worker's token, over these four lines joined by `\n`: ```text v1 ``` `ts` must be within **5 minutes** of the worker's clock, so keep the clocks in sync. The body is not signed: uploads stream many gigabytes, and the trust model is a private network. A bad signature answers `401 unauthorized (hmac): `. - **The worker's token as a bearer**, `Authorization: Bearer `, unless the worker runs with `OPOD_REJECT_BEARER=1`. Then it answers `401 unauthorized (HMAC required; bearer disabled)`. The token is the join token the worker presented, or, for a worker that joined with a certificate only, the random `sk-orc-cb-…` secret it minted. The leader received it at register. A worker with no token answers every keyed route `401 worker has no token configured`. ## Routes | Path | Method | Purpose | | ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `/healthz` | `GET` | `200 ok`. No key. The process is up. | | `/readyz` | `GET` | No key. `200 ok` when the worker is joined **and** its engine answers. From core v0.4.3 the engine must also have answered one generation since it started (a one-token warm-up request the worker sends itself): until then `503 engine warming up: …`. Otherwise `503` with `not joined: ` or `engine: `. `?join=only` skips the engine check (a worker whose engine starts only on a load). | | `/v1/models` | `GET` | What the engine has, as `{"object":"list","data":[{"id":"…","object":"model"}]}`. | | `/v1/chat/completions` | `POST` | Chat, forwarded to the engine. Streams when the body asks. | | `/v1/embeddings` | `POST` | Embeddings, forwarded to the engine. The OpenAI body: `model` and `input` (one string or a list). | | `/v1/rerank` | `POST` | Rerank, forwarded to the engine: `{"model", "query", "documents"}` (a list of strings). `501 rerank_not_supported` where the engine has none. | | `/v1/sampling-defaults` | `GET` | The served model's own sampling defaults, from its generation config. | | `/v1/load` | `GET` | From core v0.4.3 (feature `load_pull`). The engine's load sample (`kv_used_pct`, `queue_depth`, … and `sampled_at_ms`), for the leader and front doors to rank on. `?maxAgeMs=N`: a sample younger than N ms (at least 100) is served from the worker's cache, so many routers cost the engine one scrape. `501` when the engine reports no load. | | `/v1/tokenize` | `POST` | Tokenize a prompt with the served model's tokenizer: `model` plus `messages` or `prompt`, optional `max_tokens` → `{"tokens": [...]}`. The leader has no tokenizer and asks a worker, for prefix-cache routing (feature `kv_block_events`). `501` when the engine cannot. | | `/v1/model/load` | `POST` | Pull and load a model on this worker (below). | | `/v1/model/unload` | `POST` | The counterpart (below). | | `/v1/model/sleep` | `POST` | Sleep tier: the engine drops its GPU working set and keeps the process (vLLM sleep mode, `OPOD_SLEEP_MODE=1`). No body. → `{"status":"sleeping","engine":"…"}`. | | `/v1/model/resume` | `POST` | Wake from sleep. → `{"status":"resumed","engine":"…"}`. Both answer `501` with `"status":"unsupported"` and a `reason` on an engine with no sleep mode. | | `/v1/adapters` | `GET` | The LoRA adapters this worker holds. | | `/v1/adapters/load` | `POST` | `{"base", "name", "source", "rank"}`: load an adapter into the engine serving `base`; it is served as `:`. `base` is required; `rank` must not be negative. → `{"status":"ready","model":":"}`. `409` when the engine must restart to take it, `502` when the load fails. | | `/v1/adapters/unload` | `POST` | `{"base", "name"}`, both required → `{"status":"unloaded","model":":"}`. | | `/v1/process/start` | `POST` | Start a supervised process (a gang part, a coordinator, a Ray node). Body: `ProcessSpec`. → `202` with `ProcessInfo`; `502` with `{"error", "info"}` when it cannot start. From core v0.4.7, `"KVEvents": true` marks a gang head's engine that publishes KV events here: a worker started with `OPOD_KV_EVENTS=1` then subscribes. | | `/v1/process/get` | `GET` | `?id=` → `ProcessInfo`. The leader polls it for readiness after a `202`. | | `/v1/process/list` | `GET` | Every supervised process: `[]ProcessInfo`. | | `/v1/process/logs` | `GET` | `?id=&lines=` → the last lines of its output, `text/plain`. | | `/v1/process/stop` | `POST` | `{"id": "…"}` → `204`. | | `/v1/process/file` | `HEAD` | `?name=&sha256=` → `200` with header `X-File-Path` when a GGUF with that SHA-256 is present, else `404`. | | `/v1/process/upload` | `POST` | `?name=&sha256=`, raw body → `{"path","sha256","size"}`. Streams a GGUF to this worker and checks its SHA-256. The leader uses it to distribute a split model's weights. | ### Load and unload `POST /v1/model/load`: ```json {"id": "llama-3.2-3b", "ollama_name": "llama3.2:3b", "repo": "bartowski/Llama-3.2-3B-Instruct-GGUF", "file": "Llama-3.2-3B-Instruct-Q4_K_M.gguf", "path": "", "pin": false} ``` `id` is required: the catalog id, and the name the model is served under. The worker picks what its engine needs: an Ollama tag, a GGUF to fetch (from `repo` and `file`, or `path` when the file is already cached), or a Hugging Face repo for a safetensors engine. For vLLM, SGLang, llama.cpp and TensorRT-LLM the load **starts the engine process** with the model. It answers `{"status": "ready", "model": ""}` once the engine serves. `POST /v1/model/unload` takes the same identifying fields (`id`, `ollama_name`, `repo`, `path`) and answers: | Status | Body `status` | Meaning | | ------ | ------------- | ------------------------------------------------------------------------------------------- | | `200` | `unloaded` | The engine unloaded the model, or the worker stopped the engine process it launched for it. | | `200` | `noop` | Nothing to do: the model was not loaded. The call is idempotent. | | `409` | — | A gang part or an adapter of the model is still held. | | `501` | `unsupported` | The engine cannot unload. `reason` says why. | ### Supervised processes `ProcessSpec` fields (capitalised on the wire): `ID` (unique on the worker), `Command`, `Args`, `Env` (added to the worker's environment, on top of the device pin and the VRAM budget), `WorkDir`, `HealthPort` and `HealthHost` (readiness probes this TCP port; host default `127.0.0.1`), `HealthPath` (an HTTP readiness path), `ReadyTimeout`, `LogLines` (ring-buffer size), `Restart`, `MaxRestarts`, `RestartBackoff`. `ProcessInfo` fields: `id`, `command`, `args`, `pid`, `started_at`, `status`, `exit_err`, `address`, `restarts`. ## Register and heartbeat The worker calls the leader, with both an HMAC signature and its token as a bearer: - **`POST /admin/v1/nodes/register`** once at start: node id, hostname, OS, architecture, RAM, address, hardware (CPU cores, GPUs and their memory, engine id, role, KV tier, plan revision, devices given), and a new **boot id**. A changed boot id under the same node id tells the leader the old process died: its placements and gang rows are dropped (`node.reincarnated`). - **`POST /admin/v1/nodes/heartbeat`** every 5 seconds: | Field | Meaning | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id`, `boot_id` | Who is speaking. | | `loaded_models` | What the engine answers requests for, as catalog ids. From core v0.4.3 it is `[]` until the engine has answered the worker's one-token warm-up generation, so a worker whose engine lists a model before it can generate (TensorRT-LLM: about 70 s) gets no requests yet; a sleeping engine is not warmed. `null` = the engine did not answer within 2 seconds: **no report**, which changes no placement. `[]` = a definite "nothing" (nothing listens where the engine would). | | `resident_models` | For an engine that loads on first request (Ollama): which of those are in memory now. | | `sleeping` | The engine is asleep. | | `load`, and, from vLLM's NIXL connector, `kv_xfer_bytes_total`, `kv_xfer_seconds_total`, `kv_xfers_total`, `kv_fetch_waiting_to_start`, `kv_fetch_in_progress` and `kv_fetch_loaded` (arrives in the core release after v0.4.8) | The engine's load sample: `kv_used_pct`, `queue_depth`, `tokens_per_s`, `prefix_hit_pct`, `sampled_at`, and when the engine states them `kv_capacity_tokens`, `kv_used_tokens`, `preemptions_total`, `evictions_total`, the prefix-cache counters `prefix_hit_tokens_total` and `prefix_query_tokens_total` (vLLM; from core v0.4.1), the host KV tier counters (`tier_*`) and `engine_ttft_p50_ms`. | | `slots` | How many requests the engine serves at once: the engine's own word, else the number on its launch line. Omitted when neither is known. | | `engine` | The engine process state: `starting`, `serving`, `crash-looping`, `restarting` or `stopped`. `crash-looping` = the worker restarted the process more than once in its lifetime, even if the current attempt is up: the leader does not count it as capacity, and a gang part in this state is checked as possibly down. The state comes with `restarts`, `since` and `detail`, and, from core v0.4.1, the engine's own `version` once it serves (vLLM `/version`, SGLang `/server_info`, llama-server `/props` `build_info`). | | `kv_blocks` | With `OPOD_KV_EVENTS=1`: prefix-cache block hashes stored and removed since the last beat (`seq`, `block_size`, `stored`, `removed`, `cleared`). From core v0.4.0 (feature `kv_cpu_tier_hits`), `cpu_stored` and `cpu_removed` say the same for the engine's host-memory tier below the card (vLLM CPU offloading); `cleared` forgets that tier too. Omitted when the worker has no such tier or its engine does not describe it. | A heartbeat is also sent at once, out of turn, when the engine process changes state, so a crash or a restart reaches the leader well before the next timed beat. When the engine stays silent (no report) past the heartbeat bound, the node becomes `engine-silent` and gets no new work. **Figure: Heartbeats and the router.** A timeline of worker heartbeats, the age of the last one, and when the router stops and resumes sending new requests as the worker stops and returns. The interactive figure is on the web page: | Leader answer | Worker reaction | | ----------------------- | ------------------------------------------------------------------------------- | | `200` `{"status":"ok"}` | Next beat in 5 seconds. | | `404` | The leader forgot the node: register again. | | `401` / `403` | Register again with the same token; exit after 6 refused re-registers in a row. | | network error, `5xx` | Back off: 10 s, then 20 s. | On shutdown the worker sends a goodbye heartbeat (`loaded_models: []`, engine `stopped`, detail `worker shutting down`) so the leader takes it out of rotation at once, then drains for `OPOD_DRAIN_SECONDS`. See [`opod join`](https://opod.io/docs/core-cli/join/#stopping). --- title: "Control plane overview" description: "What the opod control plane manages, the jobs it takes off your hands, and where each part is documented." url: "https://opod.io/docs/control-plane/" markdown_url: "https://opod.io/docs/control-plane.md" section: "Control plane" last_updated: "2026-11-01" --- # Control plane overview > What the opod control plane manages, the jobs it takes off your hands, and where each part is documented. ## In short The control plane (`opodcp`) turns a Kubernetes cluster with GPUs into a set of OpenAI-compatible endpoints. You tell it which model to serve and how; it measures every card, places the workers, keeps them running, scales them and records what they did. It is never on the request path: each endpoint's leader serves requests even while the control plane is down. It is free up to 4 GPUs. **Works with LiteLLM.** Put LiteLLM in front of your endpoints for per-user keys, budgets and rate limits; opod keeps the GPUs. See [Use with LiteLLM](https://opod.io/docs/get-started/litellm/). ## When you need it - You run open models on your own GPUs and want one way to create, scale and roll them out. - Several teams share a pool of GPUs and you need to see who holds which card. - You need an audit trail and usage numbers for GPUs you own. - You want this page to find where a feature is documented. ## Do it 1. **Install** ```bash helm install opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --create-namespace \ --set ports.state.dsnSecret.name=opod-state --set cell.name=prod ``` See [Install](https://opod.io/docs/control-plane-install/) for the database Secret and the checks before this line. 2. **Open the console** ```bash kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d; echo kubectl -n opodcp port-forward svc/opodcp 8080:8080 ``` Open `http://127.0.0.1:8080` and sign in with the token. 3. **Create an endpoint** On **Endpoints → New**, pick a model from the catalog, press **Preview**, then **Create**. See [Create an endpoint](https://opod.io/docs/control-plane-endpoints/create/). 4. **Call it** The endpoint page's **Connect** card prints the URL and a `curl` with a key. Any OpenAI client works. ## Check it worked ```bash kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor ``` The endpoint page reads `serving` with a proof line, and **Overview** counts it under endpoints serving. Every doctor row is `✔` except `identity`, which stays red until you create a user or connect OIDC. ## If it fails | Symptom | Where to look | | ------------------------------------------- | ----------------------------------------------------------------------------------------------------- | | `helm install` fails | [Preflight](https://opod.io/docs/control-plane-install/preflight/) | | The console shows **Connect your database** | [Setup mode](https://opod.io/docs/control-plane-install/kubernetes/#setup-mode) | | A create is refused with an `E-…` code | [Troubleshooting → Creating an endpoint](https://opod.io/docs/control-plane-operate/troubleshooting/) | | A doctor row is red | [Doctor](https://opod.io/docs/control-plane-operate/doctor/) | | A placement is refused `E-LICENCE` | [Licensing](https://opod.io/docs/control-plane/licensing/) | ## What it is The control plane (`opodcp`) is one binary with its console built in. You install it with the `opod` Helm chart into the cluster it manages. It runs core's leaders and workers as Kubernetes workloads and keeps them matching the plans you write. ## What it manages | Area | What it does | Docs | | --------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | Capacity | measures every card through per-vendor probes; keeps a per-GPU VRAM ledger; places dedicated and shared workers against measured memory | [Placement](https://opod.io/docs/control-plane-endpoints/placement/) | | Endpoints | one leader per model, workers and gangs under it, front doors, the cell door | [Create an endpoint](https://opod.io/docs/control-plane-endpoints/create/) | | Plans | a versioned desired state per endpoint; every revision kept with its cause | [The plan](https://opod.io/docs/control-plane-endpoints/plan/) | | Changes | every create, edit and rollout is a run with steps, proofs, cancel and give-back | [Rollouts and runs](https://opod.io/docs/control-plane-endpoints/rollouts/) | | Scaling | in-flight, queue, KV-pressure and time-to-first-token triggers; engine sleep; scale to zero; KEDA | [Autoscaling](https://opod.io/docs/control-plane-endpoints/autoscaling/) | | Models | the catalog, user models, versions, approval, signatures, prefetch, LoRA | [Models](https://opod.io/docs/control-plane-endpoints/models/) | | Traffic | admission by worker slots, request classes, fallback, cache isolation, routing by load | [Routing policy](https://opod.io/docs/control-plane-endpoints/routing/) | | Access | endpoint API keys, users, roles, OIDC, teams, machine tokens | [API keys](https://opod.io/docs/control-plane-endpoints/api-keys/), [Users and SSO](https://opod.io/docs/control-plane-security/authentication/) | | Machines | cordon, evacuate, drain, time-slice, cache prune, card reset | [Machines](https://opod.io/docs/control-plane-operate/machines/) | | Usage | per-request rows and GPU-seconds, exported to your store | [Usage](https://opod.io/docs/control-plane-operate/usage/) | | Health | `opodcp doctor`, alerts, metrics, logs, traces | [Doctor](https://opod.io/docs/control-plane-operate/doctor/) | | Audit | a hash-chained record of every change, evidence exports | [Audit](https://opod.io/docs/control-plane-security/audit/) | ## How it is built **One endpoint is one leader and one model.** For each endpoint the control plane renders a leader Deployment (core's `opod up`), its Service, its workers (core's `opod join`, one engine each) and, for a model split across GPUs, gangs. A leader is the request path: it routes, admits and authenticates every request. The control plane is never on it. A leader keeps serving from its mounted plan and auth files while the control plane is down or restarting. **The control plane decides; Kubernetes runs.** The control plane holds the truth in its database: endpoints, plans and their revisions, runs, keys, policies, alerts and the audit chain. Kubernetes objects are its projection. Every object it creates carries `opod.io/cell` and `opod.io/endpoint` labels and has one owner, so running an operation twice is safe. **Every dependency is a port.** The state store is your Postgres. Every other port (usage sink, event bus, logs, metrics, traces, identity, alerts, secrets, checkpoints, batch files, KV store) runs on an embedded default until you connect your own service on the Connectors page. See [Connectors](https://opod.io/docs/control-plane-operate/connectors/). ### The control loops One replica runs these loops (with several replicas, the one that holds the Lease; see [High availability](https://opod.io/docs/control-plane-install/high-availability/)). `GET /api/v1/controllers` and the Settings page show each loop's interval, runs, errors and last run. | Loop | Every | What it does | | --------------------------------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `watch` | 5 s | reads the nodes and every endpoint's pods once, turns them into each endpoint's observed status and events, and hands that snapshot to the other loops | | `autoscaler` | 10 s | reads each leader's `/loadz` and grows, parks or wakes workers by the plan's policy | | `reconciler` | 1 min | converges every endpoint's objects to its stored plan; repairs what drifted. It leaves alone an endpoint whose create is still running, and one whose first deployment failed and was torn down (in `0.3.0` that holds in every state the endpoint reads, not only `pending`) | | `auth-reissue` | 1 min | keeps each leader's auth snapshot inside its age bound, even when the endpoint's apply keeps failing | | `usage-puller` | 15 s | pulls each leader's usage stream through its cursor into the spool. From 0.3.0 it pulls only a leader without core's `usage_push`; a newer leader pushes its rows to `POST /otlp/v1/logs` | | `usage-shipper` | 15 s | ships the spool to the connected usage sink | | `meter` | 1 min | records GPU-seconds each serving worker holds | | `fleet-sampler` | 1 min | the one-minute sample the Overview plots | | `telemetry` | 2 min | keeps one GPU probe DaemonSet per vendor present | | `alerts` | 15 s | raises, refreshes and resolves alerts, and sends them to the notifier | | `stops`, `gave-up`, `janitor` | 30 s, 30 s, 1 min | finish stops nobody waits on, park a gang its leader gave up on, find objects nobody owns | | `leader-move` | 15 s | moves leaders off nodes that are being evacuated | | `jobs`, `batches` | 10 s | run and follow training jobs and OpenAI batches | | `kv-sampler`, `kv-tier-auto`, `kv-disk-sweep` | 2 min, 10 min, 5 min | KV cache measurements, `tier: auto` resizing, disk tier clean-up | | `audit-retention`, `usage-retention` | 10 min | trim by the retention windows | | `gpu-daily-files` | 1 h | a GPU-hours CSV per closed day beside the S3 sink (and the Parquet sink up to 0.3.6) | | `stream-tickets` | 10 min | removes expired stream tickets | | `door-routes`, `inference-pools` | 1 min | the cell door's routes file, Gateway API InferencePools | `controllers` in the chart (`OPODCP_CONTROLLERS`) can restrict which loops run; leave it empty in production. **Figure: The request path of one endpoint.** Your app calls the leader, which routes each request to the least loaded live worker. The control plane only writes configuration and is not on the request path. Pick a failure and watch where requests go. The interactive figure is on the web page: ## Three ways to drive it - **The console** at the control plane's URL. See [Console tour](https://opod.io/docs/control-plane-operate/console/). - **The REST API** under `/api/v1`, with an OpenAPI 3.1 document at `GET /api/v1/openapi.json`. See [API reference](https://opod.io/docs/control-plane-reference/api/). - **The `opodcp` CLI**, which ships inside the image. See [CLI reference](https://opod.io/docs/control-plane-reference/cli/). ```bash docker run --rm ghcr.io/opod-io/opodcp:0.3.6 -h ``` ## What it is not - It is not a gateway. Per-user keys, budgets, rate limits and prompt checks belong to the gateway you run in front of an endpoint. See [Gateways in front](https://opod.io/docs/control-plane-endpoints/gateways/). - It does not price anything. It exports quantities; you apply your price. - It does not build images or install drivers on your nodes. `opodcp infra` installs k3s on bare machines, and that is all it installs on a host. * [Install](https://opod.io/docs/control-plane-install/): Kubernetes, bare machines, air-gapped. * [Licensing](https://opod.io/docs/control-plane/licensing/): Free up to 4 GPUs; keys, grace and burst. * [Several cells](https://opod.io/docs/control-plane/fleet/): A fleet control plane over many clusters. --- title: "Licensing" description: "The free tier, licence keys, grace, burst headroom and several cells. A licence limits new placements only and never stops a running endpoint." url: "https://opod.io/docs/control-plane/licensing/" markdown_url: "https://opod.io/docs/control-plane/licensing.md" section: "Control plane" last_updated: "2026-10-31" --- # Licensing > The free tier, licence keys, grace, burst headroom and several cells. A licence limits new placements only and never stops a running endpoint. ## In short opod is free up to 4 GPUs in total, with every feature. A licence key raises that number. The key is a signed text string that the control plane checks offline: nothing calls us, ever. A licence only limits **new** placements: when a key expires or is exceeded, everything that runs keeps running, and only the next GPU beyond the limit is refused with `E-LICENCE`. ## When you need it - You want to run opod on more than 4 GPUs. - A placement was refused `E-LICENCE`. - Your key is about to expire, or the console says `grace`. - You run several cells and want one key across them. - You must explain to procurement what happens when a licence lapses. ## Do it 1. **Check the key before you install it** The `opodcp` binary evaluates a key exactly as a control plane would, for the cell name you give: ```bash docker run --rm -i ghcr.io/opod-io/opodcp:0.3.6 licence inspect --cell prod - < customer.key ``` ```json { "token": { "v": 1, "id": "lic_…", "org": "Example Corp", "cell": "*", "maxGpus": 16, "plan": "team", "issuedAt": "2026-10-31T00:00:00Z", "expiresAt": "2027-10-31T00:00:00Z" }, "tier": { "plan": "team", "maxGpus": 16, "source": "key", "state": "valid", "org": "Example Corp", "tokenId": "lic_…", "expiresAt": "2027-10-31T00:00:00Z", "graceUntil": "2027-12-30T00:00:00Z", "detail": "team plan · 16 GPUs · expires 2027-10-31" } } ``` `tier.state` must be `valid`. `wrong-cell` means the key is bound to another cell name: check `--cell`. 2. **Install it** Use one of the three ways below: Helm, the API or the console. Pick one. A key installed through the API outranks the chart values. The change is live: no restart and no pod roll. **Helm** ```bash kubectl -n opodcp create secret generic opod-licence --from-file=key=customer.key helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ --set licence.existingSecret=opod-licence ``` `licence.key` takes the key inline instead; the chart then stores it in Secret `-opodcp-licence`. **API** ```bash curl -s -X PUT -H "Authorization: Bearer " -H 'Content-Type: application/json' \ --data "{\"key\":\"$(cat customer.key)\"}" \ https://cp.example.com/api/v1/licence ``` `{"key":""}` clears the stored key and returns the cell to the chart's key, or to the free tier. **Console** Open **License & census → Install token** and paste the key. You need the admin role. The page answers with the tier the key grants. ## Check it worked ```bash export H="Authorization: Bearer $(kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d)" curl -s -H "$H" https://cp.example.com/api/v1/licence \ | jq '{state, plan, maxGpus, detail, cellGpus, licensedGpus, unlicensedGpus}' ``` A good answer has `"state": "valid"`, your `maxGpus`, and `unlicensedGpus: 0`. The console's **License & census** page shows the same, and the doctor's `licence` row is `✔`. ## If it fails | Answer | Cause | Fix | | ------------------------------------------------------------------------------------------ | ---------------------------------------------------- | ---------------------------------------------------------------------------- | | `error: token signature does not verify against any known opod key` from `licence inspect` | the key was edited, cut short, or is not an opod key | copy the whole key again from the email, or ask for a copy | | `error: not an opod capacity token (expected the opod1. prefix)` | the file holds something else | check that the file starts with `opod1.` | | `"state": "invalid-key"` | the installed key does not verify | `detail` names the reason; install the right key | | `"state": "wrong-cell"` | the key is bound to another cell name | install a key for this cell, or ask for one with `cell: *` | | `"state": "grace"` | the key expired and grace runs | install the renewed key before `graceUntil` | | A placement refused `E-LICENCE` | it would land beyond the licensed GPUs | install a larger key; nothing running stops meanwhile | | `PUT /api/v1/licence` answers `403` | the caller is not an admin | use an admin token | ## How licensing works The control plane is free up to **4 GPUs in total**, summed across every cell. A licence key raises that number. The key is a signed string the control plane checks **offline**: nothing calls us to start, serve or check it. ## The rules 1. **One number is licensed: GPUs.** A key carries `maxGpus`. CPU, memory, endpoints, requests, tokens and users are not metered. 2. **The limit gates new placements only.** A placement on a GPU beyond the licensed count is refused with `E-LICENCE` and a remedy. Running workers are never stopped. 3. **Expiry has a grace period.** After `expiresAt` the key keeps its full ceiling for `graceDays` (default 60). After grace, new placements fall back to the free tier. 4. **No remote kill.** Nothing in the request path checks a licence, and the control plane makes no licence call to anyone. **Figure: What happens around a licence's expiry date.** A timeline of the licence phases from 30 days before expiry through the grace period and after it. At every day, running endpoints keep serving; what changes is whether new work is accepted. The interactive figure is on the web page: ## The free tier With no key the control plane runs the full product up to 4 GPUs in total. It is not a trial and no feature is held back. Fleet mode is open to the free tier. ## What a key holds A key has the form `opod1..`: a base64url JSON payload and a base64url Ed25519 signature over it. The control plane verifies the signature against public keys built into its binary. | Field | Meaning | | ----------------------- | -------------------------------------------------------------- | | `id` | the licence id (`lic_…`) | | `org` | your organisation | | `cell` | the cell name the key is bound to; empty or `*` means any cell | | `maxGpus` | GPUs allowed, summed over every cell that carries this key | | `plan` | the plan name, for example `team` or `enterprise` | | `issuedAt`, `expiresAt` | the validity window | | `graceDays` | days of full ceiling after expiry; 60 when absent | ## States `GET /api/v1/licence` and the console's **License** page show one of these states: | State | When | GPUs for new placements | | ------------- | ---------------------------------------------------------------- | ------------------------- | | `free` | no key installed | 4 | | `valid` | the key verifies, the cell matches, not expired | the key's `maxGpus` | | `grace` | expired, inside `graceDays` | still the key's `maxGpus` | | `expired` | grace is over | 4 | | `wrong-cell` | the key is bound to another cell name | 4 | | `invalid-key` | the signature does not verify (edited, truncated, wrong product) | 4 | A bad key never stops the control plane: `wrong-cell` and `invalid-key` fall back to the free tier. Read `detail` after you install a key — it names the reason. ## How the ceiling is applied The ceiling is spread over nodes in enrolment order: the oldest node first (by creation time, then name) takes its GPUs until the ceiling is reached. A plan whose worker would land on a GPU beyond that line is refused. `GET /api/v1/licence` lists `cellGpus`, `licensedGpus`, `unlicensedGpus` and each node's licensed count. ## Burst headroom A paid key may run a little over its ceiling for a short time, so a night-time burst is not refused at 02:00. - The headroom is 10 % of `maxGpus`, rounded up. - It applies to a key in state `valid` or `grace`. The free tier has none. - The window is 72 hours from the first placement that used it. After that, new placements are held to `maxGpus`. - It re-arms after the cell has spent 30 days back inside its ceiling. - When the window closes, nothing running is touched. `GET /api/v1/licence` and the License page say when a cell is bursting and until when. ## Several cells A key counts GPUs **summed over every cell it is installed in**. Install the same key on each cell. A cell sees only its own GPUs, so on its own it checks those against the key. A [fleet control plane](https://opod.io/docs/control-plane/fleet/) reads every cell, adds them up per key, and tells each cell every 30 s whether the sum is over: - **Told over:** the cell refuses new placements beyond the GPUs it holds now (`E-LICENCE`, the remedy names the fleet). Running workers never stop. A plan that keeps or shrinks what it holds still applies. - **Told within, never told, or the fleet is gone:** the cell keeps the last fact it was told and its own local check. `GET /api/v1/licence` carries the last fact as `fleet`, and the metric `opodcp_licence_fleet_over` is 1 while it says over. A cell that is never joined to a fleet cannot see other cells, so only a fleet enforces the sum. > **Version** > > The sum across cells and fleet mode are new in `0.3.0`. **Figure: One key, several cells.** Bars of GPUs in use per cell against the licence key's ceiling. The interactive figure is on the web page: ## Metrics | Series | Meaning | | --------------------------- | -------------------------------------------------- | | `opodcp_cell_gpus` | allocatable GPUs in the cell | | `opodcp_licence_max_gpus` | the current ceiling | | `opodcp_licence_fleet_over` | 1 while the fleet says the key's cells are over it | ## Buying and renewing **To get a licence, write to ** with the GPU count you run, or use the [contact form](https://opod.io/contact/). We reply within one business day with a quote, send the key by email, and invoice you. Install it as above. **(planned)** Self-serve checkout on [Pricing](https://opod.io/pricing/) and a licence portal that keeps every key you own. - **Renewal:** each paid period we re-sign the key with the same licence id and a later expiry, and email it. Install the new key as above. The id never changes, so the fleet sum across cells keeps working. - **GPU count change:** write to us. You get a new key with the new count and the same id, at once. - **Lapsed payment:** your current key keeps working to its expiry, then through its grace period. Nothing running stops. - **Enterprise:** keys are issued against a contract, the same way. - **A leaked key:** write to us. We replace it with a new licence id on the same terms and revoke the old id. **(planned)** **Automatic renewal from the control plane.** The licence service already answers it; the control plane does not call it yet. When it ships it is optional, and it works two ways: - **Connected:** one outbound HTTPS call a day to `api.opod.io`. It sends licence facts only — the licence id, an install id, the GPUs seen and the version — never prompts or usage. It gets back a fresh 30-day key, never past the paid-until date. - **Air-gapped:** nothing changes — install the key we email you, as above. **(planned)** **The signed revocation list, read by the control plane.** The list is published today; the control plane does not read it yet. A revoked key will then behave like a key past its grace period: new placements fall to the free tier, and nothing running stops. **(planned)** A signed hardware census for enterprise true-ups, off by default, exported by hand. --- title: "Several cells" description: "Run one control plane per cluster and a fleet control plane over them for one view and a licence key summed across cells." url: "https://opod.io/docs/control-plane/fleet/" markdown_url: "https://opod.io/docs/control-plane/fleet.md" section: "Control plane" last_updated: "2026-10-31" --- # Several cells > Run one control plane per cluster and a fleet control plane over them for one view and a licence key summed across cells. ## In short A **cell** is one cluster and its control plane. When you run several, a **fleet** control plane shows them all on one **Clusters** page and adds up each licence key's GPUs across the cells that carry it. The fleet manages no cluster and creates nothing: it only reads each cell with a read-only token and tells each cell whether its key is over. Fleet mode is new in `0.3.0`. ## When you need it - You run opod in more than one cluster (regions, sites, a lab and production) and want one view. - One licence key covers several cells, and the sum must be enforced. - You want one place to see which cell has open alerts or unhealthy endpoints. ## Do it 1. **Mint a machine token on each cell** Run this against each cell's control plane, with that cell's admin token: ```bash opodcp token create --cp https://opod.lab.example.com --token --scope fleet fleet-view ``` The flags go before the name. The command prints `token tok_… (fleet-view, scope fleet) — printed once, on stdout:` on stderr and the token itself on stdout, once. A `fleet` token reads like a viewer and has one write: the fleet licence fact. 2. **Store each token in the fleet's namespace** ```bash kubectl create namespace opodcp-fleet kubectl -n opodcp-fleet create secret generic lab-fleet-token --from-literal=token= ``` 3. **Install the release in fleet mode** ```bash helm install opodcp-fleet oci://ghcr.io/opod-io/charts/opodcp -n opodcp-fleet \ --set mode=fleet \ --set substrate.leaderWorkerSet.enabled=false \ --set ports.state.dsnSecret.name=opodcp-fleet-state \ --set-json 'fleet.cells=[{"name":"lab","url":"https://opod.lab.example.com","tokenSecret":{"name":"lab-fleet-token","key":"token"}}]' ``` A fleet keeps its own users, sessions and audit in a database of its own: create Secret `opodcp-fleet-state` with key `dsn` the same way as for a cell. With no `tokenSecret`, the chart reads Secret `-fleet-` (for example `opodcp-fleet-fleet-lab`), key `token`. Tokens are mounted as files and re-read on every pass. ## Check it worked ```bash export H="Authorization: Bearer $(kubectl -n opodcp-fleet get secret opodcp-fleet-admin -o jsonpath='{.data.token}' | base64 -d)" kubectl -n opodcp-fleet port-forward svc/opodcp-fleet 8080:8080 & curl -s -H "$H" http://127.0.0.1:8080/api/v1/version | jq -r .mode curl -s -H "$H" http://127.0.0.1:8080/api/v1/fleet/overview | jq '{totals, cells: [.cells[] | {name, reachable, gpus, error}]}' ``` A good answer prints `fleet`, then one entry per cell with `"reachable": true` and its GPU count. On each cell, `GET /api/v1/licence` carries the `fleet` fact within 30 s. The fleet console's **Clusters** page lists the cells, each linked to its own console. ## If it fails | Answer | Cause | Fix | | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | | `mode=fleet installs no cluster substrate: set substrate.leaderWorkerSet.enabled=false` | the default LeaderWorkerSet subchart is on | add `--set substrate.leaderWorkerSet.enabled=false` (likewise for `substrate.keda.enabled`, `ha.postgres.provide`, `ha.nats.provide`) | | `mode=fleet runs one replica: set replicas=1` | `replicas` above 1 | set `replicas=1` | | `error: usage: opodcp token create [--scope viewer\|fleet\|tokens:write\|plans:write] [--expires-in 720h] ` | a flag after the name | put every flag before the name | | A cell reads `"reachable": false` with `error` | the fleet cannot reach the cell's URL, or the token is wrong | check the URL from the fleet's pod, and the Secret and key named in `tokenSecret` | | A cell has `tellError` | the cell refused the licence fact | the token's scope must be `fleet`, not `viewer` | | `409 not_fleet` on `/api/v1/fleet/overview` | you asked a cell, not the fleet | ask the fleet's own URL | ## How a fleet works A **cell** is one cluster and its control plane. To see several cells in one place, install a second release in **fleet mode**. A fleet control plane manages no cluster: it reads each cell's API with a machine token, shows the cells on its **Clusters** page, and sums each licence key across the cells that carry it. > **Version and proof** > > Fleet mode is new in `0.3.0`. It is proven in tests against two control planes; a join of two production cells has not been shown yet. ## What a fleet does Every 30 s the fleet runs one pass over its cells, each with a 10 s HTTP timeout: 1. **Read.** For each cell it reads `/api/v1/version`, `/api/v1/licence`, `/api/v1/nodes`, `/api/v1/endpoints` and `/api/v1/alerts?state=open`, with that cell's token. A token file is read again on every pass, so a rotated token needs no restart. 2. **Sum.** It adds the cells up. An unreachable cell keeps its last counts in the totals: the GPUs it had are still GPUs you run. 3. **Group by key.** It groups the cells by licence key (cells with no key form the group `free`), adds up their GPUs, and marks a group `over` when the sum is above the key's GPU count. 4. **Tell.** It sends each reachable cell its group's fact with `PUT /api/v1/licence/fleet`: `over`, `fleetGpus`, `keyGpus`, `cells` (how many the sum covers), `fleet` (its own name) and `at`. A cell that does not answer keeps the last fact it was given. See [Licensing](https://opod.io/docs/control-plane/licensing/). It creates, places and proxies nothing. To create an endpoint, open the cell's own console; each row on the Clusters page links there. ## The overview `GET /api/v1/fleet/overview` (viewer) answers: ```json { "fleet": "hq", "at": "2026-10-30T12:00:00Z", "cells": [ { "name": "lab", "url": "https://opod.lab.example.com", "reachable": true, "readAt": "2026-10-30T12:00:00Z", "version": "…", "nodes": 4, "nodesReady": 4, "gpus": 8, "endpoints": 3, "endpointsHealthy": 3, "alertsOpen": 0, "licence": { "plan": "team", "maxGpus": 16, "source": "key", "state": "active", "tokenId": "…" }, "told": { "over": false, "fleetGpus": 8, "keyGpus": 16, "cells": 1, "fleet": "hq" } } ], "totals": { "cells": 1, "reachable": 1, "nodes": 4, "nodesReady": 4, "gpus": 8, "endpoints": 3, "alertsOpen": 0 }, "licences": [ { "key": "…", "plan": "team", "keyGpus": 16, "gpus": 8, "over": false, "cells": ["lab"] } ], "freeTierGpus": 4 } ``` - A cell that did not answer has `reachable: false` and `error`. - `endpointsHealthy` counts endpoints that serve, or sleep by design (an autoscale floor of 0). - `told` is what the cell reports it was last told; `tellError` is the last push that failed, and why. - A licence group lists in `unknown` the cells whose licence could not be read. Their GPUs are not in the group's sum. ## What a fleet release renders Only its own control plane: the Deployment, its Service, its admin Secret and a ServiceAccount with no role and no mounted token. No device plugin, PriorityClass, cluster role, preflight hook, cell door, KV store or network map. So a fleet fits in another namespace of a cell's own cluster. The chart refuses a fleet release that: - leaves `substrate.leaderWorkerSet.enabled` on (the subchart is chosen before any template runs, so turn it off by name), - turns on `substrate.keda.enabled`, `ha.postgres.provide` or `ha.nats.provide`, - sets `replicas` above 1. A fleet has no leader election, so every replica would poll every cell and push licence facts on its own. ## Run it without the chart ```bash OPODCP_FLEET_CELLS='[{"name":"lab","url":"https://lab.example","tokenFile":"lab.token"}]' opodcp serve --mode fleet ``` `GET /api/v1/version` carries `mode: cell` or `mode: fleet`. A cell answers `409 not_fleet` on `/api/v1/fleet/overview`. --- title: "Choose an install path" description: "Install on a Kubernetes cluster you already run, or let opodcp build a k3s cluster on bare machines first. Both end at helm install opodcp." url: "https://opod.io/docs/control-plane-install/" markdown_url: "https://opod.io/docs/control-plane-install.md" section: "Install" last_updated: "2026-10-31" --- # Choose an install path > Install on a Kubernetes cluster you already run, or let opodcp build a k3s cluster on bare machines first. Both end at helm install opodcp. ## In short You install the control plane with one Helm chart into a Kubernetes cluster. If you have no cluster yet, `opodcp infra` builds a k3s cluster on your Linux machines first. Either way, you check the cluster with `opodcp preflight`, give the control plane a Postgres database, and run `helm install opodcp`. After that you open the console and create endpoints. ## When you need it - You are installing opod for the first time and must choose between your own cluster and bare machines. - You want to know what `helm install opodcp` creates in your cluster before you run it. - You are planning an install with no internet access, with several replicas, or over an existing database. ## Do it 1. **Find out what you have** ```bash kubectl get nodes -o wide ``` A node list means you have a cluster: take **Path A**, [Install on Kubernetes](https://opod.io/docs/control-plane-install/kubernetes/). `The connection to the server … was refused` or no `kubectl` at all means you have none: take **Path B**, [Install on bare machines](https://opod.io/docs/control-plane-install/bare-metal/). 2. **Check the cluster** ```bash docker run --rm --network host -v ~/.kube:/kube:ro \ ghcr.io/opod-io/opodcp:0.3.6 preflight --kubeconfig /kube/config ``` The last line reads `cluster ready for: helm install opodcp …` when no fatal row failed. See [Preflight](https://opod.io/docs/control-plane-install/preflight/). 3. **Install the chart** Follow the steps of your path. Both end in the same command: ```bash helm install opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --create-namespace \ --set ports.state.dsnSecret.name=opod-state --set cell.name=prod ``` `ports.state.dsnSecret` is new in `0.3.0`; on `0.2.1` leave it out. ## Check it worked ```bash kubectl -n opodcp rollout status deploy/opodcp kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor ``` A good answer is `deployment "opodcp" successfully rolled out`, then a doctor table whose first line is `control plane http://127.0.0.1:8080` and whose rows start with `✔`. A fresh install has one expected red row: `identity`, which reads `BOOTSTRAP` until you create a user or connect OIDC. The console's **Settings → Ports & adapters** shows the same rows. ## If it fails | Symptom | Cause | Fix | | ------------------------------------------------------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | `helm install` stops with `Job Failed` | the preflight hook found a fatal row | run `opodcp preflight` yourself and fix each `✘` row ([Preflight](https://opod.io/docs/control-plane-install/preflight/)) | | `ports.state.dsn carries a user or a password in its address` | a password in a plain chart value | put the whole DSN in a Secret and set `ports.state.dsnSecret.name` | | The console shows **Connect your database** | no database, or one that does not answer | [Setup mode](https://opod.io/docs/control-plane-install/kubernetes/#setup-mode) | | `invalid ownership metadata` on the LeaderWorkerSet CRD | the cluster already runs that controller | add `--set substrate.leaderWorkerSet.enabled=false` | | Every create is refused `E-FIT` | no card is measured yet | `kubectl get nodes -L opod.io/gpu-vendor`; see [Troubleshooting](https://opod.io/docs/control-plane-operate/troubleshooting/) | ## The two paths There is one chart and one binary for every target. EKS, GKE, AKS, k3s and on-premises clusters differ only by chart values and preflight rows. | You have | Path | Steps | | ----------------------------------------------- | -------------------------- | ------------------------------------------------------------------------------------ | | A Kubernetes cluster with GPU nodes | **Path A** | `opodcp preflight` → `helm install opodcp` | | Linux machines with GPUs and SSH, no Kubernetes | **Path B** | `opodcp infra plan` → `opodcp infra up` → `opodcp preflight` → `helm install opodcp` | | No route to the internet | either path, with a mirror | mirror images with their signatures, point the chart at the mirror | The cluster is yours on Path A. The control plane does not create or manage EKS, GKE or AKS clusters. On bare machines, `opodcp infra` installs k3s because nothing else would. - [Kubernetes (Path A)](https://opod.io/docs/control-plane-install/kubernetes/): Install the chart on a cluster you run. - [Bare machines (Path B)](https://opod.io/docs/control-plane-install/bare-metal/): opodcp infra builds a k3s cell over SSH. - [Preflight](https://opod.io/docs/control-plane-install/preflight/): Every check, its severity and its remedy. - [Configuration](https://opod.io/docs/control-plane-install/configuration/): The settings most installs change. - [Air-gapped](https://opod.io/docs/control-plane-install/air-gapped/): Registry mirror, signatures, model mirror. - [High availability](https://opod.io/docs/control-plane-install/high-availability/): Several replicas, leader election, a shared bus. - [Upgrade and uninstall](https://opod.io/docs/control-plane-install/upgrade/): Schema steps, template drift, the way back. - [Backup and restore](https://opod.io/docs/control-plane-install/backup-restore/): Dumps, restores, moving the store. ## Before you start | You need | Why | Check | | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | | Kubernetes 1.28 or newer, every node Ready | the chart's pre-install check refuses an older or half-down cluster | `opodcp preflight`, rows `k8s.version`, `nodes.ready` | | Cluster DNS (CoreDNS) | workers join their leader by Service DNS | row `dns.coredns` | | A Postgres-wire database | the state store: endpoints, plans, runs, keys, the audit chain. The chart installs none unless you ask it to (`ha.postgres.provide`) | [Install on Kubernetes](https://opod.io/docs/control-plane-install/kubernetes/), step 2 | | `helm` 3 and `kubectl` | to install the chart and read its Secrets | — | | GPU nodes with their drivers | the device plugins and probes read the host driver; no GPU is needed for the control plane itself. In production it runs on a CPU node, beside a managed database off the GPU hosts; from `0.3.0` the chart prefers such a node (`nodeSelector` overrides it) | rows `gpu.allocatable`, `runtime.nvidia` | | Pull access to `ghcr.io/opod-io/*`, or a mirror | every node pulls the control plane image, because the telemetry DaemonSets copy their agent out of it | [Air-gapped install](https://opod.io/docs/control-plane-install/air-gapped/) | A missing GPU, a missing default StorageClass or unlabelled nodes are warnings, not refusals. The free tier runs up to 4 GPUs with no key; see [Licensing](https://opod.io/docs/control-plane/licensing/). ## What happens during `helm install` 1. **Preflight hook.** A Job runs `opodcp preflight` in the cluster, under a read-only ServiceAccount of its own. A fatal row fails the install before any other object is created. See [Preflight](https://opod.io/docs/control-plane-install/preflight/). 2. **The release objects.** Helm creates the Deployment, its Service, RBAC, the PriorityClasses, the device plugins and the LeaderWorkerSet controller. The admin token and the install key are minted once and kept across upgrades and uninstalls. 3. **First start.** The control plane opens the database. Until it can, it runs in **setup mode**: the console shows **Connect your database** and every API call but setup and doctor answers `503 E-SETUP`. It retries with a growing pause (2 s to 30 s), so a database that appears later is taken without a restart. 4. **Schema.** On first start it creates its schema; on later starts it applies any numbered schema steps, under a lock, so two replicas never run one twice. 5. **Discovery.** It labels GPU nodes with `opod.io/gpu-vendor` from what their device plugins advertise, then creates one telemetry DaemonSet per vendor present. The probes measure every card's memory and push a report to the control plane. Until a card is measured, a create that needs it is refused with `E-FIT`. 6. **Ready.** `/readyz` answers, the console loads, and `opodcp doctor` lists every port as embedded or connected. ## What the default release installs | Object | Name (release `opodcp`) | Notes | | --------------------------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Deployment | `opodcp` | one replica, `Recreate` strategy; non-root (uid 65532), read-only root filesystem, every capability dropped, seccomp `RuntimeDefault`. Requests 100m CPU and 256Mi, limit 1Gi. Probes `/healthz` and `/readyz` | | Service | `opodcp` | `ClusterIP` on 8080, with `prometheus.io/scrape` and `prometheus.io/port` annotations | | ServiceAccount, Role, RoleBinding | `opodcp` | the namespace's objects the control plane renders, Leases for election | | ClusterRole, ClusterRoleBinding | `opodcp` | nodes (watch, cordon, patch `opod.io/*` labels, delete a dead node), list pods on a node for a drain preview, read the LeaderWorkerSet webhooks and Gateways. With `rbac.nodeDrain=true` (the default) also `pods/eviction`, for **Machines → Drain** | | Preflight Job and its hook RBAC | `opodcp-preflight` | removed when the hook succeeds | | Device plugin DaemonSets | `opodcp-nvidia-device-plugin` and the AMD, Intel and Tenstorrent ones | each runs only on nodes labelled `opod.io/gpu-vendor=`; turn one off with `substrate.DevicePlugin.enabled=false` if the cluster already runs one. NVIDIA also gets one time-slicing DaemonSet per `timeSlicing.choices` entry, used only on nodes an admin time-slices | | LeaderWorkerSet controller | subchart `lws` | for gangs; turn it off with `substrate.leaderWorkerSet.enabled=false` when the cluster already serves the API | | PriorityClasses | `opodcp-serving` (100000), `opodcp-batch` (10000), `opodcp-batch-preemptible` (1000, never preempts) | cluster-scoped; `priorityClasses.create=false` uses classes that already exist | | Secret | `opodcp-admin` | key `token`: the bootstrap admin bearer, 40 random characters unless `admin.token` sets it | | Secret | `opodcp-install-key` | key `keys`: 32 random bytes that seal connector credentials in the database | | Secret | `opodcp-licence` | only when `licence.key` is set | Both minted Secrets carry `helm.sh/resource-policy: keep`: an uninstall leaves them, and a reinstall reuses them. Keep a copy of the install key with your database backups; a database without its key holds no readable credential. It installs **no** database, event bus, metrics stack, identity provider or registry. The per-vendor GPU telemetry DaemonSets are created by the control plane itself once it runs, not by the chart. Optional components (a provided Postgres or NATS for HA, KEDA, the cell door, the Valkey KV store, NetworkPolicies, Grafana dashboards and Prometheus rules) are each off until a value turns them on; see [Helm values](https://opod.io/docs/control-plane-reference/helm-values/). ## After the install - [Connect your services](https://opod.io/docs/control-plane-operate/connectors/): Usage sink, events, logs, metrics, OIDC, alerts. - [Create an endpoint](https://opod.io/docs/control-plane-endpoints/create/): One model, one leader, its workers. - [Check the ports](https://opod.io/docs/control-plane-operate/doctor/): opodcp doctor, row by row. --- title: "Install on Kubernetes" description: "Install the opod chart on a cluster you already run (EKS, GKE Standard, AKS, k3s, on-premises), connect the database and reach the console." url: "https://opod.io/docs/control-plane-install/kubernetes/" markdown_url: "https://opod.io/docs/control-plane-install/kubernetes.md" section: "Install" last_updated: "2026-11-01" --- # Install on Kubernetes > Install the opod chart on a cluster you already run (EKS, GKE Standard, AKS, k3s, on-premises), connect the database and reach the console. ## In short This is Path A: the cluster exists and is yours. You check it with `opodcp preflight`, put a Postgres DSN in a Secret, and run `helm install opodcp`. About five minutes later the console answers and lists your GPUs. Nothing outside the release namespace is changed except the cluster-scoped objects listed under [What the default release installs](https://opod.io/docs/control-plane-install/#what-the-default-release-installs). ## When you need it - You run EKS, GKE Standard, AKS, k3s, RKE2, OpenShift or any other conformant cluster with GPU nodes. - You already have, or can create, a Postgres database the cluster can reach. - You reinstall the control plane over a database you kept. ## Do it > **Version** > > These steps are for `0.3.0`. On `0.2.1` leave out every `ports.state` flag: it keeps its state in SQLite on a volume and needs a default StorageClass. See [Releases](https://opod.io/docs/get-started/releases/). 1. **Check the cluster** ```bash docker run --rm --network host -v ~/.kube:/kube:ro \ ghcr.io/opod-io/opodcp:0.3.6 preflight --kubeconfig /kube/config ``` Fix every fatal row. Read the warnings: `nodes.taints`, `network.policy`, `policy.engine` and (in `0.3.0`) `cp.node` tell you about values you may need. See [Preflight](https://opod.io/docs/control-plane-install/preflight/). 2. **Give it a database** Any Postgres-wire database works. Create the database and a user that owns it, then put the **whole DSN** in a Secret. A plain `ports.state.dsn` value that carries a password fails the install, because a plain value lands in the pod spec. ```bash kubectl create namespace opodcp kubectl -n opodcp create secret generic opod-state \ --from-literal=dsn='postgres://opod:PASSWORD@db.example.com:5432/opodcp?sslmode=require' ``` The control plane creates its schema on first start and applies numbered schema steps on later upgrades. 3. **Install** ```bash helm install opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp \ --set ports.state.dsnSecret.name=opod-state \ --set cell.name=prod ``` `cell.name` labels every object with `opod.io/cell` and names the cell in the console. Leave `admin.token` empty and the chart generates one once, into Secret `opodcp-admin`. The pre-install Job runs the same preflight and stops the install on a fatal row. Wait for the control plane with `kubectl -n opodcp rollout status deploy/opodcp`. 4. **Sign in** ```bash kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d; echo kubectl -n opodcp port-forward svc/opodcp 8080:8080 ``` Open `http://127.0.0.1:8080`. If the console shows **Connect your database**, the control plane is in setup mode: see [Setup mode](#setup-mode). 5. **Check the ports** ```bash kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor ``` Each row says embedded or connected, and green or red. See [Doctor](https://opod.io/docs/control-plane-operate/doctor/). ## Check it worked With the port-forward from step 4 still open: ```bash export H="Authorization: Bearer $(kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d)" curl -s http://127.0.0.1:8080/readyz; echo curl -s -H "$H" http://127.0.0.1:8080/api/v1/version curl -s -H "$H" http://127.0.0.1:8080/api/v1/nodes | jq -r '.[].name' ``` A good answer: ```text ready {"version":"…","commit":"…","coreSupported":">=0.21 <1.0","self":{"placement":"in-cluster",…},"mode":"cell"} node-a node-b ``` `/readyz` reads `ready in setup mode: …` while the control plane waits for its database, and `ready; the database is unreachable and reconnecting: …` when the database went away after start. In the console, **Overview** shows your GPUs by vendor and **Machines** lists every node with its measured cards. A card is measured within about two minutes, when the telemetry DaemonSet's probe reports. ## If it fails | Symptom | Cause | Fix | | ------------------------------------------------------------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | `Error: INSTALLATION FAILED: … Job Failed` | a fatal preflight row | `kubectl -n opodcp logs job/opodcp-preflight` (the Job is kept 10 minutes), or run step 1 again | | `ports.state.dsn carries a user or a password in its address` | the DSN went in as a plain value | put it in a Secret (step 2) and pass `ports.state.dsnSecret.name` | | `ports.state.dsn and ports.state.dsnSecret.name are both set` | both forms given | keep only the Secret | | `ports.usage is not a chart value any more` | a `0.2.1` values file | `--set ports.usage=null`, then save the setting on the Connectors page | | `/api/v1/setup` reads `"kind":"unreachable"` | the pod cannot reach the database | check the host, port, `sslmode` and a NetworkPolicy; the control plane takes the database as soon as it answers | | `curl` answers `401` | no token, or the wrong one | read it again from Secret `opodcp-admin`, key `token` | | **Machines** shows no GPU | the nodes carry no `opod.io/gpu-vendor` label, or a probe is Pending | `kubectl get nodes -L opod.io/gpu-vendor` and `kubectl -n opodcp get pods -l app=opodcp-gpu-telemetry -o wide` | More symptoms are on [Troubleshooting](https://opod.io/docs/control-plane-operate/troubleshooting/). ## Reach the console | How | Values | | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | Port-forward | nothing; `kubectl -n opodcp port-forward svc/opodcp 8080:8080` | | NodePort on a LAN | `--set service.type=NodePort --set service.nodePort=30080` | | Ingress | `--set ingress.enabled=true --set ingress.className=nginx --set ingress.host=opod.example.com` and `ingress.tls` | | Gateway API | `ingress.enabled=true` with `ingress.gateway.name`, `.namespace`, `.sectionName`: the chart renders an `HTTPRoute` on that Gateway | Behind an Ingress or a load balancer, list the proxy's CIDRs in `api.trustedProxies` so the sign-in rate limit sees real client addresses. When you use OIDC, save the console's public URL as `OPODCP_PUBLIC_URL` with the identity settings on the Connectors page, so sign-in redirects use it. ## Setup mode The control plane never refuses to start because of its database. With none set, one that does not answer, one a newer release wrote, or one from before the schema baseline, it is `Ready` and serves one task: **Connect your database**. Every other API call answers `503 E-SETUP` with the reason. It retries every 2 s, backing off to 30 s, and takes the database the moment it answers, with no restart. ```bash curl -s http://127.0.0.1:8080/api/v1/setup # {"state":"setup","task":"connect your database","kind":"no-database", ...} ``` `kind` is `connecting`, `no-database`, `unreachable`, `newer-schema` or `ladder-store`. Each one's fix is in [Doctor → state](https://opod.io/docs/control-plane-operate/doctor/). ## Managed Kubernetes notes - **GPU node taints.** A GPU pool tainted with its own resource (GKE's `nvidia.com/gpu=present:NoSchedule`) needs nothing. A taint of your own needs `workloads.tolerations`. - **Managed API server and leader isolation.** If you turn on `networkPolicy.leaderIsolation`, name where the managed API server reaches pods from in `networkPolicy.leaderIsolation.from`. See [Network and TLS](https://opod.io/docs/control-plane-security/network-tls/). - **Secrets at rest.** Turn on your provider's Secret encryption (EKS with a KMS key, GKE application-layer encryption, AKS KMS). The install key that seals connector credentials is a Secret. - **Node autoscalers.** Every pod the control plane renders carries `karpenter.sh/do-not-disrupt` and `cluster-autoscaler.kubernetes.io/safe-to-evict=false`, so a consolidating autoscaler does not drain loaded weights. Set `allowNodeConsolidation=true` to allow it. - **`cloud.provider`.** On `0.2.1` it is `onprem` on every cluster and adds nothing. In `0.3.0` it also takes `aws`, `gcp` or `azure`, each with an overlay in the chart (`values-eks.yaml`, `values-gke.yaml`, `values-aks.yaml`). An adapter names its cloud's storage class, registry mirror and workload-identity path, and adds the `cloud..*` rows to `opodcp preflight --cloud `. It provisions no nodes. These adapters are built and **not yet proven on a real EKS, GKE or AKS cluster**. - **NVIDIA RuntimeClass on a managed cloud.** EKS, GKE and AKS GPU nodes make `nvidia` the default container runtime and register no RuntimeClass `nvidia`, so preflight row `runtime.nvidia` warns there. On `0.2.1` GPU pods are always rendered with `runtimeClassName: nvidia`, and the API server refuses a pod that names a missing class: create a RuntimeClass `nvidia` with handler `nvidia` on those clusters, or the worker pods do not start. In `0.3.0` the control plane checks once a minute whether the class exists and leaves it out of every GPU pod (worker, job, probe, fabric proof) when it does not, so no workaround is needed. Check it worked: `kubectl get pod -n opodcp -l opod.io/role=worker -o jsonpath='{.items[*].spec.runtimeClassName}'` prints nothing on a managed cloud and `nvidia` on k3s. ## GitOps (Argo CD) Endpoint workloads carry only `opod.io/*` labels and no Argo tracking label, so Argo does not prune them as part of the release. The preflight hook is declared for both Helm (`helm.sh/hook`) and Argo (`argocd.argoproj.io/hook: PreSync`), because Argo renders with `helm template` and drops hooks it does not know. If you adopt endpoint workloads into an Argo application, ignore the fields the control plane owns (field manager `opodcp`) with `ignoreDifferences`. ## What the control plane may do in your cluster Two grants, rendered by the chart: - **A namespaced Role** in the release namespace holds every write and every sensitive read: the endpoint Secrets it mints, `pods/exec` into its own probe pods only, `pods/log`, Deployments, Services, ConfigMaps, Jobs, PersistentVolumeClaims, PodDisruptionBudgets, Ingresses, LeaderWorkerSets, Events, the API server's Service proxy to its own leaders, and its Lease. - **A ClusterRole** holds only what cannot be namespaced: Nodes (watch; patch to cordon and to set `opod.io/*` labels; delete a NotReady node that holds nothing of ours), a read-only list of pods so a drain can name what it would evict, `create` on `pods/eviction` for a confirmed full drain, and read-only looks at the LeaderWorkerSet controller. It cannot read a Secret, exec into a pod or create a workload outside its own namespace. `--set rbac.nodeDrain=false` removes the cluster-wide eviction right; a full drain is then refused. **Do not hand-edit what it renders.** The control plane writes every object with Server-Side Apply under field manager `opodcp`, with force. A field it renders that you change by hand (`kubectl edit`, `kubectl set image`, a patch) is put back on the next reconcile. A field it does not render (an annotation or a label of your own) stays. To change an endpoint, change its plan, or the chart value behind the field. ## Next - [Configuration](https://opod.io/docs/control-plane-install/configuration/) — tolerations, leader placement, TLS, the install key - [Connectors](https://opod.io/docs/control-plane-operate/connectors/) — usage sink, OIDC, alerts, logs - [Create an endpoint](https://opod.io/docs/control-plane-endpoints/create/) --- title: "Install on bare machines" description: "opodcp infra reads every host, runs a host gate, installs k3s server and agents over SSH, labels the nodes and writes a kubeconfig." url: "https://opod.io/docs/control-plane-install/bare-metal/" markdown_url: "https://opod.io/docs/control-plane-install/bare-metal.md" section: "Install" last_updated: "2026-10-31" --- # Install on bare machines > opodcp infra reads every host, runs a host gate, installs k3s server and agents over SSH, labels the nodes and writes a kubeconfig. ## In short This is Path B: Linux machines with GPUs and SSH, and no Kubernetes yet. `opodcp infra` builds a k3s cluster (a **cell**) over SSH, with one server or, in `0.3.0`, three servers behind one virtual IP, labels the nodes and writes a kubeconfig. Then you install the chart exactly as on any cluster. You write one inventory file; `infra plan` shows what would change, and `infra up` changes it. SSH is the only transport. The installer changes nothing on a host until you run `infra up`, and it never touches a host marked `skip: true`. It does not install GPU drivers: install the vendor driver (and, for NVIDIA, the container toolkit) yourself first. ## When you need it - You have GPU machines in a lab, a colocation rack or a cloud account, and no Kubernetes on them. - You want one small cell to try opod, with k3s and nothing else installed by hand. - You add a machine to a cell that `opodcp infra` built, or rebuild one after the hosts were re-imaged. ## Do it 1. **Get the binary** The `opodcp` binary ships inside the image. Copy it out on a Linux machine that can reach every host over SSH: ```bash id=$(docker create ghcr.io/opod-io/opodcp:0.3.6) docker cp "$id":/opodcp ./opodcp && docker rm "$id" ./opodcp version ``` 2. **Write the inventory** ```yaml # machines.yaml cell: prod-eu1 # cluster name and node label opod.io/cell ssh: { user: ubuntu, keyFile: ~/.ssh/id_ed25519, sudo: true } servers: - { name: cp-1, host: 192.0.2.10 } agents: - { name: gpu-1, host: 192.0.2.11 } # vendor detected on the host - { name: gpu-2, host: 192.0.2.12, labels: { topology.kubernetes.io/zone: eu1-b } } ``` On `0.2.1` the server is one field, `server: { name: cp-1, host: 192.0.2.10 }`; the list `servers:` is new in `0.3.0`. Every field is in [The inventory](#the-inventory) below; three servers are in [Three servers](#three-servers). 3. **Plan** ```bash ./opodcp infra plan -f machines.yaml ``` It gathers each host's facts, runs the host gate and shows what would change. Nothing is changed. A good plan prints one `gate` line per host and one planned (`·`) k3s step per host: ```text ✔ gate [cp-1] … · none · 32GB · no k3s ✔ gate [gpu-1] … · nvidia · 128GB · no k3s ✔ gate [gpu-2] … · nvidia · 128GB · no k3s · k3s.server [cp-1] install k3s server v1.31.6+k3s1 · k3s.agent [gpu-1] install k3s agent v1.31.6+k3s1 · k3s.agent [gpu-2] install k3s agent v1.31.6+k3s1 plan: 3 to install, 0 already installed — run: opodcp infra up -f machines.yaml ``` The last line arrives in the release after 0.3.6: it counts what `up` would install and what already runs k3s, and names the next command. A failed row prints under its host as `FATAL`, `warn` or `info`, its id, the message and `→` a remedy. Fix it, or mark the host `skip: true`. 4. **Converge** ```bash ./opodcp infra up -f machines.yaml ``` It installs the k3s server, then the agents, sets the labels `opod.io/cell`, `opod.io/role` and `opod.io/gpu-vendor`, and writes a kubeconfig to `~/.opodcp//kubeconfig`. Each step records a proof: ```text ✔ k3s.server [cp-1] https://192.0.2.10:6443 ready ✔ kubeconfig [cp-1] /home/ubuntu/.opodcp/prod-eu1/kubeconfig ✔ k3s.agent [gpu-1] Ready · vendor=nvidia ✔ k3s.agent [gpu-2] Ready · vendor=nvidia kubeconfig: /home/ubuntu/.opodcp/prod-eu1/kubeconfig ``` k3s servers are installed with `--secrets-encryption`, so Secrets are encrypted at rest. Running it again is safe: a step that is already converged is not repeated. When the machine you run it on is the server, add `--local`: server steps run locally and agents over SSH. 5. **Check the cluster** ```bash ./opodcp preflight --kubeconfig ~/.opodcp/prod-eu1/kubeconfig ``` 6. **Install the chart** ```bash export KUBECONFIG=~/.opodcp/prod-eu1/kubeconfig kubectl create namespace opodcp kubectl -n opodcp create secret generic opod-state --from-literal=dsn='postgres://opod:PASSWORD@db.example.com:5432/opodcp?sslmode=require' helm install opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp \ --set ports.state.dsnSecret.name=opod-state --set cell.name=prod-eu1 ``` On a LAN with no Ingress, add `--set service.type=NodePort --set service.nodePort=30080`. `ports.state.dsnSecret` is new in `0.3.0`; on `0.2.1` leave it out. Then sign in as in [Install on Kubernetes](https://opod.io/docs/control-plane-install/kubernetes/), step 4. ## Check it worked ```bash kubectl get nodes -L opod.io/cell,opod.io/role,opod.io/gpu-vendor ./opodcp infra verify -f machines.yaml ``` A good answer lists every host `Ready`, each with your cell name, its role (`server`, or `worker` on an agent) and its vendor. `infra verify` runs the host gate and the cluster preflight again, changes nothing, and exits `0`. After the chart is installed, the console's **Machines** page lists the same nodes. ## If it fails | Symptom | Cause | Fix | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | `gate failed — nothing changed`, then `error: plan did not complete cleanly` (from the release after 0.3.6: `error: infra plan did not complete cleanly — the ✘ rows above say why; every step is in ~/.opodcp//runs.jsonl`) | a host has a fatal row | read the `FATAL` lines printed under that host; fix them or set `skip: true` | | a `gate` step fails with remedy `ssh user/key/port in the inventory; host must run bash` | SSH could not log in | check `ssh.user`, `ssh.keyFile` and `ssh.port`; try `ssh -i KEY USER@HOST true` | | `FATAL priv.root` | the SSH user has no passwordless sudo | grant `NOPASSWD` sudo, or set `ssh.user: root` | | `FATAL gpu.toolkit` | an NVIDIA host has no `nvidia-container-toolkit` | install it, then plan again | | `k3s.agent` fails with `host reachable but :6443 closed` | the agent reaches the server, but the k3s port is closed | open TCP 6443 on the server firewall | | `k3s.server` fails with remedy `journalctl -u k3s on the server` | the k3s install failed | read that journal on the server | | `k3s.server` fails with `REFUSED: this host runs a single k3s server` | the inventory lists three servers, and the first one already runs a one-server cluster | the installer does not convert a running cluster: `opodcp backup`, `opodcp infra down`, `infra up` with three servers, then restore | | `vip` fails with `the API does not answer on the vip` | kube-vip did not take the address | `k3s kubectl -n kube-system logs ds/kube-vip-ds` on the first server; check `net.vip.segment` | | `FATAL net.vip.free` | something on the network already answers on the VIP | pick another free address, outside the DHCP range | | `FATAL net.vip.segment` | the VIP is behind a router from that server | pick an address in the subnet the three servers share: ARP does not cross a router | | `k3s.agent` fails with remedy `kubectl describe node gpu-1` | the agent joined but did not turn Ready within the wait | read the node's conditions | | a host key changed after a re-image | `--known-hosts` holds the old key | remove that host's line from `~/.opodcp/known_hosts`, or pin the new key as `hostKey` | ## The inventory | Field | Default | Meaning | | ------------------------------------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `cell` | — | cell name: the k3s cluster name and the `opod.io/cell` label | | `k3sVersion` | `v1.31.6+k3s1` | pinned k3s version | | `ssh.user`, `ssh.keyFile`, `ssh.port` | —, `~/.ssh/id_ed25519`, `22` | SSH defaults for every machine | | `ssh.sudo` | — | run privileged steps with `sudo -n`; otherwise the user must be root | | `servers[]` | — | the k3s servers: one, or three for a cluster that survives a server. Two is refused: etcd with two members stops when either one does. On `0.2.1` this is the single field `server` | | `vip` | — | with three servers: a free IPv4 address on the servers' own subnet, outside any DHCP range. Required with three servers, refused with one | | `agents[]` | — | the k3s agents | | `labels` | — | extra labels on every node | | `modelCache` | `/data/models` | the host directory for model weights | A fuller inventory that uses every per-machine field: ```yaml cell: prod-eu1 k3sVersion: v1.31.6+k3s1 ssh: { user: ubuntu, keyFile: ~/.ssh/id_ed25519, port: 22, sudo: true } labels: { opod.io/site: eu1 } # on every node modelCache: /mnt/nvme/models # a fast disk for weights servers: - { name: cp-1, host: 192.0.2.10, vendor: none } agents: - { name: gpu-1, host: 192.0.2.11, nodeIP: 10.0.0.11 } # SSH on one network, k3s on another - { name: gpu-2, host: gpu-2.example.com, user: root, port: 2222, hostKey: "ssh-ed25519 AAAAC3Nza…" } # pinned host key - { name: amd-1, host: 192.0.2.13, vendor: amd } # vendor stated, checked against the host - { name: old-1, host: 192.0.2.14, skip: true } # never touched ``` And a converge that refuses any host key it does not already know, waits longer per command, and keeps its state beside the inventory: ```bash ./opodcp infra up -f machines.yaml --strict-host-keys --known-hosts ./known_hosts \ --timeout 40m --state ./state --json > run.json ``` `--json` prints the run (every step with its proof) on stdout; the progress lines stay on stderr. Per machine: `name` (the node name), `host` (the SSH address), `nodeIP` (k3s `--node-ip`, default `host` when it is an IP), `user`, `port`, `vendor` (`nvidia`, `amd`, `intel`, `tt` or `none`; empty = detect on the host), `labels`, `skip` and `hostKey` (a pinned SSH host key). ### Three servers This is new in `0.3.0`, and it is not yet proven on hardware. One server is a single point of failure for the cluster itself: the control plane's replicas keep running when their node dies, but nothing schedules, heals or answers `kubectl` while the server is down. Three servers keep the Kubernetes API up when any one is lost. ```yaml cell: prod-eu1 ssh: { user: ubuntu, keyFile: ~/.ssh/id_ed25519, sudo: true } servers: - { name: cp-1, host: 192.0.2.10, vendor: none } - { name: cp-2, host: 192.0.2.11, vendor: none } - { name: cp-3, host: 192.0.2.12, vendor: none } vip: 192.0.2.50 # free, same subnet as the servers, outside DHCP agents: - { name: gpu-1, host: 192.0.2.21 } ``` What `infra up` then does, in order: 1. The first server starts embedded etcd (`--cluster-init`) with the VIP in its certificate. Before k3s starts, the installer writes kube-vip (`ghcr.io/kube-vip/kube-vip` v1.3.1, pinned by digest) into k3s's auto-deploy directory. kube-vip announces the VIP by ARP from whichever server holds its lease. It covers the Kubernetes API only, and Services stay with k3s. 2. Step `vip` waits until the API answers on `https://:6443`. 3. The other two servers join through the VIP (`--server https://:6443`). 4. The kubeconfig is written for the VIP, and every agent joins through it. A lost server then costs no agent and no `kubectl` its way in. `infra plan` adds two fatal rows per server: `net.vip.segment` (the VIP is on that server's subnet) and `net.vip.free` (nothing answers on it yet). The installer refuses to convert a running one-server cluster to three in place. For the control plane itself, run `replicas: 3` ([High availability](https://opod.io/docs/control-plane-install/high-availability/)). To reach the console at the VIP, use `service.type=NodePort`: a NodePort answers on every address of the node that holds the VIP, the VIP included. This is expected, not yet proven. ## Commands | Command | What it does | | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `opodcp infra plan -f FILE` | facts and host gate, no changes | | `opodcp infra up -f FILE` | converge: k3s server and agents, labels, kubeconfig. A kubeconfig it cannot fetch fails the run, with the command that fetches it by hand (the release after 0.3.6) | | `opodcp infra verify -f FILE` | host gate plus the cluster preflight, no changes. With no kubeconfig yet it exits `1` and says to run `infra up` first (the release after 0.3.6; 0.3.6 skips the cluster check and exits `0`) | | `opodcp infra down -f FILE` | uninstall k3s from every machine; asks first, `--yes` skips the question. From the release after 0.3.6, answering no removes nothing and exits `0`, and with no terminal it refuses and prints the `--yes` command (0.3.6: `error: aborted`, exit `1`) | | Flag | Default | Meaning | | -------------------- | ----------------------- | ----------------------------------------------------------------------------------- | | `-f` | `machines.yaml` | inventory file | | `--local` | `false` | the server is this machine (no SSH to it) | | `--state` | `~/.opodcp/` | state directory (kubeconfig, run log) | | `--json` | `false` | print the run as JSON | | `--timeout` | `20m` | per-command timeout | | `--yes` | `false` | skip the confirmation of `down` | | `--known-hosts` | `~/.opodcp/known_hosts` | the SSH known_hosts file the installer keeps | | `--strict-host-keys` | `false` | refuse a host whose key is neither pinned nor already known (no trust on first use) | `infra down` deletes every pod and the cluster state on those machines. Back up the control plane's database first if you want to keep it. ## The host gate `infra plan` and `infra up` read every host's facts and judge each machine. A host with a fatal row is never converged; fix it, or mark it `skip: true` in the inventory. | Row | Severity | Passes when | Remedy | | ----------------- | ------------------------------------------------ | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `os.linux` | fatal | Linux on x86_64 or aarch64 | Windows hosts are not supported | | `os.cgroupv2` | fatal | cgroup v2 is mounted | boot with `systemd.unified_cgroup_hierarchy=1` (the default from Ubuntu 22.04) | | `priv.root` | fatal | the SSH user is root or has passwordless `sudo -n` | grant `NOPASSWD` sudo, or SSH as root | | `host.ram` | fatal | at least 8 GB of RAM on an agent, 16 GB on the server | add RAM, or move the server role to a host with 16 GB or more (the remedy is printed from the release after 0.3.6) | | `host.disk.root` | warning | at least 40 GB free on `/`, for images | free space, or move the containerd root | | `host.disk.cache` | warning | at least 100 GB free for the model cache directory | mount an NVMe disk there | | `host.time` | warning | the clock is NTP-synchronised | enable systemd-timesyncd or chrony: TLS and join tokens need a sane clock | | `k3s.role` | fatal, only when k3s is already there | it runs in the role the inventory gives this host | uninstall it (`k3s-uninstall.sh`, `k3s-agent-uninstall.sh`) or fix the inventory | | `gpu.vendor` | fatal on a mismatch, else information | the inventory's `vendor` matches what the host reports | fix the inventory or the drivers | | `gpu.driver` | fatal on NVIDIA, warning otherwise | the vendor's kernel driver is loaded: NVIDIA, `amdgpu`, `i915`/`xe`, `tt-kmd` | install the driver (Tenstorrent also needs hugepages) | | `gpu.toolkit` | fatal, NVIDIA only | `nvidia-container-toolkit` is installed | install it; k3s then registers RuntimeClass `nvidia` by itself | | `gpu.present` | warning, agents only | an accelerator is detected | a host with none can hold leaders and the control plane, not engines | | `net.vip.segment` | fatal, servers of three only | the VIP is on the server's own subnet (no router between) | pick an address in the subnet the servers share | | `net.vip.free` | fatal, servers of three, before k3s is installed | nothing answers ping on the VIP | pick another free address, outside DHCP | | `net.server` | fatal, agents only | the agent reaches the server on port 6443, tested from the agent | `host reachable but :6443 closed`: run the server step first or open 6443; `cannot reach`: give the agent a route to the server. An agent behind NAT only needs to dial out | [Requirements → Nodes](https://opod.io/docs/get-started/requirements/) has the same thresholds from the buyer's side. --- title: "Preflight" description: "opodcp preflight checks a cluster before helm install. Every row, its severity, and the flags that change what it checks." url: "https://opod.io/docs/control-plane-install/preflight/" markdown_url: "https://opod.io/docs/control-plane-install/preflight.md" section: "Install" last_updated: "2026-11-01" --- # Preflight > opodcp preflight checks a cluster before helm install. Every row, its severity, and the flags that change what it checks. ## In short `opodcp preflight` reads your cluster and tells you, row by row, whether `helm install opodcp` will work. It changes nothing. A fatal row (`✘`) blocks the install; a warning (`!`) or information row (`i`) tells you about a value you may want to set. The chart runs the same check as a hook, so running it first only shows you the answer sooner. ## When you need it - Before the first `helm install`, on any cluster. - Before an upgrade, with `--upgrade`, to see what the pre-upgrade hook will say. - When `helm install` or `helm upgrade` stops with `Job Failed` and you need the full report. - Before you raise `replicas` or set `workloads.leaderPool`, to check there are enough nodes. ## Do it 1. **Run it against the cluster** ```bash docker run --rm --network host -v ~/.kube:/kube:ro \ ghcr.io/opod-io/opodcp:0.3.6 preflight --kubeconfig /kube/config ``` Add the flags of the release you will install, so the rows judge the same thing: `--namespace opodcp`, `--replicas 3` for HA, `--leader-pool opod.io/pool=fronts` with a leader pool. 2. **Fix each fatal row** Every `✘` row ends in `→` and the remedy. For example: ```text ✘ dns.coredns 0 CoreDNS pod(s) → cluster DNS is required (workers join leaders via Service DNS) ``` 3. **Run it again, then install** Repeat until no row is fatal, then go on with [Install on Kubernetes](https://opod.io/docs/control-plane-install/kubernetes/), step 2. ## Check it worked ```bash docker run --rm --network host -v ~/.kube:/kube:ro \ ghcr.io/opod-io/opodcp:0.3.6 preflight --kubeconfig /kube/config; echo "exit=$?" ``` A good answer ends with `cluster ready for: helm install opodcp charts/opodcp -n opodcp --create-namespace` and `exit=0`. That line names the chart by a local path; use `oci://ghcr.io/opod-io/charts/opodcp` as the other pages do. Warnings and information rows do not change the exit status. ## If it fails | Output | Cause | Fix | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- | | `error: 1 fatal check(s): k8s.version — …` | Kubernetes older than 1.28 | upgrade the cluster | | `✘ nodes.ready 3/4 nodes Ready → kubectl describe node ` (from the release after 0.3.6 the remedy names the NotReady nodes: `→ kubectl describe node node-d`) | a node is NotReady | `kubectl describe node NODE`; on an upgrade the hook passes `--upgrade` and this row is a warning | | `✘ ha.nodes` | `--replicas` is larger than the Ready, schedulable nodes | add or uncordon nodes, or lower `replicas` | | `✘ fronts.pool` | the leader pool matches fewer than two nodes, or is not a label selector | label two nodes so the pool matches, or widen `workloads.leaderPool` | | `✘ endpoints.expose` | `endpoints.expose=gateway` and no Programmed Gateway | fix the Gateway, or use `endpoints.expose=auto` | | `preflight could not read the cluster: … — retrying once in 5s` | the kubeconfig is wrong or the API server does not answer | that is the check failing, not a verdict; fix `--kubeconfig` or the network and run it again | | `error: kubeconfig PATH: stat PATH: no such file or directory — pass --kubeconfig PATH or set KUBECONFIG` (the release after 0.3.6; 0.3.6 waited 5 s and retried) | the file you named is not there | pass the right path | | `unknown cloud provider "ibm" (have: aws, azure, gcp, onprem)` | `--cloud` names an adapter this build does not carry (`0.2.1` carries only `onprem`) | use one of the names it lists, or leave `--cloud` out | ## How it reads the cluster `opodcp preflight` reads a cluster and says whether `helm install opodcp` will work. It changes nothing. The chart runs the same check as a pre-install and pre-upgrade hook Job and refuses a half-install. Run it yourself first to see the answer earlier. ```bash opodcp preflight --kubeconfig ~/.kube/config opodcp preflight --json | jq '.[] | select(.pass == false)' # without the binary docker run --rm --network host -v ~/.kube:/kube:ro \ ghcr.io/opod-io/opodcp:0.3.6 preflight --kubeconfig /kube/config ``` Each row prints `✔` (pass), `i` (information), `!` (warning) or `✘` (fatal), its id, a message and, on a failure, a remedy after `→`. A fatal row makes the command exit `1` and names every fatal id. If the check itself cannot read the cluster (an unreachable API server, a bad kubeconfig), it retries once after 5 s and then says `preflight could not read the cluster`: that is the check failing, not a verdict on the cluster. ## Rows The rows print in this order. A row marked "only when" is left out otherwise. | Row | Severity | Passes when | Remedy on a failure | | ----------------- | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `k8s.version` | fatal | Kubernetes 1.28 or newer (an N-2 policy), compared as numbers from 0.3.0 (on 0.2.1 the minor was compared as text, so a three-digit minor failed) | upgrade the cluster | | `nodes.ready` | fatal (warning with `--upgrade`) | every node is Ready; the message reads `3/4 nodes Ready`. Zero Ready nodes is always fatal | `kubectl describe node ` | | `ha.nodes` | fatal, only when `--replicas` is above 1 | there are as many Ready, schedulable nodes as replicas: the chart runs each replica on a node of its own | uncordon or add nodes, or lower `replicas` | | `nodes.vendors` | warning | some node carries `opod.io/gpu-vendor`; the message lists the count per vendor | none needed: the control plane labels nodes itself from what each node advertises, on every reconcile. `opodcp infra up` and NFD also set it | | `gpu.allocatable` | warning | some node advertises `*/gpu`, `gpu.intel.com/*` or `tenstorrent.com/*`; the message lists the totals | the chart installs the per-vendor device plugins | | `storage.default` | warning | a default StorageClass exists | needed only for `ha.postgres.provide`, `pvc://` job checkpoints and the `0.2.1` SQLite volume (k3s: `local-path`). The control plane itself keeps nothing on a volume | | `runtime.nvidia` | warning | RuntimeClass `nvidia` exists, or no node is labelled `nvidia` | on k3s, install nvidia-container-toolkit on NVIDIA nodes and k3s registers the class by itself. On EKS, GKE and AKS the class is absent by design: on `0.2.1` create it (see [Managed Kubernetes notes](https://opod.io/docs/control-plane-install/kubernetes/#managed-kubernetes-notes)); from `0.3.0` GPU pods are rendered without it and the warning needs no action | | `dns.coredns` | fatal | at least one `k8s-app=kube-dns` pod runs in `kube-system` | workers join leaders by Service DNS, so cluster DNS is required | | `network.policy` | information | says whether the CNI enforces NetworkPolicy: enforced (naming it), not enforced (naming the network), or unknown | with no enforcement, `networkPolicy.enabled=true` is stored and does nothing. Install Cilium or Calico (Canal beside flannel) if the namespace must be isolated; when unknown, apply a deny-all policy in a scratch namespace and test | | `nodes.taints` | information | lists GPU nodes whose taints no pod of ours tolerates. Such nodes are measured and counted, and the placer skips them. GPU-resource taints (for example `nvidia.com/gpu`) are tolerated without any setting | the `workloads.tolerations` value to set, printed as `--set-json` | | `cp.node` | warning (`0.3.0`) | some Ready, uncordoned node with no hard taint has no accelerator; the control plane prefers such a node | add a CPU node, or tolerate a GPU-less node's taint with `tolerations`. A cluster of GPU nodes only installs and runs as it is | | `fronts.pool` | warning, only with `--leader-pool`; fatal when the value is not a label selector | at least two Ready, unfenced nodes match the pool; the message names them | label two nodes so the pool matches, or widen `workloads.leaderPool` | | `secrets.at-rest` | warning; information on a managed cluster | every k3s server runs with `--secrets-encryption`. On EKS, GKE or AKS the API cannot say, so the row names the provider's setting | on each k3s server: `sudo k3s secrets-encrypt enable`, then `sudo systemctl restart k3s`. The install key that seals stored connector credentials is a Secret, so it is only as private as etcd | | `substrate.lws` | information | says whether the LeaderWorkerSet API is already served by this cluster | if this chart did not install that controller, install with `substrate.leaderWorkerSet.enabled=false`: Helm will not adopt a CRD another release owns (`invalid ownership metadata`). An upgrade of a release that brought its own needs nothing | | `policy.engine` | warning, only when Kyverno or Gatekeeper is present | names the engine | the pods the control plane renders meet Pod Security Standards `baseline`. `restricted` also needs `runAsNonRoot`, which the upstream vLLM and llama.cpp images do not support: exempt the release namespace from `restricted` | | `ns.opod` | information | says whether namespace `opodcp` exists already | `helm install --create-namespace` creates it | ### Rows a cloud adapter adds `opodcp preflight --cloud ` (default `onprem`, or `OPODCP_CLOUD`) prints the adapter's rows after the ones above. `onprem` adds none. The `aws`, `gcp` and `azure` adapters are new in `0.3.0`, built and not yet proven on a real cluster: ```bash opodcp preflight --kubeconfig ~/.kube/config --cloud gcp --replicas 3 ``` | Row | Severity | Passes when | Remedy on a failure | | ------------------------------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `cloud..storageclass` | warning | the default StorageClass uses the cloud's own CSI driver: `ebs.csi.aws.com`, `pd.csi.storage.gke.io` or `disk.csi.azure.com` | make the cloud's class the default (EKS `gp3`, GKE `standard-rwo`, AKS `managed-csi`) | | `cloud..gpu-nodes` | warning | some node carries the cloud's accelerator label | add a GPU node pool | | `cloud.gcp.autopilot` | fatal | the cluster is not GKE Autopilot | use GKE Standard: Autopilot forbids the host path the weights live in and the host driver tree the GPU probes read | | `lws.controller` | information, or warning when half-installed | the LeaderWorkerSet CRD, webhook and controller are whole (pass), or all absent (gangs then land as per-part Deployments) | a half-installed controller would accept a gang and never schedule it: `helm upgrade --reset-then-reuse-values` restores it. Until it is whole, gang plans are refused with `E-GANG-SUBSTRATE` | | `endpoints.expose` | information; fatal with `endpoints.expose=gateway` and no ready Gateway | says how endpoints will be reached from outside and why: `one HTTPRoute per endpoint`, `one Ingress per endpoint` or `no route from outside` | install or fix the Gateway (it must be Programmed), name it with `endpoints.gateway.name` and `namespace`, or set `endpoints.expose=auto` | A cloud adapter may add its own `cloud..*` rows. `onprem` adds none. From `0.3.0`, `--cloud aws` adds `cloud.aws.storageclass` and `cloud.aws.gpu-nodes`, `--cloud azure` adds `cloud.azure.storageclass` and `cloud.azure.gpu-nodes`, and `--cloud gcp` adds `cloud.gcp.storageclass`, `cloud.gcp.gpu-nodes` and `cloud.gcp.autopilot`. These three adapters are built and not yet proven on a real EKS, GKE or AKS cluster. A missing GPU is a warning, not a failure: the control plane installs and serves its console on a cluster with no GPU. ### Example output ```text ✔ k8s.version Kubernetes v1.31.4+k3s1 ✔ nodes.ready 4/4 nodes Ready ✔ nodes.vendors vendor labels: map[nvidia:2] ✔ gpu.allocatable allocatable accelerators: map[nvidia.com/gpu:4] on 2 node(s) ! storage.default default StorageClass: → no default StorageClass: the chart's optional ha.postgres and pvc:// job checkpoints need one (k3s: local-path); the control plane itself does not ✔ runtime.nvidia RuntimeClasses: [nvidia] ✔ dns.coredns 1 CoreDNS pod(s) … i endpoints.expose no route from outside — … cluster ready for: helm install opodcp charts/opodcp -n opodcp --create-namespace ``` With `--json` the command prints one array of objects: `id`, `node` (`cluster`), `pass`, `severity` (on 0.2.1 a number: `0` information, `1` warning, `2` fatal; from 0.3.0 its name: `"info"`, `"warn"`, `"fatal"`), `message` and `remedy`. When a fatal row fails, the last line names every fatal id, for example `error: 2 fatal check(s): k8s.version, dns.coredns — each is printed above with what to do about it`, and the exit status is `1`. ## Flags | Flag | Default | Meaning | | --------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | `--kubeconfig` | `$KUBECONFIG` | kubeconfig path; empty = in-cluster | | `--json` | `false` | JSON output | | `--namespace` | `$OPODCP_NAMESPACE`, else `opodcp` | the namespace the chart installs into; the LeaderWorkerSet controller and the Gateway choice are read there | | `--cloud` | `$OPODCP_CLOUD`, else `onprem` | cloud provider adapter; adds its own checks. An unknown name is refused with the list of registered ones | | `--upgrade` | `false` | a release already runs here (the pre-upgrade hook sets it): NotReady nodes are a warning, zero Ready nodes stays fatal | | `--leader-pool` | `$OPODCP_LEADER_POOL` | the chart's `workloads.leaderPool` label selector; adds `fronts.pool` | | `--replicas` | `1` | control-plane replicas the release runs; above 1 adds `ha.nodes` | ## The pre-install Job `substrate.preflight=true` (the default) renders the Job `-opodcp-preflight` as a Helm `pre-install,pre-upgrade` hook (weight `-5`) and as an Argo CD `PreSync` hook, so a GitOps sync that renders with `helm template` still runs it. In a fleet release it is not rendered. What the Job does: 1. It runs the control plane's own image with `preflight`, in-cluster. On an upgrade it adds `--upgrade`. It always passes `--replicas` from the chart's `replicas`, and `--leader-pool` when `workloads.leaderPool` is set. It also gets the `endpoints.expose`, `endpoints.gateway.*` and `endpoints.ingress.*` settings, so `endpoints.expose` is judged the way the control plane will judge it. 2. It runs under its own ServiceAccount, created as an earlier hook (weight `-10`), with a ClusterRole that can only get and list nodes, namespaces, pods, StorageClasses, RuntimeClasses and Gateways — and, from 0.3.0, the Endpoints, Deployments and webhook configurations the `lws.controller` row reads (on 0.2.1 it could not read them). From 0.3.0 it also passes `--namespace` with the release's namespace; on 0.2.1 it judged `opod` whatever the release namespace was. The role and binding are deleted when the hook succeeds. 3. It honours the chart's `nodeSelector`, `tolerations` and `imagePullSecrets`, so it runs where the control plane will run. That matters on a cell where only some nodes can pull the image. 4. A read that fails right after the binding is created is retried once after 5 s. 5. `backoffLimit` is 0 and the Job is kept for 10 minutes after it finishes. Its last words go into the pod's termination message as well as its log, so they survive when the log is gone. When Helm reports only `Job Failed`, read the pod's status or run the command yourself for the full report: ```bash kubectl -n opodcp get pods -l app.kubernetes.io/name=opodcp -o jsonpath='{.items[*].status.containerStatuses[*].state.terminated.message}' opodcp preflight --kubeconfig ~/.kube/config --upgrade ``` To skip the Job (for example on a cluster where a hook cannot run), set `substrate.preflight=false` and run the command yourself first. --- title: "Configuration" description: "The chart settings most installs change (database, admin token, install key, tolerations, leader placement, resources, exposure) and every OPODCP_* variable the binary reads." url: "https://opod.io/docs/control-plane-install/configuration/" markdown_url: "https://opod.io/docs/control-plane-install/configuration.md" section: "Install" last_updated: "2026-10-31" --- # Configuration > The chart settings most installs change (database, admin token, install key, tolerations, leader placement, resources, exposure) and every OPODCP_* variable the binary reads. ## In short You configure the control plane in two places. Chart values (`helm upgrade --set …`) set what the release itself needs: the database, the admin token, the install key, where pods run, their resources and how endpoints are reached. Every other service it talks to (a usage sink, OIDC, alerts, logs) is a connector that an admin saves on the console's **Connectors** page. A chart value change rolls the control plane pod; a change that touches pod templates waits for each endpoint's next rollout. ## When you need it - Your GPU nodes carry a taint of their own, and nothing is placed on them. - Leaders land on GPU nodes and you want them on cheap CPU nodes instead. - Workers need more CPU or memory than the default floor, or a memory ceiling. - You want endpoints reachable from outside the cluster through your Gateway or Ingress. - You reinstall over a kept database and must bring back its install key. - You need a proxy, a custom CA bundle or an OIDC claim name that has no chart value. ## Do it 1. **Read what runs now** ```bash export CP=https://cp.example.com export OPODCP_URL=$CP # the opodcp CLI reads these two export OPODCP_TOKEN=$(kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d) export H="Authorization: Bearer $OPODCP_TOKEN" helm get values opodcp -n opodcp curl -s -H "$H" $CP/api/v1/config | jq -r '.env[] | select(.set) | "\(.name)=\(.value // "(" + .redaction + ")")"' ``` `helm get values` prints only what you set. `/api/v1/config` (admin) prints every `OPODCP_*` variable the pod runs with, a secret shown as `(secret)`. Each row also carries `chart` (the value that sets it) and `helm` (the upgrade line that changes it). 2. **Change the value** ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ --set-json 'workloads.tolerations=[{"key":"sku","operator":"Equal","value":"gpu","effect":"NoSchedule"}]' kubectl -n opodcp rollout status deploy/opodcp ``` 3. **Roll the endpoints, if the value changes pod templates** Tolerations, resources, images and TLS change the pods the control plane renders. Running endpoints keep their pods and report `template-drift` until you roll them: ```bash kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor | grep template-drift opodcp endpoint rollout --wait --note 'new tolerations' chat ``` ## Check it worked ```bash kubectl -n opodcp get deploy opodcp -o json \ | jq -r '.spec.template.spec.containers[0].env[] | select(.name=="OPODCP_WORKLOAD_TOLERATIONS") | .value' # [{"effect":"NoSchedule","key":"sku","operator":"Equal","value":"gpu"}] ``` The variable beside each value in [Set from a chart value](#set-from-a-chart-value) is the one to look for. The console shows the same on **Settings → Effective configuration**, each row with the `helm upgrade` line that changes it. ## If it fails | Message | Cause | Fix | | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | --------------------------------------------------------------- | | `ports.usage is not a chart value any more: connector settings are saved on the Connectors page …` | a connector value from a `0.2.1` values file | add `--set ports.usage=null`, then save it on **Connectors** | | `ports.state.dsn carries a user or a password in its address` | a credential in a plain value | put the whole DSN in a Secret; set `ports.state.dsnSecret.name` | | `ha.postgres.provide and ports.state.dsn (or its Secret) are both set` | two databases asked for | keep one | | `replicas > 1 cannot run under nodeSelector kubernetes.io/hostname` | an HA release pinned to one node | remove the hostname from `nodeSelector` | | A new default did not arrive after an upgrade | plain `--reuse-values` | upgrade again with `--reset-then-reuse-values` | | A plan is refused `E-NODE-TAINTED` | `workloads.tolerations` does not cover the node's taint | set the value the refusal names in `details.set` | ## Two places: chart values and connectors The chart carries **one connector setting, the database**. Every other connector (usage sink, events, logs, metrics, traces, OIDC, notifier, secret store, checkpoints, batch files, KV store) is saved by an admin on the console's **Connectors** page, into the database. See [Connectors](https://opod.io/docs/control-plane-operate/connectors/). This page covers the chart values you set at install, for `0.3.0`. The full table is the [Helm values reference](https://opod.io/docs/control-plane-reference/helm-values/). In `0.2.1` the database was an embedded SQLite file on a volume and the connectors were chart values under `ports.`; see [Releases](https://opod.io/docs/get-started/releases/). Change a value with: ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values --set = ``` Use `--reset-then-reuse-values`, never plain `--reuse-values`, which drops every default a newer chart added. The console's **Settings → Effective configuration** shows each `OPODCP_*` variable the control plane runs with and the exact `helm upgrade` that changes it. ## Database | Value | Default | Meaning | | ---------------------------- | ------- | ----------------------------------------------------------------- | | `ports.state.dsnSecret.name` | `""` | a Secret in the release namespace holding the whole DSN | | `ports.state.dsnSecret.key` | `dsn` | the Secret's item | | `ports.state.dsn` | `""` | a plain `postgres://host/db` with no credential in it | | `ports.state.adapter` | `""` | your declaration of the adapter; checked against the DSN's scheme | ```bash kubectl -n opodcp create secret generic opod-state-dsn \ --from-literal=dsn='postgres://opod:…@pg.example.com:5432/opod?sslmode=require' helm upgrade --install opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --create-namespace \ --set ports.state.dsnSecret.name=opod-state-dsn \ --set ports.state.adapter=postgres ``` Give one of `dsn` or `dsnSecret`, never both: both set fails the render. A plain DSN with a user, a password, or a credential in its query fails the render too. `ports.state.dsnSecret` is new in `0.3.0`. With no database, the control plane starts in setup mode and asks for one until it answers. `ha.postgres.provide=true` lets the chart run a CloudNativePG Postgres instead; it fails the render when `ports.state.dsn` or its Secret is also set. See [High availability](https://opod.io/docs/control-plane-install/high-availability/). Any other `ports.` value fails the render: connector settings are not chart values any more. ## The admin token `admin.token` (or `admin.existingSecret`, a Secret with item `token`) is a **bootstrap** credential. Empty, the chart generates one once into `-opodcp-admin` and keeps it across upgrades and uninstalls. Every action taken with it is audited as `static-admin`, so the doctor's `identity` row stays red while the shared token still works. A configured OIDC issuer retires the token. Local users do not: users beside a working token is the worse doctor state, because acting as `static-admin` stays possible. Emptying `admin.token` alone does not remove it, because the chart keeps the generated token in its Secret. See [Users, roles and SSO](https://opod.io/docs/control-plane-security/authentication/). ```bash # bring your own bootstrap token, kept in a Secret you manage kubectl -n opodcp create secret generic opod-admin --from-literal=token="$(openssl rand -hex 20)" helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ --set admin.existingSecret=opod-admin # read the token the chart generated, when you did not bring one kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d; echo ``` ## The install key The install key is new in `0.3.0`. It seals every connector credential the control plane stores in its database (envelope encryption with Google Tink). Empty, the chart mints 32 random bytes once into `-opodcp-install-key` and keeps it across upgrades and uninstalls. | Value | Meaning | | --------------------------- | -------------------------------------------------------- | | `installKey.existingSecret` | a Secret with item `keys` | | `installKey.keys` | base64 keys, comma-separated; the first seals new values | ```bash # save the key the chart minted, beside your database backup kubectl -n opodcp get secret opodcp-install-key -o jsonpath='{.data.keys}' | base64 -d > install-key.txt # a reinstall over the same database reuses it kubectl -n opodcp create secret generic opod-install-key --from-file=keys=install-key.txt helm upgrade --install opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp \ --set installKey.existingSecret=opod-install-key --set ports.state.dsnSecret.name=opod-state-dsn ``` **Keep the install key with your database backups.** The database without it holds no readable credential. A lost key loses the stored credentials, never the data: you enter them again on the Connectors page. To rotate, put the new key first, save each connector again, then drop the old key. ## Tolerations for your GPU nodes `tolerations` applies to the `opodcp` pod only. `workloads.tolerations` applies to **every pod the control plane creates**: leaders, workers, gang parts, prefetch, warm, eval and cache-prune Jobs, and training Jobs. ```bash helm upgrade … --set-json 'workloads.tolerations=[{"key":"sku","operator":"Equal","value":"gpu","effect":"NoSchedule"}]' ``` You do not need it for a GPU pool tainted with its own device resource (`nvidia.com/gpu`, `amd.com/gpu`, `gpu.intel.com/*`, the Tenstorrent resource). A node with a taint nothing tolerates is measured and counted, never placed on, and a plan that names it is refused `E-NODE-TAINTED` with the exact value to set. Operators `Exists` and `Equal` only. Changing this value changes pod templates: running endpoints report template drift and take it on their next rollout. Preflight (`nodes.taints`) and doctor (`node-taints`) also print the value to set. ## Where leaders and front doors run The control plane picks each leader's and door's node by a fixed rule and pins it with a required node affinity: 1. nodes labelled `opod.io/leaders=prefer` 2. then nodes with no accelerator 3. then the node with the fewest leaders and doors 4. then the node name A node labelled `opod.io/leaders=avoid` is never picked. `workloads.leaderPool` (it is new in `0.3.0`) is a label selector (for example `opod.io/pool=fronts`) that keeps every leader and door inside the nodes it matches. Preflight (`fronts.pool`) and doctor (`leader-fence`) warn when fewer than two nodes may hold one. ```bash opodcp node label --cp https://cp.example.com --token "$OPODCP_TOKEN" node-a opod.io/leaders=avoid # node node-a: opod.io/leaders=avoid opodcp nodes --leaders # reads OPODCP_URL and OPODCP_TOKEN when --cp and --token are left out ``` Flags go before the node name: the command stops reading flags at the first word that is not one. `opodcp node label` and `opodcp nodes` are new in `0.3.0`. A pin moves only when its node may no longer hold a front: fenced, outside the pool, tainted or gone. Labelling a node `prefer` steers the next pick, not a running leader. ## Resources and scheduling | Value | Default | Meaning | | ------------------------------------- | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `resources` | 100m / 256Mi, limit 1Gi | the `opodcp` pod | | `workerResources.requests` | 500m CPU, 2Gi | the floor a worker is scheduled at; raise for large models | | `workerResources.limits.memory` | `""` | a memory ceiling per worker; set it on machines shared with other work | | `workloads.leader.resources` | 100m / 256Mi, no memory limit | each leader; is new in `0.3.0` | | `workloads.gateway.resources` | 100m / 192Mi, no memory limit | each front door; is new in `0.3.0` | | `workloads.worker.startBudgetMinutes` | `90` | a worker never Ready this long is restarted; `0` turns it off; is new in `0.3.0` | | `kvOffload.maxNodePct` | `50` | the share of one node's memory its KV cache tiers may take; past it a plan is refused `E-KV-RAM`; is new in `0.3.0` | | `priorityClasses.*` | created | `opodcp-serving` (100000) above `opodcp-batch` (10000) above `opodcp-batch-preemptible` (1000), all below `system-cluster-critical`; an empty name = no priority | | `priorityClasses.nodePressure` | `""` | `system-cluster-critical` lets the cache prune and the probe run on a node under DiskPressure | | `allowNodeConsolidation` | `false` | `true` lets Karpenter or cluster-autoscaler move our pods; `0.2.1` ignored this value | | `kube.qps`, `kube.burst` | `0` (50 / 100) | the control plane's client-side budget against the API server | | `api.rateLimit.rps`, `.burst` | `0` (off) | a per-caller API rate limit; over it, `429` with `Retry-After` | A change to worker, leader or door resources is a pod-template change and rides each endpoint's next rollout. A realistic set for large models on machines shared with other work: ```yaml # values-resources.yaml resources: { requests: { cpu: 200m, memory: 512Mi }, limits: { memory: 2Gi } } workerResources: requests: { cpu: "4", memory: 32Gi } # a 70B model's host-side buffers limits: { memory: 64Gi } # a ceiling, because the machine runs other jobs workloads: leader: { resources: { requests: { cpu: 250m, memory: 512Mi }, limits: { memory: 1Gi } } } gateway: { resources: { requests: { cpu: 200m, memory: 256Mi }, limits: { memory: 512Mi } } } worker: { startBudgetMinutes: 120 } # big weights take long to load the first time kvOffload: { maxNodePct: 40 } priorityClasses: { nodePressure: system-cluster-critical } kube: { qps: 100, burst: 200 } # a cell with hundreds of endpoints api: { rateLimit: { rps: 20, burst: 40 } } ``` ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values -f values-resources.yaml opodcp endpoint rollout --wait --note 'new worker resources' chat # each endpoint takes the new template ``` ## How endpoints are reached By default an endpoint is reachable inside the cluster through its Service, in plain HTTP on port 8080. To reach endpoints from outside, set a host pattern and let the control plane render one route per endpoint: ```yaml endpoints: expose: auto # auto · gateway · ingress · none gateway: { name: "", namespace: "", sectionName: "" } ingress: host: "{endpoint}.{cell}.example.com" className: nginx tlsSecret: "" annotations: { cert-manager.io/cluster-issuer: letsencrypt } ``` Set `endpoints.ingress.host` in a values file or with `--set-json`: `--set` reads braces as a list. Its default is `""` (no route); in `0.2.1` it was `{endpoint}.{cell}.example.com`. `endpoints.expose` and `endpoints.gateway` are new in `0.3.0`. `tlsSecret` and `annotations` are read only when `className` is set. `auto` attaches an `HTTPRoute` to your Programmed Gateway when one exists, else an `Ingress` through your class, else nothing. With `gateway`, every endpoint apply is refused `E-GATEWAY-NOT-READY` while no Gateway is ready. Your Gateway or Ingress terminates TLS with your certificate. See [Network and TLS](https://opod.io/docs/control-plane-security/network-tls/), including `endpoints.tls.embedded` for in-cluster TLS. ## RBAC and the service account | Value | Default | Meaning | | ----------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `rbac.create` | `true` | render the Role, ClusterRole and their bindings; `false` when your platform team applies them | | `rbac.nodeDrain` | `true` | the cluster-wide `create` on `pods/eviction` that a full **Drain** needs; `false` removes that one rule, and evacuating our own workloads still works | | `serviceAccount.create` | `true` | render the ServiceAccount `-opodcp` | | `serviceAccount.name` | `""` | the ServiceAccount to run as; empty = the release's own | A cluster whose platform team owns every role, and that allows no cross-namespace eviction: ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ --set rbac.create=false --set rbac.nodeDrain=false \ --set serviceAccount.create=false --set serviceAccount.name=opod-cp ``` With `rbac.create=false`, the grants listed in [What the control plane may do in your cluster](https://opod.io/docs/control-plane-install/kubernetes/#what-the-control-plane-may-do-in-your-cluster) must already be bound to that ServiceAccount, or the doctor's `executor` row and every apply fail with `forbidden`. ## Engine images `engineImages.*` names the leader image and one worker image per engine and vendor, each pinned by digest. A plan pins the images it runs when it is created; only a rollout re-pins them. To serve a pair the chart has no named value for, add `OPODCP_IMAGE__` through `extraEnv`. To use your own registry, see [Air-gapped install](https://opod.io/docs/control-plane-install/air-gapped/). ```yaml engineImages: vllmNvidia: registry.example.com/opod/opod-worker-vllm-nvidia@sha256:… # your mirror of the same digest trtllmNvidia: registry.example.com/opod/trtllm-nvidia@sha256:… # setting it accepts NVIDIA's NGC licence extraEnv: - { name: OPODCP_IMAGE_SGLANG_TT, value: "registry.example.com/opod/sglang-tt@sha256:…" } # a pair with no named value; the planner still refuses a pair its engine cannot run ``` ```bash opodcp images matrix # every engine × vendor pair and the image the executor will use ``` ## Extra environment `extraEnv` adds environment to the `opodcp` container, in Kubernetes `EnvVar` form. Use it for variables with no named value: `HTTPS_PROXY` and `NO_PROXY`, `SSL_CERT_FILE`, the OIDC claim names (`OPODCP_OIDC_ROLE_CLAIM`, `OPODCP_OIDC_TEAM_CLAIM`, `OPODCP_OIDC_REDIRECT_URL`), `OTEL_EXPORTER_OTLP_HEADERS`, `OPODCP_LOGS_HEADERS`. Put anything that carries a token in a Secret and use `valueFrom.secretKeyRef`. A name the chart already sets is rejected by the API server as a duplicate. [Environment variables](#environment-variables) lists which variables have no chart value. ```yaml extraEnv: - name: HTTPS_PROXY valueFrom: { secretKeyRef: { name: corp-proxy, key: url } } ``` ## Environment variables Read what a running control plane uses, with secrets redacted: ```bash curl -s -H "$H" https://cp.example.com/api/v1/config | jq '.env[] | select(.name | startswith("OPODCP_WORKER"))' kubectl -n opodcp exec deploy/opodcp -- /opodcp serve -h | sed -n '/^environment/,$p' ``` The `opodcp` binary reads its settings from `OPODCP_*` variables. `opodcp serve -h` lists every name. The chart sets most of them from its values; you rarely set one by hand. The default below is the binary's own, used when the variable is unset. This list describes `0.3.0`: in `0.2.1` the connector variables came from chart values under `ports.`. These names are new in `0.3.0`: `OPODCP_MODE`, `OPODCP_FLEET_CELLS`, `OPODCP_INSTALL_KEYS`, `OPODCP_HELM_RELEASE`, `OPODCP_CHART_REF`, `OPODCP_CHART_VERSION`, `OPODCP_KEDA_SUBSTRATE`, `OPODCP_NODE_SCALING`, `OPODCP_ALLOW_NODE_CONSOLIDATION`, `OPODCP_GPU_SLICES_PER_CARD`, `OPODCP_GPU_SLICE_CHOICES`, `OPODCP_KV_TIER_MAX_PCT`, `OPODCP_WORKER_START_BUDGET_MIN`, `OPODCP_LEADER_POOL`, `OPODCP_LEADER_CPU_REQUEST`, `_MEMORY_REQUEST` and `_MEMORY_LIMIT`, `OPODCP_GATEWAY_CPU_REQUEST`, `_MEMORY_REQUEST` and `_MEMORY_LIMIT`, `OPODCP_DOOR_IMAGE`, `_REPLICAS`, `_CPU_REQUEST` and `_MEMORY_REQUEST`, `OPODCP_EXPOSE`, `OPODCP_GATEWAY_NAME`, `_NAMESPACE` and `_SECTION`, `OPODCP_INFERENCEPOOL`, `OPODCP_INFERENCEPOOL_GATEWAY_NAMESPACE` and `_LABELS`, `OPODCP_IMAGE_EPP` and `OPODCP_TRACES_SAMPLE_RATIO`. ### Set from the release The chart fills these from the release itself. No value changes them. | Variable | Default | Meaning | | ----------------------------------------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `OPODCP_ADDR` | `:8080` | the listen address | | `OPODCP_DATA` | `/var/lib/opodcp` | a scratch directory; it holds only the Sigstore root cache | | `OPODCP_NAMESPACE` | `opodcp` | where endpoints are created; the release's namespace (`opod` in `0.3.0`) | | `OPODCP_HELM_RELEASE` | `opodcp` | the release name, for the `helm upgrade` lines the console prints (`opod` in `0.3.0`) | | `OPODCP_CHART_VERSION` | `""` | the chart version installed | | `OPODCP_SELF_URL` | `""` | this control plane's Service address, which the node probes report to. From the release after 0.3.6, only a control plane outside its cluster is pushed to at this address; one inside reads each probe on port 9147 | | `OPODCP_POD_NAME`, `OPODCP_NODE_NAME` | `""` | the pod's name and node (downward API) | | `OPODCP_DOOR_ROUTES_CONFIGMAP`, `OPODCP_DOOR_URL` | `""` | the cell door's routes ConfigMap and address, with `door.enabled` | | `OPODCP_EVENTS_URL` | `""` = the embedded journal | the chart's NATS, with `ha.nats.provide`; a saved events connector wins | | `OPODCP_KVSTORE_URL`, `_SECRET`, `_SECRET_KEY`, `_PASSWORD` | `""`; the secret key defaults to `password` | the chart's KV store, with `kvStore.enabled`; a saved KV store connector wins | ### Set from a chart value | Variable | Chart value | Default when unset | | ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | | `OPODCP_CELL` | `cell.name` | `default` | | `OPODCP_SERVICE_DOMAIN` | `cell.serviceDomain` | `.svc` | | `OPODCP_MODE` | `mode` | `cell` | | `OPODCP_FLEET_CELLS` | `fleet.cells` | `""`; a JSON list of `{name, url, tokenFile}` | | `OPODCP_ADMIN_TOKEN` | `admin.token` or `admin.existingSecret` | `""`; the binary refuses to start without it, unless `OPODCP_BOOTSTRAP_ADMIN_PASSWORD` or `OPODCP_INSECURE` is set | | `OPODCP_INSTALL_KEYS` | `installKey.*` | `""` | | `OPODCP_LICENCE_KEY` | `licence.*` | `""` = the free tier | | `OPODCP_STATE_DSN` | `ports.state.dsn` or `ports.state.dsnSecret` | `""` = setup mode | | `OPODCP_STATE_ADAPTER` | `ports.state.adapter` | `""`; `postgres` with `ha.postgres.provide` | | `OPODCP_KUBE_QPS`, `OPODCP_KUBE_BURST` | `kube.qps`, `kube.burst` | `0` = 50 and 100 | | `OPODCP_API_RATE_RPS`, `OPODCP_API_RATE_BURST` | `api.rateLimit.*` | `0` = off | | `OPODCP_TRUSTED_PROXIES` | `api.trustedProxies` | `""`, comma-separated CIDRs | | `OPODCP_CONTROLLERS` | `controllers` | `""` = every loop | | `OPODCP_AUTOSCALER` | `autoscaler.adapter` | `embedded` | | `OPODCP_KEDA_SUBSTRATE` | `substrate.keda.enabled` | off | | `OPODCP_CLOUD` | `cloud.provider` | `onprem` | | `OPODCP_NODE_SCALING` | `cloud.nodeScaling` | off | | `OPODCP_ALLOW_NODE_CONSOLIDATION` | `allowNodeConsolidation` | off | | `OPODCP_IMAGES_VERIFY` | `images.verify` | `warn` | | `OPODCP_IMAGES_TRUST` | `images.trust` | `""`; a JSON list | | `OPODCP_IMAGES_TRUST_ROOT` | `images.trustRoot`, `images.trustRootConfigMap` | `auto`; a ConfigMap becomes a file path | | `OPODCP_IMAGE_LEADER`, `OPODCP_IMAGE_LLAMACPP_CPU`, `OPODCP_IMAGE__` | `engineImages.leader`, `engineImages.llamacppCpu`, the other `engineImages.*` | none: an unset image is refused by name | | `OPODCP_IMAGE_EPP`, `OPODCP_IMAGE_FABRIC_PROBE` | `engineImages.epp`, `engineImages.fabricProbe` | `""` | | `OPODCP_IMAGE_PULL_SECRET` | `imagePullSecrets[0].name` | `""` | | `OPODCP_HUB_ENDPOINT` | `weights.hubEndpoint` | `""` = the public Hub | | `OPODCP_SKIP_SOURCE_CHECK` | `weights.skipSourceCheck` | off | | `OPODCP_CATALOG_PUBKEY`, `OPODCP_CATALOG_REQUIRE_SIGNED` | `weights.catalogPubKey`, `weights.catalogRequireSigned` | `""`, off | | `OPODCP_WORKER_MTLS` | `workers.mtls` | `allow`; an unknown value is read as `allow` | | `OPODCP_WORKER_REJECT_BEARER` | `workers.rejectBearer` | off | | `OPODCP_WORKER_CPU_REQUEST`, `OPODCP_WORKER_MEMORY_REQUEST` | `workerResources.requests.*` | `500m`, `2Gi` | | `OPODCP_WORKER_MEMORY_LIMIT` | `workerResources.limits.memory` | `""` = no limit | | `OPODCP_LEADER_CPU_REQUEST`, `_MEMORY_REQUEST`, `_MEMORY_LIMIT` | `workloads.leader.resources.*` | `100m`, `256Mi`, no limit | | `OPODCP_GATEWAY_CPU_REQUEST`, `_MEMORY_REQUEST`, `_MEMORY_LIMIT` | `workloads.gateway.resources.*` | `100m`, `192Mi`, no limit | | `OPODCP_WORKER_START_BUDGET_MIN` | `workloads.worker.startBudgetMinutes` | `90`; `0` = off | | `OPODCP_KV_TIER_MAX_PCT` | `kvOffload.maxNodePct` | `50`; 1 to 100 | | `OPODCP_WORKLOAD_TOLERATIONS` | `workloads.tolerations` | `""`; a JSON list | | `OPODCP_LEADER_POOL` | `workloads.leaderPool` | `""` = every node | | `OPODCP_PRIORITY_CLASS_SERVING`, `_BATCH`, `_BATCH_PREEMPTIBLE`, `_NODE_PRESSURE` | `priorityClasses.*` | `""` = no priority | | `OPODCP_AMD_PRIVILEGED_FALLBACK` | `substrate.amdDevicePlugin.privilegedFallback` | off | | `OPODCP_GPU_SLICES_PER_CARD`, `OPODCP_GPU_SLICE_CHOICES` | `substrate.nvidiaDevicePlugin.timeSlicing.*` | `4`; an empty list (the chart sets `2,4,8`) | | `OPODCP_LWS_ENABLED` | `substrate.leaderWorkerSet.enabled` | off; on = a gang plan is refused while the LeaderWorkerSet controller is missing | | `OPODCP_RDMA_DEVICE_PLUGIN` | `substrate.rdmaDevicePlugin.enabled` | off | | `OPODCP_RDMA_RESOURCE`, `OPODCP_RDMA_NETWORK` | `fabric.rdmaResource`, `fabric.networkAttachment` | `""` (the chart sets `rdma/hca_shared_devices_a`, `opodcp-rdma`) | | `OPODCP_FABRIC_HOSTNETWORK` | `fabric.hostNetwork` | off | | `OPODCP_INFERENCEPOOL` | `inferencePool.enabled` | off | | `OPODCP_INFERENCEPOOL_GATEWAY_NAMESPACE`, `_LABELS` | `inferencePool.gatewayPods.*` | `envoy-gateway-system`; empty labels = Envoy Gateway's own | | `OPODCP_DOOR_IMAGE`, `_REPLICAS`, `_CPU_REQUEST`, `_MEMORY_REQUEST` | `door.*` | `""`, `2`, `100m`, `64Mi` | | `OPODCP_TLS_EMBEDDED` | `endpoints.tls.embedded` | **on** when unset; the chart always sets it, `0` by default | | `OPODCP_TLS_CERT_DAYS`, `OPODCP_TLS_RENEW_DAYS` | `endpoints.tls.certDays`, `.renewDays` | `3650`, `30` | | `OPODCP_EXPOSE` | `endpoints.expose` | `auto` | | `OPODCP_GATEWAY_NAME`, `_NAMESPACE`, `_SECTION` | `endpoints.gateway.*` | `""` = the one Programmed Gateway | | `OPODCP_INGRESS_HOST`, `OPODCP_INGRESS_CLASS` | `endpoints.ingress.host`, `.className` | `""` | | `OPODCP_INGRESS_TLS_SECRET`, `OPODCP_INGRESS_ANNOTATIONS` | `endpoints.ingress.tlsSecret`, `.annotations` | `""`; set only with a class | | `OPODCP_LEADER_ISOLATION` | `networkPolicy.leaderIsolation.enabled` | off | | `OPODCP_LEADER_ISOLATION_DETECT_API_SERVER` | `networkPolicy.leaderIsolation.detectAPIServer` | on | | `OPODCP_LEADER_ISOLATION_FROM` | `networkPolicy.leaderIsolation.from` | `""`; a JSON list | | `OPODCP_LEADER_ISOLATION_SCALER_NAMESPACE`, `_SCALER_LABELS` | `networkPolicy.leaderIsolation.scaler.*` | the release's namespace; `app.kubernetes.io/name=keda-operator` | Each chart value reaches the binary as the variable beside it. For example, this upgrade sets three of them: ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ --set workers.mtls=require \ --set workloads.worker.startBudgetMinutes=120 \ --set images.verify=enforce kubectl -n opodcp get deploy opodcp -o json \ | jq -r '.spec.template.spec.containers[0].env[] | select(.name|test("WORKER_MTLS|START_BUDGET|IMAGES_VERIFY")) | "\(.name)=\(.value)"' # OPODCP_WORKER_MTLS=require # OPODCP_WORKER_START_BUDGET_MIN=120 # OPODCP_IMAGES_VERIFY=enforce ``` ### Saved on the Connectors page An admin saves these on the **Connectors** page, into the database. They are not chart values. See [Connectors](https://opod.io/docs/control-plane-operate/connectors/). | Variable | Default | Meaning | | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `OPODCP_USAGE_DSN`, `OPODCP_USAGE_ADAPTER` | `""` | the usage sink; empty = rows stay in the spool | | `OPODCP_USAGE_RETENTION` | 30 days | spool retention, `720h` or `30d`; `0` keeps everything | | `OPODCP_USAGE_TRIM_EXISTING` | off | also trim rows written before retention was set | | `OPODCP_EVENTS_URL` | `""` | `nats://host:4222`: every event is also published there; wins over `ha.nats.provide` | | `OPODCP_SECRETS_URL` | `""` | `vault://…`: a record of every minted token | | `OPODCP_NOTIFY_URLS` | `""` | alert sinks, comma-separated; empty = the console and `/metrics` | | `OPODCP_JOB_CHECKPOINTS` | `""` | job checkpoints; `""` = a host path on the job's node, `pvc://…` = one claim per job | | `OPODCP_LOGS_ADAPTER`, `_URL`, `_TOKEN`, `_STREAMS` | `stdout`, `""`, `""`, all streams | where the control plane's records, the audit stream and events go besides stdout | | `OPODCP_TRACES_URL` | `""` | the OTLP/HTTP collector every leader exports spans to | | `OPODCP_TRACES_SAMPLE_RATIO` | `""` = every request | 0 to 1 | | `OTEL_EXPORTER_OTLP_ENDPOINT` | `""` | push metrics over OTLP/HTTP as well | | `OPODCP_KVSTORE_URL`, `_SECRET`, `_SECRET_KEY`, `_PASSWORD` | `""`, `""`, `password`, `""` | your Redis or Valkey for peer KV tiers (`redis://valkey.example.com:6379`), or, from the release after 0.3.6, `pvc://nfs-rwx?size=200Gi` for one ReadWriteMany volume per endpoint; wins over the chart's `kvStore` | | `OPODCP_BATCH_FILES_BUCKET`, `_PREFIX`, `_ENDPOINT`, `_REGION`, `_PATH_STYLE`, `_DOWNLOADS`, `_ACCESS_KEY`, `_SECRET_KEY` | `_DOWNLOADS` = `proxy` | the batch API's object store; an empty bucket = no store | | `OPODCP_OIDC_ISSUER`, `_CLIENT_ID`, `_CLIENT_SECRET` | `""` | SSO; an issuer and a client id turn it on | | `OPODCP_OIDC_ROLE_MAP`, `OPODCP_OIDC_DEFAULT_ROLE` | `""`, `viewer` | groups to roles | | `OPODCP_PUBLIC_URL` | `""` | how browsers reach the console | ```bash # the same as the Connectors page's Save: the control plane stores it and restarts curl -s -H "$H" -H 'Content-Type: application/json' -X PUT \ https://cp.example.com/api/v1/connectors/usage/settings \ -d '{"set":{"OPODCP_USAGE_DSN":"clickhouse://ch.example.com:8123/opod","OPODCP_USAGE_RETENTION":"14d"}}' curl -s -H "$H" -H 'Content-Type: application/json' -X PUT \ https://cp.example.com/api/v1/connectors/usage/settings -d '{"unset":["OPODCP_USAGE_RETENTION"]}' ``` ### Only through `extraEnv` No chart value and no connector field sets these. Add them with `extraEnv`. | Variable | Default | Meaning | | ------------------------------------- | ----------------------------------------------- | ------------------------------------------------------------------------ | | `OPODCP_OIDC_ROLE_CLAIM` | `groups` | the claim roles are read from | | `OPODCP_OIDC_TEAM_CLAIM` | `""` | the claim naming a user's team; unset = unscoped | | `OPODCP_OIDC_REDIRECT_URL` | `/api/v1/auth/oidc/callback` | | | `OPODCP_LOGS_HEADERS` | `""` | `k=v,k=v` headers for the logs sink | | `OTEL_EXPORTER_OTLP_HEADERS` | `""` | `k=v,k=v` headers for the metrics push | | `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | `""` | wins over `OTEL_EXPORTER_OTLP_ENDPOINT` | | `OPODCP_BOOTSTRAP_ADMIN_PASSWORD` | `""` | seeds the local user `admin` while no user exists | | `OPODCP_LEADER_ELECTION` | on | controller loops run behind a Kubernetes Lease; `0` turns it off | | `OPODCP_CACHE_GC` | `manual` | `off`, `manual` or `auto`: how far the weight-cache prune goes alone | | `OPODCP_SELF_IMAGE` | `""` = this pod's own image | the image node probes copy the agent from | | `OPODCP_LICENCE_FILE` | `""` | a file holding the licence key; `OPODCP_LICENCE_KEY` wins | | `OPODCP_CHART_REF` | `oci://ghcr.io/opod-io/charts/opodcp` | the chart the printed `helm upgrade` lines name | | `OPODCP_TLS_CERT`, `OPODCP_TLS_KEY` | `""` | file paths; with both set, the API serves HTTPS itself | | `OPODCP_INSECURE` | off | `1` turns authentication off; local development only, never on a cluster | ```yaml extraEnv: - { name: OPODCP_OIDC_ROLE_CLAIM, value: roles } - { name: OPODCP_OIDC_TEAM_CLAIM, value: team } - { name: OPODCP_CACHE_GC, value: auto } - { name: OPODCP_LEADER_ELECTION, value: "1" } - name: OTEL_EXPORTER_OTLP_HEADERS valueFrom: { secretKeyRef: { name: otlp-auth, key: headers } } # "authorization=Bearer …" ``` `OPODCP_URL` and `OPODCP_TOKEN` are read by the `opodcp` CLI commands, not by `opodcp serve`: the control plane's address and a token. --- title: "Air-gapped install" description: "Mirror the images with their signatures, point the chart at your registry and model mirror, and keep signature verification working with no egress." url: "https://opod.io/docs/control-plane-install/air-gapped/" markdown_url: "https://opod.io/docs/control-plane-install/air-gapped.md" section: "Install" last_updated: "2026-10-31" --- # Air-gapped install > Mirror the images with their signatures, point the chart at your registry and model mirror, and keep signature verification working with no egress. ## In short opod runs with no internet access. You copy the images (with their signatures) and the chart into your own registry, point the chart at it, and give workers a model mirror or a pre-filled cache. Signature checks and the licence both work offline. Nothing in opod calls home. ## When you need it - Your cluster has no route to the internet, or only through an allow-listed proxy. - Your security policy says every image must come from your own registry. - You must prove that the images you run are the ones we signed, without reaching Sigstore. ## Do it 1. **Mirror the images and the chart** ```bash cosign copy ghcr.io/opod-io/opodcp:0.3.6 harbor.example.com/opod/opodcp:0.3.6 helm pull oci://ghcr.io/opod-io/charts/opodcp --version 0.3.6 helm push opod-0.2.1.tgz oci://harbor.example.com/charts ``` Repeat `cosign copy` for every digest the chart pins: [1. Mirror the images](#1-mirror-the-images-with-their-signatures) prints the list. 2. **Write a values file for the mirror** Put the `image`, `imagePullSecrets`, `engineImages`, device plugin and `lws` lines from [2. Point the chart at the mirror](#2-point-the-chart-at-the-mirror) and the `images` block from [3](#3-keep-signature-verification) into `values-airgap.yaml`, and the `weights` values from [4](#4-model-weights). 3. **Install from the mirror** ```bash helm install opodcp oci://harbor.example.com/charts/opodcp --version 0.3.6 -n opodcp --create-namespace \ -f values-airgap.yaml ``` 4. **Install the licence key from a file** See [6. The licence](#6-the-licence). A key is verified offline. ## Check it worked ```bash export H="Authorization: Bearer $(kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d)" kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor | grep -E 'registry|images-signed' kubectl -n opodcp port-forward svc/opodcp 8080:8080 & curl -s -H "$H" http://127.0.0.1:8080/api/v1/images | jq '.images[] | {ref, pinned, signature, signatureReason}' ``` A good answer: every `ref` starts with your registry and ends in `@sha256:…`, `pinned` is `true`, and `signature` is `verified`. The `images-signed` doctor row is `✔` and names the trust root in use. The console's **Images & artifacts** page shows the same list. ## If it fails | Symptom | Cause | Fix | | -------------------------------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------ | | Pods in `ImagePullBackOff` with `harbor.example.com/…: unauthorized` | no pull Secret, or the wrong one | create the Secret in namespace `opodcp` and list it in `imagePullSecrets` | | `signature: invalid`, `signatureReason: untrusted-identity` | no `images.trust` entry matches the mirror path | add the two entries in step 3, with your mirror prefix | | `signature: unknown` | the control plane could not ask the registry | check `imagePullSecrets` and the registry's address from the pod | | A rollout is refused `E-UNSIGNED` or `E-SIGNATURE` | `images.verify: enforce` and a signature that fails | copy the image with `cosign copy`, not `docker push`, so the signature travels | | A worker fails to fetch weights from `huggingface.co` | no mirror set | set `weights.hubEndpoint`, and `weights.skipSourceCheck: true` | | A plan is refused `E-NO-ENGINE` | that engine × vendor has no image in `engineImages` | mirror its image and set the value | ## What reaches out by default The control plane needs no connection to us at any time, and verifying signatures needs no egress. An install without internet access needs three things: the images in your registry, the chart, and a source for model weights. | What | Where to | Without it | | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | | image pulls | `ghcr.io/opod-io/*`, `nvcr.io`, `docker.io` (AMD, Intel, Valkey), `registry.k8s.io` (LeaderWorkerSet), `ghcr.io` (Tenstorrent plugin, CloudNativePG, the endpoint picker) | mirror them (step 1) | | model weights | `huggingface.co`, from workers and prefetch Jobs | a Hub mirror or a pre-filled cache (step 4) | | the Sigstore root | `tuf-repo-cdn.sigstore.dev`, daily, with `images.trustRoot: auto` | the root built into the binary is used, and the doctor says so | | signature reads | your registry only | — | | the licence | nothing: a key is verified offline | — | ## 1. Mirror the images with their signatures Copy every image the chart pins **by digest**, with `cosign copy`, so each image's signature and SBOM travel with it and the digests stay the same: ```bash helm show values oci://ghcr.io/opod-io/charts/opodcp --version 0.3.6 > values-upstream.yaml # every image reference the chart pins: grep -oE '[a-z0-9.-]+\.[a-z]+/[^ "]+@sha256:[0-9a-f]{64}' values-upstream.yaml | sort -u cosign copy ghcr.io/opod-io/opodcp:0.3.6 harbor.example.com/opod/opodcp:0.3.6 cosign copy ghcr.io/opod-io/opod-leader@sha256: harbor.example.com/opod/opod-leader ``` The list includes the control plane, the leader, one worker per engine and vendor, the device plugins, the LeaderWorkerSet controller and, when you use them, KEDA, CloudNativePG, NATS, Valkey and the endpoint picker. Every node must be able to pull the control plane image: the GPU telemetry DaemonSets copy their agent out of it. Mirror the chart too: ```bash helm pull oci://ghcr.io/opod-io/charts/opodcp --version 0.3.6 helm push opod-0.2.1.tgz oci://harbor.example.com/charts ``` ## 2. Point the chart at the mirror ```yaml image: repository: harbor.example.com/opod/opodcp digest: sha256: imagePullSecrets: [{ name: harbor }] # the first entry is also used for every endpoint pod engineImages: leader: harbor.example.com/opod/opod-leader@sha256: llamacppNvidia: harbor.example.com/opod/opod-worker-llamacpp-nvidia@sha256: vllmNvidia: harbor.example.com/opod/opod-worker-vllm-nvidia@sha256: # … one line per engine × vendor you serve; leave the rest empty to refuse them by name substrate: nvidiaDevicePlugin: { image: harbor.example.com/nvidia/k8s-device-plugin@sha256: } lws: image: { manager: { repository: harbor.example.com/lws/lws, tag: "v0.7.0@sha256:" } } ``` An empty `engineImages` value means the planner refuses that engine × vendor pair with the reason, before anything is created. ## 3. Keep signature verification The control plane verifies every pinned image's cosign keyless signature offline (the Fulcio chain, the transparency log's signed timestamp, the digest). With the signatures copied, it needs no egress. Two settings make that explicit: ```yaml images: verify: enforce # refuse an invalid, unsigned or unverifiable image (default: warn) trustRoot: embedded # never go online for the Sigstore root trust: - repositoryPrefix: harbor.example.com/opod/opod- issuer: https://token.actions.githubusercontent.com identityRegex: ^https://github\.com/opod-io/opod-core/\.github/workflows/.+@refs/(heads|tags)/.+$ - repositoryPrefix: harbor.example.com/opod/opodcp issuer: https://token.actions.githubusercontent.com identityRegex: ^https://github\.com/opod-io/opod-cp/\.github/workflows/.+@refs/tags/.+$ ``` The leader and worker images are signed by the core repository's workflows, and the control plane image by the control plane repository's release workflow on a tag. A mirror that holds both needs both entries, as above. A prefix without a trailing slash matches every repository that starts with it. - Nothing outside `ghcr.io/opod-io/` is trusted until a `trust` entry names who signs it. A mirror filled with `cosign copy` keeps **our** signatures, so its entry names our identity. A mirror you re-sign names yours. - With `trustRoot: auto` (the default) the control plane refreshes Sigstore's root daily when it can reach it and otherwise uses the copy built into the binary. `opodcp doctor` says which is in use. - After a Sigstore key rotation, a binary's built-in root can age out. Mount a current root with `images.trustRootConfigMap` (a ConfigMap with item `trusted_root.json`). - A registry the control plane cannot ask reads as `unknown`. An unknown is never refused and always recorded. See [Supply chain](https://opod.io/docs/control-plane-security/supply-chain/). ## 4. Model weights Workers and prefetch Jobs fetch weights from Hugging Face by default. Without internet access: | Value | Effect | | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------- | | `weights.hubEndpoint` | a Hugging Face mirror's base URL, given to workers as `HF_ENDPOINT` | | `weights.skipSourceCheck` | `true` = a worker never checks a model's upstream; an air-gapped mirror needs it. With it, no model signature is checked. | | `weights.catalogPubKey` | a minisign public key: a catalog file with a signature beside it must verify against it | | `weights.catalogRequireSigned` | `true` = a catalog file with no signature is refused too (needs `catalogPubKey`) | Each of these is empty by default and reaches the pods only when set, so an install that sets none renders exactly the templates it would otherwise. ## 5. Check it ```bash kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor curl -s -H "$H" http://127.0.0.1:8080/api/v1/images | jq '.images[] | {ref, signature, signatureReason}' ``` The `images-signed` doctor row says which trust root is in use and how old it is. **Images & artifacts** lists every configured image with its pin and signature result. A row that reads `invalid` with `untrusted-identity` means a `trust` entry is missing or does not match the mirror's path. A row that reads `unknown` means the control plane could not ask the registry: check `imagePullSecrets`. ## 6. The licence The key is verified offline. Install it from a file as in [Licensing](https://opod.io/docs/control-plane/licensing/). Renewal of an air-gapped install is the same: install the new key. --- title: "High availability" description: "Run several control-plane replicas over one database with leader election and a shared event bus, your own or provided by the chart." url: "https://opod.io/docs/control-plane-install/high-availability/" markdown_url: "https://opod.io/docs/control-plane-install/high-availability.md" section: "Install" last_updated: "2026-11-12" --- # High availability > Run several control-plane replicas over one database with leader election and a shared event bus, your own or provided by the chart. ## In short One control-plane replica is a complete install, and endpoints keep serving while it restarts. Run three replicas when the API and the console must not blink during a node loss or an upgrade. Every replica serves the API; one at a time runs the control loops, chosen by a Kubernetes Lease. They need a shared Postgres and a shared event bus (NATS), your own or provided by the chart. ## When you need it - The console or the API is part of an on-call workflow and must stay up through a node drain. - Automation (CI, GitOps, a gateway that reads plans) calls the API and cannot wait a few minutes for a reschedule. - A replica's doctor row reads `blocked`, and you must decide between granting the Lease and turning election off. ## Do it These steps use your own Postgres and NATS. To let the chart run them instead, see [Or let the chart provide them](#or-let-the-chart-provide-them). For an on-premises datacenter, the [on-prem profile](#the-on-prem-profile) does it in one file. 1. **Point the state store at your Postgres** Several replicas need a database every replica reaches. Put its whole DSN in a Secret: ```bash kubectl -n opodcp create secret generic opod-state-dsn \ --from-literal=dsn='postgres://opod:PASSWORD@db.example.com:5432/opodcp?sslmode=require' ``` To move an existing store there first, use `opodcp store move` ([Backup and restore](https://opod.io/docs/control-plane-install/backup-restore/)). 2. **Scale out** ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ --set replicas=3 --set ports.state.dsnSecret.name=opod-state-dsn ``` 3. **Connect the event bus** On the **Connectors** page, save `OPODCP_EVENTS_URL=nats://nats.example.com:4222` (an optional path is the subject prefix, for example `/opod`). A user and password in it are stored sealed. The save restarts the control plane once. Every event is then mirrored to `.`, and events from other replicas fan out locally. The bus is core NATS (no JetStream stream), and its user needs publish and subscribe on `.>` and, after 0.3.6, on `_observe.>`: see [Connector setup → NATS](https://opod.io/docs/control-plane-operate/connector-setup/#event-bus-nats). With SSO, give the control plane's host sticky sessions at your ingress: in 0.3.6 a login's state lives on the replica that started it ([why](https://opod.io/docs/control-plane-operate/connector-setup/#single-sign-on-oidc)). 4. **Check** On the lease holder, `opodcp doctor` shows the `controllers` row in mode `leader` with its loop count; on each other replica it reads `standby — holds the lease /opodcp-controllers and runs the loops`. The `events` row is green on every replica. ## Check it worked ```bash kubectl -n opodcp get pods -l app.kubernetes.io/name=opodcp -o wide kubectl -n opodcp get lease opodcp-controllers -o jsonpath='{.spec.holderIdentity}{"\n"}' for p in $(kubectl -n opodcp get pods -l app.kubernetes.io/name=opodcp -o name); do kubectl -n opodcp exec "$p" -- /opodcp doctor | grep -E '^. (controllers|events) ' done ``` A good answer: three `Running` pods on three different nodes; the Lease names one pod as `-` on `0.2.1`, and as `-<8 hex digits>` (a new value at each start) in `0.3.0`. On that pod the `controllers` row reads `✔ controllers N loops leader …`. On each other pod it reads `✔ controllers standby elected standby — … holds the lease opod/opodcp-controllers and runs the loops`, and the `events` row is `✔` on all three. The console's **Settings → Controller loops** shows the loops and their last run. To prove the hand-over, delete the holder and watch a standby take the Lease. A deleted pod stops cleanly, so on `0.2.1` this takes up to about 19 s and in `0.3.0` about 4 s: ```bash kubectl -n opodcp delete pod "$(kubectl -n opodcp get lease opodcp-controllers -o jsonpath='{.spec.holderIdentity}' | sed 's/-[^-]*$//')" kubectl -n opodcp get lease opodcp-controllers -w ``` ## If it fails | Symptom | Cause | Fix | | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | | `replicas > 1 cannot run under nodeSelector kubernetes.io/hostname` | the release is pinned to one node | remove the hostname from `nodeSelector` | | A replica stays `Pending` with `didn't match pod anti-affinity rules` | fewer schedulable nodes than replicas | `opodcp preflight --replicas 3` (row `ha.nodes`); add or uncordon nodes | | `events` red on a standby, naming the replica it does not hear | no shared event bus | save `OPODCP_EVENTS_URL` on **Connectors**, or `--set ha.nats.provide=true` | | Every API call answers `503 E-DB-UNREACHABLE`, and `/readyz` still answers `200` | the database is down or unreachable from the replicas. By design the replicas stay Ready, so that each caller hears "database unreachable" and not a connection refused; each replica reconnects by itself | bring the database back; `opodcp doctor` row `state` names its host | | `controllers` reads `blocked` | the ServiceAccount cannot get, create or update the Lease | grant `coordination.k8s.io/leases` in the namespace | | `controllers` red: `NO replica is running the loops: the lease … has not been renewed for …` | the holder crashed, or the role may read the Lease but not update it | grant `update` on `leases`; the next replica then takes it | | `ha.postgres.provide and ports.state.dsn (or its Secret) are both set` | a provided and an own database at once | keep one | | A pod refuses to start under a provided Postgres after a rollback | an image older than the HA profile does not know `postgresql://` | roll forward again | ## How replicas work in detail One replica is a complete install. The pod keeps nothing on disk, so losing its node costs only the minutes Kubernetes takes to reschedule it, and endpoints keep serving meanwhile. Run more replicas when the API and the console must not blink. ### Who does what - **Every replica serves the API and the console.** Reads and writes go to the shared database, so they are safe from any replica. - **One replica runs the controller loops**: the reconciler, the autoscaler, the run resumer, the usage shipper (and the usage puller, for a leader too old to push), retention and alerts. It holds the Lease `/opodcp-controllers`; the identity in it is `-` on `0.2.1`, and `-` with a new random part at each start in `0.3.0`. The others are warm standbys: the doctor's `controllers` row reads `standby` and names the holder. - **Only the lease holder runs a create, rollout or rollback.** Any replica accepts one and answers at once. In `0.3.0` a standby writes the run to the database and the holder starts it within 2 s, and one replica runs each run once. On `0.2.1` the replica that accepted the run ran it. A create accepted by a replica just before it took the Lease could then run twice: the two runs deleted each other's prefetch Job (`jobs.batch "…-prefetch-…" not found`) and the create rolled back. Start it again once `kubectl -n opodcp get lease opodcp-controllers` shows a holder. - **Replicas share one database** and judge capacity against it as one unit, so two replicas never double-book a card. Replicas survive a node only if the database does: the chart's Postgres (`ha.postgres.provide`) runs three instances with failover. A single-instance database of your own must not share a node with a replica, or that node's death stops the database and a replica together. - **Replicas need a shared event bus.** Without one, the console's live stream on one replica misses what another publishes, and a standby's `events` doctor row turns red naming the replica it does not hear. ### How callers reach a replica Nothing outside the control plane knows there are several replicas. Every caller uses one address, the release's Service `http://..svc:8080`, and Kubernetes sends each new connection to a replica whose `/readyz` passes: | Caller | What it sends | When a replica dies | | ------------------------------------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | A leader | its usage records (OTLP), each freed only on the control plane's `2xx` | the leader keeps them in its queue and sends again; the retry reaches a live replica, and a record stored twice is one row (key: endpoint, leader boot, sequence) | | The GPU telemetry pods | each node's card readings | the next reading reaches a live replica | | The console, the CLI, your automation | API calls and the live event stream | they reconnect; through an Ingress or a Gateway (`ingress.*`) the route points at the same Service | The control plane sends plans, keys and policy to a leader as mounted files, and never calls it on the request path. The leader therefore serves whichever replica is up, or none. Any replica takes a leader's usage push. In `0.2.1` a replica that did not hold the Lease stored those rows without the card's GPU class for two minutes after it started. From `0.3.0` it reads the endpoint's pods itself and names the card. In `0.2.1` each replica kept its own record of how each leader's usage arrives, so `GET /api/v1/usage/streams` and the console answered differently depending on the replica they reached (one read `lastBatch 0`). From `0.3.0` the record is kept in the database and every replica gives the same answer. An endpoint's status (`GET /api/v1/endpoints//status`, and the console's model and leader badges) carries what the lease holder's watch loop last saw: the leader's serving proof (`proof`) and each worker's `loaded` models. Up to `0.3.6` only the holder had them. A standby answered from the pods alone, with no `proof` and every `loaded` empty, so a console polling through the Service saw the badges change between two answers. In the release after `0.3.6`, the holder sends each endpoint's observation to the other replicas over the shared NATS bus, on the subject `_observe.`, after each watch tick (every 5 s), and every replica gives the same answer. The observation is not journaled and does not appear on the event stream. A standby uses it for 30 s. If the holder dies, the standby answers from the pods until it takes the Lease and observes for itself. The doctor's `events` row counts the observations each replica sent and received. With one replica, or no bus, nothing is sent and nothing changes. ### What the chart does when `replicas` is above 1 | Object | Setting | | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Deployment strategy | `RollingUpdate`, one replica at a time (`maxSurge: 0`, `maxUnavailable: 1`); one replica uses `Recreate`. In `0.2.1` the roll used the default surge, which never finishes when there are as many nodes as replicas: the new pod stays `Pending`. On `0.2.1`, delete the oldest replica's pod and the roll goes on | | Pod anti-affinity | required, on `kubernetes.io/hostname`: each replica runs on a node of its own | | Topology spread | `maxSkew: 1` on `topology.kubernetes.io/zone`, `ScheduleAnyway` | | PodDisruptionBudget | `minAvailable: replicas - 1`, so a node drain takes at most one replica at a time | | Preflight hook | its pod is labelled `app.kubernetes.io/name: opodcp-preflight`, so the replicas' anti-affinity does not apply to it. In `0.2.1` it carried the replicas' labels: with as many labelled nodes as replicas, `helm upgrade` hung at the pre-upgrade hook with the pod `Pending`. On `0.2.1`, label one more node for the control plane (`nodeSelector`) before the upgrade | The chart refuses `replicas` above 1 together with `nodeSelector: {kubernetes.io/hostname: …}`: one hostname is one node. Remove the pin; the database keeps the state. Each replica needs a Ready, schedulable node: run `opodcp preflight --replicas 3` first and read row `ha.nodes`. ### The lease | Timing | Value | | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | lease duration | 15 s. After a holder crashes (no clean stop), a standby takes the lease once it has not seen a renewal for 15 s, at its next retry: up to about 17 s. Measured on a two-replica install: about 17 s after a SIGKILL of the holder's process, 15 s after every pod on the holder's node was killed | | holder crash, restarted in place | on `0.2.1`, if the kubelet restarts the crashed container before a standby takes the lease, the same pod takes it back as its own: the Lease names `-1` again (the control plane is process 1 in its container) and shows no transition. The loops stop for as long as the restart takes, which grows with each restart (16.8 s measured on a second restart). In `0.3.0` each start has a new identity, so a restarted holder waits out the lease like any standby: up to about 17 s (17.3 s measured), and the Lease records the transition | | renew deadline | 10 s: a holder that cannot renew in time stands down before the lease can go to anyone else | | retry period | 2 s | | clean stop (a roll, a drain, `helm upgrade`) | on `0.2.1` the holder exits before it releases the lease, so a standby waits out the lease (18 to 19 s measured). In `0.3.0` the holder releases it first, and a standby took it in 3 to 4 s on a two-replica install | A replica that loses the lease **exits** and Kubernetes restarts it as a standby. A loop caught mid-decision cannot be unwound, so a restart is the one handover with no overlap. The doctor's `controllers` row also reads the Lease itself. A lease nobody has renewed for more than 45 s (three lease durations) turns the row red, even on a standby that believes it knows the holder. That catches a dead holder, and a grant that allows `get` but not `update`. **Figure: Two replicas, one lease.** A timeline of two control-plane replicas and which one runs the controller loops when the lease holder goes away. The interactive figure is on the web page: ## Or let the chart provide them Both are off by default, because the default release installs no service pods. | Value | What it installs | | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ha.postgres.provide=true` | CloudNativePG's operator in namespace `opod-cnpg`, and a Postgres `Cluster` of `ha.postgres.instances` (default 3) in the release namespace. Its `-pg-app` Secret (`opodcp-pg-app` for release `opodcp`) becomes the state store. A post-install hook creates the `Cluster` once the operator's webhook answers. | | `ha.nats.provide=true` | a three-node NATS JetStream cluster in namespace `opod-nats`, which becomes `OPODCP_EVENTS_URL`. A URL saved on the Connectors page wins. | ```bash helm install opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --create-namespace \ --set replicas=3 --set ha.postgres.provide=true --set ha.nats.provide=true ``` Each comes with a PodDisruptionBudget. `ha.postgres.storage` (default `10Gi`) and `ha.postgres.storageClass` (default: the cluster's default class) size each instance. Images are pinned by digest under `ha` and the `cloudnative-pg` and `nats` subchart values. A provided Postgres is a convenient start, not a managed database: you own its backups. `opodcp backup` works the same against it. ## The on-prem profile The chart carries `values-onprem.yaml` from `0.3.0`: three replicas over a Postgres and a NATS the chart provides, with `cloud.provider: onprem`. It needs three schedulable nodes. 1. **Check the nodes** ```bash opodcp preflight --kubeconfig ~/.kube/config --replicas 3 ``` Row `ha.nodes` passes with three Ready, schedulable nodes. 2. **Install with the profile** ```bash helm pull oci://ghcr.io/opod-io/charts/opodcp --untar helm install opodcp ./opod -n opodcp --create-namespace -f ./opod/values-onprem.yaml ``` 3. **Check** Run [Check it worked](#check-it-worked). You can also run `kubectl -n opodcp get cluster opodcp-pg` to see the provided Postgres `Cluster`. To use your own database, add `--set ha.postgres.provide=false --set ports.state.dsnSecret.name=opod-state-dsn`. To use your own bus, add `--set ha.nats.provide=false` and save `OPODCP_EVENTS_URL` on **Connectors**. On bare metal nothing hands out a load-balancer address unless you run kube-vip or MetalLB, and the chart installs neither. A `NodePort` address belongs to one node, so it goes when that node goes. Put the console behind your Ingress or Gateway, or behind a virtual IP of your own. A cluster that `opodcp infra` builds with three servers has one already (`0.3.0`, not yet proven on hardware): the Kubernetes API's VIP, where a `NodePort` also answers. See [Bare metal → Three servers](https://opod.io/docs/control-plane-install/bare-metal/#three-servers). ## Upgrades with several replicas Pods roll one at a time under the PodDisruptionBudget. The first new pod runs any schema step under a Postgres advisory lock; a second new pod waits and then finds nothing left to run. Replicas still on the old binary keep serving the API from the same database until they are replaced. Every schema step only adds; a drill that runs a step while an old replica still serves has not been run yet. An image older than the HA profile does not know the `postgresql://` scheme that CloudNativePG writes and refuses to start under a provided Postgres. Roll forward again to clear it. ## A single replica without leader election Leader election is on by default (`OPODCP_LEADER_ELECTION` unset means on). At start the replica reads the Lease once. On a cluster that will not grant it, the replica serves the API and runs no loops. The doctor's `controllers` row reads `blocked` with the reason, and the replica tries the check again every 30 s. It never runs the loops without the lease, because a second replica would then decide everything twice. The fix is one of two: - Grant `coordination.k8s.io/leases` `get`, `create` and `update` in the namespace. The chart's Role does. - For a single replica only, set `OPODCP_LEADER_ELECTION=0` through `extraEnv`: ```yaml extraEnv: - { name: OPODCP_LEADER_ELECTION, value: "0" } ``` A control plane that runs outside any cluster (for example `opodcp serve` on a laptop against a kubeconfig) also elects, against the Lease in that cluster. ## Fleet mode A fleet control plane has no leader election and runs exactly one replica. See [Several cells](https://opod.io/docs/control-plane/fleet/). --- title: "Upgrade and uninstall" description: "Upgrade the control plane with one helm command, what happens to the store and to running endpoints, the way back, and a clean uninstall." url: "https://opod.io/docs/control-plane-install/upgrade/" markdown_url: "https://opod.io/docs/control-plane-install/upgrade.md" section: "Install" last_updated: "2026-11-01" --- # Upgrade and uninstall > Upgrade the control plane with one helm command, what happens to the store and to running endpoints, the way back, and a clean uninstall. ## In short An upgrade is one `helm upgrade` with `--reset-then-reuse-values`. Endpoints keep serving and are not restarted: each keeps its pods until you roll it out. The new control plane applies any schema steps to its database on start. Take a backup first, because a schema step is the one thing a `helm rollback` cannot undo. ## When you need it - A new chart version is out and you want its fixes. - The doctor row `template-drift` is red after an upgrade, and you must decide when to roll each endpoint. - An upgrade went wrong and you need the way back. - You move from `0.2.1` (SQLite) to `0.3.0` (Postgres). - You remove opod from a cluster. ## Do it ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp --version -n opodcp --reset-then-reuse-values ``` Use `--reset-then-reuse-values`, never plain `--reuse-values`. Plain `--reuse-values` keeps only what the old install set and drops every default the new chart added. The chart pins the control plane image by digest, so an upgrade never pulls a floating tag. Read the new version's notes first: ```bash helm show readme oci://ghcr.io/opod-io/charts/opodcp --version helm show values oci://ghcr.io/opod-io/charts/opodcp --version ``` ### Order of operations 1. **Check and back up** `opodcp doctor` is green, or you understand each red row. Take a backup. It is **required** when the release notes name a schema step: it is the only way back to the previous release. ```bash kubectl -n opodcp port-forward svc/opodcp 8080:8080 & curl -s -H "Authorization: Bearer " http://127.0.0.1:8080/api/v1/backup -o before-upgrade.jsonl ``` 2. **Upgrade** Run the command above. One replica restarts; with several, they roll one at a time. 3. **Watch it come up** ```bash kubectl -n opodcp rollout status deploy/opodcp kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor ``` A store it refuses says why in the pod log and in setup mode. 4. **Roll endpoints when you choose** If the doctor row `template-drift` is red, roll out each endpoint it names (**Roll out plan…** on the endpoint page, or `opodcp endpoint rollout --wait NAME`). Until then each keeps its running pods. ## Check it worked ```bash helm history opodcp -n opodcp --max 2 kubectl -n opodcp port-forward svc/opodcp 8080:8080 & curl -s -H "Authorization: Bearer " http://127.0.0.1:8080/api/v1/version | jq -r .version kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor | grep -E '^✘' ``` A good answer: the last `helm history` row is `deployed` with the new chart version, `/api/v1/version` prints the new version, and the only `✘` row, if any, is `template-drift`, which clears as you roll each endpoint. The console's **Settings** page shows the version, and **Activity** lists `endpoint.template-drift` for each endpoint still to roll. ## If it fails | Symptom | Cause | Fix | | ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------------------------------- | | `Error: UPGRADE FAILED: … Job Failed` | the pre-upgrade preflight found a fatal row | `kubectl -n opodcp logs job/opodcp-preflight`; fix it and upgrade again | | `ports.usage is not a chart value any more` | an upgrade from `0.2.1` with connector values | follow [From 0.2.1 to 0.3.0](#from-021-to-030) | | The pod logs `store schema N was written by a newer opodcp; this binary knows schema M` and serves setup mode | a rollback below a schema step | restore the backup taken before the upgrade ([The way back](#the-way-back)) | | A new default is missing after the upgrade | plain `--reuse-values` | upgrade again with `--reset-then-reuse-values` | | `template-drift` stays red | an endpoint was not rolled | `opodcp endpoint rollout --wait NAME` for each endpoint it names | | `the server could not find the requested resource` on a ScaledObject | `substrate.keda.enabled` was turned off and back on | see the KEDA warning under [Uninstall](#uninstall) | ## What happens to the store The store carries a schema version. On boot the new binary: 1. **Applies the missing schema steps in order**, each in one transaction, under a Postgres advisory lock, so replicas that start together migrate once. Steps only add tables and columns. 2. **Refuses a store a newer release wrote.** The pod logs `store schema N was written by a newer opodcp; this binary knows schema M — upgrade the binary` and serves setup mode. Nothing is written. 3. **Refuses a store from before the schema baseline**, with the way across: back up with the release that wrote it, restore into an empty database. The control plane takes no dump of its own before a step. Take the backup yourself. **Usage rows survive.** A planned upgrade loses no GPU-seconds: on `SIGTERM` the control plane writes every open occupancy segment before it exits. A crash or an OOM kill loses at most the last 15 minutes per worker pod. Rows already in the store when retention first applies are kept until you opt in with `OPODCP_USAGE_TRIM_EXISTING`. ## What happens to endpoints Endpoints keep serving through the whole upgrade, and none is restarted. Their plan, keys and policy are mounted files. **A template change waits for a rollout.** Each endpoint's leader and workers are pinned to the images its last rollout chose, so an upgrade never re-pins them. When the new release renders a pod differently (a new variable, a probe, a mount, a resource request), the control plane holds the running template, keeps the replica count, and reports it: event `endpoint.template-drift` and doctor row `template-drift` name each endpoint. A verified rollout of that endpoint renders the new template and clears the row. **Usage across the upgrade to 0.3.0.** That release renders two new variables into every leader (`OPOD_USAGE_OTLP_ENDPOINT` and `OPOD_USAGE_OTLP_HEADERS`), so each endpoint reports `template-drift` until you roll it. Until then the control plane keeps pulling its leader's usage stream. After a rollout to a leader from core v0.4.0 the leader pushes instead. During the rollout the control plane takes both: it pulls the old leader and receives the new one's push. `GET /api/v1/usage/streams` shows each endpoint's `mode`. While a row is red: - **Any plan edit renders the held templates too**, outside a verified rollout. The control plane says so with `endpoint.template-rolled`. - **Autoscaling keeps working.** A worker grown meanwhile uses the new render, so the endpoint runs a mixed set until you roll it. - The same row appears when a device plugin, node labels, fabric facts or a chart value change the render. ## The way back - **No schema step ran:** `helm rollback opodcp `, or `helm upgrade` to the previous version. The store opens as it is. - **A schema step ran:** the previous binary refuses the store. Restore the backup you took into an empty database with the previous binary: ```bash kubectl -n opodcp scale deploy/opodcp --replicas=0 helm rollback opodcp OPODCP_STATE_DSN=postgres://…/opodcp_restored opodcp restore before-upgrade.jsonl # point the release at that database (ports.state.dsnSecret), then: kubectl -n opodcp scale deploy/opodcp --replicas=1 ``` Leaders serve throughout. Endpoints created between the upgrade and the rollback exist in the cluster but not in the restored store: the doctor row `endpoint-identity` names them as foreign objects, never adopted or deleted. Recreate them, or delete them by their `opod.io/endpoint-id` label. ## From `0.2.1` to `0.3.0` `0.3.0` moves the store from SQLite to your Postgres and moves connector settings out of the chart. 1. **Note your connector values** ```bash helm get values opod -n opod ``` Every `ports.` value other than `ports.state` now fails the render. Note each one. 2. **Dump the SQLite store** ```bash kubectl -n opod exec deploy/opod-opodcp -- /opodcp backup -o - > dump.jsonl ``` 3. **Upgrade against an empty Postgres** ```bash kubectl -n opod create secret generic opod-state --from-literal=dsn='postgres://…' helm upgrade opod oci://ghcr.io/opod-io/charts/opod --version 0.3.0 -n opod --reset-then-reuse-values \ --set ports.state.dsnSecret.name=opod-state --set ports.usage=null --set ports.events=null # one null per old port value kubectl -n opod scale deploy/opod-opodcp --replicas=0 ``` 4. **Restore, then start** With `OPODCP_STATE_DSN` pointing at the new database and the new binary. `--wipe` empties the tables the first start already seeded (the model catalog): ```bash opodcp restore --wipe dump.jsonl # 0.3.6 # the release after 0.3.6 asks first; in a script: opodcp restore --wipe --yes dump.jsonl kubectl -n opod scale deploy/opod-opodcp --replicas=1 ``` 5. **Save the connectors** Enter the values you noted on the **Connectors** page. Each save asks for one restart. ## From `0.3.0` From `0.3.2` the chart, its release and its namespace are `opodcp`; `0.3.0` named all three `opod`. Helm cannot rename a release, so this one upgrade is an uninstall and an install against the **same database**. Your endpoints pause while the new control plane creates their objects again in the new namespace. That takes minutes and loses no state: the plans are in the database. 1. **Check and back up** ```bash kubectl -n opod exec deploy/opod-opodcp -- /opodcp doctor kubectl -n opod exec deploy/opod-opodcp -- /opodcp backup -o - > before-rename.jsonl ``` 2. **Copy the two Secrets into the new namespace** The install key (without it the stored connector credentials stay sealed) and the database URL. Use your own DSN Secret's name in place of `opod-state`: ```bash kubectl create namespace opodcp kubectl -n opod get secret opod-opodcp-install-key -o jsonpath='{.data.keys}' | base64 -d > keys kubectl -n opodcp create secret generic opodcp-install-key --from-file=keys=keys && rm keys kubectl -n opod get secret opod-state -o jsonpath='{.data.dsn}' | base64 -d > dsn kubectl -n opodcp create secret generic opodcp-state --from-file=dsn=dsn && rm dsn ``` 3. **Remove the old release** The endpoints' pods hold the GPUs the new release needs. The control plane created them, so helm alone leaves them running; deleting the namespace stops them. ```bash helm get values opod -n opod > values-0.3.0.yaml # your other values, for the install below helm uninstall opod -n opod kubectl delete namespace opod ``` 4. **Install the newest release** ```bash helm install opodcp oci://ghcr.io/opod-io/charts/opodcp --version 0.3.6 -n opodcp -f values-0.3.0.yaml \ --set installKey.existingSecret=opodcp-install-key --set ports.state.dsnSecret.name=opodcp-state ``` 5. **Check** Watch every endpoint reach **serving** in the console, then: ```bash kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor ``` `values-0.3.0.yaml` may still name the old Secrets (`installKey.existingSecret`, `ports.state.dsnSecret.name`); the two `--set` flags come after it and win. ## Uninstall ```bash helm uninstall opodcp -n opodcp ``` This deletes the control plane. It does not touch your database. It keeps the admin Secret and the install key Secret: keep the install key with your database backup if you may reinstall over the same database. Objects the control plane created while it ran — endpoints' leaders and workers, the GPU telemetry DaemonSets, their Secrets and ConfigMaps — stay in the namespace. Delete the endpoints from the console or the API **before** you uninstall. Then `kubectl delete namespace opod` removes the rest. > **KEDA** > > Turning `substrate.keda.enabled` off after it was on removes KEDA's CRDs and every ScaledObject with them, and Helm does not re-install CRDs on a later upgrade. Toggle it once, at install. To remove the cluster itself on bare machines: `opodcp infra down -f machines.yaml`. --- title: "Backup and restore" description: "Take a logical dump of the control plane's store, restore it, move it to another Postgres, and bring the install key with it." url: "https://opod.io/docs/control-plane-install/backup-restore/" markdown_url: "https://opod.io/docs/control-plane-install/backup-restore.md" section: "Install" last_updated: "2026-11-12" --- # Backup and restore > Take a logical dump of the control plane's store, restore it, move it to another Postgres, and bring the install key with it. ## In short `opodcp backup` writes the control plane's whole database to one JSON-lines file, and `opodcp restore` reads it back into an empty database. Endpoints keep serving while you do either. Keep the install key next to every backup: without it the stored connector credentials cannot be opened. `opodcp store move` copies the database to another Postgres and checks the copy. ## When you need it - You want a nightly backup of the control plane, kept with your other database backups. - You upgrade across a schema step and need a way back. - You lost the database, or rebuilt the cluster, and must bring back endpoints, keys and history. - You move the control plane's database to another Postgres server. ## Do it 1. **Take a backup** ```bash export H="Authorization: Bearer $(kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d)" curl -sf -H "$H" https://cp.example.com/api/v1/backup -o opodcp-$(date -u +%F).jsonl chmod 600 opodcp-$(date -u +%F).jsonl ``` 2. **Save the install key beside it** ```bash kubectl -n opodcp get secret opodcp-install-key -o jsonpath='{.data.keys}' | base64 -d > install-key-$(date -u +%F).txt chmod 600 install-key-$(date -u +%F).txt ``` The install key is new in `0.3.0`. 3. **Store both off the cluster** Copy both files to encrypted storage with short retention. A backup holds key hashes and session hashes. To restore, follow [Restore](#restore) below. ## Check it worked ```bash head -c 300 opodcp-$(date -u +%F).jsonl; echo wc -l opodcp-$(date -u +%F).jsonl ``` A good backup starts with the header line `{"opodcp_backup":1,"at":"…","tables":[…]}` and has one more line per row. After a restore, the command prints one count per table, in name order, and a total on stderr, and the audit chain verifies: ```text restored into OPODCP_STATE_DSN (postgres://o…) alert_rules 2 … endpoints 3 … total 5210 rows ``` ```bash curl -s -H "$H" https://cp.example.com/api/v1/audit/verify | jq '{ok, entries, headSeq}' # {"ok": true, "entries": 1830, "headSeq": 1830} ``` The console's **Audit log → Chain** card shows the same verification, and **Settings → Backup** downloads a backup. ## If it fails | Message | Cause | Fix | | ------------------------------------------------------------------------ | ----------------------------------------------------- | ------------------------------------------------------------------------- | | `restore: not an opodcp backup (header "…")` | the file is not a backup, or it is an HTML error page | take the backup again; check that `curl` got a `200` (`-f`) | | `restore: endpoints row 1: …` (a duplicate key) | the target store is not empty | restore into an empty database, or pass `--wipe` | | `restore: this store already holds an audit chain … restore with --wipe` | two audit chains cannot be merged | pass `--wipe`, which replaces the store, chain included | | `store schema N was written by a newer opodcp` | the backup came from a newer release | restore with that release or a newer one | | `restore into the target (it must be empty): …` from `store move` | the target holds state | point `--to` at an empty database | | Alert `connector.sealed` after the restore | the release minted a new install key | install with `--set installKey.existingSecret=…` naming the key you saved | | The backup request answers `403` | the token is not an admin's | use the admin token or an admin user's session | ## What the store holds The control plane's database holds endpoints and every plan revision, models and their versions, API key hashes, users and sessions, alerts and rules, runs, stream cursors, the journal, leader events, usage facts, policies and settings, and the audit hash chain. Leaders and workers keep nothing but the model weight cache. Losing the store loses governance, not serving: every endpoint keeps answering from its mounted files. Restoring the store brings back the management view, keys, policies and history, and the reconciler then re-applies each restored plan within a minute. ## What a backup is `opodcp backup` writes one **logical JSON-lines file**: a header line, then one line per row of every table, in a fixed order, with nothing dialect-specific. ```text {"opodcp_backup":1,"at":"2026-10-30T23:40:00Z","tables":["endpoints","plans",…]} {"table":"endpoints","row":{"id":"ep_…","name":"chat",…}} ``` It holds every table the schema creates except `opodcp_schema` (the schema's own history: the target store writes its own), `ledger` and `usage_ingest` (counters that a restore moves forward) and `stream_tickets` (single-use credentials that expire in seconds). The audit chain is dumped and restored link for link, so `GET /api/v1/audit/verify` passes after a restore. **A backup holds secrets** — key hashes, remote vendor keys, session hashes. Treat it like the store: mode 0600, encrypted at rest, short retention. Connector credentials in it are sealed with the install key. ## Take a backup | From | Command | | -------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | a shell with the control plane's environment | `opodcp backup -o opodcp-2026-10-30.jsonl` (`-o -` streams to stdout) | | the API, with an admin token | `curl -H "Authorization: Bearer " https://cp.example.com/api/v1/backup -o opodcp.jsonl` | | the console | **Settings → Backup → Download backup** (admin) | | inside the pod | `kubectl -n opodcp exec deploy/opodcp -- /opodcp backup -o - > opodcp.jsonl` | A backup can run while the control plane serves. Reads are consistent per statement and the control tables are small; for a point-in-time copy of a busy store, use `pg_dump` as well. Nightly is enough: the store changes on operator actions, not on request traffic. A CronJob that calls `/api/v1/backup` with an automation token and ships the file to object storage is the usual shape. **Keep the install key with the backup.** Every connector credential in the store is sealed with it. Save the Secret `-opodcp-install-key` next to your database backups. ## Restore 1. **Stop the writer** ```bash kubectl -n opodcp scale deploy/opodcp --replicas=0 ``` Leaders keep serving. 2. **Point at the target store** Set `OPODCP_STATE_DSN=postgres://…` as `serve` would. An empty database is fine; the schema is created on open. Restore with the binary that wrote the dump or a newer one, never an older one: a store a newer release wrote is refused. 3. **Restore** ```bash opodcp restore opodcp-2026-10-30.jsonl # into an empty store opodcp restore --wipe opodcp-2026-10-30.jsonl # empty every table first; asks on a terminal opodcp restore --wipe --yes opodcp-2026-10-30.jsonl # in a script or a Job (the release after 0.3.6) ``` Without `--wipe` a non-empty store is refused on the first conflicting row; there is no silent merge. A store that already holds an audit chain refuses a dump that carries one unless you pass `--wipe`. 4. **Bring the install key** Install with `--set installKey.existingSecret=`. A release installed without it mints a new key; the sealed settings are then not applied, and the alert `connector.sealed` names, per port, the key id each setting needs and the one it holds. Give it the old key (or both, comma-separated, while you move), or enter the credentials again on the Connectors page. 5. **Start** ```bash kubectl -n opodcp scale deploy/opodcp --replicas=1 ``` Within one reconcile (60 s) every plan is re-applied, auth and policy Secrets are rewritten, and usage cursors resume. Over the API: `POST /api/v1/restore?wipe=1` with the dump as the body (admin). Use it only when nothing else writes. The console downloads backups but does not restore. **A new cluster under a kept store.** If the store is kept and the cluster is rebuilt (or every object of an endpoint is deleted), an endpoint with no pods whose last deployment had succeeded is re-created from its plan, and the activity feed says `endpoint.recreated`. ## Move the store to another Postgres ```bash kubectl -n opodcp scale deploy/opodcp --replicas=0 opodcp store move --to-file /run/secrets/target-dsn # or --to postgres://host/db ``` It reads the store `serve` opens (`OPODCP_STATE_DSN`, so run it where that is set, for example in a Job with the release's environment), refuses the store it already uses and a target that already holds state, restores into it, then compares every table's row count and the audit chain's head. The source is untouched. If it stops part way (`move stopped: …`), the target may be partly written: empty it before you run `store move` again. Postgres to Postgres only. Point the release at the target (`ports.state.dsnSecret`), then scale back to 1. Prefer `--to-file` when the DSN carries a password, so it stays off the command line. ## What a connector switch moves | Port | When you switch its adapter | | ------------- | ------------------------------------------------------------------------------------------------------------------ | | `state` | a new store starts empty: move it with `opodcp store move` | | `usage` | nothing to do: a new sink is sent every row the spool still keeps, oldest first | | `secrets` | a new store records tokens from then on; `opodcp secrets sync` records every token the Kubernetes Secrets hold now | | `batchfiles` | files in the old bucket are not moved; let running batches finish first | | `checkpoints` | checkpoints already written are not moved | | others | nothing to move | --- title: "Create an endpoint" description: "Create an endpoint from the console, the API or a scenario file, preview it first, watch it reach serving, and call it." url: "https://opod.io/docs/control-plane-endpoints/create/" markdown_url: "https://opod.io/docs/control-plane-endpoints/create.md" section: "Endpoints" last_updated: "2026-10-31" --- # Create an endpoint > Create an endpoint from the console, the API or a scenario file, preview it first, watch it reach serving, and call it. An endpoint is one model behind one URL. You create it with a name, a model and a plan. The control plane judges the plan, places it, and applies it. In 0.3.0 the create also runs as a [run](https://opod.io/docs/control-plane-endpoints/rollouts/) with steps and proofs. ## In short You give the control plane three things: a name, a model and a plan (what to run and where). It checks the plan against the measured GPUs, places the workers, and starts one leader and its workers. When the leader returns a first token, the endpoint is `serving` and you call it with the OpenAI API. ## When you need it - You want a model behind a URL for the first time. - You want a second copy of a model under another name, for example for another team. - You want to put an outside OpenAI-compatible API behind the same keys and usage (a [remote endpoint](#remote-endpoints)). ## Do it 1. **Set the two shell variables** ```bash CP=https://cp.example.com H="Authorization: Bearer " # an operator's session token, or the admin token ``` 2. **Write the request body** The smallest body names the endpoint, the model and one worker. The placer picks the card. ```bash cat > chat.json <<'JSON' { "name": "chat", "model": "qwen2.5-7b-instruct", "plan": { "model": { "id": "qwen2.5-7b-instruct", "engine": "vllm" }, "workers": [ { "replicas": 1 } ] } } JSON ``` 3. **Preview it** ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X POST $CP/api/v1/endpoints/preview -d @chat.json \ | jq '{claims, advisories}' ``` Expect `claims` with one `{node, gpu, class, engine}` row and a list of `advisories`. Nothing is created. A refusal is a `400` with an `E-…` code; fix the plan and preview again. 4. **Create it** ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X POST $CP/api/v1/endpoints -d @chat.json | jq '{id, name, url}' # {"id":"ep_…","name":"chat","url":"http://opodcp-ep-chat.opod.svc:8080"} ``` The answer is `201`. Keep the `id`. 5. **Wait for serving** ```bash watch -n 5 "curl -s -H '$H' $CP/api/v1/endpoints//status | jq -c '{phase, waiting, lastError}'" ``` The phase moves from `pending` to `converging` to `serving`. A first create pulls the weights, so it can take minutes. 6. **Mint a key and call it** ```bash KEY=$(opodcp key create --endpoint chat --cp $CP --token first-key) curl -s http://opodcp-ep-chat.opod.svc:8080/v1/chat/completions -H "Authorization: Bearer $KEY" \ -H 'Content-Type: application/json' \ -d '{"model":"qwen2.5-7b-instruct","messages":[{"role":"user","content":"hello"}]}' | jq -r '.choices[0].message.content' ``` A `*.svc` URL answers only inside the cluster. From your laptop, use the console's **Playground**, or see [Network and TLS](https://opod.io/docs/control-plane-security/network-tls/). ## Check it worked ```bash curl -s -H "$H" $CP/api/v1/endpoints//status | jq '{phase, counts, proof}' ``` A good answer has `"phase": "serving"`, `counts.ready` equal to `counts.planned`, and a non-empty `proof`. In the console the endpoint's row on **Endpoints** reads **serving**, and its **Connect** card shows the URL. ## If it fails | Symptom or code | Cause | Fix | | ----------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | | `409 conflict` on create | an endpoint of that name exists | pick another `name`, or change the existing one's plan | | `400` with `E-FIT` | the plan does not fit the measured free memory | read `details`; see [Placement → What `E-FIT` says](https://opod.io/docs/control-plane-endpoints/placement/#what-e-fit-says) | | `400` with another `E-…` code | the planner refused the plan | apply one of `details.alternatives`; see [Error codes](https://opod.io/docs/control-plane-reference/error-codes/) | | `400` "logging" | the body carries the removed `logging` field | delete it | | `403` | you are a viewer, or you named another team | ask for the operator role, or drop `team` | | `phase` stays `converging` | pods are starting or pulling weights; `waiting` says which | wait, or read the run log and the pod logs (below) | | `phase` is `degraded` | a pod cannot schedule, or the engine failed | read `lastError`, then `GET …/logs` for the leader and the worker | ## From the console Open **Endpoints → New**. 1. Pick a model from the catalog, or add one from a Hugging Face repo on the **Models** page first. From the release after 0.3.6, each model in the list says whether the placer would fit it on this fleet now, for the colocation the form sends: `fits ×2`, `does not fit · E-AUTO-NOFIT` (the planner's code), `refused` (the planner refuses it for another reason, such as a catalog entry with no weights its engine can load) or `size unknown` (the catalog records no size, so the placer cannot tell). The field's hint gives the reason. The answer comes from [`GET /api/v1/capacity/fits`](https://opod.io/docs/control-plane-endpoints/placement/) and is advice: you can still choose a model that does not fit, and Preview judges your exact plan. 2. Pick a **recipe** or a **workload preset** if you know your traffic shape, or leave the defaults. See [Recipes](#recipes). 3. Leave placement on **Auto** to let the control plane choose engine, cards and split, or switch to explicit and name them. Placement is one or the other: **Auto** picks from every ready machine, and explicit uses the machines you choose. From the release after 0.3.6, a cell with more than eight ready machines shows a filter above **Node**, and the expert section's **More machines** shows one when more than eight other machines are ready. Type words from a machine's name, vendor or GPU model, for example `nvidia a6000`. Each word must match. The field lists up to 100 matches and counts the rest, and the machine you already chose stays in the list. In an expert gang, the machine in **Node** is the **head**, the part that serves the API. The machines you tick follow it, as in a plan, where `head` defaults to the first part. 4. Press **Preview**. It shows the shape, the cards it would claim, each placement step's reason and any advisories. Nothing is created. From the release after 0.3.6, Preview runs by itself once the form has a name and a model and you stop typing for a moment; the button asks again on demand. 5. Press **Create**. The endpoint page then follows the endpoint until it serves. From a terminal, in the release after 0.3.6: `opodcp endpoint create --model qwen2.5-7b --dry-run chat` previews the same body, and without `--dry-run` creates it; see [the CLI reference](https://opod.io/docs/control-plane-reference/cli/#endpoint-create). The **Apply YAML** dialog on the Endpoints page takes a scenario document (below). In 0.3.0, the form also sets these fields. Each is sent only when you set it, and Preview shows the control plane's answer: | Form control | Where | Plan field | Example | | --------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Card** | Placement, explicit and **shared** (the release after 0.3.6) | `workers[].gpu` | `1 · 38 GB free · code (best fit)`: the card the budget goes on; the default is the card with the most free VRAM, and the budget may not pass the chosen card's free VRAM. A dedicated worker takes whole cards and the device plugin picks them, so it has no **Card** | | **Longest request** | Workload | `workload.maxContext` | `32768` sizes each worker's KV cache for a 32k-token request instead of the model's full window | | **Below the CPU tier → auto**, **Grow up to · GiB** | Advanced → KV cache tier (explicit placement) | `workers[].kvOffload {tier: auto, sizeGb, maxGb}` | start at 4 GiB, and let the control plane resize it up to 32 GiB | | **KV cache precision** | Advanced (explicit placement) | `workers[].flags.kv_cache_dtype` (llama.cpp: `kv_cache_type`) | `fp8` on vLLM holds about twice the tokens of the 16-bit default | | **KV block events** | Advanced → Prefix cache (vLLM, SGLang) | `kvEvents` | route a request to the worker that already holds its prompt's blocks | | **Who shares the prefix cache** | Advanced → Prefix cache | `routing.cacheIsolation` | `key`: no two keys share cached prompts | | **Gateway API InferencePool** | below Cell door alias | `exposure.inferencePool` | `pool-a`: your Gateway picks among every leader in that pool | To change these after create, use `opodcp endpoint kv` and `opodcp endpoint expose` ([CLI](https://opod.io/docs/control-plane-reference/cli/#endpoint-kv--policy--expose)). ## From the API `POST /api/v1/endpoints/preview` and `POST /api/v1/endpoints` take the same body. Preview writes nothing and answers with the plan as it would be stored, the claims and the advisories, or with the create's own refusal, word for word. ```bash H="Authorization: Bearer " cat > chat.json <<'EOF' { "name": "chat", "model": "qwen2.5-7b-instruct", "protocol": "chat", "plan": { "placement": "explicit", "model": { "id": "qwen2.5-7b-instruct", "engine": "vllm" }, "colocation": "dedicated", "workers": [ { "replicas": 2, "engine": "vllm" } ], "shardGroups": [], "autoscale": { "floor": 1, "max": 4, "unit": "workers" } } } EOF curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/endpoints/preview -d @chat.json curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/endpoints -d @chat.json ``` A worker row with no `node` is placed by the placer; `replicas: N` with no node becomes N single placements. You need the operator role. A team-scoped operator's endpoint lands in their team; naming another team is `403`. > **There is no dry-run flag on create** > > `POST /api/v1/endpoints?dryRun=true` creates the endpoint. Use `POST /api/v1/endpoints/preview` for a dry run. | Body field | Meaning | | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | the endpoint's name: a DNS label, `a-z`, `0-9` and `-`, at most 40 characters; it appears in its Service and object names | | `model` | the catalog or user model id | | `protocol` | `chat`, `embeddings` or `rerank`. When omitted, the endpoint serves the protocol its model is from 0.3.0; in 0.2.1 an omitted protocol is `chat`, whatever the model | | `team` | the owning team; `default` when absent | | `plan` | the [plan](https://opod.io/docs/control-plane-endpoints/plan/) | | `slo` | optional targets: `ttftMs`, `latencyMs`, `tpotMs` (milliseconds) and `availabilityPct` (1 to 100). Refused when negative or when `ttftMs` is above `latencyMs`. Change it later with `PUT /api/v1/endpoints/{id}/slo` | | `remoteKey` | write-only vendor key for a remote endpoint | | `cell` | optional; defaults to this control plane's cell. Any other cell is refused `400`: endpoints are cell-scoped | | `tenant`, `region` | optional labels stored on the endpoint record as given; `""` when absent | | `workloadType` | optional; `endpoint` when absent. From 0.3.0 any other value is refused `400` (a training run is a job: `POST /api/v1/jobs`); 0.2.1 stores it, and every usage row still says `endpoint` | A body with every optional field: ```json { "name": "search-chat", "model": "qwen2.5-7b-instruct", "protocol": "chat", "team": "search", "cell": "prod-east", "tenant": "acme", "region": "eu-west", "workloadType": "endpoint", "slo": { "ttftMs": 800, "latencyMs": 20000, "tpotMs": 60, "availabilityPct": 99 }, "plan": { "model": { "id": "qwen2.5-7b-instruct", "engine": "vllm" }, "workers": [ { "replicas": 2 } ] } } ``` \| `logging` | removed. A body that carries it is refused `400`: recording request content is not the control plane's job | A create answers `201` with the endpoint record. A second endpoint of the same name is `409 conflict`. A refusal is a `400` with an `E-…` code; see [The plan → Refusals](https://opod.io/docs/control-plane-endpoints/plan/#refusals). A rerank endpoint on an engine that cannot score documents is refused `E-ENGINE-RERANK`. The preview answer: ```json { "plan": { "…": "the plan as it would be stored" }, "model": { "id": "qwen2.5-7b-instruct", "engine": "vllm", "…": "…" }, "claims": [ { "node": "node-a", "gpu": 0, "class": "dedicated", "engine": "vllm" }, { "node": "node-b", "gpu": 0, "class": "dedicated", "engine": "vllm" } ], "advisories": [], "fronts": { "leader": { "nodes": ["node-c"], "placement": "gpu-less" } } } ``` A claim carries `budgetGb` for a shared worker and `part` (the gang id) for a gang part. `fronts` names the nodes the leader and front doors will be pinned to, and is new in 0.3.0, as does `prefillDecode` (the prefill and decode sizing for a plan with a workload). ## From the CLI ```bash opodcp preview -f chat.json --cp https://cp.example.com --token opodcp apply -f scenario.yaml --cp https://cp.example.com --token opodcp verify -f scenario.yaml --out report.json ``` `opodcp preview` is new in 0.3.0; `apply` and `verify` are in 0.2.1. `apply` creates or updates the endpoint a scenario names (`POST /api/v1/apply`). `verify` waits for it to serve, chats with it, and runs the scenario's `verify` block. A scenario is a YAML or JSON document: ```yaml apiVersion: opod.io/v1 kind: Scenario name: chat-rag endpoint: { name: chat-rag, model: qwen2.5-1.5b-instruct, protocol: chat } plan: placement: explicit model: { id: qwen2.5-1.5b-instruct, engine: vllm } workers: - { replicas: 1, engine: vllm, kvOffload: { tier: cpu, sizeGb: 8 } } workload: { inputTokens: 16000, outputTokens: 1000, peakConcurrency: 8 } autoscale: { floor: 1, max: 4, unit: workers } verify: chat: { prompt: "What is the capital of France?", maxTokens: 16, expectContains: "Paris" } balance: { requests: 30, expectWorkersUsed: 2, maxSharePct: 70 } ``` | `verify` block | Checks | | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `chat` | one completion of `prompt` with `maxTokens`; `expectTokens` requires a non-empty answer; `expectContains` requires the text, ignoring case (sent at temperature 0) | | `embed` | one embeddings request over `inputs`; `expectDimensions` fixes the vector width | | `balance` | `requests` sent `concurrency` at a time spread across at least `expectWorkersUsed` workers; `maxSharePct` caps any one worker's share | | `gpu` | the measured VRAM on `node` and `index`: `expectUsedGbBetween`, `expectHolderGb`, `expectEndpointHolds` | | `autoscale` | a `load` of `parallel` clients for `seconds` drives at least `expectWorkersAtLeast` workers, then `expectShrinkTo`, `expectSleepAfterIdle` or a wake within `wakeBudgetSeconds` | `opodcp apply` defaults to explicit placement. A scenario may also carry `description`, `notes`, `remoteKey`, `timeoutSeconds`, `setup.teamQuotas` (admin) and `expectRefusal.contains`: a scenario that must be refused passes only when the refusal carries that text. ## Watch it reach serving ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//status | jq '{phase, proof, waiting, lastError, counts}' ``` | Phase | Meaning | | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `pending` | stored, nothing running yet | | `converging` | pods are starting or the leader has not answered yet; `waiting` says why | | `serving` | the leader produced a first token for the plan's model; `proof` holds the evidence | | `degraded` | something is wrong; `lastError` says what, for example `apply: …` or an unschedulable pod. From the release after 0.3.6 the endpoint page shows it under the header with a link to the pod logs, and the list shows it on the state's tooltip (a converging or pending endpoint shows its `waiting` reason the same way) | | `sleeping` | healthy and idle: every worker's engine is asleep (sleep tier), or a `floor: 0` endpoint is parked at zero workers and wakes on the next request | | `deleting` | teardown in progress | The status document: | Field | Meaning | | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `phase`, `observedAt` | the phase and when it was read; the control plane observes every endpoint about every 5 s | | `leader`, `workers[]`, `gateways[]` | each pod: `pod`, `node`, `ready`, `phase`, `loaded` (the models the leader routes to this worker; `[]` = none yet, `null` = not known: the leader is not ready, or it could not be read and the pod is new or restarted — an unchanged pod keeps its last list through a failed read; from the release after 0.3.6 — before it, always absent), `stale` (still on an old revision; it serves until it stops), `worker` (plan row), `nodeId`, `terminating`, `placement` (the rule that put a leader or door there), and from the release after 0.3.6 `restarts` (the container's restart count) and `waiting` (the reason it waits in — `CrashLoopBackOff`, `ImagePullBackOff`, …; absent while it starts normally) | | `counts` | `planned`, `scheduled`, `running`, `ready`, `stale`, `terminating` | | `proof`, `waiting`, `lastError` | the serving evidence, what a converge waits for, the last failure | | `rollingOut` | the workloads (`leader`, `worker/`) still on an older pod template | | `gangs[]` | per gang: `id`, `render` (`leaderworkerset` or `per-part`), `reason`, `vendors` | | `scaling` | who scales the endpoint and why; see [Autoscaling](https://opod.io/docs/control-plane-endpoints/autoscaling/#what-it-is-doing) | | `doorsWanted`, `doorsAsked` | the front-door count it runs and the count the plan asks for | The proof is kept per set of pods: a leader restart or a worker change is proven again. From 0.3.0, the create's run log (`GET /api/v1/runs/{id}/log`) shows what each step saw, including what Kubernetes said about the pods. `GET /api/v1/endpoints` lists every endpoint you may see; `?expand=plan` attaches each plan in the same answer. `GET /api/v1/endpoints/status` answers every visible endpoint's status in one call. `GET /api/v1/endpoints/{id}` adds the planner's `advisories` for the stored plan. ## Call it The endpoint's `url` field is its in-cluster Service, for example `http://opodcp-ep-chat.opod.svc:8080`. It serves the OpenAI API under `/v1`: `GET /v1/models`, `POST /v1/chat/completions`, `POST /v1/completions`, `POST /v1/embeddings`, `POST /v1/rerank`. Send a key as `Authorization: Bearer sk-orc-`. ```python from openai import OpenAI client = OpenAI(base_url="http://opodcp-ep-chat.opod.svc:8080/v1", api_key="sk-orc-") print(client.chat.completions.create(model="qwen2.5-7b-instruct", messages=[{"role": "user", "content": "hello"}]).choices[0].message.content) ``` The endpoint page's **Connect** card shows the URL, the public URL when a route exists (`publicUrl`), and code to copy. A leader that serves TLS also reports `tlsFingerprint` and `tlsNotAfter`. From outside the cluster, see [Network and TLS](https://opod.io/docs/control-plane-security/network-tls/). To test through the control plane, use the **Playground** or `POST /api/v1/endpoints/{id}/gateway/v1/chat/completions`. ## Remote endpoints An endpoint can front a model served elsewhere, by any OpenAI-compatible API. Set `plan.model.source: remote`, `plan.model.remoteUrl` (an `http(s)` base URL; `/v1` optional) and `plan.model.id` (the vendor's model id), with no workers, gangs or autoscale. Give the vendor key as `remoteKey`. Only the leader runs; there is no GPU, ledger claim or placer. The stored plan's engine reads `openaicompat`. Keys, fallback, usage and the Connect card work unchanged. Rotate the vendor key with `PUT /api/v1/endpoints/{id}/remote-key {"key": "…"}` (it answers `{"set": true}`, or `false` for an empty key, which clears it); the leader is rolled to pick it up. No route ever returns the key. ## Logs ```bash curl -s -H "$H" "https://cp.example.com/api/v1/endpoints//logs?tail=200" # the leader curl -s -H "$H" "https://cp.example.com/api/v1/endpoints//logs?pod=&previous=true" ``` `tail` is 1 to 5000 (default 200), at most 1 MiB. Only pods of this endpoint can be read. ## Delete `DELETE /api/v1/endpoints/{id}` (operator) answers `202` with `{"id": "…", "state": "deleting"}` and tears the endpoint down: remove objects, wait for pods to go, free the GPUs, remove the record. In 0.3.0 the delete is a run with those four steps (`remove objects`, `pods gone`, `GPUs freed`, `record removed`), it cannot be cancelled, and the endpoint's plan history stays readable by its id. Every Kubernetes object of an endpoint names the endpoint's plan ConfigMap (`-plan`) as its owner, and a delete removes that ConfigMap first. So a teardown the control plane does not live through (a crash or an upgrade mid-delete) is finished by Kubernetes garbage collection, and no worker is left holding a card the ledger already gave away. A plan edit or a rollout patches the ConfigMap in place, so it never removes a serving endpoint's objects. ## Recipes Recipes and workload presets on the create form are new in 0.3.0. A recipe fills the create form for a traffic shape. The stored plan carries only the fields, never the recipe's name. | Recipe | Your traffic | The shape | | --------------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------- | | Short and frequent | many short requests | replicas under autoscale 1–4; 800 tokens in, 200 out, 64 at once | | Shared long prefix | RAG, agents, one long system prompt | a host-memory KV tier (8 GiB) per worker; 16,000 in, 1,000 out, 8 at once; autoscale 1–4 | | Offline batch | many independent requests | 1,000 in, 300 out, 128 at once; autoscale 0–4, parked after 5 minutes idle | | Big model, one machine | too big for one card | tensor parallel 2 across one machine's cards (vLLM, SGLang, TensorRT-LLM) | | Big model, several machines | too big for one machine | a pipeline gang across two machines; a plan file today | A recipe the chosen engine or machine cannot run is greyed with the planner's refusal code. --- title: "The plan" description: "Every field of an endpoint's plan (apiVersion opod.io/v1) — model, workers, gangs, autoscale, workload, routing, doors, canary, eval and adapters." url: "https://opod.io/docs/control-plane-endpoints/plan/" markdown_url: "https://opod.io/docs/control-plane-endpoints/plan.md" section: "Endpoints" last_updated: "2026-10-30" --- # The plan > Every field of an endpoint's plan (apiVersion opod.io/v1) — model, workers, gangs, autoscale, workload, routing, doors, canary, eval and adapters. The plan is an endpoint's desired state. Read it with `GET /api/v1/endpoints/{id}/plan`. Change it with `PUT /api/v1/endpoints/{id}/plan` (an edit, applied at once) or `POST /api/v1/endpoints/{id}/rollouts` with the plan as the body (a verified rollout). Add `?dryRun=true` to the `PUT` to validate only. Both need the operator role; in 0.3.0 a machine token with scope `plans:write` may make them too. Every write is judged by the planner and stored with the next `revision`. In 0.3.0, every revision is also kept in the plan history with its cause (`create`, `edit`, `rollout`, `rollback`, `scale`, `sleep`, `wake`, `grant`, `adapters`, `imported`), and a plan edit is refused `E-RUN-ACTIVE` while a rollout, rollback or create runs on the endpoint. ```yaml apiVersion: opod.io/v1 revision: 3 placement: explicit model: { id: llama-3.2-3b, source: catalog, format: gguf, engine: llamacpp } colocation: shared workers: - { node: node-c, gpu: 0, vramBudgetGb: 6, engine: llamacpp, replicas: 1, flags: { ctx: "8192" } } shardGroups: [] autoscale: { floor: 1, max: 3, unit: workers } door: { alias: chat } ``` ## In short The plan is one YAML or JSON document that says what an endpoint runs: the model, the workers or gangs, the autoscale bounds, the doors and the rollout gates. You never edit pods. You change the plan, and the control plane makes the cluster match it. Every change is checked first, so a plan that cannot run is refused before anything moves. ## When you need it - To change what an endpoint runs: a bigger context, another engine, more workers, a tensor split. - To turn on a feature that lives in the plan: front doors, the cell door alias, a canary, an eval gate, LoRA adapters. - To read why an endpoint looks the way it does: `resolved`, `images` and `advisories`. ## Do it 1. **Read the stored plan** ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//plan > plan.json jq '{revision, placement, workers}' plan.json ``` 2. **Change one thing** For example, raise vLLM's context window on every worker row: ```bash jq '.workers[].flags.max_model_len = "16384"' plan.json > new.json ``` 3. **Validate it without applying** ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X PUT \ "https://cp.example.com/api/v1/endpoints//plan?dryRun=true" -d @new.json | jq '.workers' ``` A `200` answers the plan as it would be stored, and nothing changes. A `400` names the rule and, for a planner refusal, an `E-…` code in `details.code`. Once a plan is stored, `GET /api/v1/endpoints/{id}` carries the planner's `advisories` for it. 4. **Roll it out** ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X POST \ "https://cp.example.com/api/v1/endpoints//rollouts?note=context%2016k" -d @new.json | jq '{id, state}' ``` A verified rollout proves each step and puts the old plan back when a step fails. Use `PUT …/plan` without `dryRun` only when you want the change applied at once, with no proof steps. ## Check it worked ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//plan | jq '{revision, flags: [.workers[].flags.max_model_len]}' curl -s -H "$H" https://cp.example.com/api/v1/endpoints//status | jq '{phase, rollingOut}' ``` A good answer: `revision` is one higher, the flag reads `"16384"`, `phase` is `serving` and `rollingOut` is empty. In the console, the endpoint page shows the new revision; from 0.3.0 its **History** tab shows the diff. ## If it fails | Symptom or code | Cause | Fix | | ----------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `400` naming an unknown flag key | the engine does not take that flag; the message lists the keys it knows | use a listed key, or pass it as plain tokens in `flags.extra` | | `400` naming a model that is not in the catalog | a model id the catalog does not know needs `model.repo` | add `model.repo` (and `model.file` for GGUF), or add the model first ([Models](https://opod.io/docs/control-plane-endpoints/models/)) | | `E-ENGINE-MODEL` | the engine cannot load the model's format | another engine, or another format | | `E-UNVERIFIED` | `verifiedOnly` is on and the path was never proven | prove it with `opodcp verify`, or turn `verifiedOnly` off | | `E-MTLS-REPLICAS`, `E-MTLS-GANG` | `workers.mtls=require` and the plan has replicas or gangs | see [Refusals](#refusals) below | | `E-RUN-ACTIVE` (0.3.0) | a rollout, rollback or create runs on the endpoint | wait for it, or cancel it | | A rollout ends `rolled-back` | a step failed; the old revision is back | read the failed step's `error` and `code` ([Rollouts](https://opod.io/docs/control-plane-endpoints/rollouts/#read-a-run)) | ## Top-level fields | Field | Default | Meaning | | | ------------------------ | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | | `apiVersion` | `opod.io/v1` | schema version; a missing one is filled, an unknown one refused | | | `revision` | set by the server | bumped by every write | | | `placement` | `explicit` | `explicit` or `auto`; see [Placement](https://opod.io/docs/control-plane-endpoints/placement/) | | | `resolved` | set by the server | the auto ladder's pinned answer; re-resolved only by a rollout | | | `model` | — | what is served (below) | | | `colocation` | `dedicated` | `dedicated` (a whole GPU per worker) or `shared` (packed by `vramBudgetGb`); anything else is refused | | | `workers[]` | `[]` | single-pod workers (below). A plan needs at least one worker or one gang | | | `shardGroups[]` | `[]` | gangs; see [Gangs](https://opod.io/docs/control-plane-endpoints/gangs/) | | | `autoscale` | fixed size | see [Autoscaling](https://opod.io/docs/control-plane-endpoints/autoscaling/) | | | `workload` | none | the expected traffic; the planner sizes memory from it. See [KV cache and sizing](https://opod.io/docs/control-plane-endpoints/kv-cache/). New in 0.3.0 | | | `routing.cacheIsolation` | `team` | who may share the prefix cache: `team`, `key` or `none`. New in 0.3.0 | | | `routing.session` | on: `ttlSec: 300`, `signedRoute: true`, `turnPriority: true` | from 0.3.3: how a conversation (named by `X-Opod-Session` or the OpenAI `user` field) keeps its worker, across front doors; `disabled: true` pins per key as before. `ttlSec` 0 … 86400. See [Routing → Sticky sessions](https://opod.io/docs/control-plane-endpoints/routing/#sticky-sessions) | | | `kvEvents` | `false` | vLLM workers report the KV blocks they hold, for cache-aware routing; a launch flag, so it rides a rollout | | | `gateways` | off | front doors: `enabled`, `replicas` (pin the count), `max` (cap a derived count, default 8) | | | `door.alias` | `""` | the endpoint's name on the cell door; unique in the cell | | | `exposure.inferencePool` | `""` | join a Gateway API InferencePool of this name. New in 0.3.0 | | | `speculative` | absent (off) | from 0.3.6, with a leader and workers from core v0.4.5: speculative decoding for every worker, `{method: ngram, tokens: 4}` — the engine guesses the next `tokens` (1–16) by looking them up in the prompt and the model checks them in one step, so answers are unchanged. vLLM, SGLang and llama.cpp on NVIDIA; another vendor or a gang is refused `E-SPEC-UNSUPPORTED`. `method: draft` with `model: ` (a small model of the same family proposes the tokens) arrives in the release after 0.3.6: the draft must be a registered model with a size — it is counted with the model's in every sizing — and loadable as a draft (a GGUF file for llama.cpp, a safetensors repo for vLLM and SGLang), else `E-SPEC-DRAFT`. On the cell's 8 GB cards a draft only a third the size of the model made chat 20–51 % slower: a draft pays when the model is many times larger. On the design-partner cell a copy-heavy load ran 2.9–3.5× faster at 1 stream on all three engines and 1.6–2.2× at 16; plain chat ran 1–8 % slower on vLLM and llama.cpp and 22–30 % faster on SGLang. CLI \`opodcp endpoint speculative --method ngram | off NAME\` | | `exposure.vertex` | `false` | serve Vertex AI's custom-container routes on the leader. New in 0.3.0 | | | `canary` | none | `holdSeconds` (default 600) and `weight` (percent of requests) for a rollout's canary step | | | `eval` | none | `suite`, `image`, `minScore`, `timeoutSeconds` (default 900) for a rollout's eval step | | | `adapters[]` | `[]` | LoRA adapters: `name`, `source`, `rank`; vLLM only, at most 16 | | | `verifiedOnly` | `false` | refuse any placement path this control plane has not proven (`E-UNVERIFIED`) | | | `images` | set by the server | the digest-pinned images the plan runs, keyed `leader` or `/`; written for missing keys at create and re-pinned only by a rollout, never by an autoscale edit | | | `extra` | none | free-form data kept with the plan; nothing in the control plane reads it | | The endpoint's SLO (`ttftMs`, `latencyMs`, `tpotMs`, `availabilityPct`) is not part of the plan: set it with `PUT /api/v1/endpoints/{id}/slo`, or in the create body. It rolls nothing. An empty body clears it. ## `model` | Field | Meaning | | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | `id` | the model id; for a remote endpoint, the vendor's id | | `source` | `catalog`, `hf`, `oci`, `s3` or `remote` | | `format` | `gguf` or `safetensors` (or `fp8` and other formats a catalog entry states) | | `engine` | `llamacpp`, `vllm`, `sglang`, `trtllm`; resolved from the catalog when empty. A remote endpoint's engine is stored as `openaicompat` | | `repo`, `file` | the Hugging Face repo and, for GGUF, the file | | `version` | a registered model version; resolved to `revision` and `sha256` when the plan is stored | | `revision`, `sha256` | pin exact bytes, with or without a version name | | `remoteUrl` | a remote endpoint's base URL | One endpoint serves one model identity. A model id that is not in the catalog needs `model.repo` (and `model.file` for GGUF), or the plan is refused `400`. The planner refuses an engine that cannot load the model's format (`E-ENGINE-MODEL`). Pinning an archived version is refused `E-VERSION-ARCHIVED`. With approval required, pinning an unapproved version is refused `E-MODEL-UNAPPROVED`; see [Models → Approval](https://opod.io/docs/control-plane-endpoints/models/#approval). ## `workers[]` | Field | Meaning | | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `node`, `gpu` | where it runs; empty `node` lets the placer choose | | `vramBudgetGb` | the VRAM it may hold on a `shared` card. From 0.3.0, a shared worker that states none is sized from its model (weights, KV pool and overhead); in 0.2.1 it is required. See [Placement](https://opod.io/docs/control-plane-endpoints/placement/#dedicated-and-shared). A model with no recorded size or architecture still needs one | | `engine` | the worker's engine; every worker of an endpoint runs the plan's engine | | `replicas` | identical copies of this row, at least 0. Omitted means 1 when autoscaling is off; under autoscale, 0 is a parked row that keeps its node and flags | | `parallelism` | `tensor` (a power of two the node can hold); `pipeline` and `data` above 1 are gang shapes and replicas. A shared worker is one card, so `tensor` above 1 there is refused. `expert: true` asks for expert parallelism on a mixture-of-experts model: a gang shape only, vLLM or SGLang, dedicated, inside one machine unless a passed fabric proof measured all-to-all between machines; see [Gangs](https://opod.io/docs/control-plane-endpoints/gangs/) | | `flags` | engine settings passed to core (below) | | `image` | override the cell's image for this engine and vendor | | `role` | `prefill` or `decode` for one half of a disaggregated pair; empty = a complete server. Roles come in pairs: a plan with one role only is refused | | `kvOffload` | a KV cache tier below VRAM: `tier`, `sizeGb`, `maxGb`, `diskGb`. See [KV cache and sizing](https://opod.io/docs/control-plane-endpoints/kv-cache/). `maxGb` and `diskGb` are new in 0.3.0 | | `modelSpec` | the ConfigMap holding a Tenstorrent worker's vendor model spec; required on a Tenstorrent node, refused on any other (`E-TT-SPEC`) | | `sleeping` | set by the autoscaler while the worker's engine sleeps | | `shape` | set by the autoscaler on a row it grew from a growth shape. New in 0.3.0 | ### Common `flags` Each engine accepts its own set of keys. Any other key is refused `400` and the message lists the keys that engine knows. | Flag | Engine | Meaning | | ----------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ctx` | llama.cpp | context size, 512 to 4,194,304 | | `parallel` | llama.cpp | slots, 0 to 4096 | | `ngl` | llama.cpp | layers offloaded to the GPU, 0 to 4096 | | `kv_cache_type` | llama.cpp | the KV cache element type | | `kv_unified` | llama.cpp | `true` (one shared KV pool) or `false` (one per slot); from 0.3.0 the planner writes it from the colocation class | | `tensor_split` | llama.cpp | each device's share, for example `"12,8"` | | `max_model_len` | vLLM, SGLang, TensorRT-LLM | maximum request length, 512 to 4,194,304 | | `max_num_seqs` | vLLM, TensorRT-LLM | requests served at once, 0 to 4096; the leader admits by it (default 256) | | `max_running_requests` | SGLang | requests served at once, 0 to 4096 | | `gpu_memory_utilization` | vLLM | the engine's memory fraction, 0.05 to 0.95 | | `mem_fraction_static` | SGLang | the engine's memory fraction, 0.05 to 0.95. SGLang with a speculative draft on an 8 GB card needs more than its default share; from core v0.4.6 (pinned by the chart in the release after 0.3.6) the endpoint's error names the value to set here | | `kv_cache_free_gpu_memory_fraction` | TensorRT-LLM | the KV cache's memory fraction, 0.05 to 0.95 | | `pp_layer_partition` | vLLM, SGLang | layers per pipeline stage, for example `"8,12,12,8"` | | `kv_cache_dtype` | vLLM, SGLang, TensorRT-LLM | an 8-bit KV cache; opt-in. TensorRT-LLM takes it, and over weights it is not proven with it is refused `E-KV-DTYPE`, from 0.3.0 | | `tp` | vLLM, SGLang, TensorRT-LLM | deprecated: a power of two from 1 to 64. Use `parallelism.tensor`; a `tp` that disagrees with it is refused | | `extra` | all | further engine arguments as plain tokens | Split flags take numbers and commas only. Core passes a fixed set of flag keys to each engine and plain tokens in `extra`; an argument in JSON form in `extra` is dropped. A KV-cache connector typed into `extra` is refused: ask for a tier with `kvOffload`. ## Nested objects The pages linked below hold each block's rules and refusals. This section lists every field once, so the plan can be read from one place. A field marked *server* is written by the control plane; a value you send for it is ignored or replaced. ### `autoscale` | Field | Type | Default | Meaning | | ---------------- | ------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `floor` | int | 0 | minimum workers or gangs; `0` = may scale to zero | | `max` | int | 0 | maximum; `0` = autoscaling off, the worker set is fixed | | `unit` | string | `workers` | `workers` or `gangs` | | `targetInflight` | int | 2 | in-flight requests one worker carries before another is added | | `idleSeconds` | int | 120 | how long demand stays below the current size before one worker parks | | `kvPressurePct` | int | 85 | grow when the busiest worker's KV cache reaches this percent; `0` = off | | `ttftBudgetMs` | int | 0 | TTFT p95 budget in ms; over it the endpoint grows, never shrinks; `0` = none | | `sleepSeconds` | int | 0 | idle seconds before the engine sleeps (vLLM on NVIDIA); `0` = no sleep tier | | `sleepCard` | string | `keep` | `keep` holds the card while asleep; `free` releases it (shared plans only) | | `scaleIn` | string | `drain` | `drain` lets running requests finish; `now` stops the worker at once | | `drainSeconds` | int | 120 | the longest a drain may take | | `wakeSloMs` | int | 0 | advisory wake target; it gates nothing | | `grantHeadroom` | int | 1 | workers reserved beyond what runs, for an external scaler (KEDA) during an outage | | `growth[]` | list | none | ordered growth shapes: `name` (default the vendor), `vendor`, `max` (0 = up to `autoscale.max`), `vramBudgetGb` (0 = the template's), `flags` (laid over the template's, key by key), `parallelism` (empty = the template's), `image` (empty = the cell's image for that engine and vendor) | | `granted[]` | list | *server* | the capacity reserved for an external scaler, one `{node, gpu}` per slot | | `reserved` | bool | *server* | a shared row's card holds every replica's budget up to `max` | See [Autoscaling](https://opod.io/docs/control-plane-endpoints/autoscaling/). `growth`, `sleepCard`, `scaleIn` and `drainSeconds` are new in 0.3.0. ### `shardGroups[]` | Field | Type | Default | Meaning | | ------------- | ------ | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | `id` | string | required | the gang's id, at most 28 characters | | `engine` | string | the model's engine | must equal it | | `parts[]` | list | required | `node`, `gpu`, `vramBudgetGb` (required on a shared plan), `devices` (GPUs per part, default 1, the same on every part) | | `head` | string | the first part's node | the node of the coordinating part | | `parallelism` | object | `pipeline` = the number of parts, `tensor` = devices per part | as on a worker, `expert` included | | `flags` | map | none | the engine flags for every part, for example `tensor_split` | | `kvOffload` | object | none | a CPU KV tier for a vLLM gang; `sizeGb` is the gang's total | | `parked` | bool | *server* | the autoscaler parked the gang as a unit | | `gaveUp` | object | *server* | `{at, attempts, code, reason, revision}` after three failed heals; a rollout clears it | | `shape` | string | *server* | the growth shape the autoscaler grew this gang from | See [Gangs](https://opod.io/docs/control-plane-endpoints/gangs/). `kvOffload`, `gaveUp` and `shape` are new in 0.3.0. ### `workload` | Field | Type | Default | Meaning | | ----------------------------- | ------ | ---------------------------- | ----------------------------------------------------------------- | | `inputTokens`, `outputTokens` | int | 0 | one typical request's prompt and answer | | `maxContext` | int | `inputTokens + outputTokens` | the longest request, prompt and answer together | | `peakConcurrency` | int | 1 | requests in flight at the busiest moment; memory is sized from it | | `peakRps` | number | 0 | recorded and said back, never sized from | | `headroomPct` | int | 15 | the margin over the pool; `0` is a stated "no margin" | See [KV cache and sizing](https://opod.io/docs/control-plane-endpoints/kv-cache/). The block is new in 0.3.0. ### `resolved` (server) With `placement: auto`, the ladder's pinned answer: `path` (the capability-graph key a proof is recorded against), `shape` (`worker` or `gang`), `engine`, `parallelism`, `nodes`, `needGb` (the memory it sized against; 0 = unknown), `why[]` (one `{step, chosen, reason, rejected[]}` per rung), `verified` (`none`, `integration` or `fleet`), `resolvedAt` and `revision`. Only a rollout re-resolves it. See [Placement](https://opod.io/docs/control-plane-endpoints/placement/). ### Every field in one plan ```yaml apiVersion: opod.io/v1 placement: explicit model: id: qwen2.5-32b-instruct source: hf format: safetensors engine: vllm repo: Qwen/Qwen2.5-32B-Instruct version: v3 # resolved to revision + sha256 when stored colocation: dedicated workers: - node: node-a gpu: 0 engine: vllm replicas: 1 parallelism: { tensor: 2 } flags: { max_model_len: "32768", gpu_memory_utilization: "0.90" } kvOffload: { tier: cpu, sizeGb: 64 } autoscale: floor: 1 max: 4 unit: workers targetInflight: 4 # add a worker past 4 requests in flight each idleSeconds: 300 # 5 minutes below the current size parks one kvPressurePct: 80 ttftBudgetMs: 1500 sleepSeconds: 0 scaleIn: drain drainSeconds: 180 wakeSloMs: 60000 # advisory grantHeadroom: 1 growth: - { name: a6000, vendor: nvidia, max: 3 } # tried first - { name: big-card, vendor: nvidia, max: 1, parallelism: { tensor: 1 }, vramBudgetGb: 0 } # then one card per worker workload: { inputTokens: 2000, outputTokens: 500, maxContext: 32768, peakConcurrency: 40, peakRps: 8, headroomPct: 15 } routing: { cacheIsolation: team } kvEvents: true gateways: { enabled: true, max: 4 } door: { alias: qwen-32b } exposure: { inferencePool: "", vertex: false } canary: { holdSeconds: 600, weight: 10 } eval: { suite: mmlu-mini, image: registry.example.com/evals/mmlu@sha256:…, minScore: 0.82, timeoutSeconds: 900 } adapters: [] # LoRA adapters: vLLM only, at most 16, for example { name: sql, source: org/sql-lora, rank: 16 } verifiedOnly: false extra: { owner: search-team, ticket: OPS-1432 } ``` A gang plan replaces `workers` with `shardGroups`: ```yaml colocation: dedicated workers: [] shardGroups: - id: g0 engine: vllm head: node-a parts: - { node: node-a, gpu: 0, devices: 2 } - { node: node-b, gpu: 0, devices: 2 } parallelism: { tensor: 2, pipeline: 2 } flags: { max_model_len: "16384" } autoscale: { floor: 1, max: 2, unit: gangs } ``` Send either with `PUT /api/v1/endpoints/{id}/plan?dryRun=true` first, then without `dryRun`, or as the body of `POST /api/v1/endpoints/{id}/rollouts`: ```bash yq -o json plan.yaml > plan.json curl -s -H "$H" -H 'Content-Type: application/json' -X PUT "https://cp.example.com/api/v1/endpoints//plan?dryRun=true" -d @plan.json curl -s -H "$H" -H 'Content-Type: application/json' -X POST "https://cp.example.com/api/v1/endpoints//rollouts?note=tp2%20on%20node-a" -d @plan.json ``` ## Advisories The planner says what it noticed and did not refuse as `advisories[]` on Preview, on create, and on the endpoint: `{ kind, where, path, reason }`. `GET /api/v1/endpoints/{id}` also carries `advisoriesRevision` and `advisoriesStale` (the advisories were judged on an earlier revision). Examples: `placement` (tensor parallel over PCIe or across nodes, with its cost), `weights` (from the release after 0.3.6: the weights alone are larger than the card, or than a gang's cards together, so the engine cannot load them and the worker fails at start — a warning, not a refusal; it names a larger card, tensor parallel or a smaller model, and for llama.cpp `flags.n_gpu_layers`), `context` (the context window will not fit the budget, and the engine will shorten it), `engine` (an engine the catalog does not recommend), `workload` (the sizing arithmetic), `unproven` (a path this control plane never proved), `budget-sized`, `card-filled`, `endpoint.single-point` (one failure would stop it), `workers.stacked`, `workers.outside-use`, `doors.capped`, `host-ram`, `gang`, `gang-kv`, `kv-no-store` (up to 0.3.6; from the release after 0.3.6 a peer tier with no store is refused instead), `kv-disk`, `kv-peer`, `kv-signal`, `sleep-card`, `wake-hold`, `pd`, `pd-roles`, `pd-split`, `cache-isolation`, `vertex-keyless`, `leader-tls`, `growth-no-node`. Several of these are new in 0.3.0 with the features they describe. ## Refusals A refusal is a `400` with `{ "error", "code": "invalid", "details": { "code": "E-…", "alternatives": [ … ] } }`. Preview and create answer identically. A rule with no named code (a negative count, an unknown enum value, a bad flag value) is the same `400` with the rule in `error` and the field in `details.field`. See [Error codes](https://opod.io/docs/control-plane-reference/error-codes/). Refusals that judge the plan as a whole, beside the ones each page lists: | Code | When | Fix | | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | | `E-MTLS-REPLICAS` | `workers.mtls=require` (workers identified by certificate) and a worker row has more than one replica, or `autoscale.max` is above 1: every replica of a row would share one certificate | one worker row per node, `autoscale.max: 1`, gangs, or `workers.mtls=allow` | | `E-MTLS-GANG` | `workers.mtls=require` and the plan has an active gang | a single-pod shape, or `workers.mtls` below `require` | | `E-UNVERIFIED` | `verifiedOnly` is on and the path was never proven | prove it with `opodcp verify`, or turn `verifiedOnly` off | | `E-ENGINE-RERANK` | a rerank endpoint on an engine that cannot score documents | an engine that serves rerank | | `E-RUN-ACTIVE` | a run already holds the endpoint (0.3.0) | wait for it to finish, or cancel it | ## Plan history Plan history is new in 0.3.0. ```bash curl -s -H "$H" "https://cp.example.com/api/v1/endpoints//revisions?limit=20" curl -s -H "$H" "https://cp.example.com/api/v1/endpoints//revisions/3" | jq .doc > rev3.json curl -s -H "$H" -H 'Content-Type: application/json' -X POST \ "https://cp.example.com/api/v1/endpoints//rollouts?note=back%20to%20rev%203" -d @rev3.json ``` Every revision is kept with who wrote it, why and the run that did, and it outlives a delete. The endpoint page's **History** tab diffs a revision against the one before and rolls back to any of them as a verified rollout. --- title: "Placement and the VRAM ledger" description: "How the placer chooses cards from measured VRAM, dedicated and shared workers, the auto ladder, time-slicing, and what makes a plan fit or not." url: "https://opod.io/docs/control-plane-endpoints/placement/" markdown_url: "https://opod.io/docs/control-plane-endpoints/placement.md" section: "Endpoints" last_updated: "2026-10-31" --- # Placement and the VRAM ledger > How the placer chooses cards from measured VRAM, dedicated and shared workers, the auto ladder, time-slicing, and what makes a plan fit or not. The placer puts each worker the plan does not pin on a node and a card. It judges every plan against the **ledger**: each card's measured size, what each worker claims on it, and what something outside opod already uses. VRAM is the unit, not whole GPUs. A card that a worker pod of ours holds under an endpoint id this control plane does not know counts as taken too (0.3.0). ## In short The placer decides which machine and which card each worker gets. It decides from measured memory, not from GPU counts: a probe reads every card every 20 s. You either let it choose everything (`placement: auto`), or you name some or all nodes and cards (`placement: explicit`) and it fills in the rest. A plan that does not fit is refused with the numbers, before any pod starts. ## When you need it - Before a create: to see how many more copies of a model fit now. - When a create is refused `E-FIT` or `E-AUTO-NOFIT`. - To pack several small models on one card (`colocation: shared`, NVIDIA only). - To pin a worker to one machine, or keep it off one. - To set a team's GPU quota. ## Do it 1. **See what is free** ```bash curl -s -H "$H" https://cp.example.com/api/v1/capacity/ledger | jq . curl -s -H "$H" "https://cp.example.com/api/v1/capacity/fits?model=qwen2.5-7b-instruct" | jq . ``` The first answers each card's measured, used and free memory and who holds it. The second answers how many more of that model fit, per colocation class, and why the next one is refused. 2. **Choose a shape** Let the control plane choose: ```yaml placement: auto model: { id: qwen2.5-7b-instruct } ``` Or pack two small workers on one NVIDIA card, 6 GB each: ```yaml placement: explicit colocation: shared model: { id: llama-3.2-3b, engine: llamacpp } workers: - { node: node-c, gpu: 0, vramBudgetGb: 6 } - { node: node-c, gpu: 0, vramBudgetGb: 6 } ``` 3. **Preview it** Put the plan in a create body and `POST` it to `/api/v1/endpoints/preview` ([Create](https://opod.io/docs/control-plane-endpoints/create/#from-the-api)). Read `claims` (the cards it would take) and, for `auto`, `plan.resolved.why` (each rung of the ladder and why it was chosen or rejected). 4. **Create it** `POST` the same body to `/api/v1/endpoints`. The claim appears in the ledger at once. ## Check it worked ```bash curl -s -H "$H" https://cp.example.com/api/v1/capacity/ledger \ | jq -c '.nodes[] | {name, class, freeWhole, freeSharedGb, holders: [.holders[]?.workload]}' # {"name":"node-c","class":"shared","freeWhole":0,"freeSharedGb":12,"holders":["ep_…"]} ``` A good answer lists the endpoint's id (`ep_…`) under `holders` on the node from Preview's `claims`. Each node's `devices[]` carries the per-card numbers: `totalGb`, `usedGb`, `externalGb`, `sharedGb`, `freeGb`. In the console, **Capacity ledger** shows the claim on that card, and **Machines** shows the worker on that machine. ## If it fails | Code | Cause | Fix | | ----------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `E-FIT` | the plan does not fit; `details` carries the measured numbers | see [What `E-FIT` says](#what-e-fit-says) | | `E-AUTO-NOFIT` | no rung of the auto ladder fits | read `details`: the need, the free GPUs, the largest card and every rejection | | `E-AUTO-SHAPE` | an auto plan names a node, a split, gangs or several workers | remove them, or use `placement: explicit` | | `E-SHARED-VENDOR` | a shared plan on a card that is not NVIDIA | `colocation: dedicated` | | `E-NODE-CORDONED`, `E-NODE-TAINTED` | the named node is cordoned or tainted | uncordon it, set the toleration it names, or name another node | | `E-TELEMETRY-WARMING` (0.3.0) | the control plane just started and has not read a card yet | retry after `details.retryAfterS` | | `E-LICENCE`, `E-QUOTA` | the licence or the team's quota is full | a larger licence, a higher quota, or free a GPU | | `E-NO-ENGINE` | no worker image for that engine on that node's vendor | another engine; the message lists the ones that have an image. From 0.3.2, `details.missingImage` (`"trtllm/nvidia"`) says the engine runs there and only this install's `engineImages` value is unset: set it, or pick another engine | ## Measured, never assumed A probe pod per vendor (`opodcp-gpu-telemetry-*`) reads every card every 20 s ([where each vendor's number comes from](https://opod.io/docs/control-plane-endpoints/mixed-silicon/#how-each-vendor-is-measured)) and the control plane collects the reading (pushed in 0.3.6; from the release after 0.3.6, read by every replica from each probe): total and used memory, the memory the driver reserves, utilisation, temperature, power, links between cards, the nearest RDMA NIC, and health (uncorrected ECC errors, throttle reasons). Host facts come too: kernel, `/dev/shm`, the model cache's size and free space, huge pages, NUMA nodes, NICs. - A card nobody measured is not judged for a shared budget; a plan that needs one waits or is refused. - A card with uncorrected ECC errors or an active hardware slowdown is fenced for **new** placements and raises `gpu.unhealthy`. Nothing running is killed. - A card with at least 1 GiB in use and nothing of ours on it is **held outside**: it is not free in the ledger, and the alert `gpu.held-outside` names the node and card, never what runs there. New in 0.3.0. - Just after the control plane starts, a plan that meets an unread card gets `E-TELEMETRY-WARMING` with a retry time (`details.retryAfterS`), not a "full cell" refusal. New in 0.3.0. From 0.3.2 the same answer also covers a dedicated llama.cpp worker whose card has not been read yet: it is refused with a retry time instead of being stored at the 8,192-token default, so it is filled once the card is read. ## Dedicated and shared | Aspect | `colocation: dedicated` (default) | `colocation: shared` | | -------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | A worker holds | one or more whole cards, through the device plugin | `vramBudgetGb` on one card, pinned by index | | Judged against | free whole cards | the card's measured free memory, best fit | | Isolation | the device plugin's | none: workers on one card share its memory and fault domain | | Compute | the card's, for this worker alone | one card's, taken in turns: when both endpoints are busy, TTFT and TPOT can rise for both. In the release after 0.3.6 Preview, create and the endpoint page say so (advisory `card-shared`, naming the other endpoint) | | Vendors | all | NVIDIA only (`E-SHARED-VENDOR` elsewhere) | A node hosts one class at a time. From 0.3.0, a dedicated llama.cpp worker fills its card with KV slots, and a shared worker that states no budget is sized from the model's weights plus a KV pool of 1.15 × its maximum context plus the engine's overhead, rounded up to whole GB. In 0.2.1 every shared worker needs a `vramBudgetGb`. A stated budget wins. A shared worker cannot be tensor parallel: it is one card. A shared worker on a node with no GPU is refused: a CPU worker is dedicated to its node. **Figure: The VRAM ledger: place a model.** Five GPU cards as bars of measured memory: our workers, outside use, driver reserve, free memory, and where the selected model would go. Shared placement is NVIDIA only. The interactive figure is on the web page: ## Explicit placement The plan names what it wants; the placer fills in only what is left empty. You may name a `node` and `gpu`, leave them empty, or mix. A plan that names a node is judged on that node only: - `E-NODE-CORDONED` (uncordon it or name another node), `E-NODE-TAINTED` with the toleration to set, `E-VENDOR-UNKNOWN` for a vendor label no driver in this build knows. A node that is not in the cell is refused `400`. - `E-FIT` when it does not fit, with the measured numbers and alternatives. - `E-TP-DOMAIN` when a tensor group is wider than the node's allocatable devices; `E-TP-HEADS` when the tensor degree does not divide the model's attention heads, or neither divides nor is a multiple of its KV heads. - `E-IMAGE-FAMILY` when the worker image's compiled code does not cover the node's GPU family. Unknown families never refuse. In 0.3.0 the check reads the image for the engine on that vendor (`plan.images` or the chart's), not a worker's own `image`; from 0.3.2 it reads the image the worker actually runs, override included. - `E-NO-ENGINE` when no worker image is declared and configured for the engine on that node's vendor; the message lists the engines that have one. On a GPU-less node only llama.cpp runs. - `E-NO-ACCELERATOR` when the cell has no node with a GPU or accelerator at all, for an engine that needs one. - `E-DISK` when the node's model cache has no room for weights it does not hold yet. Tensor parallelism **may cross nodes**. It is allowed and slow on ordinary Ethernet: every token's all-reduce crosses the wire. The plan carries an advisory that says what it costs. ### What `E-FIT` says `E-FIT` carries the numbers in `details`. Its cases: | Case | Fix | | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | | a node would host both dedicated and shared workers (one class per node) | another node, or the other class | | a node is overcommitted: plans need more whole cards than it has allocatable, cards held outside counted | fewer workers there, or another node | | a card has no measured VRAM, so a shared budget cannot be judged | wait for its probe, or check the telemetry DaemonSet | | a card is over budget: shared plans reserve more than it measures | a smaller `vramBudgetGb`, or another card | | a budget is larger than the card | a smaller budget | | a time-sliced node presents no whole cards, or no free turns | a node in budget mode | | one request of the workload's length does not fit beside the weights, or the workload needs more workers than one card holds | a shorter context, fewer requests at once, or more workers | ## Automatic placement `placement: auto` takes the model (and optionally an engine, a colocation class and one template worker with a budget, flags or replicas, but no node) and resolves the shape by a fixed ladder, cheapest first: ```text engine the plan's engine → the catalog's → llama.cpp size the catalog's VRAM hint → weights + 20 % → one whole GPU when unknown one-gpu the smallest measured card that holds it whole one-node tensor parallel across the fastest island of cards in one node across-nodes pipeline parallel across nodes of one vendor; every vendor's nodes together only for llama.cpp RPC, and only when no single vendor's pool fits cpu llama.cpp on a GPU-less node, when the cell has no accelerator at all ``` A `shared` auto plan has one rung instead of the last four: `shared`, the best-fit card for its budget against the measured free VRAM. The ladder never chooses tensor parallel across nodes; state that shape explicitly. Verified paths only break ties inside one rung. The answer is written into `workers` or `shardGroups` exactly as an explicit plan would state it, judged by the same rules, and **pinned** in `plan.resolved`: ```json { "path": "…", "shape": "worker", "engine": "llamacpp", "nodes": ["node-a"], "needGb": 6, "why": [ { "step": "one-gpu", "chosen": "node-a/0", "reason": "…", "rejected": ["…"] } ], "verified": "none", "resolvedAt": "…", "revision": 1 } ``` `verified` is `none`, `integration` or `fleet`. A node that joins later never re-shapes a running endpoint. **Only a rollout re-resolves.** Refusals: `E-AUTO-SHAPE` (an auto plan that names a node, a split, gangs or several workers), `E-AUTO-SIZE` (a shared plan with nothing to size the model), `E-AUTO-NOFIT` (no rung fits: the need, the free GPUs, the largest card, every rejection, and alternatives), `E-UNVERIFIED` (with `verifiedOnly`, the rung found an unproven path). **Figure: placement: auto — the ladder, cheapest rung first.** An empty illustrative cell of four nodes and their cards. Pick an engine and the model's weights; each rung (one-gpu, one-node, across-nodes, cpu) says why it fits or not, and the cards the resolved shape uses are highlighted. The interactive figure is on the web page: ## Spread The placer keeps one endpoint's workers and gangs on different machines: a gang's own siblings first, then the endpoint's other workers. It stacks two on one machine only when no other machine of the right class has a free card, and says so (`workers.stacked`). Autoscaled workers follow the same rule. With two serving units or more, the workers get a PodDisruptionBudget of `maxUnavailable: 1`. Spread and the budget are new in 0.3.0. ## Licence and quota The same judgement applies the licence ceiling (`E-LICENCE`) and the team's GPU quota (`E-QUOTA`). Both gate **new** placements only. A team quota counts a dedicated worker as one card and a team's shared workers on one card as that one card. `E-LICENCE` names which line it crossed: the cell would hold more GPUs than the fleet licence allows, a card is outside the licensed set of the cell, or a node has fewer licensed cards free than the plan asks. `details` carries the tier, the licensed and the held counts. See [Licensing](https://opod.io/docs/control-plane/licensing/). ```bash curl -s -H "$H" -X PUT https://cp.example.com/api/v1/team-quotas \ -H 'Content-Type: application/json' -d '[{"team":"search","gpus":8}]' ``` `GET /api/v1/team-quotas` reads them; a team-scoped caller sees only their team. Setting them needs admin. ## Time-sliced machines Time-slicing is new in 0.3.0. **Machines → Time-slice this machine** (or `POST /api/v1/nodes/{name}/sharing {"mode":"timeslice"}`, admin) makes NVIDIA's plugin present each card of that machine as 2, 4 or 8 turns (`nvidia.com/gpu.shared`). `slices` sets the turns per card; left out, the control plane picks the one suggested for the card. Only the counts in `substrate.nvidiaDevicePlugin.timeSlicing.choices` are accepted. `{"mode":"budget"}` switches the machine back. Shared workers there take one turn each and may budget at most one turn's worth of VRAM (`E-SLICE-BUDGET`). It gives scheduling, not capacity: memory is not isolated, and on a busy card more turns give less total output. | Refusal | Cause | | ------------------ | --------------------------------------------------------------------------------------------------------- | | `E-SHARING-BUSY` | the machine runs work the switch would strand; move or delete it first (**Machines → Evacuate** for ours) | | `E-SHARING-VENDOR` | the machine is not NVIDIA | | `E-NODE-UNKNOWN` | no node of that name | A time-sliced machine whose plugin presents no turns yet refuses new shared workers until it does. **(planned)** Hard isolation with NVIDIA MIG (a worker that asks for `isolation: hard` gets one MIG profile, and the ledger counts profiles instead of cards) is designed and not built: no plan field takes it yet. Today the placer only leaves a resource advertised as `nvidia.com/mig-` out of a node's whole-card count, so a dedicated worker is never placed on a MIG slice. ## Read the ledger | Route | Answers | | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | | `GET /api/v1/capacity/ledger` | per node and card: measured, used, outside use, shared budgets, free, holders, fenced, placeable | | `GET /api/v1/capacity/fits?model=` | how many more of a model would be placed now, per colocation class, and why the next is refused | | `GET /api/v1/nodes` | each node with its cards, holders, taints, host facts and health | | `GET /api/v1/compat/resolve?vendor=&engine=&model=&tensor=` | whether a shape runs on this silicon with this engine | | `GET /api/v1/compat/verified` | the paths this control plane has proven | The console's **Capacity ledger** page draws the first; **Machines** draws the third. --- title: "Gangs and parallelism" description: "Split one model across several pods and machines with shard groups — pipeline, tensor and expert parallelism, LeaderWorkerSets, RDMA fabrics and the fabric proof." url: "https://opod.io/docs/control-plane-endpoints/gangs/" markdown_url: "https://opod.io/docs/control-plane-endpoints/gangs.md" section: "Endpoints" last_updated: "2026-10-31" --- # Gangs and parallelism > Split one model across several pods and machines with shard groups — pipeline, tensor and expert parallelism, LeaderWorkerSets, RDMA fabrics and the fabric proof. A **gang** is one engine instance split across several pods, for a model too big for one card or one machine. The plan states it in `shardGroups[]`. The gang's **head** is the part that coordinates it; it is a worker rank, never the leader. | Engine | How it joins parts | Across vendors | | --------- | -------------------------------- | ----------------------------- | | llama.cpp | RPC servers behind a coordinator | yes: the only engine that can | | vLLM | Ray ranks launched by core | no (`E-GANG-VENDOR`) | | SGLang | its own distributed launcher | no (`E-GANG-VENDOR`) | Any other engine is refused `E-ENGINE-NO-GANG`, with the single-node shape (`parallelism.tensor`) as the alternative. Tenstorrent gangs are not placed (`E-TT-GANG`). A gang's engine is the plan's engine: a `shardGroups[].engine` that differs from `model.engine` is refused. **Figure: Splitting one model across cards and machines.** One model split by tensor parallel and pipeline parallel across cards and machines; each moving dot is one token's traffic on that link, and the verdict says what the split costs on the network. The interactive figure is on the web page: ## In short When a model does not fit on one card, split it. Inside one machine, set `parallelism.tensor` on a worker: no gang is needed and it is the fastest split. Across machines, write a gang in `shardGroups[]`: a list of parts, one per machine, that together run one copy of the model. The control plane starts the parts together and the leader routes to the gang as one worker. ## When you need it - The model's weights and KV cache do not fit in one card: use `parallelism.tensor` on one machine. - They do not fit in one machine: use a pipeline gang across machines. - You want to use cards of two vendors for one model: a llama.cpp gang (capacity, not speed). - You serve a mixture-of-experts model on vLLM: `parallelism.expert: true`. ## Do it 1. **Try one machine first** ```yaml workers: - { node: node-a, engine: vllm, parallelism: { tensor: 2 } } ``` Preview it. If it fits, stop here. 2. **Write a gang across two machines** ```yaml placement: explicit model: { id: qwen2.5-32b-instruct, engine: vllm } colocation: dedicated workers: [] shardGroups: - id: g0 head: node-a parallelism: { pipeline: 2 } parts: - { node: node-a } - { node: node-b } ``` Each part is one pod on its node. `pipeline: 2` splits the layers between the two parts; `flags.pp_layer_partition` sets the split by hand. 3. **Preview it** Put the plan in a create body and `POST` it to `/api/v1/endpoints/preview`. Expect one claim per part, each with `part: "g0"`, and advisories that state the cost of crossing machines. 4. **Create it, or roll it out** Create the endpoint with the same body, or post the plan to `POST /api/v1/endpoints/{id}/rollouts` for an existing one. A rollout also runs the fabric proof between the two machines. ## Check it worked ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//status | jq '{phase, gangs}' curl -s -H "$H" https://cp.example.com/api/v1/endpoints//shards | jq . ``` A good answer: `phase` is `serving`, `gangs[0].render` is `leaderworkerset` (or `per-part`, with the reason), and the leader's gang row for `g0` is ready. In the console the **Shards & parallelism** page shows each part on its node. ## If it fails | Code | Cause | Fix | | ------------------------------ | --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | | `E-ENGINE-NO-GANG` | the engine cannot form a gang | `parallelism.tensor` on one machine, or llama.cpp, vLLM or SGLang | | `E-GANG-VENDOR` | vLLM or SGLang parts on different vendors | one vendor, or llama.cpp | | `E-GANG-HEAD` | `head` is not one of the parts' nodes | name a part's node, or leave it empty | | `E-GANG-NAME` | the gang `id` is longer than 28 characters | a shorter id | | `E-TP-DOMAIN` | `devices` per part is more than the node has | fewer `devices`, or a bigger node | | `E-PP-LAYERS` | more pipeline stages than the model has layers | fewer parts | | `E-GANG-SUBSTRATE` | the LeaderWorkerSet controller is down, or parts are neither one per machine nor all on one machine | restore it with `helm upgrade --reset-then-reuse-values`, or reshape the gang | | `E-GANG-MULTI` | several active gangs on a leader without `shard_groups` | roll onto a newer leader image, or one gang | | The gang runs but never serves | the coordinator did not form | **Shards → Re-form**, or `POST …/shards/reform` | ## Inside one machine first Tensor parallelism inside one machine is the fastest split. It needs no gang: set `parallelism.tensor` on a worker. ```yaml workers: - { node: node-a, engine: vllm, parallelism: { tensor: 2 } } ``` `tensor` must be a power of two the node can hold and, when the catalog records the model's architecture, divide its attention heads (`E-TP-HEADS`). llama.cpp does not split by tensor inside one worker (`E-SHAPE`). ## A pipeline gang across machines ```yaml shardGroups: - id: g0 engine: vllm head: node-a parallelism: { pipeline: 2 } parts: - { node: node-a, vramBudgetGb: 20 } - { node: node-b, vramBudgetGb: 20 } ``` | Field | Meaning | | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | the gang's id; at most 28 characters, because Kubernetes caps the label it stamps on every gang pod (`E-GANG-NAME`) | | `engine` | defaults to the model's engine; must equal it | | `head` | the node of the part that coordinates; must be one of the parts' nodes (`E-GANG-HEAD`); default the first part | | `parallelism.pipeline` | equals the number of parts; at most the model's layers (`E-PP-LAYERS`) | | `parallelism.tensor` | devices per part, uniform | | `parts[]` | `node`, `gpu`, `vramBudgetGb`, `devices`; an empty `node` lets the placer choose a distinct node per part. A gang needs at least one part | | `parts[].devices` | GPUs the part holds on its node (default 1), the same on every part; dedicated only. More than the node advertises is `E-TP-DOMAIN` | | `parts[].vramBudgetGb` | required on every part of a `shared` plan | | `flags` | engine flags for the gang, for example `ctx`, `pp_layer_partition`, `tensor_split` (one list over every part). An SGLang gang takes them from core v0.4.6 (`max_model_len`, `kv_cache_dtype`, `mem_fraction_static`, `extra`, on every rank), which the chart pins in the release after 0.3.6; up to v0.4.5 its ranks started with none of them | | `kvOffload` | a CPU KV tier for a vLLM gang: `tier: cpu` and `sizeGb`, the gang's total, split over its ranks. New in 0.3.0 | | `parked` | set by the autoscaler when a gang is parked | | `gaveUp` | set when the gang's leader gave up forming it after three failed heals: `at`, `attempts`, `code`, `reason`, `revision`. The gang stays parked and the autoscaler never wakes it; a rollout, or an edit that removes the field, clears it. New in 0.3.0 | | `shape` | set by the autoscaler on a gang it grew from a growth shape. New in 0.3.0 | A tensor group across the parts of a gang needs an engine whose tensor width is the gang's (vLLM over Ray, SGLang's launcher); for llama.cpp it is `E-SHAPE`. Several gangs of one model under one leader are allowed: the leader routes to the least loaded ready gang. In core v0.4.6 that choice is load alone: a conversation's pin, the prefix pin and the route token are not read for a gang. From core v0.4.7 gangs are ranked like workers: a later turn of a conversation, or a prompt whose lead a gang served, stays on that gang while it has a free slot. That needs a leader that advertises `shard_groups`; on an older leader a plan with several active gangs is refused `E-GANG-MULTI` (roll the endpoint onto a newer leader image, park the extra gangs, or use one endpoint per gang). A gang keeps the model's full context window by default. A gang that cannot hold it fails at start; set `shardGroups[].flags.ctx`. A gang parked by hand, on a plan whose floor keeps it up, is refused `E-PARK-FLOOR`. ## Mixed vendors Only llama.cpp RPC spans vendors. A mixed gang is capacity, not throughput: activations cross TCP on every hop and decode is bounded by the slowest part. Automatic placement builds one only when no single vendor's pool can hold the model. Preview marks every mixed gang with an advisory. What is proven, and every other vendor rule, is on [Mixed GPU vendors](https://opod.io/docs/control-plane-endpoints/mixed-silicon/). ## How a gang lands With the LeaderWorkerSet controller installed (`substrate.leaderWorkerSet.enabled=true`, the default), a gang whose parts share one pod template lands as **one LeaderWorkerSet**: atomic landing, and the group is recreated together when a part dies. A gang whose parts need different templates (parts on different vendors) lands as one Deployment per part. `status.gangs[].render` says which (`leaderworkerset` or `per-part`), and why. If the chart enabled the controller but it is down, gang plans of several pods are refused `E-GANG-SUBSTRATE` until `helm upgrade --reset-then-reuse-values` restores it. Existing gangs keep serving. `E-GANG-SUBSTRATE` also refuses a gang whose parts are neither one per machine nor all on one machine: split it into one gang per machine, or put every part on one. To re-form a gang whose parts run but whose coordinator does not: **Shards → Re-form**, `POST /api/v1/endpoints/{id}/shards/reform`, or `opodcp endpoint reform NAME` (the command is new in 0.3.0). The route answers `{"reformed": true, "shards": [ … ]}`. `GET /api/v1/endpoints/{id}/shards` shows the leader's own gang rows and their live status; `GET /api/v1/endpoints/{id}/registry` shows the leader's worker rows. ## Expert parallelism For a mixture-of-experts model on vLLM, `parallelism.expert: true` spreads the experts over every device of the gang; each device is one attention data-parallel rank. `data` is parts × devices (derived when omitted), and `tensor` and `pipeline` are 1. Expert parallelism is a gang shape only: on a worker row it is `E-SHAPE`. ```yaml shardGroups: - id: g0 engine: vllm parallelism: { expert: true } parts: - { node: node-a, devices: 2 } - { node: node-a, devices: 2 } ``` Expert parallelism is partly proven: a two-part expert gang across machines has formed and answered, while an expert gang inside one multi-card machine has not been proven yet. Refused by name: `E-EP-ENGINE` (vLLM only), `E-EP-DENSE` (the catalog records no experts), `E-EP-SHARED` (every rank claims whole cards), `E-EP-DOMAIN` (parts on more than one machine with no passed fabric proof that measured all-to-all between them). ## Fabrics Between machines a gang rides the pod network over Ethernet unless you give it an RDMA fabric: | Value | Meaning | | ------------------------------------------------------ | ------------------------------------------------------------------------------------- | | `substrate.rdmaDevicePlugin.enabled` | install the RDMA shared device plugin; fill its `config` with your RDMA NICs | | `substrate.multus.enabled` | install Multus (thick) so a gang pod gets the fabric interface as a second attachment | | `fabric.rdmaResource` | the extended resource a gang part requests (default `rdma/hca_shared_devices_a`) | | `fabric.networkAttachment` | the NetworkAttachmentDefinition the interface comes from (default `opodcp-rdma`) | | `fabric.networkAttachmentDefinition.create`, `.config` | render that definition from your CNI config | | `fabric.hostNetwork` | gang pods on the host network instead; for cells with at most one worker per node | An RDMA gang adds `IPC_LOCK`, which the Pod Security `baseline` profile does not allow. **A link nobody read is `unknown`, not "none".** The probe reads how two cards are linked (NVLink, XGMI, a PCIe distance) from the vendor's tool. When it cannot (no tool, a driver that answers nothing, a VM that hides the fabric), the link is `unknown`. The placer may prefer a link it has read, and never requires one it has not. Until a fabric proof passes, two machines count as two domains, whatever their NICs are. An advisory that names a link says which case it is: read and fast, read and slow, or not read. ### The fabric proof During a rollout, every gang whose parts sit on more than one machine runs `all_reduce_perf` across its own parts and must clear the bandwidth floor (`GET`/`PUT /api/v1/fabric-policy`, `bandwidthFloorGBps`, default 100). A passed proof makes those machines an RDMA **domain**. A gang inside one machine, a mixed-vendor gang, or a cell with no `engineImages.fabricProbe` image skips the step and says why. In 0.3.0 the step also runs on an endpoint's first create. ## Prefill and decode A plan can split prefill from decode: worker rows with `role: prefill` and `role: decode` become two pools under one leader, N:M. The roles come in pairs; a plan with one role only is refused. The leader hands the KV cache from prefill to decode for vLLM; it serves a request whole on a decode worker when no prefill worker takes requests, the prefill step fails, or a repetition penalty is in force. On SGLang the roles are accepted and every request is served whole. The KV handoff, the pools and the per-role budgets are new in 0.3.0. The handoff is built for vLLM on NVIDIA and proven on hardware in one shape only: both halves on one card. A pair on two cards of one machine, and the retry on another pair after a lost transfer, are not yet proven on hardware. The leader times each handoff per pair (`opod_pd_handoff_seconds`), and each worker reports the KV its engine moved and its requests waiting on a KV load (`opod_pd_transfer_*`, `opod_pd_kv_fetch_requests`), so a slow link shows apart from a busy decoder. This arrives in the core release after v0.4.8 and is not yet proven on hardware. In the release after 0.3.6 the endpoint page's KV card shows, for each decode worker, its engine's KV transfer speed in GB/s over the card's 10 s poll and its requests waiting on a KV load by stage (waiting, moving, loaded): moving high with loaded low is a slow transfer, loaded high is a busy decoder, and a figure the engine does not report reads "not reported". The autoscaler does not read them: a pair still grows as a pair. Refused: | Code | Cause | | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `E-PD-ENGINE` | the engine has no KV connector to hand a prompt's cache from prefill to decode; or a vLLM pair sits on a vendor the handoff is not proven on — every vendor but NVIDIA today, because the AMD image does not yet carry the RIXL runtime (0.3.0) | | `E-PD-DOMAIN` | a half with no node, or a pair across nodes with no passed fabric proof between them | | `E-PD-VENDOR` | the halves sit on different vendors (0.3.0) | | `E-PD-TP` | neither half's tensor degree divides the other's (0.3.0) | | `E-PD-TIER` | a KV tier on a half that cannot take one (0.3.0) | A prefill/decode endpoint grows and shrinks by a whole pair; growth shapes do not apply to it. --- title: "Mixed GPU vendors" description: "Run NVIDIA, AMD, Intel and Tenstorrent cards in one cell — how each is measured, which engine runs where and what is proven, placement, gangs, growth and KV tiers across vendors." url: "https://opod.io/docs/control-plane-endpoints/mixed-silicon/" markdown_url: "https://opod.io/docs/control-plane-endpoints/mixed-silicon.md" section: "Endpoints" last_updated: "2026-10-31" --- # Mixed GPU vendors > Run NVIDIA, AMD, Intel and Tenstorrent cards in one cell — how each is measured, which engine runs where and what is proven, placement, gangs, growth and KV tiers across vendors. One cell may hold cards from several vendors. The control plane labels each node with its vendor, measures each card with that vendor's probe, and judges every plan against the vendor of the node it lands on. This page puts every vendor rule in one place and links to the page that has the detail. ## In short Each node gets an `opod.io/gpu-vendor` label and a probe for its vendor. A worker runs on one vendor's cards, with that vendor's image for its engine. A combination that cannot work is refused by name when the plan is written, before any pod starts. NVIDIA has every feature. The other vendors serve whole cards, with fewer engines and fewer features. One llama.cpp gang can split one model across vendors, for capacity, not speed. ## When you need it - Your machines have cards from more than one vendor, and you want to use all of them. - A model does not fit on one vendor's free cards, and the rest of the cell has room. - An endpoint is full on NVIDIA and should grow onto another vendor's cards. - A create is refused with a vendor code: `E-SHARED-VENDOR`, `E-GANG-VENDOR`, `E-NO-ENGINE`, `E-IMAGE-FAMILY`, `E-KV-OFFLOAD`, `E-PD-VENDOR`, `E-TT-*`. ## Do it 1. **See which vendor each node has** ```bash kubectl get nodes -L opod.io/gpu-vendor # NAME … GPU-VENDOR # node-a … nvidia # node-e … amd # node-f … intel # node-h … tt ``` You do not set this label. The control plane writes it from what each node advertises (see [Node labels](#node-labels-and-device-plugins)). 2. **Check that every card is measured** ```bash curl -s -H "$H" https://cp.example.com/api/v1/nodes \ | jq -c '.[] | {name, vendor, cards: [.gpuDevices[]? | {index, totalMiB, usedMiB, source}]}' ``` A card with `totalMiB` above 0 is measured. `source` says where the number came from (see [How each vendor is measured](#how-each-vendor-is-measured)). A card that reads `0` is allocated whole and cannot be shared. 3. **Ask what runs on a vendor** ```bash curl -s -H "$H" "https://cp.example.com/api/v1/compat/resolve?vendor=amd&model=qwen2.5-7b-instruct" \ | jq '{runs: [.results[] | {key, support, verified: .verified.level}], refused: [.pruned[] | {engine, why: (.pruned.reason // .advisory.reason // .support)}]}' ``` With no `engine=`, the answer lists every engine that can serve the model on that vendor (`results`), and every engine it cannot, with the reason (`pruned`). Add `engine=` for one engine, or `node=` to judge one node's facts and its configured image. 4. **Create the endpoint** Let the control plane choose the vendor and the shape: ```yaml placement: auto model: { id: qwen2.5-7b-instruct } ``` Or name a node of the vendor you want, with an engine that runs there ([Create](https://opod.io/docs/control-plane-endpoints/create/)). Preview it first: `POST /api/v1/endpoints/preview`. ## Check it worked ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//plan | jq '.resolved.why' curl -s -H "$H" https://cp.example.com/api/v1/endpoints//status | jq '{phase, gangs}' ``` A good answer: `phase` is `serving`. For `placement: auto`, `resolved.why` names each rung of the ladder and the node it chose, and every node it rejected with the reason (for example `no vllm worker image for vendor intel`). For a gang across vendors, `gangs[].render` is `per-part`. In the console, **Machines** shows each node's vendor and cards, and **Capacity ledger** shows the claim. ## If it fails | Code | Cause | Fix | | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `E-SHARED-VENDOR` | a shared (budgeted) worker, or a shared growth shape, on a card that is not NVIDIA | `colocation: dedicated`, or an NVIDIA node | | `E-NO-ENGINE` | no worker image for that engine on the node's vendor | another engine; the message lists the engines that have one | | `E-IMAGE-FAMILY` | the image is not built for this GPU family (vLLM's AMD image on Instinct, SGLang's AMD image on Radeon, vLLM's Intel image on an Arc A-series) | the engine or image that covers the family | | `E-GANG-VENDOR` | a vLLM or SGLang gang with parts on different vendors | one vendor, or llama.cpp | | `E-KV-OFFLOAD` | a KV tier on a vendor other than NVIDIA | no tier, or an NVIDIA node | | `E-PD-VENDOR` (0.3.0) | the prefill and decode halves on different vendors | both halves on one vendor | | `E-PD-ENGINE` (vendor form, 0.3.0) | a vLLM prefill/decode pair on a vendor its handoff is not proven on (every vendor but NVIDIA) | role empty for complete servers, or an NVIDIA node | | `E-GROWTH-ENGINE` (0.3.0) | a growth shape names a vendor where the engine has no image | another vendor, or drop that shape | | `E-SHARING-VENDOR` | time-slicing a machine that is not NVIDIA | none: time-slicing is NVIDIA's device plugin | | `E-VENDOR-UNKNOWN` | a node's vendor label, or a growth shape's vendor, names a vendor this build does not know | fix the label, or the shape | | `E-TT-SPEC`, `E-TT-WEIGHTS`, `E-TT-HUGEPAGES`, `E-TT-GANG` | a Tenstorrent worker without a matching model spec, weights, 1 GiB huge pages, or in a gang | see [Tenstorrent workers](https://opod.io/docs/control-plane-endpoints/models/#tenstorrent-workers) | | `E-AUTO-NOFIT` whose `details` reject a card with "VRAM not measured" | an auto plan for a sized model, and the card's size could not be read | see the Intel and Tenstorrent rows in [How each vendor is measured](#how-each-vendor-is-measured), or name the node in an explicit plan: a dedicated worker takes the card whole | ## How each vendor is measured A telemetry DaemonSet per vendor (`opodcp-gpu-telemetry-`) runs on that vendor's nodes and reports every card every 20 s. The ledger never places on an estimate and never uses a table of sizes by device id: a card whose size could not be read is **unknown**, not zero, and is allocated only whole. | Vendor | Size from | Used memory from | `source` | | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------- | | NVIDIA | `nvidia-smi`, with the driver the NVIDIA runtime injects | `nvidia-smi` | `nvidia-smi` | | AMD | the `amdgpu` driver's own sysfs attributes | the same | `amdgpu` | | Intel | the kernel's DRM memory-region query, read by the probe with `/dev/dri` mounted and the `PERFMON` capability; failing that, the PCI memory window, which is the whole card only with Resizable BAR on in the host firmware | the DRM query; without `PERFMON`, unknown (never "empty") | `drm`, `drm-size` (size only), or `pci-bar` (the window) | | Tenstorrent | the PCI memory window, where the board maps all of its DRAM (32 GB on a Blackhole p150b) | no interface reports it: the ledger counts what the control plane granted | `pci-bar` | Health readings (utilisation, temperature, power) are applied for every vendor whose driver publishes them, even when the size is unknown. Uncorrected ECC errors and throttle reasons come from `nvidia-smi`. An Intel worker always gets `ZES_ENABLE_SYSMAN=1`, which the SYCL engine needs to ask for free memory. It is needed, and not enough: on the Intel image measured on 2026-09-23 the engine still logged that it could not read free memory. A card on the bus with no kernel driver bound reads `driver: none`; the ledger reports it unusable, with the remedy (install the vendor driver, then restart the device plugin). See [Placement → Measured, never assumed](https://opod.io/docs/control-plane-endpoints/placement/#measured-never-assumed). ## What runs where `support` is what `GET /api/v1/compat/resolve` answers: `supported`, `experimental`, `delegated` (the vendor's own plugin owns the model) or `unsupported` (refused by name). **Proven** is what has served requests on that hardware through the control plane; the image table is [Images](https://opod.io/docs/core-reference/images/). | Engine | NVIDIA | AMD | Intel | Tenstorrent | | ------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | llama.cpp | supported · proven | supported (ROCm) · proven on one Radeon card, and as two gang parts on two cards of one machine | supported (SYCL) · proven on one Arc A770, and as the Intel part of mixed-vendor gangs (with NVIDIA; with NVIDIA and AMD). An all-Intel gang needs an image built from core `e763153` (`GGML_SYCL_ENABLE_OPT=0` on the rpc-server), which no published image carries yet | unsupported | | vLLM | supported · proven, single card and pipeline gangs across machines | supported (ROCm) · proven on one Radeon card. Tensor parallel is refused (`E-TP-DOMAIN`) in 0.3.0: on two Radeon RX 7900 XTX cards it answered wrong. The host's amdgpu driver reported a cache-line size of 0, and ROCm 10.0.0 and 10.1.0 then fall back to a value that breaks the all-gather vLLM uses for its logits ([ROCm/rocm-systems#14886](https://github.com/ROCm/rocm-systems/issues/14886)). AMD fixed the fallback in ROCm's source ([#11617](https://github.com/ROCm/rocm-systems/pull/11617)); no released ROCm has it yet. On 0.2.1 the plan is accepted and the endpoint answers wrong. From 0.3.2 a pipeline gang is refused the same way: two Radeon cards in pipeline 2 faulted in RCCL's setup, and with P2P off the first request hung | experimental (XPU): Xe2 and newer only; an Arc A-series is `E-IMAGE-FAMILY`. No Xe2 card has served yet | delegated (tt-metal) · proven on one Blackhole chip, and four chips as one worker (`parallelism.tensor: 4`) | | SGLang | supported · proven | experimental: the image is Instinct only (Radeon is `E-IMAGE-FAMILY`); not yet proven | experimental (XPU) in 0.3.0 and 0.3.2, `supported` from 0.3.3; on 0.2.1 there is no image (`E-NO-ENGINE`). Proven through the control plane on 2026-11-07 with the image 0.3.2 pins: one Arc A770, and a tensor-parallel gang of 2 across two A770 machines. No Xe2 card has served yet. A gang must set `parallelism.tensor`: pipeline is not declared on Intel (`E-TP-DOMAIN`) | experimental: no image (`E-NO-ENGINE`) | | TensorRT-LLM | experimental · proven on one card; one node only | unsupported | unsupported | unsupported | A GPU-less node runs only llama.cpp's CPU build. It is meant for tests, not for serving. `GET /api/v1/compat/verified` lists the exact paths this control plane has proven. With `verifiedOnly: true`, an auto plan refuses a path that is not on that list (`E-UNVERIFIED`). ## Placement across vendors | Feature | NVIDIA | AMD, Intel, Tenstorrent | | ------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------- | | Dedicated workers (whole cards) | yes | yes | | Shared workers (a budget on one card) | yes | no: `E-SHARED-VENDOR` | | Time-sliced machines | yes | no: `E-SHARING-VENDOR` | | Tensor parallel inside one machine | yes | AMD and Intel where the engine allows it (not vLLM on AMD, above); Tenstorrent through the vendor plugin | **Why shared is NVIDIA only.** A shared worker is pinned to a card by index, not handed the card by the device plugin. Only NVIDIA's container runtime gives a container a card it did not allocate. On AMD, Intel and Tenstorrent the device files are absent, and an engine such as llama.cpp falls back to the CPU without an error, while the ledger says the card is held. **Automatic placement** (`placement: auto`, [Placement](https://opod.io/docs/control-plane-endpoints/placement/#automatic-placement)): - It considers only nodes whose vendor has a worker image for the engine. Every other node is rejected with that reason in `resolved.why`. - `one-gpu` takes the smallest measured card of **any** vendor that holds the model whole. A card with no measured size is rejected when the model is sized. - `across-nodes` tries one vendor's nodes at a time. It joins every vendor's nodes in one gang only for llama.cpp, and only when no single vendor's pool can hold the model. - A node that joins later never re-shapes a running endpoint; only a rollout re-resolves. ## One model across vendors A llama.cpp gang is the only gang that may span vendors: each part runs its own vendor's `rpc-server`, and only activations cross the network. A vLLM or SGLang gang across vendors is refused `E-GANG-VENDOR`, because their ranks join through one vendor's library. ```yaml placement: explicit model: { id: qwen2.5-32b-instruct, engine: llamacpp } colocation: dedicated workers: [] shardGroups: - id: g0 head: node-a parallelism: { pipeline: 3 } parts: - { node: node-a } # NVIDIA - { node: node-e } # AMD - { node: node-f } # Intel ``` - **Capacity, not speed.** Activations cross TCP on every hop, and decode runs at the pace of the slowest part. Preview marks every mixed gang with an advisory. - **Dedicated only.** Each part holds whole cards, so a mixed gang cannot be `shared`. - **Each part needs an image with the RPC pair.** The published llama.cpp images carry it and say so with the label `io.opod.llamacpp.rpc=true`; the control plane reads that label. An image without it is refused for a gang part on AMD and Intel. - **It lands one Deployment per part**, not as a LeaderWorkerSet, because the parts need different images. So the embedded loop scales it, never KEDA, and the fabric proof skips it. - **Proof.** A two-part NVIDIA + Intel gang (2026-09-25), a two-part NVIDIA + AMD gang (2026-09-29) and a three-part NVIDIA + AMD + Intel gang (2026-09-29) served through the control plane on real cards. A gang of Intel parts only did not form on the published Intel image; a fix in the image's `rpc-server` start-up has served once and is not yet on a published image. See [Gangs → Mixed vendors](https://opod.io/docs/control-plane-endpoints/gangs/#mixed-vendors). ## Scaling across vendors - **Without growth shapes, an endpoint grows only on the vendor of its template worker.** Another vendor needs another image, budget and flags. So an endpoint whose vendor is full holds at its ceiling (`autoscale.no-capacity`) while another vendor has free cards. The same holds for the KEDA capacity grant, and (from 0.3.0) for a copy of a gang. - **Growth shapes** (`autoscale.growth`, 0.3.0) name, in order, the vendors an endpoint may grow onto, each with its own budget, flags and image. Each shape is judged when the plan is written: `E-GROWTH-ENGINE` for a vendor without an image for the engine, `E-SHARED-VENDOR` for a shared shape off NVIDIA, the advisory `growth-no-node` for a vendor with no node yet. A scale-in parks the last shape first. One engine only: a shape cannot change the engine. A plan with growth shapes is scaled by the embedded loop, never by KEDA. See [Autoscaling → Growing onto other hardware](https://opod.io/docs/control-plane-endpoints/autoscaling/#growing-onto-other-hardware). - **Proof.** Worker growth from NVIDIA onto Intel cards, and its scale-in in shape order, ran on real cards (2026-10-28). Growth onto AMD has not been run. A gang shape onto Intel was placed and parked in order, and did not serve, for the Intel-gang reason in the section above. - The sleep tier is vLLM on NVIDIA only. ## Prefill/decode and KV tiers - **Prefill/decode** needs an engine with a KV connector, vLLM or SGLang (`E-PD-ENGINE` elsewhere), and both halves must sit on one vendor (`E-PD-VENDOR`, 0.3.0). Of the shipped vLLM images, only the NVIDIA one carries the NIXL runtime that hands the KV cache from prefill to decode, so in 0.3.0 a vLLM pair on any other vendor is refused `E-PD-ENGINE`, naming the vendor. The handoff has served on one NVIDIA card shared by both halves; a pair on two cards is not yet proven on any vendor. See [Gangs → Prefill and decode](https://opod.io/docs/control-plane-endpoints/gangs/#prefill-and-decode). - **KV tiers** (CPU, disk, auto) are proven on NVIDIA only in 0.3.0 and refused `E-KV-OFFLOAD` on every other vendor, naming it. From 0.3.2, vLLM's tiers are also open on AMD. See [KV tiers → Vendors](https://opod.io/docs/control-plane-endpoints/kv-tiers/#vendors). ## Node labels and device plugins - **The control plane writes `opod.io/gpu-vendor`** on every node, on every reconcile, from the device plugin's resources (`nvidia.com/gpu`, `amd.com/gpu`, `gpu.intel.com/i915`, `gpu.intel.com/xe`, `tenstorrent.com/*`) and from a cloud's accelerator labels, which a managed node carries before any device plugin runs. It corrects a label that disagrees with what the node advertises. An accelerator it cannot identify is left alone and reported, never written as `none`. It writes only `opod.io/*` labels. - **Without the label nothing is measured**: the telemetry DaemonSets select nodes by it, so an unlabelled cluster has no probe, no measured card, and every create is `E-FIT`. Check with `kubectl get nodes -L opod.io/gpu-vendor`. - **Device plugins.** The chart installs each vendor's device plugin on the nodes labelled for it; turn one off with `substrate.DevicePlugin.enabled=false` when the cluster already runs it. See [What the default release installs](https://opod.io/docs/control-plane-install/#what-the-default-release-installs). - `opodcp infra up` sets the label itself on machines it installs ([Bare metal](https://opod.io/docs/control-plane-install/bare-metal/)). ## Tenstorrent - tt-metal's vLLM starts from a vendor **model spec** and loads its model at start-up. A worker names the spec's ConfigMap in `workers[].modelSpec`, and the node needs 1 GiB huge pages and the weights in its cache. See [Tenstorrent workers](https://opod.io/docs/control-plane-endpoints/models/#tenstorrent-workers). - One worker may drive several chips of one machine as one tensor group (`parallelism.tensor: 4`). A gang is refused `E-TT-GANG`. - The ledger knows each board's size, but no interface reports what is in use: used memory on a board is what the control plane granted, and the console says so. --- title: "Autoscaling" description: "Scale each endpoint on in-flight requests, queue, KV pressure and time to first token; sleep engines, scale to zero, grow onto other vendors, and hand scaling to KEDA." url: "https://opod.io/docs/control-plane-endpoints/autoscaling/" markdown_url: "https://opod.io/docs/control-plane-endpoints/autoscaling.md" section: "Endpoints" last_updated: "2026-10-31" --- # Autoscaling > Scale each endpoint on in-flight requests, queue, KV pressure and time to first token; sleep engines, scale to zero, grow onto other vendors, and hand scaling to KEDA. Each endpoint scales by its own `plan.autoscale`. The control plane reads each leader's `/loadz` every 10 s and adds or parks workers (or whole gangs) inside `floor` and `max`. With `max: 0` the endpoint's size is fixed: the planner then writes `floor` and `max` as the number of workers the plan runs. ```yaml autoscale: floor: 1 # minimum workers; 0 = may scale to zero max: 4 # maximum; 0 = autoscaling off unit: workers # workers | gangs targetInflight: 2 # in-flight requests one worker carries before another is added idleSeconds: 120 # demand below the current size this long parks one worker kvPressurePct: 85 # grow when the busiest worker's KV cache reaches this percent ttftBudgetMs: 0 # grow when the leader's p95 time to first token is above this; 0 = none sleepSeconds: 0 # idle seconds before the engine sleeps (vLLM); 0 = no sleep tier sleepCard: keep # keep | free, for shared plans with a sleep tier scaleIn: drain # drain | now drainSeconds: 120 # how long a stopping worker may finish its requests wakeSloMs: 0 # advisory wake target for the stats; gates nothing grantHeadroom: 1 # workers reserved beyond what runs, for an external scaler ``` **Figure: Paid GPUs vs. the GPUs traffic needs, over one day.** An illustrative model, not a measurement: reserved GPUs, autoscaled GPUs and demand over 24 hours, with the GPU-hours autoscaling saves for a chosen number of busy hours per day. The interactive figure is on the web page: ## In short Autoscaling adds a worker when an endpoint is busy and parks one when it is quiet, always between `floor` and `max`. The control plane reads the leader's load every 10 s and decides. With `floor: 0` an idle endpoint frees its GPUs, and the next request wakes it. With `max: 0` the endpoint keeps a fixed size. ## When you need it - Traffic changes through the day, and you do not want to hold GPUs for the peak all the time. - A test or batch endpoint is idle for hours: let it scale to zero. - Requests queue, or time to first token is too long, at busy moments. - You want scaling to keep working while the control plane is down: hand it to KEDA. ## Do it 1. **Choose the bounds** This example keeps one worker, grows to four, and parks a worker after 5 minutes of low demand: ```yaml autoscale: { floor: 1, max: 4, unit: workers, targetInflight: 4, idleSeconds: 300 } ``` 2. **Write it into the plan** ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//plan \ | jq '.autoscale += {floor: 1, max: 4, unit: "workers", targetInflight: 4, idleSeconds: 300}' > new.json curl -s -H "$H" -H 'Content-Type: application/json' -X PUT \ https://cp.example.com/api/v1/endpoints//plan -d @new.json | jq .autoscale ``` From 0.3.0 the CLI changes only the fields you name: ```bash opodcp endpoint autoscale --floor 1 --max 4 --target-inflight 4 --idle 300 chat ``` 3. **Drive some load** Send more requests at once than `floor × targetInflight` for a minute, for example with your load tool or the `autoscale` block of a scenario ([Create → From the CLI](https://opod.io/docs/control-plane-endpoints/create/#from-the-cli)). 4. **Watch it decide** ```bash watch -n 10 "curl -s -H '$H' https://cp.example.com/api/v1/endpoints//status | jq -c '{phase, counts, scaling}'" ``` ## Check it worked A good answer: `scaling.by` is `embedded` (or `keda`), `counts.ready` rises above `floor` under load, and it falls back one worker at a time after `idleSeconds` of quiet. `scaling.ceiling` says the most the endpoint can reach now. In the console, the **Autoscale** page shows each endpoint's owner, bounds and current size. ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//autoscale/stats | jq '{wakes, lastWakeMs, savedGpuHours}' ``` ## If it fails | Symptom or code | Cause | Fix | | --------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | | It never grows past one worker | demand stays under `targetInflight` per worker, or `max` is 0 | a lower `targetInflight`, or a `max` above `floor` | | `scaling.ceiling` is below `max`; alert `autoscale.no-capacity` | the ledger, the licence or the team quota has no room for the next worker | free a card, raise the quota, or a larger licence; read `scaling.blocked` | | `E-KV-SIGNAL` | a KV trigger on an engine that reports no KV pressure | `kvPressurePct: 0` | | `E-TTFT-SIGNAL` | a TTFT budget on an embeddings or rerank endpoint, or a leader without the measurement | `ttftBudgetMs: 0` | | `E-SLEEP-CARD` | `sleepCard: free` on a dedicated plan | `keep`, or a shared plan | | `E-PARK-FLOOR` | parked gangs would leave fewer serving than `floor` | lower `floor`, or wake a gang | | `E-SCALER-ROWS` (KEDA) | several worker rows; KEDA drives one template | one row, or `autoscaler.adapter=embedded` | | `E-GROWTH-ENGINE` | a growth shape's vendor has no image for the engine | another vendor, or drop that shape | | The first request after zero takes a long time | a wake from zero starts a pod and loads the model | a sleep tier (`sleepSeconds`, vLLM on NVIDIA), or `floor: 1` | ## Fields | Field | Default | Range and rule | | ----------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `floor`, `max` | fixed size | 0 or more; `floor` at most `max` | | `unit` | `workers` | `workers` or `gangs`; `gangs` needs `shardGroups` | | `targetInflight` | 2 | in-flight requests per worker | | `idleSeconds` | 120 | seconds of low demand before one worker parks | | `kvPressurePct` | 85 | 0 (off) to 100. Written only for an engine that reports KV pressure (vLLM, SGLang, llama.cpp as slot occupancy) and not on llama.cpp workers that share one KV pool | | `ttftBudgetMs` | 0 | 0 (none) or 50 to 600,000 | | `sleepSeconds` | 0 | 0 or more; a sleep tier needs vLLM and `unit: workers` | | `sleepCard` | `keep` | `keep` or `free`; `free` needs a sleep tier and a shared plan. New in 0.3.0 | | `scaleIn` | `drain` | `drain` or `now`; `now` with `drainSeconds` is refused. New in 0.3.0 | | `drainSeconds` | 120 | 0 (the default) to 3600. New in 0.3.0 | | `growth[]` | none | ordered growth shapes (below). New in 0.3.0 | | `wakeSloMs` | 0 | 0 (no target) to 3,600,000; advisory | | `grantHeadroom` | 1 | workers reserved beyond what runs, under KEDA | | `granted[]`, `reserved` | set by the server | the capacity reserved for an external scaler (`node`, `gpu` per slot); never taken from a caller | A remote endpoint takes no autoscale (`autoscale.max` above 0 is refused). ## When it grows and shrinks It grows by one worker when any of these holds: - in-flight requests exceed `targetInflight` per worker; - the leader's queue is not empty (every slot is busy); - the busiest worker's KV cache is at or above `kvPressurePct`; - the leader's time-to-first-token p95 over the last minute is above `ttftBudgetMs` (streamed answers only). Any traffic in the last minute holds at least one worker. With the endpoint at zero, a request the leader refused in the last minute is demand, so the endpoint wakes. A worker whose engine is dead is asked for again on top of the demand. Growth from a serving size waits 30 s after the last grow, so one burst does not climb straight to `max`; a wake from zero does not wait. It shrinks one worker at a time once demand has stayed below the current size for `idleSeconds`, then waits a full window again before the next step. A non-empty queue, a KV cache at or above half of `kvPressurePct` (85 when unset), a dead engine, or a breached TTFT budget holds off a shrink. A TTFT budget may only add workers, never remove them. A prefill/decode endpoint grows and shrinks by a whole pair. Refused by name where a trigger could never fire: `E-KV-SIGNAL` (a KV trigger on an engine with no KV signal), `E-TTFT-SIGNAL` (a TTFT budget on embeddings or rerank, which never stream, or on a leader without the measurement). `unit: gangs` with `max` above 1, or several active gangs, needs a leader that advertises `shard_groups`. **Figure: The autoscaler, minute by minute.** Workers running over 20 simulated minutes against the workers the traffic asks for, with the endpoint's awake, asleep, parked and waking states. The interactive figure is on the web page: ## Tiers of idle | Tier | What happens | Wake | | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | | Sleep | the last awake worker's engine sleeps after `sleepSeconds`; its pod and ledger claim stay. vLLM on NVIDIA only. | sub-second | | Pod-zero | with `floor: 0`, the last worker's pod is parked after `idleSeconds` more; weights stay cached on the node | a pod start and a model load | | Node-zero (opt-in) | with `cloud.nodeScaling=true`, an endpoint that KEDA owns, held at its ceiling by a full fleet while its load wants more, asks the node autoscaler for one more GPU node of its vendor through a Pending request pod | a node, then a pod | The node-zero tier runs only for endpoints KEDA owns: the request is made where the capacity grant is refreshed, and the embedded loop has no grant. It is built and tested, and not yet proven against a real node provisioner. It is off by default: on bare metal nothing answers, and a Pending pod nobody explains is worse than an endpoint that says it is at its ceiling. In 0.3.0 a fixed-size plan with a sleep tier also sleeps. **Requests during a wake are held, not refused.** A plan with `floor: 0` runs with the leader's admission hold raised to 60 s, so a client waits through the wake instead of getting a 503; Preview says so with a `wake-hold` advisory. A request for a `sleepCard: free` sleeper that must wake on another card waits up to 3 minutes. Both holds are new in 0.3.0. **`sleepCard: free`** (shared plans with a sleep tier) releases the card's claim while the engine sleeps, so another endpoint may place there. The wake claims it again, or, when it was taken, parks the worker and wakes one on another card. A dedicated plan is refused `E-SLEEP-CARD`. The default, `keep`, keeps the sub-second wake. **`scaleIn: drain`** (default) lets a stopping worker finish the requests it is serving: it takes no new request and stops its engine when nothing is in flight or `drainSeconds` pass. Its pod's grace period is 30 s longer. `now` stops at once and cuts every stream on it. It applies to every stop of a worker: a scale-in, a rolling update, a deleted pod. It needs a worker image with core's `worker_drain` feature; an older one stops at once. ## Growing onto other hardware Growth shapes are new in 0.3.0 (what is proven per vendor: [Mixed GPU vendors](https://opod.io/docs/control-plane-endpoints/mixed-silicon/#scaling-across-vendors)). `autoscale.growth` is an ordered list of shapes the loop grows in. The first shape that places wins; a scale-in parks the last shape's workers first and your own rows last. ```yaml autoscale: floor: 1 max: 8 growth: - { name: nvidia-extra, vendor: nvidia, max: 4 } - { name: amd-overflow, vendor: amd, max: 4, vramBudgetGb: 20, flags: { max_model_len: "8192" } } ``` | Shape field | Meaning | | -------------- | ----------------------------------------------------------------------------------------------------- | | `vendor` | required: the vendor this shape grows on | | `name` | a label on events and on each worker it grew; default the vendor; unique in the list | | `max` | workers grown on this shape; 0 = up to `autoscale.max` | | `vramBudgetGb` | the budget per worker; 0 = the template's | | `flags` | laid over the template's flags, key by key | | `parallelism` | replaces the template's when set | | `image` | an image for this vendor; default the cell's image for the engine and vendor. A gang shape names none | Each shape is the template worker (the first active row) with what it names laid over it. Each is judged when the plan is written, as a one-worker plan on its vendor's largest card: a vendor where the engine has no image is `E-GROWTH-ENGINE`, a shared shape off NVIDIA is `E-SHARED-VENDOR`, and a vendor with no node yet draws the advisory `growth-no-node`. Growth is refused with autoscaling off, on a prefill/decode endpoint, and on a gang plan whose `unit` is not `gangs`. Under `unit: gangs`, a shape is laid over the template gang and its parts are placed on the shape's vendor. When growth finds only a preemptible job's card, it evicts that job. In 0.3.0 a grow, a create or a rollout evicts only the jobs whose cards it takes, and a node that already holds the weights is chosen first. - **From 0.3.2** waking a parked gang and growing a prefill/decode pair evict a preemptible job on the cards they need, too. In 0.3.0 they hold instead. - **On a KEDA-owned endpoint too** (`autoscaler.adapter: keda`, a worker plan with `max` above `floor` and no growth shapes; from 0.3.2). The capacity grant may reserve a card a preemptible job holds when no free card is left; the reservation alone evicts nothing. When KEDA adds a replica and no node takes it, the control plane evicts the job on its granted card within one autoscale pass, and the pod lands. On 0.3.0 the pod waits `Pending` behind the job: give the plan a growth shape (`autoscale.growth: [{vendor: nvidia}]`) so the control plane's loop scales it. ## Gangs Under `unit: gangs` a gang parks and wakes as a unit; gangs have no sleep tier. In 0.3.0, with every gang awake and `max` 2 or more, the loop adds a placed copy of the first gang under a new id, on that gang's vendor, and parks the last gang first when idle. Up to 0.3.6 the embedded loop grew a gang only on in-flight requests and the TTFT budget. From the release after 0.3.6 it also reads a gang's queue and KV cache, which the leader takes from the gang's coordinator (core's `gang_load`): a queue, or the busiest gang's cache at or above `kvPressurePct`, adds one gang, and a cache above half of it holds a park. A dead part does not ask for another gang. A plan whose parked gangs leave fewer serving than its floor is refused `E-PARK-FLOOR`. A gang whose leader gave up forming it (`gaveUp`) is never woken. ## The embedded loop or KEDA `autoscaler.adapter` chooses who moves an endpoint's replicas. The choice is per install, and ownership is per endpoint: with `keda` on, an endpoint KEDA cannot drive stays on the embedded loop in the same cluster, and its `scaling.by` says so. | Aspect | `embedded` (default) | `keda` | | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Who moves replicas | the control plane's own loop | KEDA's operator and a HorizontalPodAutoscaler, through one `ScaledObject` per endpoint | | What it moves | the plan: worker rows, gangs, sleep marks | the replica count of one worker Deployment, or the group count of one gang's LeaderWorkerSet. The control plane never sends `replicas` for it | | Signals | the leader's `/loadz` every 10 s: in-flight, queue, KV pressure, TTFT p95 | the same `/loadz`, read by KEDA's `metrics-api` trigger every 10 s: `in_flight` against `targetInflight`, `queue_depth` against 1 per worker, `kv_busy_workers` against `kvPressurePct` (only for an engine that reports KV), `ttft_p95_ms` against `ttftBudgetMs` (only when set), and `unavailable_1m` and `rpm_1m` to wake and to hold one worker | | How fast it grows | one worker at a time, 30 s after the last grow | in proportion to the load, up to double every 15 s | | How fast it shrinks | one worker per `idleSeconds` of low demand | one pod a minute, after a 300 s stabilisation window; the last worker after `idleSeconds` (`cooldownPeriod`) | | Wake from zero | a request the leader refused in the last minute | the same count (`unavailable_1m`), through KEDA's activation | | During a control-plane outage | the size freezes. Running workers keep serving; an endpoint parked at zero stays parked and its requests get `503` once the leader's hold runs out | scale-out, scale-in and wake from zero keep working, inside the reservation that was in place when the control plane went away | | Needs on the cluster | nothing | KEDA (`substrate.keda.enabled=true`, or your own) and a serving external-metrics API | | Capacity | each grow is judged against the ledger, licence and quota when it happens | reserved in advance in `plan.autoscale.granted` (below) | | Node-zero tier (`cloud.nodeScaling`) | no | yes | | Endpoints it can own | every plan that autoscales | the classes in the next list | **What KEDA can own.** Exactly these, and only with `max` above `floor` and no sleep tier: - dedicated workers in one worker row (`unit: workers`); - a shared plan of one budgeted row on a named card, when that card holds every replica's budget up to `max` (`autoscale.reserved: true`); - one gang that landed as one LeaderWorkerSet (`unit: gangs`), parked and woken: `max: 1`. In 0.3.6 KEDA also took a gang with `max` 2 or more, but its second gang was a copy pinned to the first gang's machines, so it waited `Pending` for ever while other cards sat idle. From the release after 0.3.6, such a gang stays on the embedded loop, which places each new gang on machines of its own. **What stays on the embedded loop**, per endpoint, with the reason in `scaling.detail`: any other shared plan, the sleep tier, several gangs, one gang that may grow past one (`max` 2 or more; the release after 0.3.6), a gang that landed one Deployment per part (no LeaderWorkerSet controller, or parts on different vendors), plans with growth shapes (0.3.0), and remote endpoints. A fixed-size plan is scaled by nobody (`scaling.by: off`). Refused under `keda`: `E-SCALER-ROWS` (several worker rows: KEDA drives one template), `E-SCALER-PD` (a prefill/decode plan; 0.3.0). ### How capacity is reserved for KEDA KEDA never reads the ledger, the licence or the team quota, so the control plane decides the bounds in advance and writes them into objects KEDA and Kubernetes already obey: - **The grant.** On every pass, the control plane walks the placer for the endpoint, as it would for a grow, and stores the result in `plan.autoscale.granted`: one `{node, gpu}` slot per worker. The slots are what runs, plus `grantHeadroom` more (default 1), never more than `max`. The next slot goes on another machine before it doubles up on one. - **The bounds.** `maxReplicaCount` is the number of slots, and a node label `opod.io/grant-` on each approved node pins the replicas there. So KEDA can never start a worker on capacity nobody approved. Each step it takes runs a worker, which moves the grant up on the next pass, so it can still reach `max`. - **Who counts it.** The ledger and the team quota count every slot: no other endpoint may place there. The licence counts only the slots with a worker running, so unused headroom does not spend the free tier. - **Give-back.** Headroom that stays unused for two hours is given back to the ledger, and taken again when the endpoint uses what it has. When the endpoint leaves the classes KEDA can own (you set a sleep tier, add a row, or switch the adapter back), the whole grant is released. - **A grant below the floor.** The grant wins: KEDA's minimum is lowered to the grant, and the alert `autoscale.grant-below-floor` names the endpoint, the floor and the grant. - **A shared row.** Its grant is every replica up to `max` on its one card, with no headroom rule, because a replica of that row can only land on that card. ### What an outage still stops With every control-plane replica down, KEDA keeps scaling inside the grant that was stored last. Nothing else moves: no new grant, no new capacity, no plan edit, no rollout, and no embedded-loop endpoint changes size. KEDA is then the part that must stay up. If its operator stops, nothing grows and an endpoint parked at zero does not wake; if the cluster's external-metrics API stops serving, no trigger can be read and nothing scales. Running workers keep serving in both cases. A stopped operator still reports its ScaledObjects `Ready`, so the control plane reads the lease the operator renews instead: `scaling.ready` reads `stale` for a stopped operator, `no-metrics` for the metrics API, and `absent` or `false` for a missing or unready ScaledObject. Any value but `true` raises the alert `autoscale.scaler-unhealthy`, which the control plane can only raise while it runs. ### Which should I pick - **Keep `embedded`** when the cluster cannot run KEDA, or when most endpoints use the sleep tier, shared cards, several gangs or growth shapes. KEDA would own none of them. - **Pick `keda`** when an endpoint at `floor: 0` must wake, or a busy endpoint must grow, while the control plane is down (an upgrade, a lost node, a database outage). That is the one thing only KEDA gives. - **Pick `keda`** for dedicated single-row endpoints with fast-changing load. It answers a burst in proportion to its size, where the embedded loop adds one worker per 30 s. - **Stay on `embedded`** when you cannot spare a held card: under KEDA each owned endpoint keeps `grantHeadroom` cards (or budgets) reserved beside what runs. `grantHeadroom: 1` is the smallest reservation. - **Mixed installs are normal.** Turn `keda` on, and read `scaling.by` on each endpoint: the ones KEDA cannot own stay on the embedded loop and say why. ```bash helm upgrade opodcp … --reset-then-reuse-values --set autoscaler.adapter=keda --set substrate.keda.enabled=true opodcp doctor # the autoscaler row: "keda connected", or what is missing ``` `substrate.keda.enabled` installs KEDA as a chart dependency, in the release namespace, with its Secret access restricted to that namespace. Leave it off when the cluster already runs KEDA. Toggle it once: turning it off later removes KEDA's CRDs and every ScaledObject. Before 0.3.0, `substrate.keda.enabled` and `cloud.nodeScaling` did not take effect. ## What it is doing Each endpoint's status carries `scaling`: ```json { "by": "keda", "ceiling": 3, "max": 4, "ready": "true", "detail": "…why this owner and this ceiling…", "blocked": { "reason": "…why the next worker cannot be placed…", "since": "…" } } ``` `by` is `embedded`, `keda` or `off`. `ceiling` is the plan's `max` lowered to what the ledger, the licence and the quota allow. A grow that cannot be placed raises the alert `autoscale.no-capacity` after a minute. In 0.3.0 it is also `blocked`, and a line on the endpoint page. A grow that was given back holds growth for a while, and the hold says until when. `GET /api/v1/endpoints/{id}/autoscale/stats?since=` (default: the last 30 days) says what parking saved and what the last wake cost: ```json { "endpoint": "chat", "since": "…", "until": "…", "gpuHours": 41.2, "savedGpuHours": 30.5, "savedBasis": "…", "parkedSeconds": 109800, "awakeSeconds": 148320, "wakes": 12, "lastWakeAt": "…", "lastWakeMs": 54000, "wakeSloMs": 60000, "wakesInSlo": 11, "attainment": 0.92 } ``` `savedGpuHours` is absent when the endpoint has no measured footprint. `pendingWake` is true when a wake has not yet proven a token. Attainment appears only when you set `wakeSloMs`; it gates nothing. ## From the CLI The `opodcp endpoint` commands are new in `0.3.0`. ```bash opodcp endpoint autoscale chat # print the policy, who scales it, why it is held opodcp endpoint autoscale --floor 0 --max 4 --sleep 300 chat # change only those fields opodcp endpoint autoscale --scale-in drain --drain 60 chat opodcp endpoint autoscale --growth-file shapes.yaml chat ``` Flags: `--floor`, `--max`, `--unit`, `--target-inflight`, `--idle`, `--kv-pressure`, `--sleep`, `--sleep-card`, `--ttft-budget`, `--wake-slo`, `--grant-headroom`, `--scale-in`, `--drain`, `--growth-file`. The console's **Autoscale** page and the endpoint page's **Edit policy** set the same fields. --- title: "Rollouts and runs" description: "Every change to an endpoint is a run with steps and proofs. Verified rollouts, canaries, eval gates, rollback, cancel, and how to read a run." url: "https://opod.io/docs/control-plane-endpoints/rollouts/" markdown_url: "https://opod.io/docs/control-plane-endpoints/rollouts.md" section: "Endpoints" last_updated: "2026-10-31" --- # Rollouts and runs > Every change to an endpoint is a run with steps and proofs. Verified rollouts, canaries, eval gates, rollback, cancel, and how to read a run. A **run** is one change to an endpoint, recorded step by step. Each run records what it takes the moment it takes it. A run that does not succeed gives back what it still holds, newest first. > **Runs are new in 0.3.0** > > In 0.2.1 only a verified rollout or rollback is recorded, at `/api/v1/rollouts` and `/api/v1/rollouts/{id}`, with `POST /api/v1/rollouts/{id}/rollback`, `…/promote` and `…/abort`. The `/api/v1/runs` routes, runs of other kinds, the run log, cancel, the signature hold and `E-RUN-ACTIVE` are new in 0.3.0, and the `/api/v1/rollouts` routes go away. | Kind | Started by | Steps | | --------------- | -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | `rollout` | a verified rollout | `validate`, `prefetch`, `apply`, `converge`, `probe`, `fabric-proof`, `smoke`, `canary`, `eval`, `promote` | | `rollback` | a rollback of a run, a revision or a model version | the same as `rollout` | | `create` | an endpoint's first deployment | `validate` to `smoke`: no `canary`, `eval` or `promote`, because there is no older revision to compare with | | `edit` | `PUT …/plan` | `apply`, `pods rolled`, `serving` | | `delete` | `DELETE /api/v1/endpoints/{id}` | `remove objects`, `pods gone`, `GPUs freed`, `record removed` | | `scale` | the autoscaler | `decide`, `pods ready`, `serving` to grow; `decide`, `pods stopped`, `GPUs freed` to shrink | | `sleep`, `wake` | the sleep tier | `decide`, `engine asleep`; `decide`, `engine awake`, `serving` | | `cleanup` | the janitor or a person removing a remnant | `remove objects`, `pods gone` | A failed `rollout`, `rollback` or `create` adds a `rollback` step: the give-back. Only `rollout`, `rollback`, `create` and `edit` hold an endpoint's one running slot. A second one while it runs is refused `E-RUN-ACTIVE`, and so is a plan edit (`PUT …/plan`). ## In short A verified rollout changes an endpoint and proves each step: the plan is accepted, the weights are on the nodes, the pods are ready, a real request is answered, and, when you ask for them, a canary and an eval pass. If any step fails, the control plane puts the previous plan back by itself. Use a rollout for every change to a serving endpoint that you cannot afford to get wrong. ## When you need it - To change a serving endpoint's plan, image, engine or model version safely. - To pick up a new control-plane release, a changed chart value that touches pods, or new worker certificates. These wait for a rollout. - To test a new revision on one worker first (canary) or score it (eval gate). - To go back to an earlier plan (roll back). ## Do it 1. **Start from the stored plan** ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//plan > plan.json ``` 2. **Change it and add the gates you want** ```bash jq '.workers[].flags.max_model_len = "16384" | .canary = {holdSeconds: 600, weight: 10}' plan.json > new.json ``` 3. **Start the rollout** ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X POST \ "https://cp.example.com/api/v1/endpoints//rollouts?note=context%2016k" -d @new.json | jq '{id, state}' # {"id":"…","state":"running"} ``` The answer is `202`. To roll out the stored plan again with no change (new image pins, new templates), post `plan.json` as it is. 4. **Follow it to the end** ```bash watch -n 10 "curl -s -H '$H' https://cp.example.com/api/v1/runs/ | jq -c '[.state, (.steps[] | [.name, .state])]'" ``` The `id` is the one the start answered. From 0.3.0 the route is `/api/v1/runs/{id}` (0.2.1 served it at `/api/v1/rollouts/{id}`), and `opodcp endpoint rollout --wait chat` waits for you. ## Check it worked A good answer: the run's `state` is `succeeded`, and every step is `passed` or `skipped` (a skipped step had nothing to do; its `error` says why). The endpoint's plan `revision` equals the run's `toRevision`, and its status reads `serving` with an empty `rollingOut`. In the console, **Activity** shows the run with its steps. ## If it fails | Symptom or code | Cause | Fix | | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | | `400` before any record | the body has no worker and no gang | post the whole plan, not a bare `{}` | | The run ends `rolled-back` | a step failed and the old plan is back | read that step's `error`, `code` and `remedies` | | `converge` fails after 8 minutes | a pod did not become Ready; the step's error is the last fact it read. A first pull of a large image can take longer (counted against the budget on 0.3.2 and earlier) | read the run log (0.3.0) and the pod logs; for a pull, roll out again once the node holds the image | | `canary` stays `running` | the canary was too quiet to judge; event `rollout.canary-unjudged` | send traffic, or end the hold with `…/promote` or `…/abort` | | `E-EVAL-GATE` | the eval score is below `minScore` | fix the model, or lower `minScore` | | `E-UNSIGNED`, `E-SIGNATURE`, `E-UNVERIFIED` | `images.verify=enforce` and an image failed the signature check | see [Supply chain](https://opod.io/docs/control-plane-security/supply-chain/) | | `E-RUN-ACTIVE` (0.3.0) | another rollout, rollback or create runs on the endpoint | wait, or cancel it | | `409 E-CANARY-DECIDED` | a second promote or abort on one hold | none: the first decision stands | ## A verified rollout ```bash # roll out the stored plan again: re-pins images to the chart's current digests and re-renders templates opodcp endpoint rollout --wait --note 'take the new leader image' chat # or post a changed plan curl -s -H "$H" -H 'Content-Type: application/json' -X POST \ "https://cp.example.com/api/v1/endpoints//rollouts?note=bigger%20context" -d @plan.json ``` `opodcp endpoint rollout` is new in `0.3.0`. In the console: **Roll out plan…** on the endpoint page, or **Edit plan & roll…** (0.3.0). From the release after 0.3.6, while a run is active the endpoint page shows a banner with its kind, the step it is on and a link to its steps, and holds those buttons until it ends; the endpoint list names the run beside the state. The body of `POST …/rollouts` is the whole desired plan. A body with no worker and no gang is refused `400` before any record is written, so a bare `POST` never re-rolls what is deployed: post the stored plan to do that. `note` is one line of at most 200 characters. The answer is `202` with the run. You need the operator role; in 0.3.0, a machine token with scope `plans:write` may start one too. A rollout runs these steps: | Step | What it proves | | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `validate` | the planner accepts the plan: fit, licence, quota, image signatures, model approval. In 0.3.0 it also runs every refusal a create or a plan edit runs | | `prefetch` | the plan's weights are on every target node's cache (a Job running `opod fetch`); skipped where the file is already there. From the release after 0.3.6, a plan with a speculative draft model (`speculative.method: draft`) also gets the draft pulled, and each node's unit says so (`… · pulled draft : in 18s`, or `draft cached`); before, each worker downloaded the draft as its engine started | | `apply` | the objects are rendered and applied; the image pins are written | | `converge` | every planned pod is Ready on this revision; for a gang, every active gang is formed | | `probe` | the leader answers its probes | | `fabric-proof` | each gang across machines clears the bandwidth floor | | `smoke` | one real request through the leader is answered (a scored list for rerank) | | `canary` | one worker, or one whole gang, moves first and is judged against its siblings | | `eval` | an eval suite scores the new revision, when the plan has one | | `promote` | the rest follow, and the revision is the endpoint's | Budgets: `converge` may take 8 minutes, `smoke` 3 minutes (it covers a wake from zero), and the whole rollout 30 minutes. A step that runs out of time fails with the last fact it read. From 0.3.3, time a pod spends pulling its image (the kubelet's `Pulling` event, no `Pulled` yet) is not counted against `converge`: the first pull of a 20 GB engine image no longer fails the rollout, and the 30 minutes still bound it. The endpoint's status lists those pods under `pulling`. On 0.3.2 and earlier, pre-pull a large image on its node first, or the first create of it can fail at 8 minutes. A step's state is `pending`, `running`, `passed`, `failed` or `skipped`. **`skipped` means the endpoint's shape gave the step nothing to do** (no canary policy, no eval suite, no gang across machines); the reason is in `error` and it is not a failure. A failed step carries `error` and, when it was a refusal rather than a breakage, a `code` and `remedies`. On failure the previous plan revision is restored and the run ends `rolled-back`. A failed `create` has no previous revision: its workloads are removed and stay removed (the endpoint reads `pending`) until you roll it out again, edit its plan, or delete it. In `0.3.0` the reconciler leaves it removed, but a new key, an auth-policy or policy change, a route-key change or an autoscaler decision can still re-apply it. In the release after `0.3.0` (it arrives then), those writes are stored and do not bring it back. **A parked endpoint is woken for the rollout.** `converge`, `probe` and `smoke` need a running pod. When KEDA owns the endpoint and has parked it at zero (`floor: 0`), the rollout holds it at its planned size (one group for a gang) for the run, publishes `rollout.woke`, and hands it back to KEDA when it ends. So an image or flag change, a security patch included, can be proven on an endpoint nobody is using. Under the embedded loop a parked endpoint is woken through the plan, which `converge` already reads. An endpoint whose every gang an operator parked by hand is not woken. Under `images.verify=enforce`, `validate` refuses an image with no signature published beside it (`E-UNSIGNED`), one whose signature does not hold (`E-SIGNATURE`) and one whose signature could not be verified (`E-UNVERIFIED`). Under `warn` it records them. See [Supply chain](https://opod.io/docs/control-plane-security/supply-chain/). **Figure: A verified rollout, step by step.** Ten rollout steps from validate to promote, and the share of requests on the new revision at each step. The interactive figure is on the web page: ## Canary ```yaml canary: { holdSeconds: 600, weight: 10 } ``` During the hold, one worker runs the new revision and takes `weight` percent of requests (by plan revision, on a leader that supports it; otherwise its 1/N share). On a sharded endpoint the canary is one whole gang. The canary rolls in place: capacity dips by one worker during the hold, and no spare card is needed. The canary is judged by its error rate against its siblings' over the same minutes, from usage facts: - judged good → the rest follow; - judged bad → the rollout is compensated; - too quiet to judge → the hold does not end by itself. The step stays `running` and the event `rollout.canary-unjudged` is published once. End a hold by hand: `POST /api/v1/runs/{id}/promote` (the rest follow; the proof says it was not judged) or `POST /api/v1/runs/{id}/abort` (fails the step `E-CANARY-ABORTED` and compensates). In 0.2.1 the routes are `/api/v1/rollouts/{id}/promote` and `…/abort`. The first decision stands; a second one is `409 E-CANARY-DECIDED`, and a hold that is not running is `409 E-CANARY-NOT-HOLDING`. ## Eval gate ```yaml eval: { suite: mmlu-mini, image: registry.example.com/evals/mmlu@sha256:…, minScore: 0.82, timeoutSeconds: 900 } ``` The image is given the endpoint's gateway URL and a key, and must print a JSON object with a `score` field. A score below `minScore` fails the step `E-EVAL-GATE` and compensates the rollout. `minScore: 0` records the score and gates nothing. A plan that pins a model version records the score on that version under `suite`. ## A model signature that does not verify The signature hold is new in 0.3.0. The prefetch step checks a model signature the repository publishes. Only a signature that is **invalid** holds the rollout (`hold: "signature"` on the step). An admin then decides: - `POST /api/v1/runs/{id}/signature/accept` — load anyway. The acceptance is recorded on the model version for that exact commit, so the same bytes do not ask again. - `POST /api/v1/runs/{id}/signature/reject` — fail the step `E-MODEL-SIGNATURE-REJECTED`. Nothing was applied yet. A second decision is `409 E-SIGNATURE-DECIDED`; a run that is not holding is `409 E-SIGNATURE-NOT-HOLDING`. Nobody deciding ends the run at its 30-minute budget. See [Supply chain](https://opod.io/docs/control-plane-security/supply-chain/). ## Roll back - `POST /api/v1/runs/{id}/rollback` starts a new verified rollout to the plan that run captured at its start, image pins included. It answers `202`. In 0.2.1: `POST /api/v1/rollouts/{id}/rollback`. - The endpoint page's **History** tab rolls back to any revision (0.3.0). - A model version rollback (`POST /api/v1/models/{id}/versions/{v}/rollback`) rolls every endpoint that pins a newer version. ## Cancel Cancel is new in 0.3.0. ```bash curl -s -H "$H" -X POST https://cp.example.com/api/v1/runs//cancel ``` The running step ends at its next safe point, no further step starts, and the run gives back what it took; it ends `cancelled`, or `failed` when a give-back failed. It answers `202` with the run. `?force=true` stops the run's pods with a one-second grace period instead of their own. A delete cannot be cancelled (`E-RUN-NOT-CANCELLABLE`); a run that already ended is `409 E-RUN-FINISHED`. ## When the control plane restarts mid-run A verified rollout, a rollback and a create **resume**. The run's journal says which step it stopped at, every step is safe to run twice, and the new control-plane process continues from the first step that has not passed. A run it cannot resume (its endpoint is gone, or its target plan cannot be read) ends `failed`, and the endpoint keeps what was applied. The other kinds (`scale`, `sleep`, `wake`, `delete`, `edit`, `cleanup`) only follow a decision that was already made. One that nobody has followed for two minutes ends `failed` with the reason "a control-plane restart", and gives back what it held. What happened next is on the endpoint's events. ## Read a run ```bash curl -s -H "$H" "https://cp.example.com/api/v1/runs?endpoint=&kind=rollout,rollback&limit=10" curl -s -H "$H" "https://cp.example.com/api/v1/runs/" | jq '.state, .steps[] | {name, state, proof, error, code}' curl -s -H "$H" "https://cp.example.com/api/v1/runs//log?format=text" ``` `GET /api/v1/runs` answers newest first: `kind` takes a comma list, `limit` is 1 to 1000 (default 100). A team-scoped caller sees only runs of their team's endpoints. | Run field | Meaning | | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | | `id`, `kind`, `state` | `state` is `running`, `succeeded`, `failed`, `rolled-back` or `cancelled` | | `endpointId`, `endpointName`, `cell` | what it changed | | `by`, `note` | who, and the one-line reason; a rollback's note names the run it undoes | | `fromRevision`, `toRevision` | the plan revisions it moved between | | `steps[]` | `name`, `state`, `startedAt`, `finishedAt`, `proof`, `error`, `code`, `remedies`, `decision` (a canary or signature decision), `hold` | | `acquired[]` | what it took: `kind`, `ref`, `detail`, `from`, `to`, `at`, and `releasedAt`, `release` once given back | | `cancel` | who asked to cancel it, and when | | `createdAt`, `updatedAt` | — | The log holds each step's lines: its start and end, every change a waiting step saw, the units it touched, and what Kubernetes said about the pods. JSON (the default) is `{lines, next}`: pass `next` back as `after` to read only new lines, and `step=` to read one step. `format=text` is one line each under a header naming the run. The console's **Activity** page shows every run with its steps; **Copy** writes the text form. The digests a run pinned are not on the run record: read `plan.images` on the endpoint and the `apply` step's proof. ## Changes that wait for a rollout A serving pod is never restarted by an unattended apply. These reach running pods only through a rollout (or any plan edit): - a new control-plane release that renders pods differently (doctor row `template-drift`); - a changed chart value that touches pod templates: tolerations, resources, the leader pool, the trace collector; - worker certificates for mTLS; - a new image pin. **Embedded TLS certificates** are re-minted by a rollout whose `apply` step finds the certificate within `endpoints.tls.renewDays` of expiry. The fingerprint then changes. The alert-rule metric `endpoint.cert_expiry_days` says when a rollout is due. ## Events In 0.3.0, every run publishes `run.started`, `run.step`, `run.step-progress` and `run.finished`, each with its `kind`, and `run.cancel-requested` when someone cancels it, on `GET /events` and in the audit record. A verified rollout also publishes `rollout.started`, `rollout.step`, `rollout.finished`, `rollout.failed` and its canary and eval events (`rollout.canary`, `rollout.canary-verdict`, `rollout.canary-weight`, `rollout.canary-promoted`, `rollout.canary-aborted`, `rollout.canary-unjudged`, `rollout.eval`), plus `rollout.signature-hold`, `rollout.signature-accepted` and `rollout.signature-rejected` from 0.3.0. --- title: "API keys" description: "Mint and revoke endpoint API keys, require them, bound the age of the auth snapshot, and revoke a key with the control plane down." url: "https://opod.io/docs/control-plane-endpoints/api-keys/" markdown_url: "https://opod.io/docs/control-plane-endpoints/api-keys.md" section: "Endpoints" last_updated: "2026-10-30" --- # API keys > Mint and revoke endpoint API keys, require them, bound the age of the auth snapshot, and revoke a key with the control plane down. An **endpoint API key** (`sk-orc-…`) is the right to call one endpoint. The control plane mints it, keeps only its hash, and pushes the hashes to the endpoint's leader in an **auth snapshot**: a file in the endpoint's Secret, mounted in the leader pod. The leader checks keys from that file. No request waits on the control plane. A key is an identity, not a budget. It carries no rate limit, quota or model allowlist. Per-user and per-team limits are the job of the gateway in front of the endpoint. See [Gateways in front](https://opod.io/docs/control-plane-endpoints/gateways/). ## In short An endpoint key is the password a client sends to call one endpoint. You mint it once, store it, and give it to one app or one gateway. Until you turn on **Require keys**, the endpoint takes calls with no key at all. The leader checks keys itself, so keys keep working, and a revoke still lands, while the control plane is down. ## When you need it - Before anyone outside your team can reach the endpoint: mint a key, then require keys. - When a key leaks or an app is retired: revoke it. - When the control plane is down and a key must stop now: revoke it with `--direct`. - When a batch must yield to live traffic: give its key `class: sheddable` (see [Routing → Admission](https://opod.io/docs/control-plane-endpoints/routing/#admission)). ## Do it 1. **Mint a key** ```bash opodcp key create --endpoint chat --expires-in 720h --cp https://cp.example.com --token ci-bot > ci-bot.key ``` stderr shows the key's id (`k_…`) and its expiry. stdout, here the file, holds only the key (`sk-orc-…`). The control plane never shows it again. 2. **Require keys on the endpoint** ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X PUT \ https://cp.example.com/api/v1/endpoints//auth -d '{"requireKeys": true}' ``` 3. **Give the key to the client** The client sends `Authorization: Bearer sk-orc-`. In the OpenAI SDK, that is `api_key="sk-orc-"`. 4. **Revoke it when it is no longer needed** ```bash opodcp key revoke --endpoint chat k_3f9a1c2b7d4e ``` The leader refuses the key within about a minute. ## Check it worked ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//auth | jq '{requireKeys, activeKeys, stale: .snapshot.stale}' # {"requireKeys": true, "activeKeys": 1, "stale": false} ``` Then call the endpoint twice from a pod in the cluster: with the key it answers `200`, without it `401`. The console's **API keys** page lists the key as `active`, and a revoked one as `revoked`. ## If it fails | Symptom | Cause | Fix | | --------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `PUT …/auth` answers `400` | the endpoint has no active key (an endpoint key, or a route key that lists it) | mint a key first | | `PUT …/auth` refused `E-VERTEX-KEYS` | the plan serves the keyless Vertex AI routes | turn `exposure.vertex` off first | | A minted key gets `401` | it expired, it was revoked, or it belongs to another endpoint | read `GET …/keys`; mint a new key | | A revoked key still works | the leader has not synced its snapshot yet | wait about a minute; check `snapshot.revision` in `GET …/auth` | | Keyed calls get refused after a long control-plane outage | `auth.maxSnapshotAgeSec` is set and the snapshot passed it | bring the control plane back; it re-issues the snapshot | | `400` on create naming `rpmLimit` or another limit field | keys carry no limits (0.3.0) | set limits in your gateway | | `opodcp key revoke` fails with the control plane down | the API cannot be reached | add `--direct` and a kubeconfig. From the release after 0.3.6 the error ends with the exact `--direct` command; 0.3.6 printed only the dial error | ## Mint a key **CLI** ```bash opodcp key create --endpoint chat --expires-in 720h --cp https://cp.example.com --token ci-bot opodcp key create --endpoint chat --no-expiry litellm ``` The CLI prints the key id and expiry on stderr and the key alone on stdout. It sets a name and an expiry; for `class` or `team`, use the API. **API** ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X POST \ https://cp.example.com/api/v1/endpoints//keys \ -d '{"name":"ci-bot","expiresAt":"2026-12-31T00:00:00Z","class":"standard","team":"search"}' ``` **Console** The **API keys** page, or the endpoint page's **Connect** card. The answer is `201` and carries the plaintext `key` **once**, beside the key record. You need the operator role. In 0.3.0, a machine token with scope `tokens:write` may mint and revoke keys too. ```json { "id": "k_3f9a1c2b7d4e", "endpointId": "…", "name": "ci-bot", "prefix": "sk-orc-XXXXX…", "expiresAt": "2026-12-31T00:00:00Z", "createdAt": "…", "createdBy": "…", "class": "standard", "team": "search", "state": "active", "key": "sk-orc-" } ``` | Field | Default | Meaning | | ----------- | ---------------- | ------------------------------------------------------------------------------------------------------------------- | | `name` | — | required: a label for people, at most 64 characters | | `expiresAt` | 90 days from now | an RFC 3339 time in the future; the leader enforces it locally | | `noExpiry` | `false` | a key that never expires, as an explicit choice recorded on `key.created`; not with `expiresAt` | | `class` | `standard` | `critical`, `standard` or `sheddable`: how the key's requests rank when the endpoint is full | | `team` | none | at most 64 characters; makes the key one flow with every other key of that team, for fair share and cache isolation | In 0.3.0 any other field is refused `400`, and a limit field (`rpmLimit`, `tpmLimit`, `quotaDailyTokens`, `allowedModels`) gets a message that says keys carry none; 0.2.1 ignores unknown fields. Class and team are set at creation; to change them, mint a new key. ## Require keys A new endpoint accepts any caller until you require keys. Turn it on with the **Require keys** switch on the Connect card, or: ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X PUT \ https://cp.example.com/api/v1/endpoints//auth -d '{"requireKeys": true}' ``` It is refused `400` while the endpoint has no active key (an endpoint key, or a route key of an auto route that lists it), and, from 0.3.0, while the plan serves the keyless Vertex AI routes (`E-VERTEX-KEYS`). The control plane's own calls and the console's proxy use the endpoint's admin token, so requiring keys never locks an operator out. Clients send the key as `Authorization: Bearer sk-orc-` (or `X-Api-Key`). ## Revoke a key ```bash opodcp key revoke --endpoint chat k_3f9a1c2b7d4e curl -s -H "$H" -X DELETE https://cp.example.com/api/v1/endpoints//keys/ ``` Revoke by the key's `id` (`k_…`), never by the plaintext key. The route answers `200` with the record, now `state: revoked`. The leader refuses the key on its next snapshot sync, within about a minute. The revocation is written as a **tombstone** (`revokedKeys` in the snapshot) as well as by dropping the key, so no later writer can bring it back. ## Revoke a key with the control plane down Revocation is delivered by the cluster, not by the control plane. With only a kubeconfig: ```bash opodcp key revoke --direct --endpoint chat --kubeconfig ~/.kube/config --namespace opodcp k_3f9a1c2b7d4e ``` `--direct` takes the key's id or its name. It finds the endpoint's auth Secret by its labels (`opod.io/endpoint=,opod.io/role=auth`), appends the tombstone, stamps a new snapshot revision and keeps every other field. A key already revoked there writes nothing. `--endpoint-id` picks one endpoint when two of one name have a Secret; `--secret ` names the Secret directly. When the control plane returns it keeps the tombstone, marks the key revoked and publishes `key.revoked`. The same edit with `kubectl` and `jq`: ```bash S=$(kubectl -n opodcp get secret -l opod.io/endpoint=chat,opod.io/role=auth -o name) kubectl -n opodcp get "$S" -o jsonpath='{.data.auth\.json}' | base64 -d \ | jq -c --arg k '.revokedKeys = ((.revokedKeys // []) + [$k] | unique)' > auth.json kubectl -n opodcp patch "$S" --type merge -p "{\"data\":{\"auth.json\":\"$(base64 < auth.json | tr -d '\n')\"}}" ``` The RBAC either path needs: ```yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: { name: opodcp-key-revoker, namespace: opodcp } rules: - apiGroups: [""] resources: [secrets] verbs: [list, get, update, patch] ``` A tighter grant names the endpoint's Secret with `resourceNames` and drops `list`; then use `--secret`. ## The snapshot's age By default a leader serves from whatever snapshot it holds, for as long as it holds it (fail-static). The control plane re-issues an unchanged snapshot hourly. If revocation matters more than availability during a control-plane outage, set a bound in the endpoint's policy: ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//policy > policy.json # read it first jq '.auth.maxSnapshotAgeSec = 3600' policy.json > new.json curl -s -H "$H" -H 'Content-Type: application/json' -X PUT \ https://cp.example.com/api/v1/endpoints//policy -d @new.json ``` Send the whole policy back: a `PUT` that leaves out `routing.fallbackUrl` clears the fallback. See [Routing policy](https://opod.io/docs/control-plane-endpoints/routing/). `maxSnapshotAgeSec` is 0 (fail-static) or 600 to 2,592,000 (30 days). Past it, the leader refuses keyed traffic and says why. The control plane then re-issues every third of the bound. `GET /api/v1/endpoints/{id}/auth` shows the gate: ```json { "requireKeys": true, "activeKeys": 2, "routeKeys": 1, "snapshot": { "revision": "…", "issuedAt": "…", "ageSec": 1260, "maxSnapshotAgeSec": 3600, "keys": 3, "revokedKeys": 1, "stale": false, "readAt": "…" } } ``` `routeKeys` counts the usable route keys that open the endpoint; it is new in 0.3.0. `stale` is true when a bound is set and the snapshot is past it. `snapshot.error` is the last write that failed; `snapshotError` says why the Secret could not be read. The doctor row `auth-snapshots` names every endpoint whose snapshot is past its bound. ## List keys | Route | Answers | | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `GET /api/v1/keys` | every key of the cell the caller may see; a team-scoped caller sees its team's endpoints' keys | | `GET /api/v1/endpoints/{id}/keys` | one endpoint's keys: `id`, `name`, `prefix` (the first 12 characters), `expiresAt`, `createdAt`, `createdBy`, `revokedAt`, `state` (`active`, `revoked`, `expired`), `class`, `team` | Hashes are never returned. ## Keys for the cell door's auto routes Route keys are new in 0.3.0. An auto route on the cell door lists several endpoints. A **route key** is accepted by every endpoint the route lists, so a fallback is not a `401`: `POST /api/v1/door/auto-routes/{name}/keys` (admin, the same body as an endpoint key), `GET` to list, `DELETE …/keys/{kid}` (operator) to revoke. A route key's record carries `autoRoute` and no `endpointId`. Usage stays with the endpoint that served. Removing a route revokes its keys. See [Routing policy](https://opod.io/docs/control-plane-endpoints/routing/). ## Test a key through the control plane The proxy route `POST /api/v1/endpoints/{id}/gateway/{path}` sends the endpoint's admin token by default. To test what a customer sees, add `X-Opod-Endpoint-Key: sk-orc-` (forwards that key) or `X-Opod-Endpoint-Key: -` (forwards none). The Playground offers the same choice. --- title: "Routing policy, doors and admission" description: "How a leader picks a worker, admits and ranks requests, falls back, and how front doors and the cell door put endpoints behind one URL." url: "https://opod.io/docs/control-plane-endpoints/routing/" markdown_url: "https://opod.io/docs/control-plane-endpoints/routing.md" section: "Endpoints" last_updated: "2026-10-30" --- # Routing policy, doors and admission > How a leader picks a worker, admits and ranks requests, falls back, and how front doors and the cell door put endpoints behind one URL. The leader routes; the control plane only sets its policy. Each endpoint's **policy** is a JSON document the control plane writes as `policy.json` beside the auth snapshot in the endpoint's Secret. The leader applies it live, with no restart. ## In short Each endpoint has a **policy**: a small JSON document that tells its leader how to pick a worker, how long a request may wait for a free slot, which requests go first when the endpoint is full, and where to send requests when no worker can serve. You read the document, change it, and send it back whole. The leader applies it within seconds, with no restart. Front doors and the cell door are set in the plan and the chart, not in the policy. ## When you need it - Requests get `503` at busy moments: raise `admission.holdMs`, or add workers. - Live traffic must win over a batch: list `admission.classes`, and give batch keys `class: sheddable`. - Long shared prompts (RAG, agents) should hit a worker that already holds them: `prefixAffinity`, `kvWeight`. - A cloud API should answer when your GPUs cannot: set a fallback. - A leader restart must cost no requests: turn on front doors. - Clients should call one URL for every model: the cell door. ## Do it 1. **Read the policy and its revision** ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//policy > policy.json jq -r .revision policy.json # the same value the ETag header carries ``` 2. **Change only what you need** This example lets a request wait up to 5 s for a slot and keeps a batch class from taking more than a quarter of the slots: ```bash jq '.admission.holdMs = 5000 | .admission.classes = [{"name":"sheddable","maxShare":0.25}]' policy.json > new.json ``` `policy.json` has no fallback key in it (the `GET` never returns one). Leaving `fallbackUrl` as it is keeps the stored key. 3. **Send it back with If-Match** ```bash curl -s -H "$H" -H 'Content-Type: application/json' -H 'If-Match: ""' -X PUT \ https://cp.example.com/api/v1/endpoints//policy -d @new.json | jq .admission ``` `200` with the stored policy means it is applied. `409` means someone changed it since your read: read it again and repeat. ## Check it worked ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//policy | jq '{admission, fallbackKeySet: .routing.fallbackKeySet}' ``` A good answer shows your values and a new revision. Under load, the leader's metrics `opod_admission_held` and `opod_admission_shed_total` move by class. In the console, **Routing policies** shows the same document for the endpoint. ## If it fails | Symptom | Cause | Fix | | ------------------------------------------ | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | `409` on `PUT` | the stored policy changed after your `GET` | read it again, re-apply your change, send the new revision | | `400` naming a field | a value is out of range, a class name is unknown, or a class is listed twice | use the ranges in the tables below | | `400` on a fallback change | the URL changed and the key was not resent | resend `fallbackKey`, or `""` for none | | The fallback stopped working after a `PUT` | on 0.2.1, the body left out `routing.fallbackUrl`, which clears the fallback | on 0.2.1, send `fallbackUrl` and `fallbackModel` on every `PUT`; from 0.3.0 a field left out is kept | | `E-KV-EVENTS` | `prefixBlockWeight` needs `plan.kvEvents: true` on vLLM or SGLang | turn `kvEvents` on by a rollout, or leave the weight at 0 | | `E-DOOR-ALIAS` | the alias is taken, is `auto`, or names an auto route | another alias | | `E-DOORS-NODES` (0.3.0) | a pinned `gateways.replicas` above the nodes that may hold a door | a lower count, or leave it derived | | `E-GATEWAY-UNSUPPORTED` | the leader image cannot stand behind doors | roll onto a newer leader image | ## The policy document ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//policy # carries a revision and an ETag curl -s -H "$H" -H 'Content-Type: application/json' -H 'If-Match: ""' -X PUT \ https://cp.example.com/api/v1/endpoints//policy -d @policy.json ``` The `PUT` (operator) replaces the whole document. With `If-Match` it is applied only while the stored document still has that revision, and otherwise answers `409` having written nothing. Without `If-Match` it is unconditional. It answers `200` with the stored policy and its new ETag. What a field left out of the `PUT` (or sent as `null`) does. From 0.3.0, **every field left out is kept**, and an explicit value replaces it: `"fallbackUrl": ""` clears the fallback (and with it the model and the key), `"accessLog": false` turns the log off. | Left out | 0.2.1 | 0.3.0 | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------- | ------------------------------------- | | `routing.fallbackUrl`, `routing.fallbackModel` | **cleared** — send them back on every `PUT` | kept | | `routing.fallbackKey` | kept, when `fallbackUrl` is unchanged | kept, when `fallbackUrl` is unchanged | | the routing knobs (`kvWeight`, `kvSaturationPct`, `prefixAffinity`, `prefixBlockWeight`, `speedRank`, from 0.3.0 `prefixBlockTier` and `stickyTtlSeconds`, and from 0.3.3 `loadRefreshMs`) | kept | kept | | `auth.maxSnapshotAgeSec`, `admission.holdMs`, `admission.maxHeld`, `admission.classes` | kept; `"classes": []` clears the list | kept; `"classes": []` clears the list | | `logging.accessLog` | turned **on** | kept | On 0.2.1, read the document, change it, and send it whole. A `GET` never returns the fallback key: it answers `fallbackKeySet` instead. `GET /api/v1/policies` lists every endpoint's policy you may see. ```json { "routing": { "fallbackUrl": "https://api.example.com", "fallbackModel": "gpt-small", "fallbackKey": "…", "kvWeight": 50, "kvSaturationPct": 90, "prefixAffinity": true, "prefixBlockWeight": 0 }, "logging": { "accessLog": true }, "auth": { "maxSnapshotAgeSec": 0 }, "admission": { "holdMs": 2000, "maxHeld": 64, "classes": [ { "name": "critical", "holdMs": 10000 }, { "name": "sheddable", "maxShare": 0.25 } ] } } ``` The console's **Routing policies** page edits the same document per endpoint. In 0.3.0, `opodcp endpoint policy --kv-weight 2 --prefix-affinity on chat` changes the named knobs and keeps the rest. | Section | Fields | | ----------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `routing` | the fallback (below), the worker-choice knobs (below) and `speedRank` | | `logging` | `accessLog`: the leader's access log, on by default | | `auth` | `maxSnapshotAgeSec`; see [API keys → The snapshot's age](https://opod.io/docs/control-plane-endpoints/api-keys/#the-snapshots-age) | | `admission` | `holdMs`, `maxHeld`, `classes[]` (below) | The control plane writes two more parts that no `PUT` sets. `routing.revisions` is the traffic split by plan revision while a canary holds; the `GET` shows it. `wake.noResumeInPlace` names `sleepCard: free` sleepers the leader must not resume on their card (0.3.0). Before 0.3.0 the policy also carried a `guardrails` list; it is gone, and a `PUT` ignores the key. ## How the leader picks a worker The leader reads each worker's KV-cache use and queue depth from its heartbeat (every 5 s) and ranks the workers. From core v0.4.3, the leader and every front door instead pull each worker's sample every 500 ms (`GET /v1/load` on the worker; a front door ranked on its own in-flight count before). A pulled sample older than three intervals is not ranked on (the worker is scored on what is in flight), and requests sent after a sample count toward the worker's score. A worker on an older core keeps its heartbeat's sample. `/gatewayz` lists each worker's sample age under `load_samples`; `/loadz` carries the same map from core v0.4.4, and from 0.3.4 the endpoint page shows it under **Load**: the oldest pulled sample and any worker the leader no longer ranks. It is the leader's view; each front door pulls its own samples. 0.3.4 also shows, under **Load**, how many requests named a session in the last minute and how often a conversation's pin held, and warns when an endpoint with front doors has traffic and no caller sends `X-Opod-Session`. 1. A worker whose slots are all in flight, or whose KV use is at or above `kvSaturationPct`, goes behind every worker with headroom. 2. Among the rest, the lowest score wins: **in-flight + queue depth + `kvWeight` × KV used % / 100 − `prefixBlockWeight` × leading blocks of the request the worker holds**. 3. With `prefixAffinity` on, and only when no worker reported holding any block of the request, the worker that last served the longest matching part of the prompt moves to the front, unless it is saturated. | Knob | Range | Default | Effect | | ------------------- | ------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `loadRefreshMs` | 0–60000 | 0 (= 500 ms) | from 0.3.3, with a leader from the core v0.4.3: how often the leader and every front door pull each worker's load; a sample older than three intervals is not ranked on. CLI `opodcp endpoint policy --load-refresh 500ms` | | `tokenWeight` | 0–100 | 0 (off) | arrives in the release after 0.3.6, with a leader from the core release after v0.4.8: what 1,000 uncached prompt tokens still in prefill weigh against one request in flight, so a burst of long prompts spreads over the workers; held until the first streamed token, or until the request fails. CLI `opodcp endpoint policy --token-weight 0.5` | | `prefixDepthKiB` | 0, or 4–1024 | 0 (= 256 KiB) | arrives in the release after 0.3.6, with a leader from the core release after v0.4.8: how much of a prompt's leading text the prefix match reads; 4 = the 4 KiB chain from before; a leader without `prefix_depth` stops at 4 KiB. CLI `--prefix-depth 256` | | `slowFactor` | 0, or above 1 | 0 (off) | arrives in the release after 0.3.6, with a leader from the core release after v0.4.8: a worker whose median time to first token per 1,000 uncached tokens, or median gap between tokens, is more than this many times its siblings' over their last 20 answers ranks down — fewer requests, never none; a model with one worker is never judged; the endpoint page names it under Load, Activity shows "Worker slower than its siblings", and the alert `endpoint.worker-slow` is open while it lasts. CLI `--slow-factor 2` | | `kvWeight` | 0–100 | 0 (off) | switches the KV term on: how many in-flight requests a full KV cache counts as | | `kvSaturationPct` | 0–100 | 0 (off) | a worker at or above this KV use goes behind every worker with headroom | | `prefixAffinity` | true / false | `false` | pin a prompt prefix to the worker that last served it: a hash chain over the system prompt and every message, in 256-byte links to 4 KiB, then one link at 8, 16, 32 … KiB up to 256 KiB (arrives in the core release after v0.4.8; until then the first 4 KiB only), never the text; pins live 10 minutes, or `stickyTtlSeconds` | | `prefixBlockTier` | `gpu` / `cpu-lower` | `gpu` | from 0.3.0: with `cpu-lower`, a leading block the worker's CPU tier holds beyond its card's counts too, at 0.8 of a card block (a CPU-tier hit measured 0.94–0.96 of a card hit's saving on vLLM); needs `kvEvents` and a CPU tier | | `stickyTtlSeconds` | 0–86,400 | 0 (the leader's) | how long a session and a prompt prefix stay on the worker that last served them, in seconds. See [Sticky sessions](#sticky-sessions) | | `prefixBlockWeight` | 0–10 | 0 (off) | credit a worker for the leading KV blocks of the request its engine reports holding (16 tokens a block); needs the plan's `kvEvents: true` (vLLM or SGLang; `E-KV-EVENTS` otherwise) | The policy knobs apply live. `kvEvents` is an engine launch flag, so turning it on or off rides a rollout. Routing by reported KV blocks is partly proven: on vLLM, on a pool that fits both caches, it tied the prefix pin, so both stay off by default. A choice between two SGLang workers has not been run yet. The formula, where each worker's KV use comes from, what is hashed, a worked example with four workers and when to use each knob are on [KV cache: Routing](https://opod.io/docs/control-plane-endpoints/kv-cache/#routing). **Cache isolation** is a plan field, not a policy knob: `plan.routing.cacheIsolation` is `team` (default: keys of one team share the prefix cache, teams never do), `key` or `none`. The leader salts each request to vLLM, SGLang and TensorRT-LLM with an HMAC of the caller's team or key under the endpoint's admin token, never the id. llama.cpp shares its cache whatever the mode, and the plan says so. A remote endpoint is always `none` (`E-CACHE-REMOTE` otherwise). See [KV cache: Isolation](https://opod.io/docs/control-plane-endpoints/kv-cache/#isolation). **Figure: KV-cache strategies.** One tab per strategy: workers needed when each card holds weights and its share of the KV pool; requests that fit one 80 GB card's KV room at 16-bit and 8-bit KV; prefix reuse across three requests; four workers' routing scores and the worker picked; and the memory tiers where requests found their prefix blocks. The interactive figure is on the web page: ## Sticky sessions From 0.3.0, `routing.stickyTtlSeconds` keeps an API key's turns on the worker that served its last turn, so the engine reuses that conversation's prefix cache. It also sets how long a prefix pin (`prefixAffinity`) lives. - **When you need it:** multi-turn chat or agents, where each turn resends the conversation so far. - **Default `0`:** the leader's own value. A control-plane leader has none, so session pins are off and prefix pins live 10 minutes. - **Live:** no rollout. A pin placed after the policy lands expires by the new value; a pin already placed keeps the expiry it had. - **Soft:** a pinned worker that is saturated or drained loses the pin, and the request goes elsewhere. - **A leader without the `sticky_ttl_policy` feature ignores the field.** Roll the endpoint onto a newer leader image first. - **A conversation, not a key (core v0.4.3).** Send `X-Opod-Session: ` (or the OpenAI `user` field) and the pin belongs to that conversation, so two conversations under one key each keep their own worker. With the core policy's `routing.session.signedRoute`, every answer carries `X-Opod-Session-Route`; echo it and any front door routes the next turn to the same worker. With `routing.session.turnPriority`, a later turn of an active conversation leaves the hold before a first turn of the same flow, capped so a first turn that waited 8 s still goes first. A pin never lands a request on a saturated worker or one with no free slot. From core v0.4.7 the same pins hold a conversation on its **gang** when a model has several: the route token then names the gang and its head worker, and is ignored once that head restarted or the gang re-formed on another head. - **Session pins need a leader from core v0.4.1** (control plane 0.3.2 pins core v0.4.2). A key the control plane issues has no user id, and core v0.4.0 (the leader 0.3.0 pins) pins only by user id, so on it the field moves prefix pins and no session is pinned. 1. **Set 15 minutes on the endpoint chat** ```bash opodcp endpoint policy --sticky-ttl 15m chat # or 900; 0 hands it back to the leader ``` Or send `"routing": { "stickyTtlSeconds": 900 }` in the policy `PUT`, or set **Sticky TTL** on the console's **Routing policies** page. 2. **Check it worked** The command prints `sticky ttl 15m0s`, and the leader's `opod_router_sticky_hits_total{outcome="hit"}` grows as a key's turns return. | If it fails | Cause | Fix | | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | | `400` naming `routing.stickyTtlSeconds` | below 0 or above 86,400 | a value in range | | `hit` never grows | the requests carry no API key, the leader lacks the feature, or the leader is core v0.4.0, which pins no control-plane key | send a key; roll onto a leader from core v0.4.1 | ## Speed rank `routing.speedRank: true` (default `false`) ranks each worker or gang that is not saturated by (its load score + 1) × its own measured seconds per token, so a fast card takes the next request on a quiet fleet. A worker with fewer than 10 answers takes its peers' median, and 1 pick in 20 goes to the least-sampled worker. It needs a leader with the `routing_speed_rank` feature, and is new in 0.3.0. Set it with the policy `PUT`. ## Admission The leader dispatches a request to a worker only while that worker has a free **slot** (llama.cpp's slots, SGLang's running-request limit, vLLM's `max_num_seqs`, default 256). The rest wait in the leader. | Knob | Range | Effect | | --------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `admission.holdMs` | 0–60,000 | how long a request waits for a slot before `503` with `Retry-After`. `0`: shed at once when no worker can serve; wait with no deadline when every slot is busy | | `admission.maxHeld` | 0–10,000 (0 = 64) | how many requests may wait at once | | `admission.classes[]` | up to three, one per class | per class: `name` (`critical`, `standard` or `sheddable`), `holdMs` (0–60,000), `maxHeld` (0–10,000; 0 = no cap of its own), `maxShare` (0 = the class default, else a fraction in (0, 1]) | A value out of range, an unknown class name, or a class listed twice is refused `400` with the rule. A class not listed takes `admission.holdMs` and no cap of its own. With classes, `maxHeld` caps every class together. A plan with `floor: 0` runs with every hold raised to at least 60 s while it may sleep, from 0.3.0; a longer hold you set stands, and the stored document does not change. **Request classes.** With classes listed, waiting requests are served `critical` before `standard` before `sheddable`, and inside a class round the flows (a key's team, else the key) so no flow starves another. A class may hold at most `max(1, floor(maxShare × slots))` slots; default shares are 1, 1 and 0.25. That keeps a free slot for a critical request while a batch saturates the endpoint. A key's class is set when it is minted; a caller may lower its class per request with the `X-Opod-Class` header, never raise it. Overflow and expiry shed the lowest class first. Per-class leader metrics: `opod_admission_held`, `opod_admission_shed_total` (reasons `deadline`, `cap`, `evicted`, `unavailable`), `opod_admission_wait_seconds`, `opod_admission_in_flight` against `opod_admission_slots`. ## Fallback When the leader has no serving capacity, it forwards the request to `fallbackUrl/v1/chat/completions` (with `fallbackModel` and `fallbackKey`) instead of answering `503`, and marks the answer with `X-Opod-Fallback`. | Field | Rule | | --------------- | ----------------------------------------------------------------------------------- | | `fallbackUrl` | an `http(s)` URL with a host; required when `fallbackModel` or `fallbackKey` is set | | `fallbackModel` | the model name sent to the fallback | | `fallbackKey` | write-only; the `GET` answers `fallbackKeySet`. `""` sends no key | Example: send overflow to a cloud model when no worker can serve. ```bash jq '.routing += {fallbackUrl: "https://api.example.com", fallbackModel: "gpt-small", fallbackKey: ""}' policy.json > new.json curl -s -H "$H" -H 'Content-Type: application/json' -X PUT https://cp.example.com/api/v1/endpoints//policy -d @new.json \ | jq '.routing | {fallbackUrl, fallbackModel, fallbackKeySet}' # {"fallbackUrl":"https://api.example.com","fallbackModel":"gpt-small","fallbackKeySet":true} ``` A stored `fallbackKey` is never sent to a different host: a `PUT` that changes the URL without resending the key is refused `400`; resend the key, or `""` for none. A `PUT` with no `fallbackUrl` clears the whole fallback. ## Front doors **Front doors** are stateless copies of the leader's request path in front of one endpoint. With doors on, clients call the doors, and a leader restart (about 10 s) costs no requests: the doors keep serving from their mirrored worker list. ```yaml gateways: { enabled: true } # count = max(2, ⌈units / 4⌉), capped by max (default 8) ``` A **unit** is one worker or one gang. A gang counts once however many GPUs it spans, because a door sends each request to the gang's head and the head drives the other parts. So one 12-part gang gets 2 doors, two 4-part gangs get 2, and 12 single-GPU workers get 3. Until the release after 0.3.6 the count reads every gang part as a worker (that 12-part gang gets 3 doors). Pin the count with `replicas` if you need a different one. ```bash opodcp endpoint doors --max 4 chat on opodcp endpoint placement chat # where the leader and each door run, and why ``` | `gateways` field | Default | Meaning | | ---------------- | ----------- | ------------------------------ | | `enabled` | `false` | turn the doors on | | `replicas` | 0 (derived) | pin the count; you then own it | | `max` | 8 | cap the derived count | An endpoint parked at zero keeps its doors: they answer the first request and wake it. Doors cost cluster CPU, never the ledger, the licence or the team quota. The status carries `gateways[]`, `doorsWanted` and `doorsAsked`. `opodcp endpoint doors` and `opodcp endpoint placement` are new in 0.3.0, as do the per-node cap below and its refusal. One endpoint's doors stay on different nodes, so no more doors run than nodes that may hold one: the count is capped and the plan says so (`doors.capped`); a pinned `replicas` above it is refused `E-DOORS-NODES`. Doors need a leader that supports them (`E-GATEWAY-UNSUPPORTED` otherwise). As a rule: one node that may hold a front — doors off; two — doors if a leader restart must cost nothing; three or more — doors on for production. ## The cell door The **cell door** is one URL for every endpoint of the cell that names an alias. The request's `model` chooses the endpoint. ```bash helm upgrade opodcp … --reset-then-reuse-values --set door.enabled=true ``` ```yaml door: { alias: chat } # in each endpoint's plan; unique in the cell (E-DOOR-ALIAS) ``` An alias is a name a client can send as `model`: letters, digits and `.` `_` `:` `/` `-`, at most 128 characters, starting with a letter or digit. It may be the model's own id. `E-DOOR-ALIAS` refuses an alias another endpoint holds (two endpoints of one model are two names), the name `auto`, and the name of an auto route. Clients call Service `-door` (port 8080) with `model: chat`. `GET /api/v1/cell` carries `doorUrl`. The door is the leader image run as `opod up --role door`: a name lookup that forwards each request unchanged to that endpoint's leader. It holds no credential; the endpoint's leader checks the key, and the door's `GET /v1/models` lists only the aliases whose endpoint accepts the caller's key. The control plane writes the routes into ConfigMap `-door-routes` on every plan change; the door re-reads it every 10 s and keeps the last good routes while the control plane is down. | Value | Default | Meaning | | ----------------------------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------- | | `door.enabled` | `false` | run the cell door | | `door.replicas` | `2` | one per node, never more than nodes that may hold a front; from 0.3.0 the door is placed by the same rule as leaders | | `door.image` | the chart's leader image | must be a leader that knows the door role | | `door.service.type`, `.port`, `.nodePort` | `ClusterIP`, `8080` | `NodePort` to reach it from a LAN | For example, two doors reached on a node port from your LAN: ```bash helm upgrade opodcp … --reset-then-reuse-values --set door.enabled=true --set door.replicas=2 \ --set door.service.type=NodePort --set door.service.nodePort=30090 ``` ### Auto routes Auto routes are new in 0.3.0. An auto route is a name (for example `auto`) that the door resolves to several endpoints in your order, falling back down the list when one cannot take the request. A request that carries `tools` goes only to endpoints whose model can call tools. ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X PUT https://cp.example.com/api/v1/door/auto-routes \ -d '{"routes":[{"name":"auto","endpoints":["chat-large","chat-small"],"pick":"first","maxHops":1}]}' ``` | Field | Meaning | | ------------- | ---------------------------------------------------------------------------------------------------------- | | `name` | what a client sends as `model` | | `endpoints[]` | the candidates' door aliases, the first tried first | | `pick` | `first` (the order as written, the default) or `least-loaded` (each candidate leader's own `/loadz`) | | `maxHops` | fallbacks one request may take: 0 means the door's default of 1, at most the number of endpoints minus one | The `PUT` (admin) replaces the whole list and answers `{"routes": [ … ]}`; `GET /api/v1/door/auto-routes` reads it. Invalid routes are refused `E-DOOR-AUTO`, and so is any route on an install with no cell door. In 0.3.0, `opodcp door routes` prints the list and `opodcp door routes -f routes.yaml` replaces it. Give clients a **route key** so every endpoint on the route accepts them; see [API keys](https://opod.io/docs/control-plane-endpoints/api-keys/). --- title: "Models" description: "The model catalog, adding your own models, versions with approval and licence, prefetch, the Hugging Face token, LoRA adapters and the node cache." url: "https://opod.io/docs/control-plane-endpoints/models/" markdown_url: "https://opod.io/docs/control-plane-endpoints/models.md" section: "Endpoints" last_updated: "2026-10-30" --- # Models > The model catalog, adding your own models, versions with approval and licence, prefetch, the Hugging Face token, LoRA adapters and the node cache. An endpoint serves exactly one model from the control plane's **model registry**: the bundled catalog plus models you add. The catalog records each model's repo, files, formats, recommended engines, size and architecture, which the planner uses to size it. ## In short Before an endpoint can serve a model, the control plane must know it: its Hugging Face repo, its file format and its size, which the planner uses to place it. The bundled catalog already knows many models. You add your own by repo. A **version** pins exact bytes of a model, so a plan can say "run v2" and roll back to "v1" later. ## When you need it - The model you want is not in the catalog. - The repo is gated (Llama, Gemma): set the cluster's Hugging Face token once. - You want to warm a node's cache before a create, so the first start is fast. - You fine-tuned a model and want to promote and roll back by name. - Your security team must approve a model before it runs (0.3.0). - You serve LoRA adapters on vLLM. ## Do it 1. **Check the repo** ```bash curl -s -H "$H" "https://cp.example.com/api/v1/models/validate?repo=acme/my-model-GGUF&file=my-model-q4_k_m.gguf" # {"ok":true,"repo":"acme/my-model-GGUF","sizeGb":4,"files":[…],"gguf":true,"engine":"llamacpp","format":"gguf"} ``` 2. **Set the Hugging Face token, if the repo is gated** ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X PUT \ https://cp.example.com/api/v1/settings/hub-token -d '{"token":"hf_"}' ``` 3. **Add the model** ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/models \ -d '{"id":"my-model-q4","repo":"acme/my-model-GGUF","file":"my-model-q4_k_m.gguf","format":"gguf","engine":"llamacpp"}' ``` The answer is `201` with the model record, `origin: user`. 4. **Warm a node, optionally** ```bash curl -s -H "$H" -X POST "https://cp.example.com/api/v1/models/my-model-q4/prefetch?node=node-a" | jq '{state, job}' ``` 5. **Use it in a plan** Name it in `model` and `plan.model.id` of a create body ([Create](https://opod.io/docs/control-plane-endpoints/create/)). ## Check it worked ```bash curl -s -H "$H" https://cp.example.com/api/v1/models | jq '.[] | select(.id=="my-model-q4") | {id, status, sizeGb, origin}' curl -s -H "$H" "https://cp.example.com/api/v1/models/my-model-q4/prefetch?node=node-a" | jq .state ``` A good answer: `status` is `ready`, and the prefetch `state` is `cached` or `succeeded`. In the console the **Models** page lists the model, and the machine page lists the cached file. ## If it fails | Symptom or code | Cause | Fix | | ---------------------------------------- | -------------------------------------------------------------------- | --------------------------------------------------- | | `validate` answers `{"ok": false, …}` | the repo or file name is wrong, or the repo is gated | fix the name; set the Hub token | | `400` on `PUT …/hub-token` | the value does not start with `hf_` | paste a Hugging Face token | | `E-HUB-TOKEN-MISSING` | gated repo and no token in the cluster | set a token with read access | | `E-HUB-TOKEN-REFUSED` | the token is mistyped, expired or revoked | set a current token | | `E-HUB-ACCESS-DENIED` | the token's account may not read the repo | accept the model's terms on the Hub as that account | | Prefetch answers `400` | the model is not GGUF, the node is unknown, or the cache has no room | a GGUF model, a known node, or prune the cache | | `E-MODEL-IN-USE` on delete | an endpoint still names the model | delete or change that endpoint first | | `E-MODEL-UNAPPROVED` (0.3.0) | approval is required and the version is not approved | an admin approves it | | `E-VERSION-IN-USE`, `E-VERSION-ARCHIVED` | archive of a pinned version, or a pin to an archived one | unpin first; pin a live version | ## Browse and add ```bash curl -s -H "$H" https://cp.example.com/api/v1/models | jq '.[] | {id, format, engines, sizeGb, origin}' curl -s -H "$H" "https://cp.example.com/api/v1/models/validate?repo=acme/my-model-GGUF&file=my-model-q4_k_m.gguf" curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/models \ -d '{"id":"my-model-q4","repo":"acme/my-model-GGUF","file":"my-model-q4_k_m.gguf","format":"gguf","engine":"llamacpp"}' ``` `validate` probes the Hub (your mirror, when `OPODCP_HUB_ENDPOINT` is set, from the release after 0.3.6). It answers `{"ok": true, "repo", "sizeGb", "files", "gguf", "engine", "format"}`, where `engine` and `format` are its guess (`llamacpp` and `gguf` when the repo holds GGUF files, else `vllm` and `safetensors`), or `{"ok": false, "error": "…"}`. | Add-model field | Default | Meaning | | ------------------ | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `id` | from the repo's last part | a slug: `a-z`, `0-9`, `.`, `_`, `-`, 2 to 63 characters | | `repo` | — | the Hugging Face repo; required for `source: hf` | | `file` | the repo's `Q4_K_M` GGUF file, else its first GGUF file | the GGUF file inside the repo | | `source` | `hf` | where the weights come from | | `engine`, `format` | read from the Hub | `llamacpp` and `gguf` for a GGUF repo, else `vllm` and `safetensors` | | `sizeGb` | read from the Hub | the weights' size in GB, which the planner and the ledger size every worker by. A GGUF model is the size of its `file`. From the release after 0.3.6, a safetensors repo is the sum of its top-level `*.safetensors` files (a `consolidated*` copy is skipped when shard files are there too), read whatever `engine` and `format` you name, and from your Hub mirror (`OPODCP_HUB_ENDPOINT`) when one is set; before it, a safetensors repo registered with no size, so pass `sizeGb` yourself. A size you pass is kept | | `name` | the id | a display name | | `protocol` | `chat` | `chat`, `embeddings` or `rerank` | | `tools` | `false` | the model can call tools; a door auto route sends a request with `tools` only to such models. New in 0.3.0 | A model you add reads `origin: user`; a catalog model reads `origin: catalog`. A model record also carries `engines` (the catalog's recommended engines, best first), `sizeGb`, `contextWindow`, `vramHintGb`, `minRamGb` (host memory, an advisory only), `license`, `shardable`, `architecture` (`params`, `layers`, `heads`, `kvHeads`, `experts` and more; unknown fields warn and never refuse) and `status` (`ready`, `validating`, `error`). Adding a model answers `201` and needs the operator role; deleting one needs admin and is refused `E-MODEL-IN-USE` while an endpoint names it. The console's **Models** page does the same. ## Gated models: the Hugging Face token A gated repository (Llama, Gemma) needs a token. There is **one token per cluster**: ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X PUT \ https://cp.example.com/api/v1/settings/hub-token -d '{"token":""}' ``` Setting it needs admin. The control plane writes it into Secret `opodcp-hub` (`opod-hub` on `0.3.0`) and nowhere else: never its own store, an event or a log. No route returns it; `GET` answers only whether it is set. A value that does not start with `hf_` is refused. Workers and prefetch Jobs receive it as `HF_TOKEN` and `HUGGING_FACE_HUB_TOKEN`. In the console: **Settings → Hugging Face token**. A fetch the Hub refuses fails the rollout's prefetch step with a code: | Code | Cause | Fix | | --------------------- | -------------------------------------------------------------------------------------- | --------------------------------------------------- | | `E-HUB-TOKEN-MISSING` | the repository is gated or private and the cluster has no token (or the name is wrong) | set a token with read access | | `E-HUB-TOKEN-REFUSED` | the Hub answers the token `401`: mistyped, expired, revoked | set a current token | | `E-HUB-ACCESS-DENIED` | the token is valid and its account may not read the repository | accept the model's terms on the Hub as that account | ## Prefetch A rollout's prefetch step pulls the plan's weights once into each target node's cache (`/data/models`), and from the release after 0.3.6 a speculative draft model's weights too. You can also warm a GGUF model onto a node ahead of any endpoint (operator): ```bash curl -s -H "$H" -X POST "https://cp.example.com/api/v1/models//prefetch?node=node-a" curl -s -H "$H" "https://cp.example.com/api/v1/models//prefetch?node=node-a" ``` The `POST` answers at once: `200` when the node's cache already lists the file, `202` when it started a pull or one was already running. Both answer `{ model, node, file, state, job, detail }`. `state` is `cached`, `started`, `running`, `succeeded`, `failed` or `none`. A model that is not GGUF, an unknown node, a cache with no room or no image is `400` with the reason. The `GET` needs `?node=`. A vLLM worker pulls its own snapshot at launch. Weights are fetched atomically, and the cache prune never removes a file it did not fetch. ## Versions A **version** is a pinned revision of one catalog id, never a second model. ```bash opodcp model versions qwen2.5-7b curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/models/qwen2.5-7b/versions \ -d '{"version":"v2","revision":"","licence":"Apache-2.0","note":"fine-tune 2026-10"}' curl -s -H "$H" -H 'Content-Type: application/json' -X POST \ https://cp.example.com/api/v1/models/qwen2.5-7b/versions/v2/promote -d '{"state":"prod"}' curl -s -H "$H" -X POST https://cp.example.com/api/v1/models/qwen2.5-7b/versions/v2/archive ``` | Version field | Meaning | | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | `version` | the name; never reused for other bytes | | `revision`, `sha256` | the Hub commit and the file digest; a version needs at least one | | `sizeBytes`, `origin`, `lineage` | the size, where it came from (a repo, a training job, an import) and the version it was derived from | | `state` | `draft` (default), `staging`, `prod` or `archived` | | `evals` | measured scores by suite name, written by a rollout's eval step | | `note`, `createdBy`, `createdAt`, `promotedAt` | — | | `licence` | an SPDX expression (`Apache-2.0`, `MIT OR Apache-2.0`, `LicenseRef-…`); its shape is checked. New in 0.3.0 | | `approval` | `by`, `at`, `note` once an admin approved it. New in 0.3.0 | | `signature` | the last signature check: `state`, `reason`, `file`, `detail`, `identity`, `commit`, `root`, `node`, `at`. New in 0.3.0 | - Registering and promoting a version needs the operator role. - A state is a label and routes nothing: a plan pins a version with `model.version`, resolved to `revision` and `sha256` when the plan is stored. - Archiving is refused `E-VERSION-IN-USE` while an endpoint pins the version. No weight file is deleted. Pinning an archived version is refused `E-VERSION-ARCHIVED`. - `opodcp model` is new in 0.3.0. **Roll a model back.** `POST /api/v1/models/{id}/versions/{v}/rollback` starts one verified rollout per endpoint that pins a version registered after `v`. `GET …/rollback/preview` answers the same and starts nothing. A team-scoped operator rolls back only their team's endpoints; `otherTeams` counts the others. Rolling back to a version that does not exist is `E-VERSION-UNKNOWN`, and to an archived one `E-VERSION-ARCHIVED`. ## Approval Approval is new in 0.3.0. An admin approves a version for deployment. The operator who registers and pins a version is not the one who says it may run. ```bash opodcp model approve --note 'eval 0.82, licence reviewed' qwen2.5-7b v2 opodcp model revoke qwen2.5-7b v2 # clears the approval (0.3.6); the release after 0.3.6: opodcp model unapprove qwen2.5-7b v2 opodcp model approval on # models.requireApproval ``` | Route | Purpose | | ------------------------------------------------- | ------------------------------------------ | | `POST /api/v1/models/{id}/versions/{v}/approve` | approve, with an optional `note` (admin) | | `DELETE /api/v1/models/{id}/versions/{v}/approve` | revoke the approval (admin) | | `GET`, `PUT /api/v1/settings/model-approval` | `{"requireApproval": true}` (admin to set) | With `requireApproval` on (default off), a **new** pin must be an approved version: a create, preview or plan edit that pins an unapproved version, or no version at all, is refused `E-MODEL-UNAPPROVED`. A plan that keeps the pin its endpoint already runs passes, so turning the setting on never stops a running endpoint. Remote endpoints are never judged. ## Signatures Signature checks are new in 0.3.0. Each prefetch checks whether the repository publishes a model signature (`model.sig`, OpenSSF model signing) and verifies it with the same Sigstore trust root images use. The signer is matched against `images.trust`, where a model's key is `hf.co//`: ```yaml images: trust: - repositoryPrefix: hf.co/acme/ issuer: https://token.actions.githubusercontent.com identityRegex: ^https://github\.com/acme/models/\.github/workflows/.+$ ``` | Result | Meaning | Effect | | ------------ | ------------------------------------------------------------------------------- | ----------------------------------------------------- | | `verified` | the signature verifies, a trust entry allows its signer, and every file matches | none | | `invalid` | bad signature, untrusted signer, or a file that does not match | **the rollout holds** for an admin's accept or reject | | `unverified` | signed, and no trust entry covers the repository | recorded | | `unsigned` | no signature published | recorded | | `unknown` | the Hub could not be asked | recorded | Only `invalid` holds. See [Rollouts](https://opod.io/docs/control-plane-endpoints/rollouts/) for accept and reject. With `weights.skipSourceCheck` (air-gapped), no signature is checked. ## LoRA adapters **Proven** on vLLM with an NVIDIA card (2026-11-06): one worker with two adapters answered under three names (the base, `:python`, `:fin`) with three different answers, and held one card. Not proven on vLLM with AMD. `plan.adapters[]` serves LoRA variants of the one model identity on vLLM, each as `:`: ```yaml adapters: - { name: support, source: acme/qwen-support-lora, rank: 16 } ``` Names are lower-case letters, digits, `.`, `_` and `-` (at most 64), unique, and at most 16 per endpoint. `source` is a Hugging Face repo or a path under the node cache, and is required. `rank` is the adapter's own r, 0 or more: the workers size vLLM's LoRA slots from the largest rank in the set. A remote endpoint takes no adapters. A changed set in the plan rolls the pods. To add or remove one **live**, with no pod roll (operator): ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/endpoints//adapters \ -d '{"name":"support","source":"acme/qwen-support-lora","rank":16}' curl -s -H "$H" -X DELETE https://cp.example.com/api/v1/endpoints//adapters/support ``` A live adapter whose rank exceeds the rank the running engines were started for is refused `E-LORA-RANK`. A non-vLLM engine is `E-NO-ENGINE`. Adding a name the endpoint already serves is refused: drop it first to change its source or rank. Dropping a name it does not serve is `400`. A live change is a plan revision with cause `adapters`. ## The node cache Each node keeps weights under `/data/models`. `GET /api/v1/nodes/{name}/cache?minAge=24h` (admin) previews what a prune would remove: it keeps the file of every plan with a worker there (parked ones included), every file a prefetch is pulling now, and every model with a version in `staging` or `prod`. `POST …/cache/prune` removes the rest; the default minimum age of 24 hours keeps a recent rollback's weights warm. With cache management off (`cache.gc.mode=off`), a prune is refused `E-CACHE-GC-OFF`. The console's machine page lists each cached file with the endpoints that reference it. ## Tenstorrent workers tt-metal's vLLM reads its model from a vendor **model spec**. A worker on a Tenstorrent node names a ConfigMap (item `spec.json`) in `workers[].modelSpec`; generate the spec once per model and device with Tenstorrent's `tt-inference-server`. Weights sit on the node under the model cache and are not prefetched. Refusals: `E-TT-SPEC` (no spec on a Tenstorrent node, or a spec on any other), `E-TT-WEIGHTS` (no node holds the weights at the directory the spec names), `E-TT-HUGEPAGES` (1 GiB huge pages per chip), `E-TT-GANG` (Tenstorrent gangs are not placed). --- title: "KV cache" description: "Every KV-cache strategy in opod — sizing from plan.workload, 8-bit precision, prefix reuse, KV-aware routing, cache isolation and offload tiers — with formulas, knobs, proofs and costs." url: "https://opod.io/docs/control-plane-endpoints/kv-cache/" markdown_url: "https://opod.io/docs/control-plane-endpoints/kv-cache.md" section: "Endpoints" last_updated: "2026-10-30" --- # KV cache > Every KV-cache strategy in opod — sizing from plan.workload, 8-bit precision, prefix reuse, KV-aware routing, cache isolation and offload tiers — with formulas, knobs, proofs and costs. A worker's GPU memory holds the model's weights and its **KV cache**: the attention keys and values of every token the engine is working on. The KV cache decides how many requests a worker serves at once, how long a request may be, and how much of a repeated prompt is free. opod has six strategies for it. Each one below says what it solves, how it works, the knobs, where it is proven, what it costs and how it fails. > **Note** > > This page describes `0.3.0`. The published `0.2.1` has vLLM's CPU tier and the routing knobs; sizing from `plan.workload`, cache isolation, the other engines' tiers, the `disk` and `auto` tiers and the KV advice routes came after it. See [Releases](https://opod.io/docs/get-started/releases/). | Strategy | Where it is set | Changes take | | ----------------------- | ----------------------------------------------------- | ------------------------------------ | | [Sizing](#sizing) | `plan.workload`, `flags.ctx`, `flags.max_model_len` | a rollout | | [Precision](#precision) | `flags.kv_cache_dtype`, `flags.kv_cache_type` | a rollout | | [Prefix](#prefix) | your prompts; nothing to switch on | nothing | | [Routing](#routing) | the endpoint policy (`routing.*`) and `plan.kvEvents` | policy: live · `kvEvents`: a rollout | | [Isolation](#isolation) | `plan.routing.cacheIsolation` | live, no pod restart | | [Tiers](#tiers) | `workers[].kvOffload`, `shardGroups[].kvOffload` | a rollout | In 0.3.0, each of these has a control. The create form sets sizing, precision, events, isolation and tiers. `opodcp endpoint kv` changes them on a running endpoint, and `opodcp endpoint policy` changes the routing knobs ([CLI](https://opod.io/docs/control-plane-reference/cli/#endpoint-kv--policy--expose)). For example, `opodcp endpoint kv --dtype fp8 --events on chat`. Try each strategy below before you read its section. Every tab uses the planner's own arithmetic and rules. **Figure: KV-cache strategies.** One tab per strategy: workers needed when each card holds weights and its share of the KV pool; requests that fit one 80 GB card's KV room at 16-bit and 8-bit KV; prefix reuse across three requests; four workers' routing scores and the worker picked; and the memory tiers where requests found their prefix blocks. The interactive figure is on the web page: ## In short The KV cache is the GPU memory a worker uses for the requests it is serving. Its size decides how many requests run at once and how long each may be. Tell the planner your traffic in `plan.workload` and it sizes the cache for you and shows the arithmetic. The other strategies on this page reuse cache that is already computed, or keep more of it in host memory. ## When you need it - Requests queue or get preempted at the peak: size from `workload`, or use an 8-bit KV cache. - An engine starts with a shorter context than you asked for: the cache does not fit beside the weights. - Many requests share a long prefix (RAG, agents, a long system prompt): keep the prefix stable, route by prefix, add a tier. - Several teams share one endpoint and must not share cached prompts: set `cacheIsolation`. ## Do it 1. **Describe the traffic** Add a `workload` block to the plan, or pick a preset on the create form: ```yaml workload: { inputTokens: 2000, outputTokens: 500, peakConcurrency: 80 } ``` 2. **Read the arithmetic in Preview** Preview the create body (or the plan) and read the `workload` and `context` advisories: ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/endpoints/preview \ -d @chat.json | jq '.advisories[] | select(.kind=="workload" or .kind=="context")' ``` They state one request's memory, the endpoint's pool, the requests per worker and, when the workers cannot hold the peak, the `autoscale.floor` to set. 3. **Apply it** Create the endpoint, or post the plan as a verified rollout (`POST /api/v1/endpoints/{id}/rollouts`). Sizing is pinned into engine flags, so it rides a rollout. 4. **Compare with what was measured, after a week** ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//kv/advice | jq . ``` The answer is one of `insufficient`, `oversized`, `undersized`, `fits` or `unknown`, with one suggested edit. ## Check it worked ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//kv | jq . ``` A good answer shows, per worker, the planner's `planned` figure beside the engine's own `load` sample, and the KV in use stays below the pool at the peak. In the console, the endpoint page's KV card shows the same verdict and **Review the suggested size**. ## If it fails | Symptom or code | Cause | Fix | | ----------------------------------------------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `E-FIT` | one request of the workload's length does not fit beside the weights | a shorter context, an 8-bit KV cache, or a bigger card | | Preview says the model is not sized | the catalog records too little architecture for the model | pin `flags.ctx` or `flags.max_model_len` yourself | | `400`: the workload is longer than the model's window | `maxContext` (or input + output) is above the model's context window | a shorter `maxContext` | | `E-KV-DTYPE` | an 8-bit KV cache on TensorRT-LLM over weights that are not FP8 | FP8 weights (`model.format: fp8`), or 16-bit KV | | `E-KV-EVENTS` | `kvEvents` on an engine other than vLLM or SGLang | `prefixAffinity` instead | | `E-CACHE-REMOTE` | `cacheIsolation` other than `none` on a remote endpoint | leave it `none` | | `E-KV-OFFLOAD`, `E-KV-RAM`, `E-DISK` | a tier on an unproven vendor, or one that the node's memory or disk cannot hold | see [KV cache tiers](https://opod.io/docs/control-plane-endpoints/kv-tiers/) | ## Sizing **Problem.** A KV cache sized from guesses either wastes cards or runs out at the peak. An engine that cannot hold its context also shortens it silently at start. **How it works.** You describe the traffic in `plan.workload`. The planner turns it into memory and shows the arithmetic in Preview, term by term (advisory `workload`). ```yaml workload: inputTokens: 2000 # one typical prompt outputTokens: 500 # one typical answer maxContext: 4096 # the longest request, prompt + answer; default inputTokens + outputTokens peakConcurrency: 80 # requests in flight at the busiest moment; default 1 peakRps: 20 # recorded and said back, never sized from headroomPct: 15 # margin over the pool; default 15, 0 = no margin ``` ### The per-token formula The planner reads the model's shape from the catalog (`architecture`) and the element size from the plan's flags (2 bytes by default). One token of KV cache is: | Architecture | Bytes per token | Catalog fields | | -------------------------------------------------------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------- | | Grouped-query or multi-head attention | 2 × layers × KV heads × head dim × bytes per element | `layers`, `kv_heads` (else `heads`), `head_dim` (else 128) | | Multi-head latent attention, on vLLM, SGLang, TensorRT-LLM | layers × (`kv_lora_rank` + `qk_rope_head_dim`) × bytes | the engine keeps one compressed latent per layer | | Multi-head latent attention, on llama.cpp | layers × heads × (`qk_nope_head_dim` + `qk_rope_head_dim` + `v_head_dim`) × bytes | llama.cpp keeps K and V per head | | Sliding-window layers | as GQA, but only for the last `sliding_window` tokens | `sliding_window`, `sliding_layers` | | Hybrid state layers (SSM, linear attention, short convolution) | nothing per token; a fixed `state_bytes` per sequence | `state_layers`, `state_bytes` | One request of `n` tokens therefore needs: ```text full layers × per-layer bytes × n + sliding layers × per-layer bytes × min(n, window) + state bytes ``` A model whose catalog entry records too little architecture is not sized. Preview says so instead of inventing a number. ### From one request to the pool ```text one request = the formula above at the workload's context endpoint pool = peakConcurrency × one request × (1 + headroomPct / 100) per worker = (card budget − weights − engine overhead − unmeasured margin) ÷ (one request × margin) ``` - **The context** is, in this order: a context the row pins (`flags.ctx` for llama.cpp, `flags.max_model_len` for vLLM, SGLang and TensorRT-LLM), then `workload.maxContext`, then `inputTokens + outputTokens`. The shortest context an engine is started with is 512. A workload longer than the model's context window is refused. - **What gets pinned.** vLLM, SGLang and TensorRT-LLM get `max_model_len` = the context. A dedicated llama.cpp worker starts at one request's length and the fill gives it as many slots as its card holds. A shared llama.cpp worker gets one pool for its share of the peak (`ctx` = its share × the context, `parallel` = its share). - **No workload.** A llama.cpp worker with no context gets 8,192 tokens, capped at the model's window, and Preview says so. A llama.cpp gang gets no default: it keeps the model's full window, and a gang that cannot hold that much KV cache fails at start. Set `shardGroups[].flags.ctx` (see [Gangs](https://opod.io/docs/control-plane-endpoints/gangs/)). vLLM and SGLang are left at their own defaults. - **Card budget.** A row's `vramBudgetGb`, else the smallest usable card on the node. A dedicated vLLM worker fills 0.85 of its card unless `flags.gpu_memory_utilization` says otherwise. - **Engine overhead per worker:** vLLM 837 MiB on NVIDIA and 1,103 MiB on AMD; 190 MiB for anything not measured. llama.cpp in 0.3.0: 640 MiB on NVIDIA. - **llama.cpp's overhead, from 0.3.2,** is three terms, read from llama-server's own buffer log: - a fixed part per card model: 160 MiB on an RTX 3060 Ti, 365 MiB on an AMD Radeon RX 7900 XTX, 570 MiB on an RTX 5090. A card not measured (another AMD card included), or a worker not placed yet, takes 570. - a compute base of 136 MiB (the largest measured, a 7B model; 34 MiB at 0.5B). - the attention mask, 1 KiB per attended token at llama.cpp's default micro-batch of 512. A shared worker's mask spans its whole pool; a dedicated worker's spans one slot. The slot count adds nothing at a fixed pool. Example: a shared llama.cpp worker on an RTX 3060 Ti with an 8,192-token pool: 160 + 136 + 8 = 304 MiB. The same worker before it is placed: 570 + 136 + 8 = 714 MiB. A 2-million-token shared pool adds 2 GiB of mask. - **Weights and the unmeasured margin.** The catalog records weights in GB (10⁹ bytes); the card is measured in GiB (2³⁰ bytes). The planner converts the weights to GiB, and adds an *unmeasured margin* of 7.4 % of them, which Preview names in every reason. The margin keeps every claim the size it was in 0.2.1, which counted the weights in GB as if they were GiB. It is the one margin over what is not measured, and it stays. New in 0.3.0. - **llama.cpp KV layout.** The planner pins `kv_unified`: `true` (one pool every slot shares) on a shared worker, `false` (one partition per slot) on a dedicated one. When the workers cannot hold the peak, Preview says how many workers it takes and suggests `autoscale.floor`. It never changes your plan. A worker that cannot hold even one request of the workload's length is refused `E-FIT`, and a shared worker no card in the cell can hold is `E-FIT` with the number of workers it takes. See [Error codes](https://opod.io/docs/control-plane-reference/error-codes/). The planner sizes **memory only**. A request rate without a latency gives no concurrency, so `peakRps` alone is said back with a request for `peakConcurrency`. ### Worked example: an 8B model Llama 3.1 8B (`llama-3.1-8b`): 32 layers, 8 KV heads, head dim 128 (not recorded, so the 128 default), bf16 weights of 16.07 GB. | Step | Arithmetic | Result | | -------------------------------------------- | -------------------------------- | ----------------------------------------- | | One token, 16-bit | 2 × 32 × 8 × 128 × 2 B | 131,072 B = 128 KiB | | One request, chat preset (2,000 + 500) | 2,500 × 128 KiB | 0.31 GiB | | One request at 4,096 tokens | 4,096 × 128 KiB | 0.50 GiB | | One request at the full 131,072-token window | 131,072 × 128 KiB | 16 GiB | | Endpoint pool, 80 at once, 15 % margin | 80 × 0.305 × 1.15 | 28.1 GiB | | Weights in GiB, and the unmeasured margin | 16.07 × 10⁹ ÷ 2³⁰; 16.07 − 14.97 | 14.97 GiB; 1.10 GiB | | Room on a dedicated vLLM worker, 48 GiB card | 48 × 0.85 − 14.97 − 1.10 − 0.82 | 23.9 GiB | | Requests per worker | 23.9 ÷ (0.305 × 1.15) | 68 | | Workers for the peak | ⌈80 ÷ 68⌉ | 2 — Preview suggests `autoscale.floor: 2` | | The same with an 8-bit KV cache | 23.9 ÷ (0.153 × 1.15) | 136 per worker, so 1 worker | The other shapes, at 32,768 tokens: | Model | Shape | Plain formula | What the planner sizes | | ---------------------------------- | -------------------------------------------------------------------- | ------------- | --------------------------------------------------- | | `gpt-oss-20b` | 24 layers, 12 sliding at a 128-token window, 8 KV heads, head dim 64 | 1,536 MiB | 771 MiB (12 full layers, plus 3 MiB for the window) | | `lfm2.5-8b-a1b` | 24 layers, 18 short-convolution state layers | 1,536 MiB | 384 MiB, plus a 0.28 MiB state | | DeepSeek-V2-Lite on llama.cpp | 27 layers × 16 heads × (192 K + 128 V) | — | 8,640 MiB (measured) | | DeepSeek-V2-Lite on vLLM or SGLang | 27 layers × (512 latent + 64 rope) | — | 972 MiB | The llama.cpp MLA figure was measured on the engine. The vLLM latent figure has not been measured on a card yet. ### Presets The create form fills `plan.workload` from three presets: | Preset | In | Out | At once | | -------------- | ------ | ----- | ------- | | Chat assistant | 2,000 | 500 | 80 | | Long documents | 16,000 | 1,000 | 8 | | Batch | 1,000 | 300 | 128 | **Cost.** None at run time: this is arithmetic. **Limits.** It is an estimate. The catalog's `head_dim` default of 128 is too high for small models (Qwen2.5-0.5B's is 64). The measured advice below corrects it. **Gangs.** A gang's pool is stated per gang, not counted in the workload pool, and a llama.cpp RPC gang does not shrink its context to fit: pin `flags.ctx` on it. See [Gangs](https://opod.io/docs/control-plane-endpoints/gangs/). ## Precision **Problem.** At 16 bits per element the KV cache is often the limit on concurrency or context length. **How it works.** An 8-bit KV cache stores each key and value element in one byte, so a token takes half the memory and a card holds twice the tokens. It is opt-in on every engine. 16-bit stays the default. | Engine | Flag | Example values | Engine argument | | ------------ | ---------------------- | ----------------------------- | --------------------------------------------------- | | vLLM | `flags.kv_cache_dtype` | `fp8`, `fp8_e4m3`, `fp8_e5m2` | `--kv-cache-dtype` | | SGLang | `flags.kv_cache_dtype` | `fp8_e4m3`, `fp8_e5m2` | `--kv-cache-dtype` | | TensorRT-LLM | `flags.kv_cache_dtype` | `fp8` | `kv_cache_config.dtype` in the engine's config file | | llama.cpp | `flags.kv_cache_type` | `q8_0`, `q4_0` | `-ctk` and `-ctv` | The planner sizes the value by its name. Every `fp8…` type is 1 byte per element. llama.cpp's block types store a scale with each block of 32 elements, so `q8_0` is 34/32 bytes, `q5_1` 24/32, `q5_0` 22/32, `q4_1` 20/32 and `q4_0` 18/32. `f32` is 4 bytes, and any other name is sized at 2 bytes, which reserves more, never less. When the KV cache is what limits the plan, Preview's `E-FIT` remedy names the smaller type for the plan's own engine, under that engine's flag. > **Warning** > > Up to and including 0.2.1, the planner read the digits of the value: `fp8_e4m3` was sized as a 4-bit cache, half of what the engine allocates, and `q8_0` as exactly 1 byte. Use `fp8` or `fp8_e5m2` on 0.2.1. 0.3.0 reads the name. **Proven.** SGLang on NVIDIA with `fp8_e5m2`: the engine reported a pool of 54,448 tokens against 27,216 at 16-bit, exactly 2.0×. TensorRT-LLM over an FP8 checkpoint served on an RTX 5090. vLLM and llama.cpp pass the flag to the engine and are sized at the new element size; no separate hardware proof is recorded for them. **Failure.** On TensorRT-LLM an 8-bit KV cache over 16-bit weights died at start for want of an attention kernel. The planner refuses it `E-KV-DTYPE` unless the plan's weights are FP8 (`model.format: fp8`). Weights of unknown precision are refused too. **Cost.** Lower precision changes the values attention reads. opod does not measure answer quality for you: add an eval step to the rollout before you keep it (see [Rollouts and runs](https://opod.io/docs/control-plane-endpoints/rollouts/)). **When not to use it:** when the KV cache is not the limit, or on a task where small numeric differences matter and you have no eval. ## Prefix **Problem.** Many requests start with the same tokens: a system prompt, tool definitions, a shared document. Computing them again for each request wastes prefill time. **How it works.** Every engine keeps a prefix cache on the card. A new request is matched against it **from the first token** and the match **stops at the first token that differs**. Everything after that point is computed again at full prefill cost, even when the rest is identical. ```text cached: [system prompt ......][tools ....][document ..........][question A] new: [system prompt ......][tools ....][document ..........][question B] └───────────────────── reused ───────────────────────┘└ computed ┘ new: [2026-10-23 09:14][system prompt ......][tools ....][document ....][question B] └ differs ──────┘└──────────── all of it computed again ─────────────────────┘ ``` There is nothing to switch on. What decides the reuse is the order of your prompt's parts. ### Prompt layout: stable first, changing last 1. The system prompt. 2. Tool definitions, always in the same order. 3. Shared reference material: a policy, a manual, a document many requests use. 4. The conversation so far. Append new turns; do not rewrite earlier ones. 5. Last: what changes per request — the user's name, the date, a request id, the question. What breaks reuse without anyone noticing: - A timestamp, request id or user name at the top of the system prompt. - Tools in a different order from one request to the next (a map iterated in random order). Sort them by name. - JSON whose key order changes. Serialise with sorted keys. - Whitespace that varies: trailing spaces, line endings, a template that sometimes adds a blank line. The cache compares tokens, not meaning. - A chat template that inserts today's date or a random id into the system header. Reuse then breaks once a day, or on every request. - Retrieved documents in a different order. Order them by a stable key, the most shared first. **Measure it.** The leader reports the engines' prefix-cache hit rate on `/loadz` as `prefix_hit_pct` (vLLM, SGLang, TensorRT-LLM; llama.cpp reports none). On core v0.4.0 it is the plain mean of the workers' own rates, and a worker that served no request yet counts as 0 %: two workers, one serving everything at 98 %, read 49 %. From core v0.4.1 (control plane 0.3.2 pins core v0.4.2), a vLLM endpoint's figure is hit tokens ÷ looked-up tokens over all its workers, so it is weighted by traffic and an idle worker adds nothing; `/loadz` also carries the two counters, `prefix_hit_tokens_total` and `prefix_query_tokens_total`, so two reads give the rate over the time between them. SGLang and TensorRT-LLM publish a rate and no counters, so their figure stays the mean: check that every worker carries traffic before you act on it. The endpoint page's **Load** card shows it. A long average prompt with a low hit rate means the prompts share little prefix. One worker much lower than its siblings points at [routing](#routing), not at the prompt. A rate that drops at the same time every day usually means a date in the chat template. **Limits.** The cache on the card holds only what fits beside the running requests; under load the engine evicts old prefixes. A [tier](#tiers) keeps them in host memory. opod never reads your prompts to judge their layout: the advice comes from the engines' own counters. ## Routing **Problem.** With several workers, a request that lands on the wrong one either queues behind a full KV cache or recomputes a prefix a sibling already holds. **How it works.** The leader picks the worker. The control plane only sets its policy (`PUT /api/v1/endpoints/{id}/policy`, see [Routing policy](https://opod.io/docs/control-plane-endpoints/routing/)). The leader reads each worker's KV use and queue depth from its heartbeat, every 5 seconds, and ranks the workers in four steps: 1. **Saturated workers go last.** A worker whose requests in flight fill its slots, or whose KV use is at or above `kvSaturationPct`, sorts behind every worker with headroom. It gets a request only when no other worker has room. 2. **Lowest score wins.** ```text score = in-flight + queue depth + kvWeight × KV used % / 100 − prefixBlockWeight × leading blocks held ``` 3. **Prefix pin.** With `prefixAffinity` on, and only when no worker reported holding any block of this request, the worker that last served the longest matching part of the prompt moves to the front — unless it is saturated or its slots are full. 4. The first worker in the list takes the request. | Knob | Range | Default | What it does | | --------------------------- | ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `routing.kvWeight` | 0–100 | 0 (off) | how many in-flight requests a full KV cache counts as | | `routing.kvSaturationPct` | 0–100 | 0 (off) | KV use at which a worker goes behind every worker with headroom | | `routing.prefixAffinity` | true / false | false | the prefix pin, for engines that publish no cache events | | `routing.stickyTtlSeconds` | 0–86,400 | 0 (the leader's: sessions off, prefix pins 10 min) | how long a session or a prefix pin lasts; live (0.3.0). See [Sticky sessions](https://opod.io/docs/control-plane-endpoints/routing/#sticky-sessions) | | `routing.prefixBlockWeight` | 0–10 | 0 (off) | how many in-flight requests one held leading block is worth; needs `plan.kvEvents: true` | | `routing.prefixBlockTier` | `gpu` / `cpu-lower` | `gpu` | `cpu-lower` also counts a leading block the worker's CPU tier holds, at 0.8 of a card block; vLLM with a `cpu` tier (0.3.0). The leader's `/loadz` `prefix_index.cpu_blocks` shows what it indexed | | `plan.kvEvents` | true / false | false | the engine publishes its cache events and the worker reports block hashes; vLLM and SGLang only (`E-KV-EVENTS` otherwise) | To see why a worker did or did not win, run the leader at `OPOD_LOG_LEVEL=debug` (0.3.0). Each pick with a prompt chain logs one `prefix block credits` line: per candidate, its leading blocks on the card (`card`), in its CPU tier (`cpu`), from a peer (`peer`) and the `credit` they earned. Every chain starts with the blocks all requests share, so `card=0` on every worker means the index is missing them; from 0.3.0 a worker restates what it holds after any heartbeat that did not land, including the first one after a leader restart. **Should you turn them on?** Measured on two RTX 3060 Ti workers with Qwen2.5-0.5B-Instruct, three seeds each, on vLLM, SGLang and llama.cpp: neither the pin nor `prefixBlockWeight` beat routing by load by more than the spread between runs. With one shared system prompt every way tied, except the pin on llama.cpp, which cost 2 %. With eight system prompts the best gain was +2.4 % (the pin on vLLM). On llama.cpp the pin raised the hit rate from 48 % to 94 % and still gained no throughput, because a 0.5B model's prefill is cheap. So both stay off by default. Turn one on when your prompts are long enough that prefill dominates, and measure your own traffic with it off and on. The policy knobs apply live. `kvEvents` is an engine launch flag, so a change rides a rollout. **Where KV use comes from.** vLLM: `vllm:kv_cache_usage_perc`. SGLang: `sglang:token_usage`. TensorRT-LLM: `kv_cache_utilization`, which the pinned image reports only when its config file turns on iteration statistics, as a [tier](#tiers) does. llama.cpp: `kv_cache_usage_ratio`, else busy slots ÷ slots — then the "KV use" is slot occupancy, not memory. A worker with no fresh sample is scored on in-flight requests alone. ### What the prefix pin hashes The leader hashes the request's leading text — the system prompt, then every message in order with its role — in a chain of 256-byte chunks. Each link is 8 bytes of a SHA-256 over the previous link and its chunk, so two prompts share links exactly as long as their text does. Every 256-byte chunk counts to 4 KiB. From the core release after v0.4.8 the chain then keeps one link at each doubling distance (8, 16, 32 … KiB) up to the leader policy's `routing.prefixDepthKiB` (default 256; 4 = the 4 KiB chain). A match at the deepest common link is within 2× of the true shared prefix. The request's cache salt seeds the chain, so a pin never crosses [isolation](#isolation). The leader keeps links and worker ids only, never the text: at most 131,072 entries, each kept for 10 minutes after the last request that used it. ### What `prefixBlockWeight` counts With `kvEvents` on, vLLM or SGLang publishes every block it stores and evicts on a local socket. The worker turns each block into opod's own hash of the block's token ids and its parent block, and sends the hashes on its heartbeat. Token ids never leave the worker. The leader keeps up to 200,000 hashes per worker, and empties a worker's set on a gap in its sequence, a new boot id, or the engine's own clear. For each request, the leader asks the engine's `/tokenize` for the first 2,048 tokens (from the core release after v0.4.8: `prefixDepthKiB` × 256 tokens, 65,536 at the default, never fewer than 2,048; it waits at most 250 ms) and builds the same chain of block hashes. A worker is credited only for **leading** blocks: block 3 is a hit only when blocks 1 and 2 were. One block is 16 tokens, so a 4,000-token system prompt is 250 blocks. ### Worked example Policy `kvWeight: 50`, `kvSaturationPct: 90`, `prefixBlockWeight: 0.1`. The request opens with a 4,000-token system prompt (250 blocks). Worker A served it a minute ago. | Worker | In flight | Queue | KV used | Load score | Leading blocks held | Final score | Rank | | ------ | --------- | ----- | ------- | ------------------- | ------------------- | ---------------- | ----- | | A | 3 | 0 | 40 % | 3 + 0 + 20 = 23 | 250 | 23 − 25 = **−2** | **1** | | B | 1 | 2 | 60 % | 1 + 2 + 30 = 33 | 0 | 33 | 3 | | C | 0 | 0 | 93 % | saturated (93 ≥ 90) | 0 | — | 4 | | D | 2 | 0 | 10 % | 2 + 0 + 5 = 7 | 0 | 7 | 2 | - With `prefixBlockWeight: 0`, D wins (7). A, the worker that holds the prompt, is third. - With `kvWeight: 0` as well, the scores are A 3, B 3, D 2: D still wins, and C still goes last because of `kvSaturationPct`. - With all three knobs off, C wins: it has the fewest requests in flight, and nothing tells the leader its cache is full. - On llama.cpp (no cache events) with `prefixAffinity: true`, no worker reports blocks, so the pin moves A to the front because it served this prefix last. **Proven.** Block routing was measured on vLLM on NVIDIA: on a pool large enough for both caches it tied the prefix pin, so both stay off by default. On SGLang the leader's index fills from the engine's events and its hashes match SGLang's tokens; a choice between two SGLang workers has not been run yet. The load score and saturation rule work on every engine that reports KV use. **Cost.** Block routing adds one tokenize call per request (at most 250 ms; a slower one is skipped) and up to 200,000 block hashes per worker in the leader's memory. The prefix pin costs one hash chain per request. **Failure modes.** A wrong index routes worse than none, so any doubt empties it and the prefix pin decides. With an index that is briefly empty the leader routes by load. Until the core release after v0.4.8 the block index is not salted, so a worker may be credited for blocks it holds under another caller's salt: a cold prefill there, never a shared one. From that release each worker seeds a prompt's first block from the salt its engine published (vLLM, SGLang), and the leader seeds the request's chain from the salt it sent and the LoRA adapter, so a worker is credited only for blocks it would share with that caller. A request whose keys the leader cannot rebuild, such as one with an image, earns no credit. **When not to use it.** One worker: there is nothing to choose. Requests with no shared prefix: block credit is zero and the tokenize call is pure cost. A high `prefixBlockWeight` makes a hot prefix pile onto one worker. Choose it from what the shared prefix should be worth: in-flight requests ÷ the prefix's blocks. To make a 250-block prompt worth 5 requests, set 5 ÷ 250 = 0.02. ## Isolation **Problem.** A shared prefix cache lets one caller reuse a prefix another caller computed, and the faster first token shows it: someone sent that text before. On a multi-tenant endpoint that is a side channel. **How it works.** `plan.routing.cacheIsolation` says whose requests may share: | Mode | Who shares a cache | | ---------------- | ---------------------------------------------------------------------------- | | `team` (default) | every key of one team; teams never share. A key with no team is its own team | | `key` | each key alone | | `none` | every caller | The leader turns the caller into a **salt**: the first 128 bits of an HMAC-SHA256 under the endpoint's admin token, over `opod-cache-salt/v1`, the mode and the team or key id. The id itself never goes on the wire. The leader sends the salt as `cache_salt` to vLLM, SGLang and TensorRT-LLM, which key their prefix cache by it, and seeds the prefix pin with it. Front doors hold the same admin token, so they derive the same salt for the same caller. The plan owns the field; the control plane copies it into the policy, and the leader applies it live with no pod restart. **Exceptions.** - **llama.cpp takes no salt.** Every caller shares its cache whatever the mode, and Preview says so in an advisory. - **No key, no salt.** On an endpoint that does not require keys, every request shares. - **Remote endpoints** are `none`: the vendor's API refuses a `cache_salt` field. Any other mode is refused `E-CACHE-REMOTE`. - **An older leader image** that does not advertise `cache_salt` shares until the endpoint is rolled; Preview says so. - A bare `opod up` leader with no admin token salts under a random key drawn at start, so its salts change on restart. **Cost.** Each team (or key) computes and stores its own copy of a shared prefix: prefill time and KV memory once per team. With `key` that is once per key. **When not to use it:** `none` is right only for a single-tenant endpoint that wants every hit. ## Tiers **Problem.** The card evicts old prefixes under load. A request that needs one again pays its full prefill. **How it works.** `workers[].kvOffload` gives the engine a tier below VRAM: blocks the card evicts are kept in host memory (and, on vLLM, on disk below that) and copied back on a prefix hit instead of being computed again. It helps when many requests share a long prefix: RAG, agents, one long system prompt. | Tier | Plan | Engines | Proven on | | -------------------- | --------------------------------------------------------------------------------- | ---------------------------------------- | ----------------------------------- | | `cpu` | `{tier: cpu, sizeGb: 8}` — host memory per replica, whole GiB | vLLM, SGLang, llama.cpp, TensorRT-LLM | NVIDIA; vLLM also on AMD from 0.3.2 | | `disk` | `{tier: disk, sizeGb: 8, diskGb: 200}` — a CPU tier with a disk tier below it | vLLM | NVIDIA; AMD from 0.3.2 | | `auto` | `{tier: auto, maxGb: 16}` — a CPU tier the control plane resizes from measurement | as `cpu` | as `cpu` | | `peer` **(planned)** | a CPU tier shared between an endpoint's workers | refused on every engine (`E-KV-OFFLOAD`) | none | - **Host memory is claimed.** The worker's `/dev/shm`, memory request and memory limit grow by `sizeGb`. Every tier on a node may take at most `kvOffload.maxNodePct` (default 50) of its memory, and tiers plus the workers' own memory must fit it, or the plan is refused `E-KV-RAM`. - **Disk is claimed.** `diskGb` is claimed on the node's model-cache volume with 15 % of the volume kept free (`E-DISK`). A `kv-prune` container keeps the directory under its cap. - **Auto** re-reads the tier advice every 10 minutes and resizes through a verified rollout when the size should move by at least a quarter, at most once in 30 minutes. - **Other vendors** are refused `E-KV-OFFLOAD`, naming the vendors the tier is proven on. A tier under tensor parallel and a tier on a gang are built but not yet proven on hardware. The whole mechanism — the engine arguments, the claims, the pruner, the auto loop's numbers, gangs and why `peer` is refused — is on [KV cache tiers](https://opod.io/docs/control-plane-endpoints/kv-tiers/). ## What was measured The control plane compares its arithmetic with what the engines report. | Route | Answers | | ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET /api/v1/endpoints/{id}/kv` | per worker: the planner's figure (`planned`: tokens, bytes per token, GB), the engine's own sample (`load`: KV in use, the pool it built, slots, preemptions, evictions, tier counters), slots, requests in flight and `tierHitPct` | | `GET /api/v1/endpoints/{id}/kv/advice` | the plan's pool against a week of measured use, with one suggested edit | | `GET /api/v1/endpoints/{id}/kv/tier-advice` | the tier size that would help, from the blocks the engines evicted and computed again | A figure the engine does not report is absent, never 0. ### The sampler and the pool advice The `kv-sampler` loop records each worker's KV in use every **2 minutes** and keeps **8 days** (at most 5,760 rows per worker). `/kv/advice` reads the last **7 days**: ```text hourly peak = Σ over workers of each worker's highest sample in that hour p90 = the 90th percentile of the hourly peaks (nearest rank) need = p90 × (1 + headroomPct / 100) # 15 % when the plan states none ratio = need ÷ pool ``` | State | When | | -------------- | ----------------------------------------------------------------------------------------------------------- | | `insufficient` | fewer than 24 hours carry samples | | `oversized` | ratio below 0.75 | | `undersized` | ratio above 1.25, or a worker used 95 % or more of the pool its engine built in more than 10 % of the hours | | `fits` | between the two | | `unknown` | samples exist, but there is no pool to hold them against | The pool comes from the workload (`peakConcurrency` × the request length × the margin), from the plan (the contexts llama.cpp workers are started with), or from the pools the engines report. The suggestion edits exactly one of `workload.peakConcurrency`, `flags.ctx` or `vramBudgetGb`. ### The tier advice `/kv/tier-advice` needs `plan.kvEvents: true`. The leader keeps a ghost list of up to 131,072 evicted blocks per worker. A block the engine stores again was computed again, and the number of evictions between its eviction and its return is its depth. A tier that holds `T` tokens keeps the last `T ÷ block size` evicted blocks, so: ```text estimated hit rate(T) = returns with depth ≤ T ÷ block size ÷ blocks computed ``` The candidate sizes come from depth buckets of 1,024, 4,096, 16,384, 65,536 and 131,072 blocks, converted to GiB with the model's bytes per token. The advice needs at least 16,384 computed blocks (about 262,000 tokens at 16-token blocks). It suggests the smallest size within 90 % of the best estimate, and nothing when the best is under 5 %. Each size is judged by the planner first, so a size the node cannot hold reads as refused. The estimate is stated as ±10 points: it assumes the traffic stays the same, and decode blocks count as computed, so it leans low. | State | Meaning | | -------------- | --------------------------------------------------------------------- | | `unknown` | no cache events, or no model shape to turn tokens into bytes | | `insufficient` | under 16,384 computed blocks | | `none` | a tier would serve under 5 %, or no size fits | | `advise` | a size is suggested | | `has-tier` | the worker keeps a tier you sized; the measurement is shown beside it | Advice changes nothing. On the endpoint page, the KV card shows the verdict, and **Review the suggested size** opens the plan editor with the edit applied, to preview and roll. **Metrics** (`opodcp` `/metrics`, labels `endpoint`, `node`): `opodcp_kv_tier_hit_tokens`, `opodcp_kv_tier_query_tokens`, `opodcp_kv_tier_loaded_bytes`, `opodcp_kv_tier_stored_bytes`, `opodcp_kv_tier_used_percent`, `opodcp_kv_tier_alloc_failures`. See [Observability](https://opod.io/docs/control-plane-operate/observability/). ## Which strategies for which workload | Workload shape | Turn on | Leave off | | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------- | | One worker, any traffic | `workload`; 8-bit KV if the KV cache is the limit | routing knobs (nothing to choose) | | Chat, several workers, short shared system prompt | `workload`; `kvWeight` and `kvSaturationPct` (for example 90) | tiers (the prefix fits on the card) | | RAG or agents: long shared prefixes, several vLLM or SGLang workers | `workload`; `kvEvents` + a small `prefixBlockWeight`; a `cpu` or `auto` tier | `cacheIsolation: none` unless single-tenant | | The same on llama.cpp | `prefixAffinity`; a `cpu` tier (`--cache-ram`) | `kvEvents` (refused `E-KV-EVENTS`) | | Long documents: few requests, very long contexts | `workload.maxContext`; 8-bit KV; on vLLM a `disk` tier for re-read documents | `prefixAffinity` (little sharing between documents) | | Batch: many short independent requests | `workload` with a high `peakConcurrency`; `kvWeight` | tiers, prefix routing | | Many tenants on one endpoint | `cacheIsolation: team` or `key` on vLLM, SGLang or TensorRT-LLM | llama.cpp (it cannot separate tenants) | | Not sure what the traffic will be | `workload` from a preset, then read `/kv/advice` after a week; an `auto` tier with `kvEvents` | hand-sized tiers | --- title: "KV cache tiers" description: "Host-memory, disk and auto-sized KV tiers below VRAM — the engine arguments, the memory and disk claims, the pruner, the auto loop, gangs, and why the peer tier is refused." url: "https://opod.io/docs/control-plane-endpoints/kv-tiers/" markdown_url: "https://opod.io/docs/control-plane-endpoints/kv-tiers.md" section: "Endpoints" last_updated: "2026-11-14" --- # KV cache tiers > Host-memory, disk and auto-sized KV tiers below VRAM — the engine arguments, the memory and disk claims, the pruner, the auto loop, gangs, and why the peer tier is refused. A **KV tier** keeps the blocks an engine evicts from the card in host memory, or on disk below that, and copies them back on a prefix hit instead of computing them again. This page is the detail behind the [Tiers](https://opod.io/docs/control-plane-endpoints/kv-cache/#tiers) summary on the KV cache page. A tier helps only a prefix that would be reused. It cannot fix a prompt whose first tokens change: see [Prompt layout](https://opod.io/docs/control-plane-endpoints/kv-cache/#prefix). ## In short A KV tier gives a worker extra cache in the machine's RAM, or on its disk, below the GPU. When the card must drop old prompt blocks, the tier keeps them, and the next request with the same prefix copies them back instead of computing them again. You set one field in the plan; the control plane writes the engine arguments, grows the pod's memory and claims that memory in the ledger. Every tier is proven on NVIDIA only. ## When you need it - Many requests share a long prefix (RAG, agents, one long system prompt), and the card evicts it under load. - `/kv/tier-advice` reads `advise` for the endpoint. - Documents are re-read later on vLLM: a `disk` tier holds more than RAM can. - You do not know the right size: an `auto` tier sizes itself from measurement. ## Do it 1. **Ask whether a tier would help** Turn on `plan.kvEvents: true` (vLLM or SGLang, by a rollout), wait for traffic, then: ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//kv/tier-advice | jq . ``` `advise` comes with a suggested size. `none` means a tier would serve under 5 %: stop here. 2. **Add the tier to the worker row** ```yaml workers: - { replicas: 2, engine: vllm, kvOffload: { tier: cpu, sizeGb: 8 } } ``` Or `{ tier: disk, sizeGb: 8, diskGb: 200 }` on vLLM with a pinned `model.revision` or `model.version`, or `{ tier: auto, maxGb: 16 }`. In 0.3.0, the same from a terminal: `opodcp endpoint kv --tier cpu --size-gb 8 chat`, or `opodcp endpoint kv --tier auto --size-gb 4 --max-gb 16 chat`. The create form offers all four tiers under **Advanced → KV cache tier**. 3. **Preview, then roll it out** Preview names the claim on each node and warns when the node's memory is unknown. Then post the plan to `POST /api/v1/endpoints/{id}/rollouts`. A tier changes engine arguments and pod memory, so it rides a rollout. ## Check it worked ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints//kv | jq '.. | objects | select(has("tierHitPct")) | .tierHitPct' ``` A good answer is a `tierHitPct` above 0 once repeated prefixes arrive. An absent figure means the engine reports nothing about its tier; `opodcp doctor` says which worker. The Prometheus series `opodcp_kv_tier_hit_tokens` rises in step. ## If it fails | Code | Cause | Fix | | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | | `E-KV-RAM` | the node's tiers pass `kvOffload.maxNodePct` of its memory, or tiers plus workers do not fit it | a smaller `sizeGb`, a node with more memory, or a higher `kvOffload.maxNodePct` | | `E-DISK` | `diskGb` does not fit the model-cache volume with 15 % kept free | a smaller `diskGb`, or a node it names | | `E-KV-OFFLOAD` | a vendor other than NVIDIA, a llama.cpp RPC gang, or `tier: peer` (with no store, or on a path not proven) | NVIDIA, a vLLM gang, or `cpu` / `disk` | | `E-PD-TIER` | a tier on a vLLM prefill or decode half | remove the tier from that half | | `400`: a tier argument in `flags.extra` | the tier was typed by hand | remove it and use `kvOffload` | | `400` on a disk tier with no pin | a disk tier needs `model.revision` or `model.version` | pin the model | | An `auto` tier never resizes | the advice reads `unknown`: no `kvEvents`, or llama.cpp / TensorRT-LLM | `kvEvents: true` on vLLM or SGLang, or a fixed `cpu` tier | | `prefix_index` reads `blocks: 0` on a vLLM worker with a tier and `kvEvents` | the worker's core is from before 0.3.0: the tier's own events failed every event batch, and its log says `kv events: a batch could not be read` | a worker image from 0.3.0; until then, choose either the tier or block routing | ## The four tiers | Tier | Plan field | What it is | | -------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `cpu` | `workers[].kvOffload: {tier: cpu, sizeGb: 8}` | host memory per replica, in whole GiB | | `disk` | `{tier: disk, sizeGb: 8, diskGb: 200}` | the CPU tier, with a disk tier of `diskGb` below it on the node's model-cache volume | | `auto` | `{tier: auto, maxGb: 16}` | a CPU tier the control plane resizes from measurement, within `maxGb` | | `peer` **(planned)** | `{tier: peer, sizeGb: 8}` | a CPU tier shared between the endpoint's workers through the `kvstore` connector (Valkey/Redis, or a shared volume from the release after 0.3.6); refused in 0.3.6; from the release after 0.3.6, vLLM on NVIDIA through a shared volume | A tier with no `tier` is `cpu`. `sizeGb` must be at least 1. `diskGb` is valid only with `tier: disk`. ## The CPU tier Each engine has its own host tier. The control plane renders it from `sizeGb`: | Engine | What runs | Lazy fill | | ------------ | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | | vLLM | `--kv-offloading-size --kv-offloading-backend native` | yes: as blocks leave the card | | SGLang | HiCache: `--enable-hierarchical-cache --hicache-write-policy write_through --hicache-size ` | not reported; it keeps 10 GiB of the pod's memory free before it allocates the pool | | llama.cpp | the host prompt cache, `--cache-ram ` MiB; without a tier `--cache-ram 0` | yes: as slots are saved | | TensorRT-LLM | `kv_cache_config.host_cache_size` (bytes) with `enable_block_reuse: true`, in the engine's config file | not reported | You never type these arguments. A tier argument in `flags.extra` is refused: it would grow no `/dev/shm` and claim no memory, and the engine would die when it filled. A hand-typed `--kv-transfer-config` beside a tier is refused too, because the tier is the engine's KV connector and a second one would replace it. **How the pod changes.** The engine maps the tier as a file in a memory-backed `/dev/shm`, so: - `/dev/shm` = the engine's own room (8 GiB for vLLM, SGLang and TensorRT-LLM) + `sizeGb`; - the memory limit grows by `sizeGb` (+ 10 GiB on SGLang); - the memory request is set equal to the limit, so the scheduler reserves the whole tier and the pod is evicted last, not first. vLLM and llama.cpp fill their tier lazily, so the machine looks freer than it is until the tier is full. Preview says so. **Prefill and decode halves.** On vLLM a worker with a `role` and a tier is refused `E-PD-TIER`: vLLM keeps one KV connector, and the tier would replace the transfer connector. On SGLang a decode half keeps HiCache natively. A tier on a prefill half is advised against: the decode pool holds the cache longer, so a tier helps there first. ## The host-memory claim: `E-KV-RAM` The tier is the one slice of host memory the ledger claims. After placement, on every node a tier lands on: 1. Every endpoint's tiers on the node may take at most `kvOffload.maxNodePct` of the node's memory (chart value, default **50**). Past it: `E-KV-RAM`. 2. Every endpoint's tiers **plus** this plan's workers' own memory there (each worker's memory request, its `/dev/shm`, and SGLang's 10 GiB reserve) must fit the node's memory. Past it: `E-KV-RAM`. A node that never reported its memory is not judged: Preview advises that a tier the machine cannot hold kills the engine when it fills. The placer chooses nodes by VRAM, not host memory, so the fix for `E-KV-RAM` is a smaller `sizeGb`, a node you name with more memory, or a higher `kvOffload.maxNodePct`. ```bash helm upgrade opodcp … --reset-then-reuse-values --set kvOffload.maxNodePct=60 ``` **Figure: What a KV tier claims on the node.** A node's host memory split into workers, their /dev/shm and their KV tiers, against the tier cap and the node size (the two E-KV-RAM checks). The interactive figure is on the web page: ## The disk tier `tier: disk` is vLLM only. The CPU tier feeds a disk tier below it (vLLM's file-system tier, which core starts from the engine flag `kv_tier_fs`). The engine writes one file per block and **never deletes from the directory**, so the control plane bounds it in three places: 1. **The claim.** `diskGb` is claimed on the worker's node in the disk ledger. Every endpoint's disk tiers on the node must fit: ```text room = free space on the model-cache volume + what these tiers already wrote there (up to each tier's claim) − the model's weights, when the node does not hold them yet − 15 % of the volume ``` Past it: `E-DISK`, naming other nodes of the same vendor where it fits. The 15 % is the kubelet's default hard eviction threshold (10 %) plus what a tier writes between two pruner passes (5 %). A node whose cache volume was never measured is advised, not judged. 2. **The pruner.** A `kv-prune` container beside the engine runs `opod cache kv-prune --dir --max-gb --every 10s --apply`. Past the cap it removes the oldest blocks first, down to 90 % of `diskGb`. It touches only the tier's own files. From core v0.4.7 it also trims ahead of the growth it measured since its last pass. In core v0.4.7 a burst that starts while it is idle can pass the cap for up to one `--every` interval; from core v0.4.8 the pruner watches the volume's free space every second while idle and starts a pass at once. See [opod cache](https://opod.io/docs/core-cli/cache/). 3. **The sweep.** Every 5 minutes the control plane looks for tier directories no plan names any more (an endpoint deleted, a revision or layout changed) and empties them with a short Job (`kv-prune --max-gb 0`). The directory is `/data/models/.kvtier//`, inside the node's model cache, so the free space the disk ledger reads is the volume the tier fills. **A disk tier needs a pinned model.** Set `model.revision` (a commit) or `model.version`. The tier outlives the pod, and the engine names a block by the model's name, dtype and split, not by the weights' bytes. Without a pin, a branch head that moved between two pod starts would read the old weights' blocks as hits: wrong answers, not slow ones. The pinned revision is part of the directory's name. **Proven** on vLLM on NVIDIA: a disk hit after the CPU tier evicted the block, and a disk-full drill. ## The auto tier `tier: auto` is a CPU tier whose size the control plane chooses from the [tier advice](https://opod.io/docs/control-plane-endpoints/kv-cache/#the-tier-advice). - `maxGb` must be at least 1. The tier starts at `sizeGb`, or at the smaller of `maxGb` and 4 GiB. - Every **10 minutes**, for each serving endpoint, the `kv-tier-auto` loop reads the tier advice capped at `maxGb`. - It resizes only when the suggestion differs from the current size by at least a quarter of it (and at least 1 GiB), and the last resize is at least **30 minutes** old. - The resize is a verified rollout of the plan with the new `sizeGb`, noted `kv-tier-auto`. A failed rollout restores the previous plan. - It never removes the tier, never goes to 0 and never exceeds `maxGb`. Each size is judged by the planner first, so it never takes more than the node's memory allows (`E-KV-RAM`). The advice needs the engine's cache events, so an auto tier resizes only with `plan.kvEvents: true` on vLLM or SGLang. On llama.cpp and TensorRT-LLM the advice reads `unknown` and the tier stays at its starting size. Only the plan's first auto worker is resized. ## Tiers on gangs A vLLM gang may take a CPU tier on `shardGroups[].kvOffload: {tier: cpu, sizeGb}`. There `sizeGb` is the gang's **total**. In 0.3.0 each part claims its ranks' share, `⌈total × its devices ÷ all devices⌉` GiB, on its own node. From 0.3.2 each part claims the **whole** total: vLLM maps the tier as one shared region of the total in each part's pod, so a 4 GiB tier on a two-part gang holds 4 GiB on each node. Each node is judged for `E-KV-RAM`. Refused on a gang, each by name: - a llama.cpp RPC gang (`E-KV-OFFLOAD`): its coordinator holds the whole KV cache, so a restore would pull the remote parts' layers over the network; - any engine but vLLM: how it splits a tier over ranks has not been read on its image; - `tier: peer` and `diskGb`: a disk tier is a worker's, not a gang's. A tier under tensor parallel on one node is built but not yet proven on hardware. Across two nodes it is: a vLLM tensor-2 gang, one NVIDIA card on each node, read 12 of 12 tier hits equal to the card's own hit, with 18,080 tokens from the tier (on the release after 0.3.6, for the reason below). A gang tier is proven from 0.3.2 and a leader from core v0.4.1: a vLLM pipeline-2 gang across two NVIDIA nodes read 12 of 12 tier hits equal to the card's own hit, with both parts' layers copied back from the tier. In 0.3.0 the tier never reached a gang's engine. Up to 0.3.6 it reached the engine only when the leader formed the gang before the control plane did; when the control plane formed it first, the engine started with no tier and the tier served nothing. From the release after 0.3.6 the tier reaches the engine either way (the same drill: 12 of 12, 18,080 tokens from the tier). A gang with `kvEvents: true` is accepted, but in core v0.4.6 a gang's engine does not publish its prefix-cache events, and the leader routes among gangs by load alone: it reads no pin for a gang either. From core v0.4.7 a vLLM Ray gang and an SGLang gang publish them: the leader starts the gang's engine with the publisher when the head's worker runs with `OPOD_KV_EVENTS=1` (an SGLang gang gets `--page-size 16` on every rank unless the plan sets one), and it scores the blocks the head reports for that gang, as it does for a worker. A vLLM expert (data-parallel) gang and a llama.cpp gang still publish nothing. Proven on the design-partner cell with two vLLM pipeline-parallel gangs on NVIDIA: the leader indexed blocks from both gang heads, and with the pins on, 60 of 60 later turns of 20 conversations found their earlier prompt in their gang's cache. An SGLang gang's events are tested on a laptop only. ## Vendors In 0.3.0 every tier is proven on NVIDIA only: the vLLM CPU tier (99.6 % of a repeated prompt's tokens read from the tier, 0 with it off), the vLLM disk tier, SGLang's HiCache, llama.cpp's host prompt cache and TensorRT-LLM's host pool. From 0.3.2, vLLM's CPU and disk tiers are also open on AMD: on the ROCm image and a Radeon RX 7900 XTX, answers read from the tier equalled the card's own cache hit 24 of 24 on two seeds, and an hour with the tier full kept memory flat. The disk tier there has one drill and no soak yet. From the same release, llama.cpp's host prompt cache is open on AMD too: on a Radeon RX 7900 XTX the drill read 6 of 6 answers equal to the card's own hit, with 822 tokens from host memory, the same as on NVIDIA. vLLM on that card is not bitwise repeatable with or without a tier: about one first token in 5,000 differed from the card's own hit with a tier, and one in 9,000 between two hits with no tier, a difference that sample cannot tell apart. On any other engine × vendor a tier is refused `E-KV-OFFLOAD`, naming the vendors it is proven on. A Tenstorrent card is refused by name: its vLLM build has no offloading connector. ## The peer tier and `kvStore` The **peer** tier lets a worker read a prefix a sibling computed. It is the worker's CPU tier, shared through the cell's `kvstore` connector. The plan field is the same for every store; the connected store picks the path. | Store | `OPODCP_KVSTORE_URL` | How the workers share | Today | | ------------------------------------------------------ | ------------------------------------------------------------ | ----------------------------------------------------------------- | ------------------------------------------------------------------------ | | none | unset | nothing to share through | refused `E-KV-OFFLOAD` by name | | Valkey or Redis | `redis://valkey.example.com:6379`, or `kvStore.enabled=true` | vLLM with LMCache: each chunk a worker computes goes to the store | refused on every vendor | | shared volume **(arrives in the release after 0.3.6)** | `pvc://nfs-rwx?size=200Gi` | vLLM's own file tier on one ReadWriteMany volume per endpoint | proven for vLLM on NVIDIA; refused by name on AMD, Intel and Tenstorrent | **With no store**, a peer tier is refused `E-KV-OFFLOAD` (*no shared KV store connected*), and the refusal names both stores. In 0.3.6 it was accepted and ran as each worker's own CPU tier, with the advisory `kv-no-store`; from the release after 0.3.6 it is refused, so nothing runs that differs from what you asked. The console's endpoint form then shows `peer` disabled, with the same reason and a link to the `kvstore` card on the Connectors page; a tier, a prefill/decode split or KV block events that the chosen engine or the chosen machine's vendor cannot take is shown the same way. **Through Valkey or Redis** it is refused on every vendor, whatever store is connected: on the pinned NVIDIA vLLM image, a request served from the shared cache returned a different answer from the same request computed — another prompt's answer, or garbage — in every configuration tried (0 of 6 hits correct). The cause is in the image's LMCache build, not in opod. The chart's optional `kvStore` (one Valkey Deployment, `kvStore.enabled`, `maxMemory: 8gb` with LRU eviction, a generated password) and the Valkey/Redis connector stay unused until it opens. See [Helm values](https://opod.io/docs/control-plane-reference/helm-values/). **Through a shared volume** (the release after 0.3.6), the endpoint gets one ReadWriteMany volume and every peer worker mounts it. To vLLM, each worker is its CPU tier plus a disk tier on that volume, in one directory per layout (engine, vendor, KV precision, tensor and pipeline split, block size, model revision), so one layout never reads another's blocks. vLLM writes one file per block and renames it into place, so two workers that write the same block are safe, and a sibling reads it instead of computing it. One pruner per volume keeps it under 85 % of its size. On a network filesystem a pass is slow (a round trip per directory), so from core v0.4.7 the pruner lists 32 directories at once and trims ahead of the growth it measured. The setup is [Connector setup → KV store: a shared volume](https://opod.io/docs/control-plane-operate/connector-setup/#kv-store-a-shared-volume). 1. **Connect the volume store** On the **Connectors** page, open **kvstore**, choose **shared-volume**, and save `pvc://nfs-rwx?size=200Gi` (your ReadWriteMany class). Verify answers `no-probe`. 2. **Give the workers a peer tier** The model must be pinned (`model.revision` or `model.version`): the volume outlives the workers. ```json { "model": { "id": "qwen3-8b", "revision": "0123456789abcdef0123456789abcdef01234567" }, "workers": [ { "node": "node-a", "engine": "vllm", "replicas": 1, "kvOffload": { "tier": "peer", "sizeGb": 8 } }, { "node": "node-b", "engine": "vllm", "replicas": 1, "kvOffload": { "tier": "peer", "sizeGb": 8 } } ] } ``` 3. **Check it** ```bash kubectl -n opodcp get pvc,deploy -l opod.io/endpoint=chat ``` One `…-kvshared` claim `Bound`, one `…-kvprune` Deployment, and the workers. The path is proven for vLLM on NVIDIA only. On the design-partner cell, a worker on one host computed 6 documents, and a worker on another host that never saw them answered all 6 identically with 12,368 prompt tokens read from the volume; two hosts writing 60 new documents each at once kept the volume at 0.95–1.08 × its pruner's cap in four runs with core v0.4.8's pruner. On AMD, Intel or Tenstorrent nodes, Preview refuses the plan `E-KV-OFFLOAD` with *the shared-volume peer tier is not proven for vllm on amd* (or that vendor). On that cell's 1 Gb/s NFS volume with a 0.5B model, a read from the tier was slower than computing the prompt (time to first token 453 ms against 193 ms), so the tier saves GPU work there, not time; measure it on your storage. | If it fails | Cause | Fix | | --------------------------------------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | | `E-KV-OFFLOAD` … *no shared KV store connected* | no `kvstore` is saved | connect one, above | | `E-KV-OFFLOAD` … *proven on no vendor* | the path is not proven on any vendor yet | `tier: cpu` or `disk` meanwhile | | `400` naming `model.revision` | the model is not pinned | set `model.revision` or `model.version` | | endpoint degraded, `KVSharedVolumePending (…): ProvisioningFailed: …` | the class does not exist, cannot give ReadWriteMany, or has no provisioner | save a class that offers ReadWriteMany, then delete the claim so the next rollout makes it again | | `E-KV-OFFLOAD` on SGLang or another engine | only vLLM has a file tier the control plane drives | `engine: vllm`, or `tier: cpu` | ## Measure a tier | Where | What | | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET /api/v1/endpoints/{id}/kv` | per worker: `tierHitPct` (tier hit tokens ÷ tokens looked up there, since the engine started) and the tier counters in `load` | | `/metrics` on `opodcp` | `opodcp_kv_tier_hit_tokens`, `opodcp_kv_tier_query_tokens`, `opodcp_kv_tier_loaded_bytes`, `opodcp_kv_tier_stored_bytes`, `opodcp_kv_tier_used_percent`, `opodcp_kv_tier_alloc_failures` | | `GET /api/v1/endpoints/{id}/kv/tier-advice` | what a tier of each size would have served, and the size to use | | `opodcp doctor` | whether every worker the plan gives a tier reported tier figures | A worker whose engine says nothing about its tier has no series: absent, never zero. ## When not to use a tier - Requests that share no prefix: the tier fills and serves nothing. Read `/kv/tier-advice` first; `none` means a tier would serve under 5 %. - A node short of memory: the tier is reserved in full from the first second. - A non-NVIDIA card: refused until proven. - On vLLM with prefill and decode halves: refused (`E-PD-TIER`). --- title: "Gateways in front" description: "Put LiteLLM or another gateway in front of an endpoint for per-user keys and budgets, join a Gateway API InferencePool, or serve Vertex AI's routes." url: "https://opod.io/docs/control-plane-endpoints/gateways/" markdown_url: "https://opod.io/docs/control-plane-endpoints/gateways.md" section: "Endpoints" last_updated: "2026-10-31" --- # Gateways in front > Put LiteLLM or another gateway in front of an endpoint for per-user keys and budgets, join a Gateway API InferencePool, or serve Vertex AI's routes. opod serves tokens on GPUs you own. The jobs of a **gateway** are not opod's: keys per user, team and app; requests and tokens per minute; quotas and budgets; spend in money; which team may use which model; prompt and answer logs; PII and injection checks. Run a gateway in front of each endpoint for them. opod never reads the gateway, and the gateway reads nothing from opod but its endpoints. ```text apps ──► gateway (yours) ──► opod endpoint (leader) ──► workers keys, budgets, endpoint key check, spend, guardrails request classes ``` ## In short A gateway such as LiteLLM sits between your apps and an opod endpoint. It owns users, budgets, rate limits and guardrails. opod owns the GPUs and checks one key: the gateway's. You give the gateway one endpoint key, register the endpoint as an OpenAI model in the gateway, and then close every other way in. ## When you need it - You need a key per user, team or app, with its own limits or budget. - You must log prompts, filter PII or block prompt injection. opod does none of these. - You want spend in money per team. opod reports GPU-hours, and the gateway reports tokens. - Your cluster runs a Gateway API inference gateway, and you want it to choose the leader (InferencePool, below). - Vertex AI serves the model from a custom container (Vertex routes, below). ## Do it The [full step-by-step LiteLLM guide](https://opod.io/docs/get-started/litellm/) has every command, including the LiteLLM install. The short form: 1. **Mint the gateway's key** ```bash opodcp key create --endpoint chat-small --no-expiry litellm > litellm.key ``` stdout holds only the key (`sk-orc-…`). stderr shows its id (`k_…`) and its expiry. Store the key in the gateway's Secret, for example as `OPOD_CHAT_SMALL_KEY`. 2. **Find the URL the gateway calls** ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints | jq -r '.[] | select(.name=="chat-small") | .url' # http://opodcp-ep-chat-small.opod.svc:8080 without front doors # http://opodcp-ep-chat-small-front.opod.svc:8080 with front doors (plan.gateways.enabled) ``` Use this `url` with `/v1` added as the gateway's `api_base`. 3. **Register the endpoint in the gateway** Add the `model_list` entry from [LiteLLM](#litellm) below, then restart the gateway. 4. **Require keys on the endpoint** ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X PUT \ https://cp.example.com/api/v1/endpoints//auth -d '{"requireKeys": true}' ``` From now on a caller without an opod key gets `401` from the leader. 5. **Admit only the gateway on the network** Apply the NetworkPolicy in [LiteLLM](#litellm) step 3, with the gateway's namespace and labels. ## Check it worked ```bash # through the gateway, with a gateway key: 200 and an answer curl -s https://litellm.example.com/v1/chat/completions -H "Authorization: Bearer sk-" \ -H 'Content-Type: application/json' -d '{"model":"chat-small","messages":[{"role":"user","content":"hi"}]}' | jq .usage # straight to the endpoint with no key, from a pod in the cluster: 401 curl -s -o /dev/null -w '%{http_code}\n' http://opodcp-ep-chat-small.opod.svc:8080/v1/models ``` A good answer: the first call returns a `usage` object with non-zero `completion_tokens`. The second call prints `401`, or it times out when your NetworkPolicy also blocks that pod. In the console, the endpoint's **Connect** card shows **Require keys** on, and the **API keys** page lists the `litellm` key as `active`. ## If it fails | Symptom | Cause | Fix | | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | | The gateway gets `401` from opod | the gateway's key is wrong, expired, revoked or for another endpoint | mint a new key for this endpoint (step 1) and update the gateway's Secret | | `PUT …/auth` answers `400` | the endpoint has no active key yet | mint the key first, then require keys | | `PUT …/auth` refused `E-VERTEX-KEYS` | the plan serves the keyless Vertex AI routes | turn `exposure.vertex` off, or leave keys off | | Streamed answers count zero tokens at the gateway | `stream_options.include_usage` is not set | add it to the model's `litellm_params` | | Every rollout fails its `probe` step after you applied your NetworkPolicy | the policy does not admit the API server, which carries the control plane's calls to a leader | add the API server's source address as an `ipBlock` | | The gateway times out after `networkPolicy.leaderIsolation.enabled=true` | the gateway dials the leader's own Service `opodcp-ep-`, whose port isolation closed | point the gateway at the endpoint's `url` (`…-front`), or list the gateway's pods in `networkPolicy.leaderIsolation.from` | | `E-POOL-MODEL-MISMATCH` | two endpoints in one InferencePool serve different models | one pool per model | | `E-INFERENCEPOOL-CRD` | the cluster has no InferencePool `v1` CRDs | install your gateway's CRDs first | ## LiteLLM This is the reference form of the steps above. The [full step-by-step LiteLLM guide](https://opod.io/docs/get-started/litellm/) covers the install, TLS, streaming and cost per team. 1. **Mint one endpoint key for the gateway** ```bash opodcp key create --endpoint chat-small --no-expiry litellm ``` It is the only opod key the gateway holds. Your users get gateway keys, never opod ones. 2. **Register the endpoint as a model** ```yaml # litellm-config.yaml model_list: - model_name: chat-small # what your users ask for litellm_params: model: openai/ api_base: http://opodcp-ep-chat-small.opod.svc:8080/v1 # the endpoint's url + /v1 api_key: os.environ/OPOD_CHAT_SMALL_KEY stream_options: { include_usage: true } # count streamed tokens general_settings: master_key: os.environ/LITELLM_MASTER_KEY database_url: os.environ/DATABASE_URL ``` `api_base` is the endpoint's `url` field plus `/v1`. With front doors on (`plan.gateways.enabled`), the `url` is `opodcp-ep--front`: that Service reaches the leader and every door. With `endpoints.tls.embedded=true`, use `https://` and give the gateway the endpoint's certificate (item `tls.crt` of its auth Secret) as its trust store. 3. **Make the gateway the only way in** Turn on **Require keys** for the endpoint so a caller without the key gets `401`. As defence in depth, admit only the gateway to port 8080 with a NetworkPolicy. It must also admit: - the endpoint's own pods (workers join and heartbeat on 8080); - the pods labelled `app.kubernetes.io/name: opodcp`: the eval Job and the batch runner, which call `/v1` on the leader; - the **API server**. Every call the control plane makes to a leader rides the API server's Service proxy, so it arrives from the API server, not from the control plane's pod. Without this rule every rollout's probe step fails. Leave the probe port 8081 open. ```yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: { name: only-the-gateway, namespace: opodcp } spec: podSelector: { matchLabels: { opod.io/front: chat-small } } policyTypes: [Ingress] ingress: - from: [{ namespaceSelector: { matchLabels: { kubernetes.io/metadata.name: litellm } }, podSelector: { matchLabels: { app: litellm } } }] ports: [{ port: 8080 }] - from: [{ podSelector: { matchLabels: { opod.io/endpoint: chat-small } } }] - from: [{ podSelector: { matchLabels: { app.kubernetes.io/name: opodcp } } }] - from: [{ ipBlock: { cidr: 192.0.2.10/32 } }] # the API server: a control-plane node's address, or on flannel the first two addresses of its pod range - ports: [{ port: 8081 }] ``` Policies add up. With `networkPolicy.enabled=true` and leader isolation off, the chart's `-endpoints` policy admits every source on 8080 to our pods, so this policy then closes nothing. Turn on leader isolation, or keep `networkPolicy.enabled` off and rely on this policy alone. The chart's `networkPolicy.leaderIsolation` is **not** a gateway-only policy. It closes the leader's port, not the doors, and only on an endpoint with front doors (`plan.gateways.enabled`); an endpoint without doors gets a policy that stays open. It admits the endpoint's own pods, the API server, KEDA when `autoscaler.adapter=keda`, the cell door's pods when the endpoint has a door alias, and the peers you list in `networkPolicy.leaderIsolation.from`. Nothing else. So: - a gateway that calls the endpoint's `url` (`opodcp-ep--front`) reaches the doors, which this policy does not close; - a gateway that calls the leader's own Service (`opodcp-ep-`) must be listed in `from`, or it is cut off. See [Network and TLS → Leader isolation](https://opod.io/docs/control-plane-security/network-tls/#leader-isolation). An endpoint on the cell door is reachable through the door with any of its keys: put the gateway in front of the door too, or keep a gated endpoint off it. Rules that keep the numbers right: - **Count streamed tokens** with `stream_options.include_usage`, or a streamed answer counts as zero. - **Pass the end user** in OpenAI's `user` field; opod's usage row keeps only which endpoint key called. - **A gateway retry is a new request** to opod. - **Reconcile** the gateway's tokens per model per day with opod's GPU-hours export (`GET /api/v1/usage/gpu-daily`, JSON or CSV; it is new in 0.3.0). Fewer tokens at the gateway than opod served means traffic went around it. - **Pin the gateway's image by digest.** For cost per team, join the gateway's tokens per team with opod's GPU-hours per endpoint. See [Usage → Cost per team](https://opod.io/docs/control-plane-operate/usage/). **Guardrails, prompt logs, key pause and IdP groups** are LiteLLM settings too; the [LiteLLM guide](https://opod.io/docs/get-started/litellm/#guardrails-prompt-logs-and-key-control) has one example of each. **Traces.** With LiteLLM's `forward_traceparent_to_llm_provider: true`, the caller's `traceparent` reaches the leader, which continues the trace into the engine: one trace from caller to engine. ## Gateway API InferencePool InferencePool membership is new in 0.3.0. If your cluster runs a Gateway API inference gateway, the control plane can make an endpoint's leader a member of an `InferencePool`. The gateway picks a **leader**; the leader still picks the **worker**. ```bash helm upgrade opodcp … --reset-then-reuse-values --set inferencePool.enabled=true ``` ```yaml exposure: { inferencePool: chat } # in the plan ``` In 0.3.0, the create form has a **Gateway API InferencePool** field, and `opodcp endpoint expose --inference-pool chat chat-small` joins a running endpoint to the pool (`-` leaves it). A pool name is lowercase letters, digits and `-`, at most 40 characters, starting and ending with a letter or digit; anything else is refused `400`. Every endpoint that names one pool is a member. The control plane renders the pool, one endpoint picker (llm-d's, `engineImages.epp`) and one `HTTPRoute` on your Gateway. The leader keeps auth, admission and usage for its own requests. Members of one pool serve one model (`E-POOL-MODEL-MISMATCH`). A remote endpoint cannot join a pool: its leader is a proxy to another API. The InferencePool `v1` CRDs come with your gateway; the chart never installs them (`E-INFERENCEPOOL-CRD` when absent). With `inferencePool.enabled` on, the control plane may create the picker's ServiceAccount and Role in its namespace. | Port | Scheme | Carries | | ---- | ------------------------------------------ | --------------------------------------------------------------------- | | 8080 | the leader's own (HTTPS with embedded TLS) | `/v1/*` for direct clients | | 8081 | always plain HTTP | `/healthz`, `/readyz`, `/loadz`, `/metrics`, which the picker scrapes | | 8082 | always plain HTTP, only on a pool member | the whole API, for the gateway's proxies | For example, a gateway whose proxies run in namespace `gateways` and carry the label `app: my-gateway-proxy`: ```bash helm upgrade opodcp … --reset-then-reuse-values --set inferencePool.enabled=true \ --set inferencePool.gatewayPods.namespace=gateways --set inferencePool.gatewayPods.podLabels.app=my-gateway-proxy ``` The 8082 hop is clear text inside the cluster, so the control plane renders a NetworkPolicy per pool (`opodcp-pool-`) that admits only your Gateway's proxies to it. `inferencePool.gatewayPods.namespace` (default `envoy-gateway-system`) and `.podLabels` (default empty) name them. The defaults fit Envoy Gateway: with `podLabels` empty, the proxies are selected by the `gateway.envoyproxy.io/owning-gateway-name` and `-namespace` labels of the Gateway the routes attach to. For another gateway, set both to where its proxies run and the labels they carry; a namespace alone is never sent. The leader publishes vLLM-named aliases the picker reads, beside its own metrics: `vllm:num_requests_waiting` (the summed queue), `vllm:num_requests_running`, `vllm:kv_cache_usage_perc` (mean KV use, 0–1). ## Vertex AI custom-container routes The Vertex AI routes are new in 0.3.0. `plan.exposure.vertex: true` makes the leader answer `POST /v1/vertex:predict` and `GET /v1/vertex/health` on the endpoint's own URL. `predict` takes Vertex's `{instances, parameters}` and answers `{predictions}`, serving each instance as a chat request; a chat body is passed through. > **These routes take no key** > > They assume Vertex AI's IAM checked the caller. Anyone who reaches the leader can call the model through them. They are refused on an endpoint that requires keys (`E-VERTEX-KEYS`), and accepted with the advisory `vertex-keyless` on one that does not. Also refused: `E-VERTEX-PROTOCOL` (not a chat endpoint), `E-VERTEX-DOORS` (front doors do not serve the routes), `E-VERTEX-UNSUPPORTED` (the running leader lacks them). This is partly proven: the control plane's render is proven, and Vertex AI's own front end has not yet called a leader. --- title: "Jobs and batches" description: "Run training or batch Jobs on the same GPU ledger as serving, preemptible jobs that resume from checkpoints, and OpenAI's files and batches API." url: "https://opod.io/docs/control-plane-endpoints/jobs-batches/" markdown_url: "https://opod.io/docs/control-plane-endpoints/jobs-batches.md" section: "Endpoints" last_updated: "2026-11-12" --- # Jobs and batches > Run training or batch Jobs on the same GPU ledger as serving, preemptible jobs that resume from checkpoints, and OpenAI's files and batches API. The control plane schedules two kinds of work beside endpoints: Kubernetes Jobs on the GPU ledger, and OpenAI-style batches against an endpoint. ## In short A **job** runs your own container on the same GPUs as your endpoints, for example a fine-tune. It takes a card from the same ledger, so it never collides with serving. Mark it `preemptible` and it gives its card back when an endpoint needs it, then resumes from its checkpoint. A **batch** is OpenAI's batch API: you upload a file of requests, and the control plane runs them against one endpoint and writes the answers to your object store. ## When you need it - Jobs: a training run or an offline script should use idle cards at night and yield them by day. - Batches: you have thousands of requests that need no answer now, and an OpenAI client that already speaks the batch API. ## Do it: a preemptible job 1. **Submit it** ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/jobs -d '{ "name": "finetune-support", "priority": "preemptible", "spec": { "recipe": { "engine": "generic", "image": "registry.example.com/train@sha256:…", "command": ["python", "train.py"], "args": ["--resume", "/ckpt"] }, "gpus": 1, "maxRetries": 3 } }' | jq '{id, state, message}' ``` The recipe must write its checkpoints to `/ckpt` and resume from there. 2. **Follow it** ```bash curl -s -H "$H" https://cp.example.com/api/v1/jobs/ | jq '{state, node, gpu, attempts, preempted, gpuSeconds}' curl -s -H "$H" "https://cp.example.com/api/v1/jobs//logs?tail=100" ``` ## Do it: a batch 1. **Connect the object store** On the **Connectors** page, save the `batchfiles` settings: at least `OPODCP_BATCH_FILES_BUCKET`, and for MinIO or Ceph `OPODCP_BATCH_FILES_ENDPOINT` and `OPODCP_BATCH_FILES_PATH_STYLE=1`. The bucket must exist. On 0.2.1, set `ports.batchFiles.bucket` (and `.endpoint`, `.pathStyle`) with `helm upgrade` instead. 2. **Write the input file** One request per line, OpenAI's format. Every line's `model` must resolve to the same endpoint: ```json {"custom_id": "1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "qwen2.5-7b-instruct", "messages": [{"role": "user", "content": "Summarise: …"}]}} ``` 3. **Upload it and start the batch** Use the Python example in [Run a batch](#run-a-batch), pointed at `https://cp.example.com/v1` with an endpoint key. 4. **Collect the results** ```python b = client.batches.retrieve(b.id) # until b.status == "completed" print(client.files.content(b.output_file_id).text) ``` ## Check it worked - Job: `state` moves `queued` → `placing` → `running` → `succeeded`. A preempted job reads `preempted`, then `running` again with `preempted` one higher. The console's **Jobs** page shows the same. - Batch: `GET /v1/batches/{id}` reads `completed`, with `request_counts.failed` at 0, and the output file is in your bucket. ## If it fails | Symptom or code | Cause | Fix | | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- | | Job stays `queued` | no card is free; `message` says why | wait, free a card, or make the job `shared` with a `vramBudgetGb` | | `400` naming a field on submit | a rule is broken, for example a CPU job with no `spec.node` | fix the named field | | A preempted job restarts from zero | the recipe does not resume from `/ckpt`, or it moved node without `pvc://` checkpoints | resume from `/ckpt`; save `OPODCP_JOB_CHECKPOINTS=pvc://…` | | An endpoint create is refused for a job's card | the job is `standard`, which keeps its card | make such jobs `preemptible` | | `501 batch_store_not_configured` (`E-BATCH-STORE`) | no batch object store is connected, or it cannot be used | connect `batchfiles` on the Connectors page and restart | | `batch_store_credentials_expire` | the store's credentials expire before the batch window ends | static keys, or a shorter `completion_window` | | `batch_store_unavailable` | the control plane could not ask the store when its credentials expire (the store did not answer, or refused) | check the store from the control plane's pod: the doctor's `batchfiles` row names the reason | | Batch lines fail with `interrupted` | the runner was killed after it sent the line and before the answer came | run those lines again in a new batch | ## Jobs A **job** is a container run on the same GPUs as serving. It claims capacity in the same ledger as an endpoint worker and runs as a Kubernetes Job. It is the second thing the control plane schedules, beside endpoints. ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/jobs -d '{ "name": "finetune-support", "team": "search", "priority": "preemptible", "spec": { "recipe": { "engine": "generic", "image": "registry.example.com/train@sha256:…", "command": ["python", "train.py"], "args": ["--resume", "/ckpt"], "env": { "EPOCHS": "3" } }, "gpus": 1, "vendor": "nvidia", "colocation": "dedicated", "maxRetries": 3 } }' ``` | Field | Default | Meaning | | ----------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | — | a DNS label: `a-z`, `0-9` and `-`, at most 40 characters | | `team` | — | the owning team; a team-scoped operator's job lands in their team | | `priority` | `standard` | `standard` keeps its claim to completion; `preemptible` yields its card to serving and resumes later | | `spec.recipe` | — | `engine: generic` (the only recipe built): an `image` (required), `command`, `args`, `env`; the image is pinned by digest at submit when the registry answers | | `spec.gpus` | — | GPUs, 0 or more; `0` is a CPU job, which must name its node in `spec.node` | | `spec.vendor` | any vendor with an image | `nvidia`, `amd`, … or `none` | | `spec.node` | the placer chooses | pin the job to a node of this cell; a GPU job needs a node with an accelerator | | `spec.colocation` | `dedicated` | `dedicated` whole GPUs, or `shared`: one device, with `spec.vramBudgetGb` required, judged against measured VRAM | | `spec.checkpoint` | a directory named after the job | where the recipe writes and resumes, mounted at `/ckpt`: a name is a directory under the node's checkpoint root (or the claim of that name with `pvc://`); an absolute path is a host directory (host-path mode only) | | `spec.maxRetries` | 0 | retries of a failed run | A rule broken is refused `400` with the field. The container gets the node's model cache at `/data/models` and a checkpoint directory at `/ckpt`. The job record adds `id`, `state`, `node`, `gpu`, `pod`, `message` (why it is queued or failed), `attempts` (pod starts, retries and resumes counted), `preempted` (times evicted), `gpuSeconds`, `startedAt`, `finishedAt`, `createdAt`, `updatedAt` and `by`. **States:** `queued` (with the reason, while no card is free), `placing`, `running`, `preempted`, `succeeded`, `failed`, `cancelled`. **Preemption.** A create or a plan change that needs a preemptible job's card evicts that job within one reconcile. In 0.3.0 it evicts only the jobs whose cards it takes (0.2.1 evicts every preemptible job in the cell), and the autoscaler's growth may evict one too. The job reads `preempted`, keeps its GPU-seconds, and is placed again when capacity returns; the recipe resumes from `/ckpt`. An endpoint that needs a standard job's card is refused. **Checkpoints.** By default `/ckpt` lives under the node's model cache, so a preempted job resumes on the same node only. Save `OPODCP_JOB_CHECKPOINTS=pvc://[storageClass]?size=20Gi` on the Connectors page (on 0.2.1, the chart value `ports.checkpoints.url`) for one PersistentVolumeClaim per job, kept across preemption and deleted with the job, to resume on any node. Object-store checkpoints (`s3://`, `gs://`, `azblob://`) are not supported, and the control plane refuses them by name. **GPU-seconds** are pod running time × GPUs, charged when a run segment ends (preempted, succeeded, failed or cancelled), as one usage row per segment. | Route | Purpose | | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET /api/v1/jobs`, `GET /api/v1/jobs/{id}` | list, read | | `POST /api/v1/jobs` | submit (operator) | | `GET /api/v1/jobs/{id}/logs?tail=N` | the trainer's log; `tail` 1 to 5000, default 200. Once the pod is gone, the last 64 KB kept when the job ended (`X-Opod-Log-Source: kept`, with `X-Opod-Log-Kept-At`) | | `POST /api/v1/jobs/{id}/cancel` | cancel | | `DELETE /api/v1/jobs/{id}` | delete a finished job | **(planned)** Packaged training recipes (axolotl, TRL, torchtune, LLaMA-Factory), train-to-serve, multi-node jobs and a Kueue adapter are not built. ## OpenAI files and batches The control plane serves OpenAI's `/v1/files` and `/v1/batches`, so an OpenAI client runs a batch with no new code, pointed at the control plane's URL. ### It needs your object store File bytes live **only** in an S3-compatible store you run: AWS S3, MinIO, Ceph RGW, or GCS in S3 mode. The control plane keeps the records and no bytes. With no store, every route answers `501 batch_store_not_configured` (`E-BATCH-STORE`). Save these on the Connectors page (**batchfiles**). On 0.2.1 they are chart values under `ports.batchFiles` (`bucket`, `prefix`, `endpoint`, `region`, `pathStyle`, `credentialsSecret`, `downloads`). | Setting | Meaning | | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | `OPODCP_BATCH_FILES_BUCKET` | the bucket; it must exist | | `OPODCP_BATCH_FILES_PREFIX` | empty by default: files go to the bucket root. Example `batch-files` | | `OPODCP_BATCH_FILES_ENDPOINT` | `http(s)://host[:port]`; empty = AWS S3 | | `OPODCP_BATCH_FILES_REGION` | the region | | `OPODCP_BATCH_FILES_PATH_STYLE` | `1` for MinIO, Ceph and in-cluster stores | | `OPODCP_BATCH_FILES_ACCESS_KEY`, `_SECRET_KEY` | stored sealed; unset = the standard AWS chain (environment, EKS workload identity, instance metadata) | | `OPODCP_BATCH_FILES_DOWNLOADS` | `proxy` (default: the control plane streams file content) or `redirect` (OpenAI clients get a `307` to a 5-minute presigned URL) | The batch runner reads its input and writes its results directly through presigned URLs, so the store must be reachable from pods in the namespace. Temporary credentials that expire before a batch's window are refused (`batch_store_credentials_expire`); give the store static keys or use shorter windows. ### Run a batch ```python from openai import OpenAI client = OpenAI(base_url="https://cp.example.com/v1", api_key="sk-orc-") f = client.files.create(file=open("requests.jsonl", "rb"), purpose="batch") b = client.batches.create(input_file_id=f.id, endpoint="/v1/chat/completions", completion_window="24h") ``` - **Auth:** an endpoint key, or a console credential (viewer reads, operator writes). A key sees only what it created. - **Files:** up to 200 MB, streamed into the store as they arrive. `purpose` is `batch`. - **Batches:** `endpoint` is `/v1/chat/completions`, `/v1/completions` or `/v1/embeddings`; `completion_window` is `1h` to `167h`; `metadata` holds up to 16 pairs. - **One batch is one endpoint.** Every line's `model` resolves, through the cell door's aliases or the id exactly one endpoint serves, to one endpoint. - **Statuses** are OpenAI's: `validating`, `in_progress`, `finalizing`, `completed`, `failed`, `expired`, `cancelling`, `cancelled`. | Route | Role | Purpose | | ----------------------------------------- | -------- | ------------------------------------------------------------------ | | `POST /v1/files` | operator | upload, as `multipart/form-data` with `purpose` and `file` | | `GET /v1/files`, `GET /v1/files/{id}` | viewer | list (filter with `?purpose=`), read one | | `GET /v1/files/{id}/content` | viewer | the bytes, streamed or redirected (`OPODCP_BATCH_FILES_DOWNLOADS`) | | `POST /v1/batches` | operator | create | | `GET /v1/batches`, `GET /v1/batches/{id}` | viewer | list (`limit` 1 to 100, default 20; `after` a batch id), read one | | `POST /v1/batches/{id}/cancel` | operator | cancel | | `GET /api/v1/batches` | viewer | the console's list of every batch you may see | The roles are for a console credential; an endpoint key may use every route, on what it created. Errors use OpenAI's shape, for example `400 invalid_request_error`. There is no file delete route: retention is your bucket's. When a batch starts, the control plane mints a `sheddable`-class key on the endpoint and runs one Kubernetes Job from the leader image (core's `opod batch run`) against the endpoint's leader. The Job needs no GPU. A line is marked sent before its request goes, so no line is sent twice; a line found sent but unanswered after a kill is written to the error file as `interrupted`. A runner replaced on another node resumes only with `pvc://` checkpoints. The minted key is revoked when the batch ends. The control plane deletes no object when a batch ends: retention is your bucket's lifecycle rule. It computes no price or discount. **(planned)** Reaching `/v1/files` and `/v1/batches` through the cell door's URL. --- title: "Console tour" description: "Every page of the console built into opodcp, what it shows and what you can do there, and what its PARTIAL and TARGET chips mean." url: "https://opod.io/docs/control-plane-operate/console/" markdown_url: "https://opod.io/docs/control-plane-operate/console.md" section: "Operate" last_updated: "2026-10-31" --- # Console tour > Every page of the console built into opodcp, what it shows and what you can do there, and what its PARTIAL and TARGET chips mean. ## In short The console is the control plane's web page. It ships inside the `opodcp` binary, so there is nothing else to install: open the control plane's URL and sign in. Every page reads the same API you can script against, and a live event stream keeps it current. A control your role cannot use is greyed out and says which role it needs. ## When you need it - You want to see the cell at a glance: GPUs, endpoints, open alerts. - You create or change an endpoint, a key, a team quota or a connector without writing JSON. - You look up a run, an endpoint or a machine by a link someone pasted in a ticket. - You need to know which parts of the product are finished (the PARTIAL and TARGET chips). ## Do it 1. **Reach the console** ```bash kubectl -n opodcp port-forward svc/opodcp 8080:8080 ``` Open `http://127.0.0.1:8080`. On a cell with a NodePort, an Ingress or a Gateway, open that address instead; see [Reach the console](https://opod.io/docs/control-plane-install/kubernetes/#reach-the-console). 2. **Sign in** The first time, use the bootstrap admin token: ```bash kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d; echo ``` Paste it into the sign-in sheet. Later, sign in as a local user, or with **Sign in with SSO** once OIDC is connected. 3. **Create your own user** Open **Teams & quotas**, add a user with the admin role, sign out and sign in as that user. The doctor's `identity` row then names the next step, which is to retire the shared token. See [Users, roles and SSO](https://opod.io/docs/control-plane-security/authentication/). ## Check it worked The account menu at the top right names you: `static-admin` while you use the bootstrap token, your user name after step 3. **Overview** shows your GPUs by vendor. The chips the console draws come from one call: ```bash curl -s -H "Authorization: Bearer " http://127.0.0.1:8080/api/v1/capabilities # {"images.ci":"partial","license.token":"partial",…} ``` Each key is a part of the product that is not finished; its value is `partial` or `target`. Anything not listed is finished and carries no chip. ## If it fails | Symptom | Cause | Fix | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | | Every page reads *Connecting to the control plane…* | the live stream is down: a restart, or a proxy that cuts long responses | wait for the restart; behind a proxy, allow long-lived responses on `/events` | | The sign-in sheet comes back after every action | the token was rotated, or the user was deleted | sign in again | | The page shows **Connect your database** | setup mode | see [Setup mode](https://opod.io/docs/control-plane-install/kubernetes/#setup-mode) | | A button is greyed out | your role cannot use it | its tooltip names the role it needs; ask an admin | | A page carries a **TARGET** chip | that part is not built | hover the chip for the note | | A browser `fetch('/api/v1/…')` from the developer console answers `401` | the console sends its credential as a header, not a cookie | this says nothing about your session; check the account menu | ## Pages and how to use them The console is built into the `opodcp` binary and served at the control plane's URL. It reads the same API you script against, and a live event stream keeps it current. ## Signing in The sign-in sheet takes a username and password (local users), an admin or user token, or **Sign in with SSO** when OIDC is connected. The console keeps its credential in the browser and sends it as a header, never a cookie, so a control-plane restart or upgrade does not sign you out. The account menu at the top right names who you are. ⌘K opens a search over every page. ## Chips: what is not finished A page or a control that rests on something not finished carries a chip: **PARTIAL** (built, with a stated gap) or **TARGET** (not built). Hover a chip for the note. A control without a chip works. The chips come from `GET /api/v1/capabilities`, which lists only what is unfinished. ## Pages | Section | Page | What it is for | | ------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | — | **Overview** | the cell at a glance: GPUs by vendor, VRAM in use, endpoints serving, in-flight requests, and the open alerts with **Ack** (operator); an acked alert names who acked it and when | | — | **Activity** | every change and every event, newest first: who created, edited, rolled out, scaled or deleted what, and what happened on its own. Runs with their steps; the *Rollouts* filter; **Remnants** (objects nothing owns any more, with a clean action) | | Fleet | **Topology** | clients → Service → leader → workers, drawn per machine with GPU shares; hover to isolate one endpoint. In the release after 0.3.6, machines keep a fixed place: grouped by zone label, else by the /24 (IPv6: /64) of their InternalIP, then ordered by address and name. The **Fabric** toggle (2D) adds a rail beside the machines: each machine's best NIC and how many are down, and a green bracket per RDMA domain a fabric proof recorded. Click a Service for its north-south path | | Fleet | **Network & fabric** | the release after 0.3.6: the network health checks, every machine's address, range (private or public), zone and pod IPs used out of usable (amber from 80 %), every NIC the GPU probe read (speed, fabric, MTU, link state, GPUDirect, nearest GPUs), the RDMA domains, the fabric proofs with each path's all-reduce trend over its kept proofs, the NetworkPolicies the control plane wrote, and **Can A reach B?** | | Fleet | **Machines** | every node with its cards, holders, taints and health. **Labels…**, **Cordon**, **Evacuate**, **Drain**, **Time-slice this machine**, cache preview and prune, **Reset card** | | Fleet | **Capacity ledger** | the placer's own ledger per card and per node, and what still fits | | Fleet | **Clusters** | this cell; in fleet mode, every cell with a link to its console | | Serve | **Models** | the catalog and your models, versions, approval, licence and signature | | Serve | **Endpoints** | every endpoint; **New** opens the create form with recipes, presets, Preview; **Apply YAML** takes a scenario | | Serve | endpoint page | status and proof, Connect card, Load, KV cache per worker, KV advice, the leader's registry, the **Network** card (the release after 0.3.6: hops, the address the leader dials per worker against its pod IP, heartbeat age against the router's 30 s cut-off, gang part addresses), SLO card, **Roll out plan…**, **Edit plan & roll…**, History, Events, logs | | Serve | **Shards & parallelism** | gangs, their parts and live status; **Re-form**. In the release after 0.3.6, each gang also says what sits between its parts (a proven RDMA domain, or each machine's NIC) and its last fabric proof against the floor | | Serve | **Engines & KV cache** | each deployment's engine, parallelism and budget, and the load each leader reports; the engine × vendor grid | | Serve | **Autoscale** | per-endpoint policy, who scales it, its ceiling, what parking saved and the last wake | | Serve | **Jobs** | training and batch jobs; the **Batches** tab | | Serve | **Images & artifacts** | every image the executor runs, its pin and its signature result | | Traffic | **Routing policies** | each endpoint's policy: fallback, load-aware knobs, admission, classes; the cell door's auto routes | | Traffic | **Playground** | chat and embeddings through the control plane's proxy, with the credential you choose | | Govern | **Teams & quotas** | teams, their GPU quotas, users, and **Machine tokens** | | Govern | **API keys** | every endpoint key: mint, revoke | | Govern | **Audit log** | the hash-chained record with filters, **Load older** and CSV export; the **Chain** card (verify, rebase, export); **Retention** (days, keep all); the alert rules card | | Account | **Usage** | requests, tokens and GPU-hours per team, model, endpoint and worker; latency and TTFT percentiles; export | | Account | **Connectors** | every port with Verify, Save, a credential form and test sends | | Account | **License & census** | the licence state and **Install token** | | Account | **Settings** | the control plane's version and location, identity, Hugging Face token, fabric policy, ports, effective configuration with the `helm upgrade` for each value, controller loops, **Backup** | ## Detail pages and links Every list links to a detail page. Each detail page has a stable URL, so you can paste it in a ticket: | URL | Page | | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `/endpoints/detail?id=` | one endpoint; `&tab=history` opens the plan history, `&tab=events` its events | | `/endpoints/new` | the create form; `?model=` opens it with that model chosen (the **Models** page links here) | | `/machines/detail?id=` | one machine: GPU utilization since the control plane started (one-minute samples), the node gate (Ready, the vendor probe, host facts), GPU sharing per card as the ledger holds it, per-GPU telemetry, the containers on the node and its placements. In the release after 0.3.6, a **Network** card: each NIC's link, fabric and MTU, the GPU-to-GPU link matrix and each GPU's nearest RDMA NIC | | `/runs/detail?id=` | one run: its steps with their log lines and proofs, what it took (given back when it fails), **Cancel run** and **Force**, **Rollback**, and a canary's **Promote** and **Abort** | | `/playground?endpoint=` | the playground with that endpoint chosen | | `/jobs` | the **Jobs** and **Batches** tabs | The console is a static page built into the binary. A refresh on any of these URLs serves it again; the API path `/api/…` never returns the page. ## Live updates The console opens `GET /events` with a single-use stream ticket and reconnects by itself, and it polls `GET /api/v1/endpoints/status` for every visible endpoint's status in one call. When the stream drops (a control-plane restart, a proxy timeout), every page reads *Connecting to the control plane…* until it is back. Behind a proxy, allow long-lived responses on `/events`: the stream sends a heartbeat every 15 s. ## What needs which role Viewers read every page their team may see. Operators create and change endpoints, plans, rollouts, keys, models and jobs, and acknowledge alerts. Admins manage users, machine tokens, the licence, connectors, alert rules, quotas, model approval, machine actions and backups. A control the caller's role cannot use is disabled, and its tooltip names the role it needs. ## Setup mode When the control plane has no database it can use, the console shows one screen: **Connect your database**, with the reason, the commands, and a **Verify** for a DSN. See [Install on Kubernetes → Setup mode](https://opod.io/docs/control-plane-install/kubernetes/). --- title: "Doctor and runbook" description: "opodcp doctor prints one row per port and per check, embedded or connected, green or red. Every row, when it turns red, the flags, and how to fix it." url: "https://opod.io/docs/control-plane-operate/doctor/" markdown_url: "https://opod.io/docs/control-plane-operate/doctor.md" section: "Operate" last_updated: "2026-11-12" --- # Doctor and runbook > opodcp doctor prints one row per port and per check, embedded or connected, green or red. Every row, when it turns red, the flags, and how to fix it. ## In short `opodcp doctor` is the health check for the control plane itself. It prints one row per port and per check: which adapter runs, whether it is the built-in default (**embedded**) or your own service (**connected**), green (`✔`) or red (`✘`), and one line of detail. A red row degrades one feature and says which; the control plane keeps serving. `opodcp runbook ROW` prints the causes and the fix for any row. ## When you need it - Right after an install or an upgrade, to see that every port is green. - When the console or an alert says something is wrong and you need to know which part. - In a script or a CI gate: the command exits non-zero while any row is red. - After you save a connector, to see that it took. ## Do it 1. **Run it in the control plane's pod** ```bash kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor ``` The pod already holds the admin token in its environment, so no flag is needed. The output is one row per check: ```text control plane http://127.0.0.1:8080 ✔ state postgres connected Postgres via OPODCP_STATE_DSN — the control plane's only durable store; the pod keeps nothing ✔ events in-process+journal embedded … ✔ usage spool buffer … ✘ identity local users embedded BOOTSTRAP: the shared admin token is the only way in, so every action is audited as `static-admin` … … error: 1 port(s) not OK ``` Columns: the mark, the row, the adapter, the mode, the detail. A line `adapters: …` under a row lists the adapters you may connect to that port. 2. **Read the runbook for each red row** ```bash kubectl -n opodcp exec deploy/opodcp -- /opodcp runbook identity ``` It prints what green reads, every way the row turns red with its cause and remedy, and how to connect your own service. 3. **Fix, then run the doctor again** Most fixes are a connector on the **Connectors** page or a chart value. The rows you meet first are under [The red rows you will meet first](#the-red-rows-you-will-meet-first). ## Check it worked ```bash kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor; echo "exit=$?" ``` A good answer has no `✘` row and ends with `exit=0`. The console shows the same rows on **Settings → Ports & adapters** and on each **Connectors** card. ## If it fails | Output | Cause | Fix | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------- | | `error: control plane https://cp.example.com: http 401 — set OPODCP_ADMIN_TOKEN or pass --token` (0.3.6) · `error: doctor: GET /api/v1/doctor: the control plane at … did not accept the token (…) — pass --token or set OPODCP_TOKEN; the admin token is Secret opodcp-admin …` (the release after 0.3.6) | `--cp` without a token, or a wrong one | pass `--token` with a viewer or admin token | | `error: doctor: GET /api/v1/doctor: no control plane at … — pass --cp URL or set OPODCP_URL` and `for what this machine alone can see: opodcp doctor --local` (the release after 0.3.6) | you named a control plane (`--cp`, `--url` or `OPODCP_URL`) and it did not answer | check the address and the tunnel, or run `opodcp doctor --local` | | `no control plane answering at http://127.0.0.1:8080 (…) — reporting what this process can see` | no `--url`, and nothing listens on this machine | run it inside the pod, or pass `--url` | | Rows read `not asked` or `not observable` | a local report: it could not ask a running control plane | run it against the serving control plane | | Only one row, `state` in mode `setup` | the control plane is in setup mode | connect the database; see [state](#the-red-rows-you-will-meet-first) | | `error: N port(s) not OK` | at least one row is red | read each `✘` row and its runbook | ## How it works `opodcp doctor` asks a running control plane how each of its ports and checks stands: the adapter, its mode (the **embedded** default or a **connected** service of yours, among others), green or red, and a detail line. A red secondary port degrades one feature and says so; the control plane keeps serving. A row is green (`✔`) or red (`✘`). In the release after `0.3.0` (it arrives then; `0.3.0` has green and red only), a green row can also be a warning (`!`, `"warn": true` in the JSON, amber **advice** in the console): advice that is not a fault, which never fails the exit code. Other advice stays green and says so in its detail. ```bash kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor # asks the control plane that is serving opodcp doctor --cp https://cp.example.com --token # from your laptop (--url on 0.2.1) curl -s -H "Authorization: Bearer " https://cp.example.com/api/v1/doctor ``` `GET /api/v1/doctor` needs the `viewer` role and returns a JSON list of rows: `port`, `adapter`, `mode`, `ok`, `detail`, `available` (the adapters registered for the port; a planned one reads `name (target)`) and, on ports that send somewhere, `sinks` with what each sink sent, failed, dropped and queued. The console shows the same rows under **Settings → Ports & adapters** and on **Connectors**. ## Flags | Flag | Default | Meaning | | --------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `--cp URL` | `OPODCP_URL`, else `http://127.0.0.1` on the port of `OPODCP_ADDR` (`:8080`) | the control plane to ask | | `--url URL` | the same | the same as `--cp`, its older name | | `--token TOKEN` | `OPODCP_TOKEN`, else `OPODCP_ADMIN_TOKEN` (0.3.6: `OPODCP_ADMIN_TOKEN` only) | the bearer token sent with the request | | `--ca FILE` | the system's roots | the CA that signed the control plane's certificate (the release after 0.3.6) | | `--local` | off | do not ask a running control plane; report what this process can see | When you name no control plane and nothing answers on this machine, the doctor says so on stderr and falls back to `--local`. When you name one — `--cp`, `--url` or `OPODCP_URL` — a control plane that does not answer is an error, and the doctor prints the reason and `opodcp doctor --local`. In 0.3.6 only `--url` counted as naming one: `--cp` fell back to a local report and ended on an unrelated error; the fix arrives in the release after 0.3.6. In a local report the `controllers` and `telemetry` rows read `not observable`, and a port it could not ask reads `not asked` with mode `unknown`. The command exits non-zero (`N port(s) not OK`) when any row is red, so a script can gate on it. ## Runbook `opodcp runbook` prints the full runbook, one section per row: what green reads, every way it goes red with the cause and the remedy, how to connect your own service, and what a switch moves. `opodcp runbook ` prints one. The runbook is built into the binary, so it always matches the release you run. ## Modes | Mode | Meaning | | --------------------------- | ---------------------------------------------------------------------------------------------- | | `embedded` | the built-in default is in use | | `connected` | a service of yours, or a cluster feature the row found | | `buffer` | `usage` only: no sink is connected and usage is buffering in the database | | `boot` | `config` only: a setting read at boot that could not take effect | | `setup` | `state` in setup mode; the doctor then returns this one row, and only to the admin token | | `blocked`, `elected` | `controllers`: the lease check failed; or a replica that holds, or waits for, the lease | | `engine` | `kv-tier`, `kv-disk`: one row per endpoint, with the endpoint as the adapter | | `unset` | `registry`: no leader image is configured | | `configured` | `secrets`: a store is configured and is either not reachable (red) or cannot be probed (green) | | `unknown`, `not observable` | a local report that could not ask | ## Rows Rows marked † are new in `0.3.0`. | Row | Reports on | Default → yours | Red when | | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `state` | the database: the control plane's only durable store | `postgres` (always connected) | setup mode, or the database does not answer a ping | | `events` | the event bus (console stream, fan-in between replicas) | `in-process+journal` → `nats` | a NATS dial or auth error; or a standby replica that hears none of the lease holder's events | | `metrics` | `/metrics` and an optional OTLP push | `prometheus-scrape` → `prometheus-scrape+otlp` | the OTLP push has a last error | | `traces` | the OTLP collector rendered into every leader | `none` → `otlp` | `OPODCP_TRACES_SAMPLE_RATIO` is not a number from 0 to 1 | | `kvstore` | the shared KV store for peer tiers | `none` → `lmcache-redis`, or `shared-volume` (the release after 0.3.6) | the store does not answer, or refuses the password; for `shared-volume`, a URL that does not parse (it dials nothing: a missing class shows on the endpoint) | | `logs` | where control-plane records, the audit stream and events go besides stdout | `stdout` → `otlp`, `splunk-hec` | the setting cannot run; or the sink has a last error | | `usage` | usage facts and the sink they ship to; its schema step and lag | `spool` (mode `buffer`) → `postgres`, `clickhouse`, `s3` (and `parquet` up to 0.3.6) | the sink refuses; a schema step is pending that nobody runs; the sink holds rows past retention; retention is invalid; or 10,000 rows buffered with no sink | | `batchfiles` | the object store for the batch API | `none` → `s3` | the store is configured and refused, or the bucket cannot be opened | | `identity` | sign-in: local users or OIDC | `local-users` → `oidc` | `INSECURE: auth disabled`, or `OIDC misconfigured` | | `notifier` | alert delivery, per sink | `console` → `webhook`, `alertmanager`, `slack`, `pagerduty` | a sink refused a delivery | | `checkpoints` | where job checkpoints go | `hostpath` → `pvc` | the StorageClass cannot provision the volume | | `secrets` | the secret store for minted tokens | `kubernetes-secrets` → `vault` | the store URL is rejected, or Vault refuses a write | | `registry` | where images come from | `ghcr.io` → your registry | no leader image is configured (`engineImages.leader`) | | `controllers` | the control loops: last run, errors; `standby` or `blocked` on a replica without the lease | `N loops` | the lease check failed (`blocked`); no loops and no executor; a loop reports errors | | `kv-tier` † | per endpoint with a host KV tier: whether its workers report it | — | none of its workers reports the tier | | `kv-disk` † | per endpoint with a disk KV tier: whether its release starts one | — | the leader and worker images predate the disk tier | | `config` † | port settings read at boot that could not take effect | appears only when something disagrees | always red when present | | `telemetry` | probe pods, reads and pushes (from the release after 0.3.6, `N read by this replica · N pushing`), measured devices, host facts | `vendor-probes` | a probe reports an error, or the collector has not started | | `gpu-toolkit` | the NVIDIA container toolkit on NVIDIA nodes | `nvidia-container-toolkit` | a node's toolkit refuses `NVIDIA_VISIBLE_DEVICES` for unprivileged pods (`accept-nvidia-visible-devices-envvar-when-unprivileged = false`) | | `autoscaler` | the adapter in use, and KEDA's health | `embedded` → `keda` | `keda` is chosen and its CRDs or operator are absent | | `north-tls` | how endpoints are reached from outside: HTTPRoute, Ingress or none | `self-signed` or `none` → `gateway-api`, `ingress` | `endpoints.expose=gateway` and no Programmed Gateway | | `gpu-sharing` † | budget or time-sliced sharing, and what it promises | `budget` → `timeslice` | the nodes cannot be read; a node labelled for time-slicing whose plugin presents no slices (named in the detail; red from 0.3.0, green on 0.2.1) | | `gangs` | whether gangs land as LeaderWorkerSets or one Deployment per part | `deployments` → `leaderworkerset` | the LeaderWorkerSet controller is installed but down | | `network-policy` | whether the cluster enforces NetworkPolicy | a named CNI, `k3s`, or `unconfirmed` | no enforcing CNI was recognised (`unconfirmed`), or k3s runs with `--disable-network-policy` | | `leader-isolation` | the per-endpoint leader policies: isolated or open, and why | `off` → `networkpolicy` | a policy leaves a leader's port open; the API server's source is unknown; `networkPolicy.leaderIsolation.from` does not parse | | `secrets-at-rest` † | whether the cluster encrypts Secrets in etcd | `unconfirmed`, `k3s` | a k3s server runs without `--secrets-encryption`, or the nodes cannot be listed | | `node-taints` | GPU nodes kept out by a taint nothing tolerates | `workloads.tolerations` | a GPU node is kept out, or `workloads.tolerations` does not parse | | `identity` | who can sign in, and whether every action is attributed to a person | `local users` → `oidc` | a shared admin token is configured (`BOOTSTRAP`, `SHARED ROOT BESIDE REAL USERS`), or the user store cannot be read | | `front-doors` † | nodes that may hold a door, and endpoints capped by them | `scheduler` | an endpoint runs fewer doors than it asks for | | `endpoint-resilience` † | serving endpoints that one failure would stop | `planner` | never: advice only, it stays green | | `net.server` | the release after 0.3.6: the Kubernetes API answers, and in how many ms | `kube-apiserver` | the API server does not answer | | `net.cni` | the release after 0.3.6: which CNI runs the pod network (k3s's built-in flannel included) | the CNI's name, or `unknown` | never red; `unknown` when no CNI is recognised | | `net.cidrs` | the release after 0.3.6: each node's pod CIDR, and the Service range when the cluster states it (ServiceCIDR objects, or the k3s server's `--service-cidr`) | `nodes` | never red; says when the Service range is not readable | | `dns.coredns` | the release after 0.3.6: Ready cluster DNS pods (`k8s-app=kube-dns`) | `coredns` | no DNS pod is Ready | | `fabric.attachment` | the release after 0.3.6: the Multus attachment that RDMA pods ask for | `none` (no pod asks), `multus`, `hostnetwork` | a pod asks for RDMA and Multus is not installed, or its NetworkAttachmentDefinition does not exist, or no node advertises the RDMA resource. Amber when the attachment cannot be read | | `leader-spread` † | whether leaders are spread over the nodes that may hold one | `scheduler` | one node holds more than half the leaders; a leader sits on a GPU node while a GPU-less one may hold it; the cell door's replicas share a node | | `leader-fence` † | fenced, preferred and out-of-pool nodes, and how many may hold a leader | `opod.io/leaders` | fewer than two nodes may hold a leader | | `cp-node` † | whether the control plane itself runs on a node with an accelerator | `scheduler` | it runs on a GPU node while a Ready, uncordoned, untainted node with no accelerator could hold it (the row prints the restart that moves it); a warning (`!`, arrives in the release after `0.3.0`; in `0.3.0` this case is green) when no Ready node without an accelerator exists, for example a cluster of GPU nodes only: add a CPU node, or accept the cost — the control plane takes CPU and memory there, never a GPU. A pod that `nodeSelector` pins there while a node without one exists stays green | | `template-drift` | endpoints whose running pod templates differ from what this release renders | `template-hash` | any endpoint runs a template this release renders differently | | `auth-snapshots` | each endpoint's auth snapshot age against its bound | `kubernetes-secret` | a snapshot is past its bound, not re-issued for three periods, or cannot be written | | `fabric` | what a gang across nodes rides | `pcie+ethernet` → `rdma` | never; the detail names the nodes with an RDMA NIC | | `hub-token` | whether a Hugging Face token is set | `kubernetes-secret` | never; the detail says whether gated models can be fetched | | `images-signed` | whether each image a rollout would run has a signature that verifies, and the trust root in use | `warn`, `enforce`, `off` | no usable trust root; or, under `enforce`, an image whose signature is invalid, absent or unverified | | `endpoint-identity` | workloads in the namespace that belong to no endpoint in this store | `endpoint-id` | any such workload, or the read fails | | `cloud` | the provider adapter, and whether the node-zero tier is on | `onprem` | `OPODCP_CLOUD` names a provider this build does not carry | | `licence` | the tier and how many GPUs are licensed | free tier → your key (`connected`) | the cell holds more GPUs than are licensed, or the key is invalid | | `executor` | the Kubernetes executor and its RBAC | `kubernetes` | no cluster client, or the API server does not answer | On 0.2.1 `identity` appears twice: the first row is the sign-in connector (local users or OIDC), the second is attribution (whether a shared admin token is still accepted). From 0.3.0 the second is its own row, `sign-in`; its remedy is to rotate the shared token, because the chart cannot remove it yet. ## The red rows you will meet first **`identity` — `BOOTSTRAP: the shared admin token is the only way in`.** Expected right after install. Create a user (`POST /api/v1/users`) or connect OIDC, then unset `admin.token` and upgrade. `SHARED ROOT BESIDE REAL USERS` is worse: people exist and the shared token still works, so attribution is optional. **`state` — setup mode.** `no-database`: set `ports.state.dsnSecret.name`. `unreachable`: fix the database or the DSN; the control plane takes it the moment it answers. `newer-schema`: upgrade back to that release or restore a backup. `ladder-store`: back up with the old release and restore into an empty database. Setup mode is new in `0.3.0`; `0.2.1` keeps its state in SQLite. **`usage` — no sink, or a sink behind.** With no sink, usage only buffers in the database; at 10,000 buffered rows the row turns red and raises `usage.no-sink`. A sink that refuses holds rows (they are never trimmed while untaken) and the database fills: fix the sink, or accept the loss explicitly with `POST /api/v1/usage/sink/skip?before=…`. See [Usage](https://opod.io/docs/control-plane-operate/usage/). **`template-drift`.** Roll out each named endpoint when you choose. See [Upgrade](https://opod.io/docs/control-plane-install/upgrade/). **`node-taints`.** Set the `workloads.tolerations` value the row prints, or leave the node unused. **`telemetry` — fewer nodes measured than have GPUs.** `kubectl -n opodcp get pods -l app=opodcp-gpu-telemetry -o wide`: a Pending probe is a taint or an image pull. Without a measurement the placer does not place on that node. **`gpu-toolkit`.** The row names nodes whose toolkit has `accept-nvidia-visible-devices-envvar-when-unprivileged = false`: a shared (packed) worker there cannot be pinned to one card. Set it to `true` in `/etc/nvidia-container-runtime/config.toml` and restart the container runtime, or keep those nodes dedicated. A missing RuntimeClass `nvidia` is preflight row `runtime.nvidia`, not this row. **`controllers` — `blocked`.** The replica cannot hold its Lease (RBAC). Grant `coordination.k8s.io/leases` or set `OPODCP_LEADER_ELECTION=0` for one replica. It retries every 30 s. A loop with errors: read `opodcp_controller_errors_total{controller=…}` and the pod log for that loop. **`images-signed` — `untrusted-identity`, `bad-signature`, `absent`.** See [Supply chain](https://opod.io/docs/control-plane-security/supply-chain/). **`network-policy` — `unconfirmed`.** The API accepts a NetworkPolicy on every cluster whether or not anything enforces it. Test one node: run a pod, apply a policy with an empty `egress: []`, and check that it is cut off. **`licence` — `N of M GPUs licensed`.** The cell holds more GPUs than the key allows; new capacity is refused `E-LICENCE`. Install a larger key on **Settings → Licence**; check a key with `opodcp licence inspect`. **`config`.** A declared adapter that the DSN does not select, or a KV store URL with a password in it. Fix the named setting on the Connectors page and restart; type the KV store password as `OPODCP_KVSTORE_PASSWORD`. --- title: "Connectors" description: "Point each port of the control plane at a service you already run — usage sink, events, logs, metrics, traces, OIDC, alerts, secrets, checkpoints, batch files, KV store." url: "https://opod.io/docs/control-plane-operate/connectors/" markdown_url: "https://opod.io/docs/control-plane-operate/connectors.md" section: "Operate" last_updated: "2026-11-12" --- # Connectors > Point each port of the control plane at a service you already run — usage sink, events, logs, metrics, traces, OIDC, alerts, secrets, checkpoints, batch files, KV store. ## In short The control plane works the moment it installs: usage, events, logs, metrics, identity and alerts each run on a built-in default. A **connector** points one of these ports at a service you already run, such as your ClickHouse for usage, your OIDC provider for sign-in or your PagerDuty for alerts. An admin verifies and saves it on the **Connectors** page. The setting is stored in the database, a credential sealed with the install key, and the control plane restarts once to apply it. What to prepare on each service first — grants, policies, the IdP client, webhooks — is in [Connector setup](https://opod.io/docs/control-plane-operate/connector-setup/). ## When you need it - Usage must reach your own store before the database spool fills (alert `usage.no-sink`). - People should sign in with your SSO instead of the shared admin token. - Alerts must reach your pager, chat or Alertmanager. - You run more than one replica and need a shared event bus. - You want the control plane's records and audit stream in Splunk or an OpenTelemetry collector. - Training jobs must resume on any node, or the batch API needs an object store. ## Do it The console's **Connectors** page does this for one port at a time: 1. **Verify** On the port's card, fill the settings and press **Verify**. The control plane tries the candidate from its own pod within 5 s. The answer is `ok`, or a kind: `unreachable`, `refused`, `missing`, `invalid` or `no-probe` (the adapter has no live check; a notifier is checked by a test alert instead). The detail is redacted. A required field left out is `invalid` before any probe. A usage sink with a table also returns the table's schema state. Nothing is saved, and the event `connector.verified` records who verified what. With no adapter named, Verify checks the adapter running now; on an embedded default it answers `ok` with nothing to verify. 2. **Save** Press **Save**. A credential is sealed and never shown again. The control plane answers, publishes `connector.saved` with the names of the saved settings (never a value), and restarts itself. A stored setting wins over the same variable given through `extraEnv`: at boot every stored row is set into the process environment, a sealed one opened first. 3. **Check** The doctor row turns green. On the next boot the control plane compares each port's adapter with the one the last boot ran, and `connector.changed` records `from` and `to` when they differ. The first boot records what it runs and announces nothing. The same through the API (admin): ```bash export H="Authorization: Bearer $(kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d)" curl -s -H "$H" -X POST https://cp.example.com/api/v1/connectors/usage/verify \ -H 'Content-Type: application/json' -d '{"adapter":"clickhouse","fields":{"dsn":"clickhouse://ch.example.com:8123/opod"}}' curl -s -H "$H" -X PUT https://cp.example.com/api/v1/connectors/usage/settings \ -H 'Content-Type: application/json' -d '{"set":{"OPODCP_USAGE_DSN":"clickhouse://ch.example.com:8123/opod"}}' ``` In the release after 0.3.6, `opodcp connectors verify usage` checks the adapter running now from the CLI; it exits `1` when the check fails. See the [CLI reference](https://opod.io/docs/control-plane-reference/cli/#alerts-and-connectors). `POST …/verify` takes `adapter` (its name or scheme; empty = the running one), `fields` by field key and `secrets` (field key → the name of a Secret in the namespace). In 0.3.6, `fields` or `secrets` sent with no `adapter` are ignored and the running adapter is verified (the answer says `"candidate": false`); in the release after 0.3.6 that body is refused `400`, field `adapter`. A credential never goes in the body: name the Secret that holds it. A planned adapter is `422 E-ADAPTER-TARGET`; an unknown port is `404`. `PUT …/settings` takes `{"set": {VAR: value}, "unset": [VAR]}` (at most 64 KiB). An empty change, a variable of another port, or any setting of the `state` port is `400 invalid`, naming the variables the port takes. The answer: ```json { "port": "usage", "saved": ["OPODCP_USAGE_DSN"], "restarting": true, "note": "saved; the control plane restarts now to apply it — running endpoints keep serving, and the console reconnects by itself", "schema": { "…": "the table after the schema steps ran" } } ``` `schemaError` replaces `schema` when a step was refused. The schema steps of a save get 15 s. **Which replicas restart.** In 0.3.6 only the replica that served the save restarts; with `replicas` above 1, the others keep the settings they started with until they restart too — run `kubectl -n opodcp rollout restart deploy/opodcp` after a save. In the release after 0.3.6 every replica compares the saved settings with the ones it started with every 5 s and restarts after a random wait of up to 10 s, so all of them run the new settings within about 15 s; the note then reads `saved; this replica restarts now to apply it, and every other replica within about 15 s — …`. In the release after 0.3.6 a replica that is following a run — a delete, a scale, a wake — also waits for that run to end before it restarts, for at most 3 minutes, so a save no longer leaves the run `running` with nobody following it until it fails 2 minutes later; the note adds `(a replica following a run — a delete, a scale — restarts once the run ends, at most 3 min later)`. ## Check it worked ```bash kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor | grep -E '^. usage ' curl -s -H "$H" https://cp.example.com/api/v1/connectors \ | jq '.[] | select(.port=="usage") | {adapter, running: [.running[] | {ok, mode, detail}], migrate}' ``` A good answer is a doctor row that starts `✔ usage clickhouse connected spool + …`, and `running[0].ok` is `true`. The console's **Connectors** card for the port shows the adapter in use and its doctor row in green, and **Activity** lists `connector.saved` and, after the restart, `connector.changed` with `from` and `to`. ## If it fails | Answer | Cause | Fix | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- | | Verify: `"ok": false, "kind": "unreachable"` | the service does not answer from the control plane's pod | check DNS, the port and any NetworkPolicy from namespace `opodcp` | | Verify: `"kind": "refused"` | the service answered and refused the credential | check the user, password or token | | Verify: `"kind": "missing"` | the service let the control plane in, but the database, bucket, directory, realm or mount is not there | create it first; [Connector setup](https://opod.io/docs/control-plane-operate/connector-setup/) lists what each adapter needs | | Verify: `"kind": "invalid"` | a required field is missing or malformed | fill the field the detail names | | Save: `400 invalid` `OPODCP_X is not a setting of the usage port (it takes: …)` | a variable of another port | save it on the port the list names | | Save: `400 invalid` `the state port is the database itself …` | the database is a chart value | change `ports.state.dsnSecret` with `helm upgrade` | | Verify: `422 E-ADAPTER-TARGET` | the adapter is planned, not built | choose an available adapter (`GET /api/v1/connectors` lists `status`) | | Alert `connector.sealed` | the settings were sealed with another install key | install with that key; see [When a stored credential cannot be opened](#when-a-stored-credential-cannot-be-opened) | | Alert `connector.failing` | the saved service failed its check for 2 minutes | the port's doctor row names the reason; fix it, Verify, Save | ## A save for each port Each body below is a `PUT /api/v1/connectors//settings` (admin). The console's form sends the same. Hosts are examples. ```bash put() { curl -s -H "$H" -H 'Content-Type: application/json' -X PUT \ "https://cp.example.com/api/v1/connectors/$1/settings" -d "$2"; echo; } # usage: a ClickHouse table, kept 14 days in the spool put usage '{"set":{"OPODCP_USAGE_DSN":"clickhouse://opod:PASSWORD@ch.example.com:8123/opod","OPODCP_USAGE_RETENTION":"14d"}}' # events: mirror every event to NATS under the prefix opod put events '{"set":{"OPODCP_EVENTS_URL":"nats://nats.example.com:4222/opod"}}' # logs: the audit stream and the control plane's records to Splunk put logs '{"set":{"OPODCP_LOGS_ADAPTER":"splunk-hec","OPODCP_LOGS_URL":"https://splunk.example.com:8088","OPODCP_LOGS_TOKEN":"HEC-TOKEN","OPODCP_LOGS_STREAMS":"cp,audit"}}' # metrics: push over OTLP as well as the /metrics scrape put metrics '{"set":{"OTEL_EXPORTER_OTLP_ENDPOINT":"http://otel-collector.observability:4318"}}' # traces: every leader exports spans, one request in ten put traces '{"set":{"OPODCP_TRACES_URL":"http://otel-collector.observability:4318","OPODCP_TRACES_SAMPLE_RATIO":"0.1"}}' # identity: OIDC sign-in, two groups mapped to roles, everyone else a viewer put identity '{"set":{"OPODCP_OIDC_ISSUER":"https://sso.example.com/realms/main","OPODCP_OIDC_CLIENT_ID":"opod","OPODCP_OIDC_CLIENT_SECRET":"CLIENT-SECRET","OPODCP_OIDC_ROLE_MAP":"opod-admins=admin,opod-ops=operator","OPODCP_OIDC_DEFAULT_ROLE":"viewer","OPODCP_PUBLIC_URL":"https://cp.example.com"}}' # notifier: one webhook and one PagerDuty service put notifier '{"set":{"OPODCP_NOTIFY_URLS":"https://hooks.example.com/opod,pagerduty://ROUTING-KEY"}}' # secrets: a Vault KV v2 record of every minted token put secrets '{"set":{"OPODCP_SECRETS_URL":"vault://VAULT-TOKEN@vault.example.com:8200/secret/opod"}}' # checkpoints: one 50 GiB claim per training job, on class fast-ssd put checkpoints '{"set":{"OPODCP_JOB_CHECKPOINTS":"pvc://fast-ssd?size=50Gi"}}' # batchfiles: an S3-compatible bucket for /v1/files and /v1/batches put batchfiles '{"set":{"OPODCP_BATCH_FILES_BUCKET":"opod-batches","OPODCP_BATCH_FILES_ENDPOINT":"https://minio.example.com:9000","OPODCP_BATCH_FILES_PATH_STYLE":"1","OPODCP_BATCH_FILES_ACCESS_KEY":"ACCESS-KEY","OPODCP_BATCH_FILES_SECRET_KEY":"SECRET-KEY"}}' # kvstore: your Valkey for peer KV tiers; the password in its own field put kvstore '{"set":{"OPODCP_KVSTORE_URL":"redis://valkey.example.com:6379","OPODCP_KVSTORE_PASSWORD":"PASSWORD"}}' # …or (the release after 0.3.6) one ReadWriteMany volume per endpoint from your storage class put kvstore '{"set":{"OPODCP_KVSTORE_URL":"pvc://nfs-rwx?size=200Gi"}}' # undo one setting: the port falls back to its default for that field put usage '{"unset":["OPODCP_USAGE_RETENTION"]}' ``` Each save restarts the control plane once, so save a port's settings in one body. Values that carry a credential (`OPODCP_LOGS_TOKEN`, `OPODCP_OIDC_CLIENT_SECRET`, `OPODCP_BATCH_FILES_ACCESS_KEY`, `OPODCP_BATCH_FILES_SECRET_KEY`, `OPODCP_KVSTORE_PASSWORD`, and any URL with a user, password or key in it) are sealed and never shown again. Keep them out of your shell history: read the body from a file with `-d @usage.json`. ## How connectors work Every dependency of the control plane is a **port** with an embedded default, so the control plane is usable the moment it installs. An admin points a port at your own service on the console's **Connectors** page. The settings are saved **in the database**, a credential sealed with the install key, and the control plane restarts itself to apply them. Running endpoints keep serving through the restart. A reinstall anywhere with the same database address and the same install key brings every connector back. The database itself is the one setting that stays in the chart (`ports.state`). > **Version** > > On `0.2.1` these settings are chart values under `ports.`. From `0.3.0`, a `ports.` value other than `state` fails the render. See [Upgrade](https://opod.io/docs/control-plane-install/upgrade/). ## Ports | Port | Embedded default | Settings you can save | | ------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `usage` | `spool`: a table in the database; CSV export | `OPODCP_USAGE_DSN` (`postgres://`, `clickhouse://host:8123/db`, `s3://bucket/prefix?region=…`; `parquet:///dir` up to 0.3.6 only, see [Parquet](https://opod.io/docs/control-plane-operate/connector-setup/#parquet)), `OPODCP_USAGE_ADAPTER`, `OPODCP_USAGE_RETENTION` (default 30 days), `OPODCP_USAGE_TRIM_EXISTING`. See [Usage](https://opod.io/docs/control-plane-operate/usage/) | | `events` | `in-process+journal`: in-memory fan-out with a journal in the database, which lets the console resume | `OPODCP_EVENTS_URL` (`nats://host:4222[/prefix]`): every event is mirrored to `.`, and events from other replicas fan out locally | | `logs` | `stdout`: JSON records on stdout | `OPODCP_LOGS_ADAPTER` (`otlp` or `splunk-hec`, one sourcetype per stream), `OPODCP_LOGS_URL` (`http://otel-collector:4318`, `https://splunk:8088`), `OPODCP_LOGS_TOKEN` (credential), `OPODCP_LOGS_STREAMS` (a list of `cp`, `audit`, `events`) | | `metrics` | `prometheus-scrape`: `/metrics`, no credential; the Service carries `prometheus.io/scrape` and `prometheus.io/port` | `OTEL_EXPORTER_OTLP_ENDPOINT` (`http://otel-collector:4318`): an OTLP/HTTP push every 30 s, beside `/metrics` | | `traces` | `none`: leaders export no spans | `OPODCP_TRACES_URL` (an OTLP/HTTP collector, rendered into every leader as `OPOD_OTLP_ENDPOINT`), `OPODCP_TRACES_SAMPLE_RATIO` (0–1; empty = every request; outside 0–1 turns the doctor row red). A leader picks the address up at its next rollout; the control plane sends no spans itself | | `identity` | `local-users`: bcrypt users and sessions, the bootstrap admin from a Secret | `oidc`: `OPODCP_OIDC_ISSUER` and `OPODCP_OIDC_CLIENT_ID` (required), `OPODCP_OIDC_CLIENT_SECRET` (credential), `OPODCP_OIDC_ROLE_MAP` (`opod-admins=admin,opod-ops=operator`), `OPODCP_OIDC_DEFAULT_ROLE`, `OPODCP_PUBLIC_URL` (required). See [Users, roles and SSO](https://opod.io/docs/control-plane-security/authentication/) | | `notifier` | `console`: alerts in the console and `opodcp_alerts_open` on `/metrics` | `OPODCP_NOTIFY_URLS`, one URL per destination, the scheme picks the adapter: `https://…` (webhook: `POST {event, alert, sentAt}`), `alertmanager+https://…` (Alertmanager v2; `/api/v2/alerts` is added when missing; an ack is not sent), `slack+https://…` (incoming webhook), `pagerduty://` (Events API v2: trigger and resolve; an acknowledge is not sent). A Slack URL and a PagerDuty key are stored sealed | | `secrets` | `kubernetes-secrets` | `vault`: `OPODCP_SECRETS_URL` (`vault://@host:8200//`; the token may come from `VAULT_TOKEN` instead) — a KV v2 record of every minted token. Kubernetes Secrets stay what the pods read | | `checkpoints` | `hostpath`: under the node model cache; a job resumes on the same node only | `pvc`: `OPODCP_JOB_CHECKPOINTS` (`pvc://[storageClass]?size=20Gi`), one PersistentVolumeClaim per job, so a job resumes on any node | | `batchfiles` | `none`: every `/v1/files` and `/v1/batches` call answers `501 batch_store_not_configured` (`E-BATCH-STORE`) | `s3` (AWS S3, MinIO, Ceph RGW, GCS in S3 mode): `OPODCP_BATCH_FILES_BUCKET` (required), `_PREFIX`, `_ENDPOINT`, `_REGION`, `_PATH_STYLE`, `_DOWNLOADS` (`proxy`), and `_ACCESS_KEY` / `_SECRET_KEY` (credentials). See [Jobs and batches](https://opod.io/docs/control-plane-endpoints/jobs-batches/) | | `kvstore` | `none`: a peer KV tier is refused (`E-KV-OFFLOAD`) | `lmcache-redis`: `OPODCP_KVSTORE_URL` (`redis://host:6379`; a password in the URL is refused), `OPODCP_KVSTORE_PASSWORD` (credential). The chart's `kvStore.enabled` builds the URL itself. The control plane only renders the URL into each peer worker and pings it for the doctor. `shared-volume` (the release after 0.3.6): `OPODCP_KVSTORE_URL=pvc://?size=200Gi`, one volume and one pruner per endpoint ([Connector setup](https://opod.io/docs/control-plane-operate/connector-setup/#kv-store-a-shared-volume)) | | `state` | — (required) | chart only: `ports.state.dsnSecret`. Moving it is `opodcp store move`; see [Backup and restore](https://opod.io/docs/control-plane-install/backup-restore/) | A saved setting holds the value itself; a value that carries a credential is sealed even when its field is plain. To **Verify** a candidate without putting its credential in the request, name a Kubernetes Secret in the control plane's namespace that holds the whole value (`secrets` in the body, by field key, for example `{"secrets":{"dsn":"ch-dsn"}}`). Read-only ports in the doctor are set by chart values or by what the probes read: | Port | Adapters | Set by | | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | | `executor` | `kubernetes`, the only one | — | | `registry` | `ghcr.io` (pull-only public images), `private registry` (ECR, GAR, ACR, Harbor, zot: tags pinned to digests with the cluster's pull Secret) | `engineImages`, `imagePullSecrets` | | `cloud` | `onprem`, `aws`, `gcp`, `azure` (defaults and preflight rows; none provisions nodes, and none has run on a real EKS, GKE or AKS cluster yet) | `cloud.provider` | | `autoscaler` | `embedded` (the control plane's loop over each leader's `/loadz`), `keda` (one ScaledObject per endpoint) | `autoscaler.adapter` | | `gangs` | `deployments` (one per gang part, no atomic landing), `leaderworkerset` (atomic landing, group recreate) | `substrate.leaderWorkerSet.enabled` | | `fabric` | `pcie+ethernet`, `infiniband`, `roce` | what the probes read on each node | **(planned)** Two shared KV stores are listed as target in the registry: `lmcache-server` and `mooncake-store`, for workers to reuse each other's KV cache. **Secrets at rest are the cluster's job.** The control plane keeps tokens and its install key as Kubernetes Secrets, and seals the connector credentials it stores with that install key. Turn on your cluster's Secret encryption with your own KMS key (EKS, GKE and AKS each offer it), and that key protects all of them. There is no separate KMS adapter, and none is planned. The `aws`, `gcp` and `azure` cloud adapters ship from `0.3.0`. Up to 0.3.3 the registry listed them as target; from 0.3.4 it lists them as available, with a summary that says they provision no nodes and are not yet proven on a real cluster ([Kubernetes](https://opod.io/docs/control-plane-install/kubernetes/)). `GET /api/v1/connectors` (viewer) lists every port: what it holds, its chart block, what a switch moves (`onSwitch`), every adapter with its fields and status (`available` or `target`), and the port's doctor rows. An admin also gets the values running now, redacted (a credential reads as set or not set), and `migrate`: the usage backlog a new sink would receive, or the command that moves the port. The metrics, traces and logs ports carry `reach`: embedded or connected, the scrape URL, and where data is sent. ## Usage sinks with a table A Postgres or ClickHouse sink's table is created and kept by numbered schema steps, never by a write. **Verify** shows the step the table records, the steps this release would run, whether the sink's user may run them (naming a missing grant) and the SQL. **Save** runs them; if a step is refused, the settings are saved anyway and rows wait in the spool. **Manual mode** for owners who allow no schema change: add `schema=manual` to the DSN (beside `table=`). The control plane then runs no step and writes only once your DBA has run the SQL Verify shows. ## Test the notifier `POST /api/v1/connectors/notifier/test` (admin) sends one alert marked TEST (kind `connector.test`, never stored) to every sink, fired and at once resolved, so a pager that opens an incident closes it again. It answers `{"sent": true|false, "sinks": [ … ]}` with one delivery per sink; `sent` is true only when every sink took both halves. It is a real delivery, and the doctor counts it. With no sink it is `409 E-NO-NOTIFIER`. ## Record existing tokens in a new secret store A secret store connected after tokens were minted records only what is written from then on. `opodcp secrets sync` (or `POST /api/v1/connectors/secrets/sync`) records every token the Kubernetes Secrets hold. Running it again writes nothing that is already recorded unchanged. With no store it is `400 E-NO-SECRET-STORE`. ## When a stored credential cannot be opened A reinstall that minted a new install key over a kept database leaves the stored credentials sealed. They are not applied, each port runs on what the chart sets (if anything), and the alert `connector.sealed` fires per port with the key id each setting needs and the one held. Install with `--set installKey.existingSecret=` (list both keys, comma-separated, while you move), or enter the credentials again, which seals them with the current key. While the usage credentials are sealed, `usage.no-sink` stays quiet. ## Connector failing `connector.failing` (warning) fires for any connected port whose doctor check has failed for 2 minutes, names the reason and the time it started, and points at Verify. It resolves when the check passes. An embedded default never raises it: a standby replica's red `events` row on the embedded bus is advice, not an outage. --- title: "Connector setup" description: "What to prepare on each service before you connect it — the grants, policies, IdP client, webhooks and buckets — what Verify checks, what the control plane writes there, and each adapter's limits." url: "https://opod.io/docs/control-plane-operate/connector-setup/" markdown_url: "https://opod.io/docs/control-plane-operate/connector-setup.md" section: "Operate" last_updated: "2026-11-14" --- # Connector setup > What to prepare on each service before you connect it — the grants, policies, IdP client, webhooks and buckets — what Verify checks, what the control plane writes there, and each adapter's limits. ## In short [Connectors](https://opod.io/docs/control-plane-operate/connectors/) explains how a connector is verified and saved. This page explains the other half: what you set up on **your** service first. For each adapter it gives the address shape and every option, the grants or policy the control plane's user needs, what **Verify** actually checks, what the control plane writes, and the limits you should know before you rely on it. What the control plane does is read from the `0.3.6` code. The steps on your side (the Keycloak, Okta and Entra ID settings, the `nats-server` and Alertmanager samples, the IAM and Vault policies) are a starting point: check them against your provider's own documentation. A line that says *after 0.3.6* describes the next release. ## When you need it - Verify answers `refused` or `missing` and you need the exact grant, policy or object it expects. - Your security team asks what the control plane's user may do in the database, bucket, Vault or NATS account. - You must route, deduplicate or parse what arrives: the alert payload, the usage table, the log records. - You want to know what Verify does **not** prove, so a green check is not read as more than it is. ## Do it 1. **Find your adapter below** Each section starts with a **Prepare** list. Do every item on your service, with your own tools. 2. **Verify, then save** On the console's **Connectors** page, fill the port's card and press **Verify**, then **Save**. Or send the same through the API, as [Connectors → A save for each port](https://opod.io/docs/control-plane-operate/connectors/#a-save-for-each-port) shows. A credential is sealed with the install key and never shown again. 3. **Check the real traffic** Verify proves less than the real traffic does (each section says what it checks). After the restart, read the port's doctor row and look on your side for the first rows, records or alerts. ## Check it worked ```bash kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor curl -s -H "$H" https://cp.example.com/api/v1/connectors | jq '.[] | {port, adapter, running: [.running[]? | {ok, mode, detail}]}' ``` Each connected port reads `connected` with a green row. Then check your side: a row in the usage table, a record in the log index, an alert after `POST /api/v1/connectors/notifier/test`. ## If it fails | Verify answer | What it means | Look at | | ------------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------- | | `unreachable` | no answer from the control plane's pod within 5 s | DNS, the port, a NetworkPolicy or firewall from namespace `opodcp` | | `refused` | the service answered and refused the credential or the grant | the user, password, token or policy in the adapter's **Prepare** list | | `missing` | the service let the control plane in, but the database, bucket, directory, realm or mount is not there | the object the adapter's **Prepare** list says must exist first | | `invalid` | a required field is empty, or the address is malformed | the field the detail names | | `no-probe` | the adapter has no live check (notifier, checkpoints, the shared-volume KV store) | the adapter's own test, below | An error detail is redacted. A DSN keeps only its `table`, `schema`, `sslmode` and `connect_timeout` parameters; every other query value reads `•••`. > **Up to and including 0.3.6, a setting that does not open at start-up is logged whole** > > When a saved events URL, usage DSN, secrets URL or logs URL does not open as the control plane starts, the warning it logs, and the secrets and logs rows of `opodcp doctor`, can carry the setting's password or token, most of all when the URL is malformed. With the logs connector on, that line also reaches your collector. The release after 0.3.6 redacts them the same way as a Verify detail. Until then, rotate a credential that was saved in a setting that did not open. > **Up to and including 0.3.6, a saved events URL or usage DSN that does not open leaves its row green** > > The control plane starts anyway: on the in-process bus, or with usage buffering in its database. In 0.3.6 the `events` row then reads `in-process fan-out + journal — enough for one replica` and the `usage` row reads `NO USAGE SINK IS CONNECTED`, as if nothing were saved; only the start-up warning says what failed. In the release after 0.3.6 both rows are red and read `… is configured (OPODCP_EVENTS_URL) but NOT running: ` (or `OPODCP_USAGE_DSN`), and `usage.no-sink` names the reason. In 0.3.6, press **Verify** on the port: it tests what is saved. ## Usage sinks The usage port sends one row per request to your store. The database only buffers the rows until the sink acknowledges them ([Usage](https://opod.io/docs/control-plane-operate/usage/)). All four sinks share these rules: - Shipping runs every 15 s in batches of up to 1,000 rows. A failed batch backs off from 15 s, doubling, to at most 5 min. - Delivery is at least once. The [table below](#which-sinks-drop-a-replayed-batch) says which sinks drop a replayed batch. - The sink's **mark** (how far it has taken the spool) is kept per sink address: `scheme://host/db.table`, `postgres://host/db (table)` or `s3://bucket/prefix @ host|region`. A new password keeps the mark. A new host, database, table or prefix is a new sink: it is sent every row the spool still holds. Switching back resumes from the old mark. - A DSN that is set but cannot open (for example S3 with no keys) does not stop the control plane: it boots with no sink, and the doctor and `usage.no-sink` say no sink is connected. Read the control plane's log for the reason. ### Postgres **Address:** `postgres://user:PASSWORD@pg.example.com:5432/analytics?table=opod_usage&sslmode=require`. The alias `postgresql://` also works. | Parameter | Default | Meaning | | --------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------- | | `table` | `opod_usage` | the table, optionally schema-qualified: `reporting.opod_usage`. Lower case letters, digits and `_`, 63 characters at most per part | | `schema` | `auto` | `manual`: the control plane changes nothing and writes only once your DBA has run the SQL Verify shows | | any other | — | passed to the Postgres driver (pgx): `sslmode`, `sslrootcert`, `connect_timeout`, … | **Prepare:** ```sql -- in the database the DSN names CREATE ROLE opod_usage LOGIN PASSWORD 'PASSWORD'; GRANT CONNECT ON DATABASE analytics TO opod_usage; GRANT USAGE, CREATE ON SCHEMA public TO opod_usage; -- Postgres 15+ no longer grants CREATE on public ``` If `opod_usage` or `opod_usage_schema` already exists, the control plane's user must **own** it: only a table's owner may add a column. In `schema=manual` mode the user needs only `INSERT` on the table and `SELECT` on `_schema`. **Verify** connects, then looks the table up. A table that does not exist yet is `ok` (it is created on Save). A password or role failure is `refused`; a database that does not exist is `missing`. It also returns the schema state: the step the table records, the steps this release would run, whether the user may run them (naming the grant that is missing) and their SQL. **What it writes:** table `
` with its version table `
_schema`. 25 columns: `endpoint_id`, `endpoint_name`, `team`, `event_id`, `ts` (timestamptz), `api_key_id`, `user_id`, `model`, `protocol`, `prompt_tokens`, `completion_tokens`, `latency_ms`, `ttft_ms`, `outcome`, `tenant`, `cell`, `region`, `workload_type`, `job_id`, `gpu_seconds`, `node_id`, `kind` (default `request`), `cached_tokens`, `class`, `operation`. The primary key is `(endpoint_id, event_id, kind)`, and each batch is one transaction of `INSERT … ON CONFLICT DO NOTHING`, so a replayed row is ignored. ### ClickHouse **Address:** `clickhouse://opod:PASSWORD@ch.example.com:8123/opod?table=opod_usage` over HTTP, or `clickhouses://…:8443/…` over HTTPS. In 0.3.6, give the port with `clickhouses://`: with none it defaults to 8123, not 8443; in the release after 0.3.6 it defaults to 8443. The database and the `table` must be plain identifiers (letters, digits, `_`); after 0.3.6 anything else is refused when the DSN is read. TLS trusts the system CAs; there is no CA option. `table` defaults to `opod_usage`; `schema=manual` works as for Postgres. The user and password travel as the `X-ClickHouse-User` and `X-ClickHouse-Key` headers. **Prepare:** the **database must exist**; only the table is created. ```sql CREATE DATABASE IF NOT EXISTS opod; CREATE USER opod IDENTIFIED BY 'PASSWORD'; GRANT CREATE TABLE, INSERT, SELECT, ALTER ADD COLUMN, ALTER MODIFY SETTING ON opod.* TO opod; GRANT SELECT ON system.databases TO opod; GRANT SELECT ON system.tables TO opod; ``` **Verify** runs `SELECT 1`, checks that the database exists and whether the table does. `401`, `403`, an authentication failure or code 516 is `refused`; code 81 (no such database) is `missing`. **What it writes:** `.
`, `ENGINE = MergeTree ORDER BY (cell, endpoint_id, ts)`, `ts` as `DateTime64(3, 'UTC')`, with the same columns as Postgres, and the version table `.
_schema`. Each batch is sent as `JSONEachRow` with `insert_deduplication_token=opod-usage--`. **Duplicates:** ClickHouse drops a replayed batch only on a `Replicated*` or `Shared*` engine, or once the control plane has set `non_replicated_deduplication_window = 1000` on the table (that is why it needs `ALTER MODIFY SETTING`). Otherwise a retried batch can land twice: count distinct `(endpoint_id, event_id, kind)` when you read. > **Manual mode** > > In 0.3.6, with `schema=manual` the control plane still sets `non_replicated_deduplication_window` on the table, so keep the `ALTER MODIFY SETTING` grant or set it yourself. In the release after 0.3.6, manual mode changes nothing: the `ALTER TABLE … MODIFY SETTING non_replicated_deduplication_window = 1000` statement is listed with the schema SQL that **Verify** shows, and until you run it a replayed batch can count twice (the doctor says `at-least-once`). ### Parquet > **Removed in the release after 0.3.6 — use S3** > > The Parquet sink writes inside the control plane's pod, and a restart wipes that directory, so rows the database had already handed over are lost. The release after 0.3.6 removes it: a saved `parquet://` setting then reads as an unknown scheme on Verify, Save and start-up. [S3](#s3) writes the same Parquet files, one object per batch, to any S3-compatible bucket (MinIO on premises). **Address:** `parquet:///var/lib/usage` (an absolute directory in the **control plane's pod**). `parquet://dir/sub` is relative to the pod's working directory. **Prepare:** the directory must be writable by user `65532` (the pod's user) on a filesystem that outlives the pod. The pod's root filesystem is read-only, and the only writable directory the chart mounts is an `emptyDir`, which is lost on every restart. The chart has no value to mount your own volume, so in `0.3.6` use [S3](#s3) or a database sink for anything you must keep. **Verify** checks that the directory exists (`missing` if not), then creates and removes a `.opod-verify-*` file (`refused` if it cannot). **What it writes:** `///usage-seq--.parquet` (the UTC hour of the first row, sequence numbers padded to 20 digits), Snappy-compressed, written to a temporary file and renamed. A replayed batch has the same name and replaces the file. GPU-hours per day go to `/gpu-daily/.csv`. ### S3 **Address:** `s3://opod-usage/usage?region=eu-west-1&accessKey=ACCESS-KEY&secretKey=SECRET-KEY`. | Parameter | Default | Meaning | | ---------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------ | | `region` | `us-east-1` | the bucket's region. An AWS bucket in any other region **must** set it: the host is built as `s3..amazonaws.com` | | `endpoint` | — | another S3 store: `https://minio.example.com:9000`, scheme, host and port, no path | | `pathStyle` | on with `endpoint` | `0` turns path-style addressing off; it matters only with `endpoint` | | `accessKey`, `secretKey`, `sessionToken` | — | static credentials; the DSN is then sealed | **Credentials:** in 0.3.6 the usage sink takes **static keys only**: in the DSN, or as `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` through the chart's `extraEnv`. It does not use IRSA, EKS Pod Identity or an instance role (the [batch-file store](#batch-files-s3) does). In the release after 0.3.6 it follows the batch-file store's rule: both keys in the DSN, or neither — then `AWS_*` and `MINIO_*` variables, then the cloud's identity (IRSA, EKS Pod Identity, an instance role). **Prepare:** the bucket, and a policy like this one: ```json { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": ["s3:PutObject", "s3:DeleteObject"], "Resource": "arn:aws:s3:::opod-usage/usage/*" }] } ``` Writes need only `s3:PutObject`. `s3:DeleteObject` is for Verify, which writes `/.opod-verify` and removes it. **Verify** answers `refused` on `403`, `InvalidAccessKeyId` or `SignatureDoesNotMatch`, and `missing` on `NoSuchBucket`. **What it writes:** `///usage-seq--.parquet`, one PUT per batch, content type `application/vnd.apache.parquet`, and `/gpu-daily/.csv`. A replayed batch has the same key; on a versioned bucket the replaced copy stays as a noncurrent version. ### Which sinks drop a replayed batch | Sink | A batch sent twice | | --------------------- | ---------------------------------------------------------------------------------------------- | | Postgres | ✅ ignored: the primary key refuses the second row | | ClickHouse | 🟡 dropped only on a replicated table or with the deduplication window set; else counted twice | | Parquet (up to 0.3.6) | ✅ the file is replaced | | S3 | ✅ the object is replaced | ## Database (`state`) The database is set by the chart, not on the Connectors page: `ports.state.dsnSecret` names a Secret holding the DSN. See [Configuration → Database](https://opod.io/docs/control-plane-install/configuration/). **Address:** URL form only, `postgres://opodcp:PASSWORD@pg.example.com:5432/opodcp?sslmode=require`; the `key=value` form is refused. Every driver parameter passes through. **Prepare:** an empty database whose owner is the control plane's user, or at least `CREATE` on the current schema. No extension is needed. Replicas take a Postgres advisory lock while they run the schema steps; a replica that waits about 5 min for it gives up with `ErrSchemaLocked`. **Verify** (`POST /api/v1/connectors/state/verify`) accepts an empty database or one this release can open. A schema newer than this release is `invalid`; so is a store from before 0.3.0 (it has a `schema_version` table): restore a backup into an empty database instead. **Move it** with `opodcp store move --to `, Postgres to Postgres: see [Backup and restore](https://opod.io/docs/control-plane-install/backup-restore/). ## Event bus: NATS **Address:** `nats://opod:PASSWORD@nats.example.com:4222/opod`. The path is the subject prefix; with no path it is `opod.events`. **What it uses:** core NATS publish and subscribe, not JetStream. There is no stream, no consumer and no replay: an event another replica missed while it was disconnected is not sent to it again. Each replica still journals its own events in the database, which is what the console resumes from. NATS 2.2 or later is needed (message headers). **Prepare** a NATS user that may publish **and** subscribe on: | Subject | Carries | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | `.>` | every event, as `.`, for example `opod.alert.fired`. Header `Opod-Origin: /`; body `{seq, ts, type, subject, data}` | | `_observe.>` | *after 0.3.6*: the lease holder's per-endpoint state, so a standby answers status the same way. Header `Opod-Endpoint` | `opod.>` does not cover `opod_observe.>`: the first token differs. Grant both. No `_INBOX` subject is needed. ```text # nats-server authorization block authorization { users = [ { user: opod, password: PASSWORD, permissions: { publish: ["opod.>", "opod_observe.>"], subscribe: ["opod.>", "opod_observe.>"] } } ] } ``` **Authentication:** a user and password in the URL. A token-only URL (`nats://TOKEN@host`), a credentials file, an NKey or a JWT is not supported in `0.3.6`. In the release after 0.3.6, a token-only URL works: a user with no password is sent as the token. The client reconnects every 2 s without limit; the doctor shows `disconnected (reconnecting)` meanwhile. **Verify** connects, flushes and closes: an authentication error is `refused`, anything else `unreachable`. In `0.3.6` it does not check subject permissions, and a permission violation later is not reported in the doctor: check the server's log after the first save. In the release after 0.3.6, Verify subscribes to `.>` and `_observe.>` and publishes once, so a subject the user may not use is `refused` and named; and a violation while running counts as a failure and turns the `events` row red with the server's message. ## Single sign-on: OIDC The settings are in [Users, roles and SSO](https://opod.io/docs/control-plane-security/authentication/#single-sign-on-oidc). What to set up at your identity provider: **Prepare a client:** | At the provider | Value | | --------------------------------- | ------------------------------------------------------------------------------------------------------------------- | | Client type | confidential (with a secret) or public (no secret; PKCE alone) | | Grant type | authorization code; PKCE `S256` | | Redirect URI | `https://cp.example.com/api/v1/auth/oidc/callback` (`OPODCP_PUBLIC_URL` + that path, or `OPODCP_OIDC_REDIRECT_URL`) | | Scopes the control plane asks for | `openid profile email groups` (fixed) | | ID token | must carry the groups claim (`groups`, or `OPODCP_OIDC_ROLE_CLAIM`) | **Groups come from the ID token only**, never from the userinfo endpoint. The claim may be a JSON list or one string split by commas or spaces. To put groups in the ID token: - **Keycloak:** add a *Group Membership* mapper to the client (or a client scope named `groups`), token claim name `groups`, *Full group path* off, *Add to ID token* on. - **Okta:** in the app's *Sign On* tab, add a groups claim named `groups` with a filter, for example *Starts with* `opod-`. - **Microsoft Entra ID:** set `groupMembershipClaims` in the app manifest. Entra sends group **object IDs**, so the role map names IDs: `OPODCP_OIDC_ROLE_MAP=0f3c…=admin`. An issuer that refuses a scope it does not know (`groups`) cannot be used in `0.3.6`, because the scope list cannot be changed. **The issuer must match exactly.** `iss` in the provider's discovery document must equal `OPODCP_OIDC_ISSUER`. Verify ignores a trailing `/`; sign-in does not. **Who a user is:** the name is the first of the claims `email`, `preferred_username`, `name`, `sub` that is present; that name is the actor in the audit stream, and the user id is `oidc:`. The role is the highest one the role map gives the user's groups, else `OPODCP_OIDC_DEFAULT_ROLE` (default `viewer`). It is set at sign-in and kept for the session's 24 h. **Verify** reads `/.well-known/openid-configuration` and then its `jwks_uri`. A `404` is `missing` (check the realm); a document with no `jwks_uri` or another issuer is `invalid`. It does **not** check the client id, the secret or the redirect URI: sign in once to prove those. **Sign-in errors** land on `/?sso=error#reason=…`. A login has 10 minutes from **Sign in with SSO** to the callback, and works once. > **More than one replica** > > In `0.3.6` a login's state is held in the memory of the replica that started it. With more than one replica behind the Service, a callback that reaches another replica fails with *unknown or expired login state*. Until that is fixed, turn on session affinity (sticky sessions) at your ingress for the control plane's host, or run one replica while you depend on SSO. **Logout** ends the control plane's session only; it does not sign the user out at the provider. **If SSO cannot start** (for example `OPODCP_PUBLIC_URL` is missing, or the role map names a role that does not exist), the doctor's `identity` row is red with `OIDC misconfigured: `, and `GET /api/v1/auth/oidc/start` answers `404`. When the provider does not answer, it answers `502`. ## Alerts: the notifier `OPODCP_NOTIFY_URLS` takes one URL per destination, comma-separated. The scheme picks the adapter. All of them share these rules: - One `POST` per **fired** and per **resolved** transition, `Content-Type: application/json`, `User-Agent: opodcp-notify`. Any `2xx` is delivered. - An **acknowledge is not sent**. A sticky alert that an acknowledge resolves sends no resolve either: close its incident or thread on your side. - Each delivery has 10 s. A failed one is **not retried and not queued**: it is counted in `opodcp_notify_failures_total{adapter}`, the sink's doctor row turns red until a later delivery to it succeeds, and the alert stays in the console. - A firing alert is sent once; it is not sent again while it stays open. > **In the release after 0.3.6, deliveries are queued and retried** > > Every alert state the control plane records reaches every sink: fired, acknowledged and resolved, including a sticky alert a rollout raised and an acknowledge from the console. Each state waits in the database, per alert and sink, until the sink takes it, so a standby that takes over carries on. A network error, a `5xx`, `408` or `429` is retried after 10 s, doubling to 5 min, honouring `Retry-After`, for as long as the state is still wanted. Any other `4xx` is not retried, and the row says why. A resolve goes only to a sink that took the fire, and an alert resolved before its fire got through sends nothing. Each tick sends at most 100, four at once, critical first. Delivery is at least once: PagerDuty and Alertmanager drop a repeat, while a Slack message can post twice. To group a storm into one message, point the notifier at your Alertmanager. The first start after the upgrade takes the alerts open then as already sent, so it pages nobody again. - A list with a PagerDuty key, a Slack URL, a user and password, or a credential parameter (`token=`, `secret=`, …) is stored sealed. A plain `https://` URL with a secret in its **path** is not recognised as one: put such a URL in a Secret, or give the webhook a user and password. **Verify** answers `no-probe`. Save, wait for the restart, then send a test: `POST /api/v1/connectors/notifier/test` sends one alert (id `al_test_`, kind `connector.test`, severity `warning`, title *TEST alert from opod — nothing is wrong*) to every sink, fired and at once resolved. ### Webhook **Address:** `https://hooks.example.com/opod`, or `https://user:PASSWORD@hooks.example.com/opod` for basic authentication. There is no custom header and no signature. **Body:** ```json { "event": "fired", "alert": { "id": "al_9k2m4x", "kind": "endpoint.degraded", "object": "ep_7f3a", "objectName": "chat", "severity": "serious", "title": "chat is degraded", "detail": "1 of 2 workers ready", "remedy": "…", "sticky": false, "firedAt": "2026-11-12T08:14:03Z", "lastSeenAt": "2026-11-12T08:14:03Z", "healthy": 0, "tenant": "default", "cell": "cell-1", "region": "", "workloadType": "inference" }, "sentAt": "2026-11-12T08:14:03Z" } ``` `event` is `fired` or `resolved`; a resolved alert also carries `resolvedAt` and `resolvedReason`. `severity` is `warning`, `serious` or `critical`. ### Alertmanager **Address:** `alertmanager+https://am.example.com` (or `alertmanager+http://`). `/api/v2/alerts` is added unless the URL has it. **What it sends:** a list with one alert. Labels `alertname` (the alert's kind), `severity`, `object`, `objectName`, `cell`, `tenant`, `workload_type` and `source="opodcp"`; annotations `summary`, `description`, `remedy` and `opod_alert_id`; `startsAt`, and `endsAt` on resolve. Route on `source="opodcp"`: ```yaml route: routes: - matchers: ['source="opodcp"'] receiver: platform-oncall ``` Up to and including 0.3.6, a firing alert is posted once, so Alertmanager resolves it by itself after its `resolve_timeout` (default 5 min) even while it is still open in the control plane. Raise `resolve_timeout`, or alert from the scrape (`opodcp_alerts_open`) instead, if that matters to you. In the release after 0.3.6, an open alert is sent again every minute with `endsAt` four minutes ahead, as Prometheus does, so it stays open in Alertmanager while it is open here, and expires a few minutes after a control plane that stops sending. ### Slack **Prepare:** create a Slack app, turn on *Incoming Webhooks*, and add a webhook to the channel. **Address:** its URL with `slack+` in front: `slack+https://hooks.slack.com/services/T000/B000/XXXX`. It is stored sealed. **What it sends:** `{"text": ":red_circle: [FIRED] — <detail>\n_remedy:_ <remedy>"}`, and on resolve `:large_green_circle: [RESOLVED] <title> — <detail>`. ### PagerDuty **Prepare:** on the PagerDuty service, add an **Events API v2** integration and copy its integration key. **Address:** `pagerduty://<integration key>`. It is stored sealed. Events go to `https://events.pagerduty.com/v2/enqueue`; the EU service region is not supported in `0.3.6`. **What it sends:** `event_action` `trigger` or `resolve`, `dedup_key` = the alert id, and on trigger a payload with `summary` (title), `severity` (`warning` → `warning`, `serious` → `error`, `critical` → `critical`), `source` `opodcp/<cell>`, `component` (the object), `group` (workload type), `class` (the kind) and `custom_details` (detail, remedy, object, tenant). ## Logs: OTLP and Splunk The settings are in [Observability → Logs](https://opod.io/docs/control-plane-operate/observability/#logs). `OPODCP_LOGS_HEADERS` (`key=value,…`) is set through the chart's `extraEnv` in 0.3.6; it is not a Connectors setting there. In the release after 0.3.6 it is one: a Secret with the key `headers`, stored sealed like the token. **What each stream carries:** `cp` is every log record of the control plane process. `audit` is every event that names who acted (`actor`, `by` or `user`); `events` is every other event. `usage.*`, `metrics.*` and `fleet.*` events are never shipped. Each event goes to one stream, and each replica ships only the events it published. ### OTLP **Address:** `http://otel-collector.observability:4318`. Give the host and port with **no path**: `/v1/logs` is then added. In 0.3.6 a URL with any other path is used exactly as given. In the release after 0.3.6 one rule holds for logs, metrics and Verify: `/v1/logs` is added unless the URL already ends in it, so a path prefix works (`…/otlp` → `…/otlp/v1/logs`). **What it sends:** OTLP/HTTP protobuf, not compressed. A token is sent as `Authorization: Bearer <token>` unless `OPODCP_LOGS_HEADERS` sets `Authorization`. Resource attributes `service.name=opodcp`, `service.version` and `opod.cell`; each record has `stream` = `cp`, `audit` or `events`. `https://` trusts the system CAs; add your CA with `SSL_CERT_FILE` through `extraEnv`. **Leaders** and front doors ship their own records to the same collector (`OPOD_OTLP_LOGS_ENDPOINT`). In 0.3.6 they get **no token and no headers**, and on core v0.4.6 they always post to `/v1/logs` on the host and port, so a collector that requires authentication receives the control plane's records and not the leaders'; accept unauthenticated OTLP from namespace `opodcp`, for example on a second receiver. In the release after 0.3.6, with a leader on core v0.4.7, the control plane hands them the token and `OPODCP_LOGS_HEADERS` as `OPOD_OTLP_HEADERS` — `Authorization=Bearer <token>` unless one of your headers sets `Authorization` — from item `otlp-headers` of the endpoint's auth Secret (never in the pod spec), and the leader keeps the URL's path by the rule above. A running leader picks it up with its next rollout. Core sends the same headers with its traces, so a separate traces collector sees the logs token. **Verify** posts `{}` to `<url>/v1/logs` with the token: `401` or `403` is `refused`, `404` is `missing`. In the release after 0.3.6 it posts where the exporter will, with `OPODCP_LOGS_HEADERS` as well as the token. ### Splunk HEC **Prepare:** an HTTP Event Collector token in Splunk. **Set the index on the token**: the control plane sends no `index` field, so the token's default index applies. Allow the sourcetypes `opodcp:cp`, `opodcp:audit` and `opodcp:events`. **Address:** `https://splunk.example.com:8088`; `/services/collector/event` is added when the URL has no path. The token is required and is sent as `Authorization: Splunk <token>`. TLS trusts the system CAs; there is no option to skip verification. **What it sends:** one POST per batch of newline-separated events, each with `time`, `host` (the pod name), `source=opodcp`, `sourcetype=opodcp:<stream>` and an `event` object with `message`, `level`, `cell`, `stream` and every attribute. Leaders send nothing to Splunk. **Verify** reads `/services/collector/health`. It does **not** test the token: the first real batch does. Check the doctor's `logs` row (`sent`, `failed`) after the restart. A log setting that cannot run (an unknown adapter, no URL, Splunk with no token) never stops the control plane: it keeps writing to stdout, and the doctor's `logs` row says the adapter is not running and why. ## Metrics push: OTLP **Address:** `OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector.observability:4318`. `/v1/metrics` is added after the URL unless it already has it, so a path prefix works (`…/otlp` → `…/otlp/v1/metrics`). `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` and `OTEL_EXPORTER_OTLP_HEADERS` go through `extraEnv` in 0.3.6; in the release after 0.3.6 the headers are a Connectors setting (a Secret with the key `headers`). **What it sends:** every 30 s, OTLP **JSON**, not compressed, with resource `service.name=opodcp/<cell>`. Gauges and counters only (counters as cumulative sums); histograms are not pushed, so `opodcp_http_request_duration_seconds` is on the `/metrics` scrape only. A failed push is not retried. `/metrics` keeps serving beside the push. **Verify** posts `{}` to the metrics URL **without** `OTEL_EXPORTER_OTLP_HEADERS` in 0.3.6. A collector that requires those headers answers `refused` to Verify while the real push works: read the doctor's `metrics` row (`sent N, failed N`) instead. In the release after 0.3.6 Verify sends the headers. ## Traces: OTLP **Address:** `OPODCP_TRACES_URL=http://otel-collector.observability:4318`, rendered into every leader and front door as `OPOD_OTLP_ENDPOINT`. On core v0.4.6 a leader uses the **host and port only** and always posts to `/v1/traces`; it sends no token and no header. A leader on core v0.4.7 keeps the path (`/v1/traces` is added unless the URL ends in it) and can send headers, but the control plane renders none into it yet. The collector must take unauthenticated OTLP/HTTP from the leader pods. `OPODCP_TRACES_SAMPLE_RATIO` (0–1) is rendered as `OPOD_TRACE_SAMPLE_RATIO`; a value outside 0–1 is not rendered, so leaders trace every request, and the doctor row turns red. **Verify** posts `{}` to `<url>/v1/traces` from the control plane's pod; the doctor dials the collector's host and port (default 4318) with 2 s. Neither proves the leaders reach it. A leader picks up a new address at its next rollout. ## Secret store: Vault **Address:** `vaults://VAULT-TOKEN@vault.example.com:8200/secret/opod` (HTTPS, system CAs) or `vault://…` (**plain HTTP**). The first path segment is the KV mount, the rest the base path. The token is the URL's user part, else `VAULT_TOKEN` through `extraEnv`. Only token authentication is supported; `VAULT_NAMESPACE`, `VAULT_CACERT` and the Kubernetes or AppRole auth methods are not. **Prepare:** a **KV version 2** mount and a token with this policy: ```hcl path "secret/data/opod/*" { capabilities = ["create", "update", "read"] } ``` `read` is for `opodcp secrets sync`, which compares before it writes. Nothing is ever deleted: a deleted endpoint's record stays, so no `delete` is needed. **What it writes:** one record per Kubernetes Secret, at `<mount>/data/<base>/<secret name>`: `opodcp-ep-<name>…-auth` (items `join-token`, `admin-token`, `auth.json`, `policy.json`, `remote-key`) and `opodcp-hub` (item `token`). Each change of an endpoint's `auth.json` or `policy.json` writes a new KV version. An `opodcp-connector-<port>` Secret is recorded each time the control plane writes it (today the one is `opodcp-connector-kvstore`, the workers' copy of a saved store password, written on an apply of a plan with a peer tier); `opodcp secrets sync` records any it missed, for example when Vault was down. **Verify** reads `/v1/sys/health`: active, standby and performance standby are `ok`; uninitialised and sealed are errors. **In 0.3.6 that is all it reads, and `sys/health` needs no token, so Verify does not prove the token or the policy.** Run `opodcp secrets sync` once after you save: its answer lists `written`, `same` and `failed` per Secret, and it exits non-zero if any record failed. In the release after 0.3.6, Verify and the doctor's `secrets` row also ask `POST /v1/sys/capabilities-self` for `<mount>/data/<base>/opodcp-verify`. A token Vault does not accept is `refused`; a policy that lacks `create`, `update` or `read` there is `refused` and names what is missing. Vault's built-in `default` policy allows that call, so a token issued with `no_default_policy` reads `refused` as well; attach the default policy, or grant `update` on `sys/capabilities-self`. ## Checkpoints: PVC **Address:** `OPODCP_JOB_CHECKPOINTS=pvc://fast-ssd?size=50Gi`. An empty class (`pvc://?size=50Gi`) uses the default StorageClass; size defaults to `20Gi`. `hostpath`, `hostpath://` or empty is the default. **Prepare:** a StorageClass that provisions volumes dynamically. **What it does:** one claim `opodcp-job-<name>-ckpt` per training job, ReadWriteOnce, in the control plane's namespace, created at the job's first attempt and kept across preemption and cancel. It is deleted only when the job is purged, and never when the job's spec named its own claim. With `hostpath`, checkpoints go to `/data/models/checkpoints/<job>` on the node. **Verify** answers `no-probe`. A malformed URL, or an `s3://`, `gs://` or `azblob://` one, is not refused on Save: the control plane runs on `hostpath`, and the doctor's `checkpoints` row is red with *running with hostpath*. ## Batch files: S3 **Address:** the `OPODCP_BATCH_FILES_*` settings in [Connectors → Ports](https://opod.io/docs/control-plane-operate/connectors/#ports). `OPODCP_BATCH_FILES_PREFIX` is empty by default: files go to the bucket root. Without `OPODCP_BATCH_FILES_ENDPOINT` the store is AWS S3. **Credentials:** both keys, or neither. With neither, the control plane tries `AWS_*` and `MINIO_*` environment variables and then the cloud's identity (IRSA or EKS Pod Identity). The chart's ServiceAccount takes no annotations: for IRSA, use EKS Pod Identity, or set `serviceAccount.create=false` and `serviceAccount.name` to a ServiceAccount you annotated. **Prepare:** the bucket (the control plane never creates it), and: ```json { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["s3:ListBucket", "s3:GetBucketLocation"], "Resource": "arn:aws:s3:::opod-batches" }, { "Effect": "Allow", "Action": ["s3:GetObject", "s3:PutObject", "s3:DeleteObject", "s3:AbortMultipartUpload"], "Resource": "arn:aws:s3:::opod-batches/*" } ] } ``` **What it writes:** one object per file, `<prefix>/<file id>`, 200 MB at most. Downloads are presigned URLs (redirects live 5 min), unless `OPODCP_BATCH_FILES_DOWNLOADS=proxy`. **Verify** checks only that the bucket exists and the credential may see it. It passes with read-only rights, so run one small batch after you save ([Jobs and batches](https://opod.io/docs/control-plane-endpoints/jobs-batches/)). `NoSuchBucket` is `missing`; `AccessDenied` or a bad key is `refused`. ## KV store: a shared volume **(arrives in the release after 0.3.6)** The second `kvstore` adapter, `shared-volume`. There is no server: each endpoint with a vLLM peer worker gets its own volume, and vLLM's own file tier writes the KV blocks there. The peer tier through it is proven for vLLM on NVIDIA and refused by name on every other vendor ([KV tiers → The peer tier](https://opod.io/docs/control-plane-endpoints/kv-tiers/#the-peer-tier-and-kvstore)). **Address:** `OPODCP_KVSTORE_URL=pvc://nfs-rwx?size=200Gi`. The host is a StorageClass; an empty class (`pvc://?size=200Gi`) uses the cluster's default class. `size` is each endpoint's volume and defaults to `200Gi`. The parse is the one [Checkpoints: PVC](#checkpoints-pvc) uses. **Prepare:** a StorageClass that provisions **ReadWriteMany** volumes dynamically: an NFS provisioner, CephFS, Lustre, or a cloud file share (Amazon EFS, Filestore, Azure Files). A block-storage class (EBS, a local-path class) gives ReadWriteOnce only and does not bind. Every worker node must be able to mount it. **What it does:** for each endpoint with a peer worker, one claim `opodcp-ep-<name>-<id>-kvshared` (ReadWriteMany, the URL's class and size, owned by the endpoint) mounted at `/data/kvshared` on every peer worker, and one Deployment `opodcp-ep-<name>-<id>-kvprune` that runs `opod cache kv-prune --dir /data/kvshared --max-gb <85 % of the size> --every 10s`. Both go when the endpoint is deleted, or when its plan has no peer worker any more. A claim's class and size never change in place: after you change the URL, delete the claim (`kubectl -n opodcp delete pvc <name>`) and the next rollout makes it again. The volume is your storage: no node disk is claimed in the ledger. **A burst stays near the cap.** The pruner walks the whole volume every 10 s. On a network filesystem each directory listing is a round trip, so the chart's pruner (core v0.4.8) lists 32 directories at once, passes again 1 s after a pass that found growth, trims ahead of the growth it measured, and while idle reads the volume's free space every second to start a pass as soon as a burst begins. On NFS, with a 1 GiB claim and a 0.85 GiB cap, two hosts writing 60 new documents each peaked at 0.95–1.08 × the cap in four runs. Core v0.4.7's pruner reached 1.26 × when the burst began right after an idle pass, and v0.4.6's about 2.3 ×. Keep the 15 % between the cap and the claim's size: the engine's writes fail while the volume is full. **Verify** answers `no-probe`: the control plane does not read StorageClasses. A URL that does not parse (a bad size) is `invalid`. A class that does not exist, or cannot give ReadWriteMany, shows on the endpoint instead: it reads degraded with `KVSharedVolumePending (<claim>): <reason>: <message>`, the provisioner's own event, for example `ProvisioningFailed: storageclass.storage.k8s.io "nfs-rwx" not found`. ## KV store: Valkey or Redis The peer KV tier this store serves is refused on every engine and vendor in `0.3.6` ([KV tiers → The peer tier](https://opod.io/docs/control-plane-endpoints/kv-tiers/#the-peer-tier-and-kvstore)), so a connected store stays unused today. **Address:** `OPODCP_KVSTORE_URL=redis://valkey.example.com:6379`, and the password in `OPODCP_KVSTORE_PASSWORD`; a password in the URL is refused. `rediss://` (TLS) is not supported. Or let the chart run one: `--set kvStore.enabled=true` starts one Valkey replica (LRU eviction, no persistence, a generated 40-character password in Secret `<release>-kvstore-auth`) and builds the URL itself. In 0.3.6, use a password of letters and digits on your own store: it is placed in the workers' store URL as it is. In the release after 0.3.6 any password works: the control plane's copy for the workers is percent-encoded, and the store client decodes it. **Verify** connects, sends `AUTH` when a password is set, then `PING`. `NOAUTH` is `refused`. In the release after 0.3.6 it also reads `INFO memory`, and so does the doctor's `kvstore` row: a store with no cap (`maxmemory 0`) or one that does not evict (`maxmemory-policy noeviction`, Redis's default) is `invalid`, because a KV cache in it either grows until its host runs out of memory or stops taking writes with nothing said. Set `maxmemory` and `maxmemory-policy allkeys-lru`; a `volatile-*` policy passes with a note, since it evicts only keys with a TTL. A store that refuses `INFO` keeps the `PING` answer and says the two values are unread. ## Ports set by the chart These ports are not Connectors settings. Each has its setup page: | Port | Set up | | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `registry` (ghcr.io, a private registry) | [Air-gapped install](https://opod.io/docs/control-plane-install/air-gapped/), [Supply chain](https://opod.io/docs/control-plane-security/supply-chain/) | | `autoscaler` (embedded, KEDA) | [Autoscaling](https://opod.io/docs/control-plane-endpoints/autoscaling/) | | `gangs` (Deployments, LeaderWorkerSet) | [Gangs](https://opod.io/docs/control-plane-endpoints/gangs/) | | `cloud` (onprem, aws, gcp, azure) | [Kubernetes](https://opod.io/docs/control-plane-install/kubernetes/) | | `fabric` (pcie+ethernet, InfiniBand, RoCE) | [Gangs → Fabrics](https://opod.io/docs/control-plane-endpoints/gangs/#fabrics). InfiniBand or RoCE is chosen from the link layer of the RDMA NIC the probe reads; both use the same plumbing and become a domain only after a fabric proof passes | --- title: "Usage and export" description: "Usage facts per request and per GPU-second, the summary and CSV export, GPU-hours per day, sinks, retention, and how to compute cost per team in your own tools." url: "https://opod.io/docs/control-plane-operate/usage/" markdown_url: "https://opod.io/docs/control-plane-operate/usage.md" section: "Operate" last_updated: "2026-11-12" --- # Usage and export > Usage facts per request and per GPU-second, the summary and CSV export, GPU-hours per day, sinks, retention, and how to compute cost per team in your own tools. ## In short opod counts what your GPUs did: requests, tokens, latency, time to first token and GPU-seconds, per endpoint, model, team, worker and job. It never records prompts or answers, and it never prices anything. The database only buffers these rows: connect a usage sink (Postgres, ClickHouse or S3) so they reach a store you keep, then join them with your price in your own tools. ## When you need it - Finance asks what each team's GPUs cost, and you need the hours to multiply by your price. - You want p50 and p95 latency and time to first token per endpoint. - The alert `usage.no-sink` fired: rows only buffer in the database. - You size the database: how many usage rows it keeps, and for how long. - You check, before buying, how much VRAM sits idle on a cluster (`opodcp audit`). ## Do it 1. **Read this month's numbers** ```bash export CP=https://cp.example.com export H="Authorization: Bearer $(kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d)" curl -s -H "$H" "$CP/api/v1/usage/summary?since=2026-10-01T00:00:00Z" \ | jq '.perEndpoint[] | {key, requests, promptTokens, completionTokens, gpuSeconds}' ``` 2. **Export the rows** ```bash curl -s -H "$H" "$CP/api/v1/usage/export?since=2026-10-01T00:00:00Z&until=2026-11-01T00:00:00Z" -o usage-2026-10.csv curl -s -H "$H" "$CP/api/v1/usage/gpu-daily?from=2026-10-01&to=2026-10-31&format=csv" -o gpu-daily-2026-10.csv ``` 3. **Connect a sink** On **Connectors → usage**, enter a DSN such as `clickhouse://opod@ch.example.com:8123/opod`, press **Verify**, then **Save**. The control plane restarts once and sends the sink every row the spool still keeps, oldest first. The same through the API is under [A save for each port](https://opod.io/docs/control-plane-operate/connectors/#a-save-for-each-port). 4. **Set the retention** Save `OPODCP_USAGE_RETENTION` (for example `14d`) on the same card. The spool then keeps raw rows for 14 days, and never deletes a row the sink has not taken. ## Check it worked ```bash curl -s -H "$H" $CP/api/v1/usage/retention | jq . curl -s http://127.0.0.1:8080/metrics | grep -E '^opodcp_usage_sink_(connected|lag_rows|lag_seconds)' ``` The second command needs `kubectl -n opodcp port-forward svc/opodcp 8080:8080`. A good answer: `opodcp_usage_sink_connected 1`, and `opodcp_usage_sink_lag_rows` near 0 a minute after the save. The retention answer shows the window and the sink's mark close to the newest row. The console's **Usage** page shows the numbers per team, model, endpoint and worker. ## If it fails | Symptom | Cause | Fix | | -------------------------------------------------- | ------------------------------------------------------------------------------- | --------------------------------------------------------------------- | | `400 invalid` on `/usage/export` | a bad `since` or `until`, or `until` before `since` | give RFC 3339 times, for example `2026-10-01T00:00:00Z` | | Alert `usage.no-sink` | no sink, and 10,000 or more rows buffered | connect a sink | | Alert `usage.sink-holding` | the sink is behind and rows are kept past retention | fix the sink; or export, then `POST /api/v1/usage/sink/skip?before=…` | | `0` rows in the sink and many in the spool | the sink's user may not create its table, or `schema=manual` with steps pending | **Connectors → usage → Verify** shows the missing grant or the SQL | | Every `gpu_seconds` is empty for one node | its cards are not measured | `kubectl -n opodcp get pods -l app=opodcp-gpu-telemetry -o wide` | | A team-scoped caller sees fewer rows than an admin | the export is narrowed to that team | expected | ## What is recorded The control plane records **quantities, never prices**: requests, tokens, latency, time to first token and GPU-seconds, per endpoint, model, team, worker and job. You ship them to your own store and apply your own price there. Request content (prompts and answers) is never recorded. ## Where the facts come from | Kind | Written by | Carries | | ----------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | | `request` | each leader, one row per request, pulled by the control plane through a cursor; from 0.3.0, pushed by the leader instead (below) | tokens, latency, time to first token, outcome, key id, node | | `occupancy` | the control plane's meter, every 15 minutes and when a pod stops | GPU-seconds a serving worker **held** | | job segment | the control plane, when a job's run segment ends | GPU-seconds of the job; `workload_type` is `job` and `job_id` is set | **From 0.3.0 the leader pushes its rows.** A leader from core v0.4.0 sends one OTLP log record per request to the control plane (`POST /otlp/v1/logs`). It keeps each record in memory until the control plane answers, up to 64 MiB (about 440,000 records), so a control-plane outage loses nothing until that queue is full. The control plane pulls only an older leader, so a fleet that runs both versions keeps both lanes. A resend is stored once. The control plane renders the URL and the credential into every leader; there is nothing to set. `GET /api/v1/usage/streams` says per endpoint whether usage is `push` or `pull`, and `missing` counts the records a leader dropped at its cap. A dedicated worker holds whole cards; a shared worker holds its budget's share of the card's measured size. Idle headroom and memory no plan explains belong to nobody, so a cell's GPU-seconds never exceed real card time. An unmeasured card yields no occupancy row. ## Read it ```bash curl -s -H "$H" "https://cp.example.com/api/v1/usage/summary?since=2026-10-01T00:00:00Z" | jq .perEndpoint curl -s -H "$H" "https://cp.example.com/api/v1/usage/export?since=2026-10-01T00:00:00Z&until=2026-11-01T00:00:00Z" -o usage.csv curl -s -H "$H" "https://cp.example.com/api/v1/usage/gpu-daily?from=2026-10-01&to=2026-10-31&format=csv" -o gpu-daily.csv ``` | Route | Answers | | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET /api/v1/usage/summary` | totals, errors, average latency, `rpm60`, and `perEndpoint`, `perModel`, `perTeam`, `perWorker`, `perJob`; with `since` (up to 8 days), `latency[]` per endpoint: p50 and p95 latency, TTFT and time per output token, and goodput against a stated SLO. `endpoint=` (repeatable) narrows it | | `GET /api/v1/usage/export` | CSV of the facts in a window (operator) | | `GET /api/v1/usage/gpu-daily` | GPU-hours per UTC day × endpoint × model × GPU class × workload type, JSON or CSV | | `GET /api/v1/usage/retention` | the window, the oldest row, the sink's mark and lag, and what holds rows past the window | | `GET /api/v1/usage/streams` | the pull from each leader: cursor, last pull, last error. From 0.3.0 also `mode` (`push` or `pull`), `lastPushAt`, `lastSeenAt` and `missing`; see [REST API](https://opod.io/docs/control-plane-reference/api/#usage) | Export columns, in order: `ts, tenant, cell, region, workload_type, kind, endpoint, team, model, protocol, api_key_id, user_id, prompt_tokens, completion_tokens, latency_ms, outcome, node_id, event_id, job_id, gpu_seconds, ttft_ms`. `since` is inclusive and `until` exclusive; both are optional RFC 3339 timestamps, and a bad one or an `until` before `since` is `400 invalid`. `ts` is RFC 3339 with nanoseconds, `kind` is `request` or `occupancy` (a job segment is the row whose `workload_type` is `job`), and `ttft_ms` is empty when no first token was measured (a non-streamed answer, a job). A team-scoped caller gets its own endpoints' rows and its team's job rows. `kind` is `request` for a request a leader served and `occupancy` for a segment of GPU held with no tokens: a serving worker's 15-minute meter segment, and, from 0.3.2, a job's run segment (`workload_type: job`). On 0.3.0 a job's segment exports `kind: request`; filter on `workload_type` there. The response headers say what the CSV cannot: | Header | Value | | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- | | `X-Opod-Usage-Since`, `X-Opod-Usage-Until` | the window the export was cut with; absent = unbounded. A script stores the bound and passes it as its next `since` | | `X-Opod-Usage-Retention` | the spool window (`720h0m0s`) or `forever` | | `X-Opod-Usage-Oldest` | the oldest raw row still kept; absent when there is none | The summary reads only `since`. Its `perEndpoint`, `perModel`, `perTeam`, `perWorker` and `perJob` rows each carry `key`, `requests`, `promptTokens`, `completionTokens`, `errors` and `gpuSeconds`; a `perEndpoint` row also carries the `team` and `model` recorded on its rows, so a deleted endpoint keeps its team. A `perWorker` key is `<endpoint id>|<node id>`; a `perJob` key is `<team>|<job name>`. Each table keeps the 50 busiest keys; use `endpoint=` to see one that falls outside them. A `latency[]` row carries `p50LatencyMs`, `p95LatencyMs`, `ttftP50Ms`, `ttftP95Ms`, `tpotP50Ms`, `tpotP95Ms`, their sample counts and, for an endpoint with an SLO, `judged` and `good`. An endpoint with no SLO reports no attainment. `gpu-daily` takes `from` and `to` as UTC days (`YYYY-MM-DD`) and answers JSON, or CSV for `format=csv` or `Accept: text/csv`. Its columns: `day, endpoint_id, endpoint_name, team, model, gpu_class, workload_type, tenant, cell, region, requests, prompt_tokens, completion_tokens, gpu_seconds_busy, gpu_seconds_idle, gpu_seconds_unmeasured`. A minute counts as busy when the card's utilisation reading is above 0 and idle at 0; a card whose driver publishes no utilisation is `unmeasured`, never idle. Job GPU-seconds are all `unmeasured`. These are counters that retention never trims. A team-scoped caller reads its own team's rows. The console's **Usage** page shows the same per team, model, endpoint and worker. ## Ship it to your store The database spool is an **outage buffer, not a home**. Connect a sink on the Connectors page (`OPODCP_USAGE_DSN`): | Sink | DSN | Notes | | ---------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Postgres | `postgres://user@host:5432/db[?table=…][&schema=manual]` | table `opod_usage` unless `table=` names another (`schema.table` allowed, lowercase); idempotent on `(endpoint_id, event_id, kind)`; made by schema steps | | ClickHouse | `clickhouse://user@host:8123/db[?table=…][&schema=manual]` | HTTP and JSONEachRow; `clickhouses://` for TLS; port `8123` and database `default` when left out; table `opod_usage` by default; made by schema steps | | Parquet | `parquet:///dir` | **up to 0.3.6 only**, removed in the release after: the directory is in the control plane's pod, which a restart wipes. Use S3 | | S3 | `s3://bucket/prefix?region=…[&endpoint=https://host:port][&pathStyle=0]` | Parquet objects in any S3-compatible bucket; region `us-east-1` when left out; a custom `endpoint` uses path-style addressing unless `pathStyle=0`; credentials from `accessKey`/`secretKey` in the DSN or `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY`; plus `gpu-daily/<day>.csv` | A DSN that carries a password or a key is a credential: the Connectors page seals it, or you name a Secret that holds the whole value. See [Connectors](https://opod.io/docs/control-plane-operate/connectors/). How the rows get there: 1. Every leader streams its request facts. The control plane pulls each stream through a cursor and writes the rows into the spool with an ingest sequence number. 2. Every 15 s a shipping pass sends the sink batches of up to 1,000 rows from a durable mark, for at most 10 s. One batch is one S3 object or one insert. A backlog drains across passes. 3. The mark moves only when the sink has taken the batch. Delivery is at least once. Postgres ignores a row it already holds, and S3 replaces the object of a replayed batch (as Parquet does its file, up to 0.3.6). ClickHouse drops a replayed batch only on a replicated table or once its deduplication window is set ([Connector setup → ClickHouse](https://opod.io/docs/control-plane-operate/connector-setup/#clickhouse)); otherwise count distinct `(endpoint_id, event_id, kind)`. 4. A refused batch is sent again, the same batch, after 15 s × 2ⁿ (±20 %), capped at 5 minutes. A restart simply tries again. A newly connected sink is sent every row the spool still keeps, oldest first. The previous sink keeps what it had. Rows written before ingest sequencing existed (an old upgrade) reach no sink; they are in the CSV export only. | Signal | Meaning | | ------------------------------------------------------------- | ------------------------------------------------------------------------------------- | | alert `usage.no-sink` (warning) | no sink is connected and 10,000 or more rows are buffered; the spool is the only copy | | alert `usage.sink-holding` | the sink is behind and holds rows past the retention window | | `opodcp_usage_sink_connected` | 1 when a sink is connected | | `opodcp_usage_sink_lag_rows`, `opodcp_usage_sink_lag_seconds` | rows the sink has not taken, and the age of the oldest | | `GET /api/v1/connectors` (admin), `usage` card | the backlog a switch would send | **Figure: Usage rows, from leaders to your sink.** Leaders, the spool and the sink, with the rows waiting in the spool over 30 minutes, failed passes and alerts. Traffic and rows per pass are illustrative. The interactive figure is on the web page: <https://opod.io/docs/control-plane-operate/usage/> ## Retention Raw rows stay in the spool for `OPODCP_USAGE_RETENTION`, saved on the Connectors page: 30 days when unset, at least `24h`, a Go duration (`720h`) or whole days (`30d`); `0` keeps every row. The trimmer runs every 10 minutes. `GET /api/v1/usage/retention` (viewer) shows the window, the oldest row, the sink's mark and lag, and what holds rows past the window; the API cannot change the window. - **A row the sink has not taken is never deleted.** A sink that stays down fills the database, loudly: alert `usage.sink-holding`, the doctor's `usage` row and the metric `opodcp_usage_sink_lag_seconds`. - To accept a loss explicitly, export what you need, then `POST /api/v1/usage/sink/skip?before=<RFC 3339>` (admin). The mark moves past every row the sink has not taken that is older than `before`. The answer is the span as counted: the sequence range, the rows and their real time range. The event `usage.sink_skipped` records who dropped what, and the next trimmer pass frees the rows. With no sink connected it answers `400`: there is no mark to move. - Rows that predate retention (from an upgrade or a restore) stay until you save `OPODCP_USAGE_TRIM_EXISTING=1`. - Size: about 330 bytes per row with indexes. 30 days at 5 requests a second is about 13 million rows, roughly 4 GB. ## Cost per team The control plane knows how long each endpoint held its GPUs; your gateway knows which team sent which tokens. Cost per team is the join, in your BI tool, with your price. Split each endpoint's busy GPU-hours across teams by their share of its tokens that day, and label the result **allocated**: ```sql -- opod_gpu_daily: the gpu-daily export. litellm_team: LiteLLM_DailyTeamSpend. -- gateway_map(model_group, endpoint): your gateway's model list. WITH gpu AS ( SELECT day, endpoint_name AS endpoint, SUM(gpu_seconds_busy + gpu_seconds_unmeasured) / 3600.0 AS busy_h, SUM(gpu_seconds_idle) / 3600.0 AS idle_h FROM opod_gpu_daily WHERE workload_type = 'endpoint' GROUP BY day, endpoint_name ), tok AS ( SELECT t.date AS day, m.endpoint, t.team_id, SUM(t.prompt_tokens + t.completion_tokens) AS tokens FROM litellm_team t JOIN gateway_map m ON m.model_group = t.model_group GROUP BY t.date, m.endpoint, t.team_id ), share AS ( SELECT day, endpoint, team_id, tokens::float / SUM(tokens) OVER (PARTITION BY day, endpoint) AS share FROM tok ) SELECT s.day, s.endpoint, s.team_id, g.busy_h * s.share AS allocated_busy_gpu_hours, g.busy_h * s.share * :price_per_gpu_hour AS allocated_cost FROM share s JOIN gpu g USING (day, endpoint) ORDER BY s.day, s.endpoint, s.team_id; ``` Idle hours of a dedicated endpoint belong to the team that owns it (`team` on the export). Reconcile per endpoint and day: fewer gateway tokens than opod served means traffic reached the endpoint around the gateway. ## Before you install: an idle-VRAM audit `opodcp audit` reports the idle VRAM on any cluster, read-only, with no licence. It runs probe pods in a throwaway namespace and removes them. ```bash opodcp audit --kubeconfig ~/.kube/config --duration 5m --price 2.50 --json > audit.json ``` Flags: `--namespace` (default `opodcp-audit`), `--duration` (default 60 s, a sample every 10 s), `--price` (your price per GPU-hour; 0 = GPU-hours only), `--json`, `--keep`. --- title: "Metrics, events, alerts, logs and traces" description: "What the control plane and the leaders publish. Prometheus series, the event stream, the bundled dashboards and rules, built-in alerts and rules, log shipping and traces." url: "https://opod.io/docs/control-plane-operate/observability/" markdown_url: "https://opod.io/docs/control-plane-operate/observability.md" section: "Operate" last_updated: "2026-11-12" --- # Metrics, events, alerts, logs and traces > What the control plane and the leaders publish. Prometheus series, the event stream, the bundled dashboards and rules, built-in alerts and rules, log shipping and traces. ## In short opod publishes Prometheus metrics, a live event stream, its own alerts, log records and request traces. It installs no Prometheus, Grafana or collector: you point the tools you already run at it. The control plane serves `/metrics` on port 8080; every leader serves its serving metrics on port 8081. The chart carries two Grafana dashboards and a rule file you can turn on with one value each. ## When you need it - You want opod's metrics and alerts in your existing Prometheus and Grafana. - You need a pager to ring when an endpoint errors, slows down or runs out of worker slots. - You want every change and lifecycle step as a stream, for a chat bot or your own tooling. - You ship the control plane's records and its audit stream to Splunk or an OpenTelemetry collector. - You trace a slow request through the leader and the engine. ## Do it To scrape both levels with a Prometheus that runs in the cluster: 1. **Scrape the control plane** The Service carries `prometheus.io/scrape: "true"` and `prometheus.io/port: "8080"`. A Prometheus that honours those annotations needs nothing more. Otherwise add a static target `opodcp.opod.svc:8080`. 2. **Scrape every leader** Add the `opod-leaders` job from [Metrics](#metrics) below to your Prometheus configuration. It keeps pods that carry `opod.io/front` and scrapes their port 8081. 3. **Load the rules and dashboards** ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ --set observability.prometheusRules.enabled=true \ --set observability.grafanaDashboards.enabled=true ``` This is new in `0.3.0`. 4. **Send alerts to your pager** Save `OPODCP_NOTIFY_URLS` on the **Connectors** page, then send a test: ```bash export H="Authorization: Bearer $(kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d)" curl -s -H "$H" -X POST https://cp.example.com/api/v1/connectors/notifier/test ``` ## Check it worked ```bash kubectl -n opodcp port-forward svc/opodcp 8080:8080 & curl -s http://127.0.0.1:8080/metrics | grep -E '^opodcp_(controller_runs_total|cell_gpus|alerts_open)' | head ``` A good answer shows `opodcp_controller_runs_total{controller="reconciler"} N` and its neighbours, `opodcp_cell_gpus` with your GPU count, and `opodcp_alerts_open` per severity. In Prometheus, `up{job="opod-leaders"}` is `1` for every leader. The notifier test answers `{"sent": true, "sinks": […]}`. ## If it fails | Symptom | Cause | Fix | | ----------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------ | | The `opod-leaders` targets read `context deadline exceeded` | leader isolation blocks the scrape | name your Prometheus in `networkPolicy.leaderIsolation.from` | | A panel of a labelled counter is empty | the counter has no series until its first event | nothing to fix; it appears with the first event | | `opodcp_usage_sink_lag_rows` is `NaN` | no usage sink is connected | connect one; see [Usage](https://opod.io/docs/control-plane-operate/usage/) | | The notifier test answers `409 E-NO-NOTIFIER` | no alert sink is saved | save `OPODCP_NOTIFY_URLS` | | The notifier test answers `"sent": false` | a sink refused one half | read that sink's entry in `sinks`; the doctor's `notifier` row counts failures | | `curl …/events` closes after a minute | a proxy cuts long responses | allow long-lived responses on `/events`; the stream sends `: ping` every 15 s | | The `traces` doctor row is red | `OPODCP_TRACES_SAMPLE_RATIO` is not a number from 0 to 1 | save a value such as `0.1` | ## What opod publishes opod exposes metrics, events, logs and spans and ships the files to read them. It installs no Prometheus, Grafana or collector. Every metric label is an endpoint, a worker, a model or a class, never a key, user or team. Items marked † are new in `0.3.0`. ## Metrics **The control plane:** `GET /metrics` on its Service, port 8080. The route takes no credential. The Service carries `prometheus.io/scrape` and `prometheus.io/port`. The control plane's own families are `opodcp_*`; the Go runtime and process collectors (`go_*`, `process_*`) are there too. | Series | Type | What it is | | -------------------------------------------------------------------------------------------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `opodcp_http_requests_total{route,code}` | counter | API requests by route pattern and status, 401/403/429 included | | `opodcp_http_request_duration_seconds{route}` | histogram | API latency by route pattern; buckets from 2 ms to 10 s | | `opodcp_plan_judgements_total{result}` | counter | plans judged; `result` is `ok`, an `E-…` code or `uncoded` | | `opodcp_ledger_conflicts_total` | counter | admission writes retried because the ledger moved | | `opodcp_usage_sink_connected` | gauge | 1 when a usage sink is configured, 0 when usage only buffers | | `opodcp_usage_sink_lag_rows`, `opodcp_usage_sink_lag_seconds` | gauge | rows the sink has not taken, and the oldest one's age; NaN with no sink | | `opodcp_meter_pods_seen_total`, `opodcp_meter_pods_sized_total` | counter | pods the occupancy meter looked at, and those it could size | | `opodcp_meter_pods_skipped_total{reason}` | counter | pods that accrued nothing; `reason` is `no-observed-status`, `no-observed-plan`, `not-running`, `no-node` or `no-measurable-share` | | `opodcp_controller_runs_total{controller}`, `opodcp_controller_errors_total{controller}` | counter | each control loop's runs, and runs that failed or panicked | | `opodcp_controller_last_run_timestamp_seconds{controller}`, `opodcp_controller_last_duration_seconds{controller}` | gauge | when each loop last ran, and how long it took | | `opodcp_alerts_open{severity}` | gauge | open alerts by severity | | `opodcp_notify_failures_total{adapter}` | counter | alert deliveries that failed, by notifier adapter | | `opodcp_cell_gpus`, `opodcp_licence_max_gpus` | gauge | allocatable GPUs in the cell, and the licence ceiling | | `opodcp_licence_fleet_over` † | gauge | 1 while the fleet control plane reports the cells of this key over it | | `opodcp_kv_tier_hit_tokens`, `_query_tokens`, `_loaded_bytes`, `_stored_bytes`, `_used_percent`, `_alloc_failures` † `{endpoint,node}` | gauge | each worker's host KV tier: tokens served and looked up, bytes loaded and stored, fill (0–100), and stores refused for room, since its engine started | **Each leader and front door:** `/metrics` on the probe port **8081** (plain HTTP, always on). Families `opod_*`: `opod_request_duration_seconds`, `opod_time_to_first_token_seconds`, `opod_requests_total`, the `opod_admission_*` family and more. Serving SLOs are written against these. A leader from core v0.4.0 also exposes its usage push queue on `/metrics` † (`opod_usage_queue_records`, `opod_usage_queue_bytes`, `opod_usage_sent_total`, `opod_usage_export_errors_total`, `opod_usage_dropped_total{reason}`); alert on `increase(opod_usage_dropped_total[10m]) > 0`, which means usage records are being lost. See [core Metrics](https://opod.io/docs/core-reference/metrics/#usage-push). ```yaml scrape_configs: - job_name: opod-leaders kubernetes_sd_configs: [{ role: pod, namespaces: { names: [opod] } }] relabel_configs: - { source_labels: [__meta_kubernetes_pod_label_opod_io_front], regex: '.+', action: keep } - { source_labels: [__meta_kubernetes_pod_ip], target_label: __address__, replacement: '$1:8081' } - { source_labels: [__meta_kubernetes_pod_label_opod_io_front], target_label: endpoint } - { source_labels: [__meta_kubernetes_pod_label_opod_io_role], target_label: role } - { source_labels: [__meta_kubernetes_pod_name], target_label: pod } ``` With leader isolation on, name your Prometheus in `networkPolicy.leaderIsolation.from`, or the scrape stops. To push instead of scrape, save `OTEL_EXPORTER_OTLP_ENDPOINT` on the Connectors page (OTLP/HTTP every 30 s). Headers go in `OTEL_EXPORTER_OTLP_HEADERS` (`k=v,k=v`) through `extraEnv`. The doctor's `metrics` row counts pushes sent and failed. ## Dashboards and Prometheus rules † The chart carries two Grafana dashboards (**opod · serving** and **opod · control plane**) and a rule file. Render them as ConfigMaps: ```bash helm upgrade opodcp … --reset-then-reuse-values \ --set observability.grafanaDashboards.enabled=true --set observability.prometheusRules.enabled=true ``` Grafana's dashboard sidecar finds them by the label `grafana_dashboard: "1"` (`observability.grafanaDashboards.label`, `.labelValue`). Or extract the files with `helm pull … --untar` (`files/dashboards/`, `files/prometheus-rules.yaml`). The `0.2.1` chart carries neither. | Rule | Severity | Fires when | | ----------------------------- | -------- | ------------------------------------------------------------------- | | `OpodEndpointErrors` | warning | more than 5 % of an endpoint's requests end in error for 10 minutes | | `OpodSlowFirstToken` | warning | an endpoint's p95 time to first token is above 5 s for 15 minutes | | `OpodShedding` | warning | an endpoint sheds requests of a class for 10 minutes | | `OpodNoWorkerSlots` | critical | an endpoint has no worker slot for 5 minutes | | `OpodControlPlaneLoopErrors` | warning | a control loop keeps failing for 15 minutes | | `OpodControlPlaneLoopStopped` | critical | a control loop has not run for 15 minutes | | `OpodUsageSinkLagging` | warning | the usage sink is more than 30 minutes behind, for 10 minutes | Also worth a rule: `opodcp_usage_sink_connected == 0` for an hour (usage only buffering; do not use `absent()`, the gauge always exists), and `rate(opodcp_meter_pods_sized_total[30m]) == 0 and rate(opodcp_meter_pods_seen_total[30m]) > 0` (GPU-seconds not recorded). A labelled counter has no series until its first event, so an empty panel means none yet. ## Events Every change and lifecycle step is an event on the control plane's bus. The console reads them live; you can too. ```bash TICKET=$(curl -s -H "$H" -X POST https://cp.example.com/api/v1/stream-ticket | jq -r .ticket) curl -N "https://cp.example.com/events?ticket=$TICKET" ``` `GET /events` is a Server-Sent Events stream (`viewer`). A browser cannot send a header there, so it takes a single-use ticket from `POST /api/v1/stream-ticket` as `?ticket=`. Each message is `id: <seq>`, `event: <type>` and `data:` the event as JSON: `{ "seq", "ts", "type", "subject", "data" }`. `subject` is usually the endpoint, node, run or job id. A reconnect with `Last-Event-ID` (or `?since=<seq>`) replays up to 1,000 missed events from the journal first. A comment `: ping` arrives every 15 s. With more than one replica, connect the `events` port to NATS, or a stream on one replica misses what another publishes. `GET /api/v1/events/recent` returns the last 200 events the control plane pulled from its leaders. The same events also ship to the `logs` connector as the `events` stream. | Area | Types | | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Endpoints | `endpoint.created`, `endpoint.updated`, `endpoint.deleted`, `endpoint.recreated` †, `status.changed`, `plan.applied`, `plan.deprecated-flag`, `policy.updated`, `endpoint.advisory`, `endpoint.adapters`, `endpoint.slo`, `endpoint.remote_key`, `endpoint.cert-renewed`, `endpoint.leader-moved`, `endpoint.pod-event` †, `endpoint.worker-restarted` †, `endpoint.worker-identity-revoked`, `endpoint.template-drift`, `endpoint.template-rolled`, `gang.gave-up` †, `fabric.policy`, `image.unsigned`, `image.unverified` | | Runs and rollouts | `run.started` †, `run.step` †, `run.step-progress` †, `run.finished` †, `run.cancel-requested` †, `rollout.canary`, `rollout.canary-weight`, `rollout.canary-verdict`, `rollout.canary-unjudged`, `rollout.canary-promoted`, `rollout.canary-aborted`, `rollout.eval`, `rollout.signature-hold` †, `rollout.signature-accepted` †, `rollout.signature-rejected` †, `rollout.woke` | | Scaling | `autoscale.granted`, `autoscale.scaled`, `autoscale.slept`, `autoscale.woke` | | Machines | `node.cordoned`, `node.drained`, `node.evacuated`, `node.removed`, `node.sharing-changed` †, `gpu.reset` †, `cache.pruned`, `kvtier.swept` †, `pod.forced` †, `pod.remnant` †, `pod.remnant-resolved` †, `remnant.found` †, `remnant.resolved` † | | Models | `model.created`, `model.deleted`, `model.version`, `model.version-rollback`, `model.warm-started`, `model.approval-policy` †, `cell.hub-token` | | Keys, users and teams | `key.created`, `key.revoked`, `auth.login`, `auth.login_failed`, `auth.updated`, `auth.user_deleted`, `auth.token_created` †, `auth.token_revoked` †, `user.created`, `team.quotas.changed` | | Alerts | `alert.fired`, `alert.resolved`, `alert.acked`, `alert.rules_changed` | | Connectors, usage and data | `connector.saved` †, `connector.verified` †, `connector.changed` †, `secrets.synced` †, `usage.captured`, `usage.cursor_reset`, `usage.sink_skipped`, `fleet.events`, `backup.taken`, `backup.restored`, `audit.rebased`, `audit.retention_changed` | | Licence | `licence.updated`, `licence.burst-started`, `licence.burst-ended`, `licence.fleet-over` †, `licence.fleet-under` † | | Cell door | `door.auto-routes` † | | Jobs | `job.submitted`, `job.placed`, `job.running`, `job.preempted`, `job.deleted`, and `job.<state>` for `queued`, `placing`, `running`, `preempted`, `succeeded`, `failed`, `cancelled` | | Batches | `batch.created`, `batch.file.uploaded`, `batch.in_progress`, `batch.cancelling`, and `batch.<status>` for `completed`, `failed`, `expired`, `cancelled` | In `0.2.1` a rollout publishes `rollout.started`, `rollout.step`, `rollout.step-progress` and `rollout.finished`; `0.3.0` publishes `run.*` for every kind of run instead. ## Alerts inside the control plane The control plane raises its own alerts and keeps them in the database with fire, resolve and acknowledge. One alert is open per kind and object. A condition alert resolves after three healthy observations in a row (about 45 s). A **sticky** alert resolves only on acknowledge, or when its subject is deleted. Each alert carries a title, a detail and a remedy. The bell in the console's top bar lists open ones. | Kind | Severity | Raised when | | ----------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `endpoint.degraded` | serious | an endpoint is degraded | | `endpoint.engine-unhealthy` | warning | a worker's pod runs while its engine crash-loops or stopped | | `endpoint.worker-slow` | warning | the endpoint's leader ranks a worker down because it answers slower than its siblings (`routing.slowFactor`); resolves about 45 s after the leader stops listing it. Arrives in the release after 0.3.6 | | `endpoint.images-unverified` | warning, sticky | the endpoint runs images whose signature was not verified | | `endpoint.foreign-objects` | warning | workloads in the namespace belong to no endpoint in this store | | `plan.node-missing` | serious | a plan is pinned to a node that left the cluster | | `rollout.failed` | serious, sticky | a rollout failed | | `gang.gave-up` † | serious | a gang could not form after three tries and is parked | | `autoscale.no-capacity` | warning | the next worker cannot be placed | | `autoscale.scaler-unhealthy` | warning | KEDA owns the endpoint and its ScaledObject is absent or not ready | | `autoscale.grant-below-floor` | warning | the ledger granted fewer worker slots than the plan's floor | | `worker.memory-near-limit` † | warning | a worker with a KV tier uses most of its memory limit | | `node.notready` | warning | a node is NotReady | | `node.cache-low` | warning | a node's model cache is nearly full | | `node.remnant` † | serious | pods of ours left the API without proof their processes ended; the node is cordoned | | `gpu.unhealthy` | serious | the probe read a card as faulted (uncorrected ECC, hardware slowdown) | | `gpu.held-outside` † | warning | a card's memory is in use and nothing of ours holds it | | `usage.no-sink` | warning | no usage sink, and the buffer has grown past what an outage explains; after 0.3.6 it also fires, naming the reason, when a saved sink did not open | | `usage.sink-holding` | serious | the sink is behind and rows are kept past the retention window | | `connector.failing` † | warning | a connected port has failed its doctor check for a while | | `connector.sealed` † | warning | a port's stored credentials were sealed with another install key | | `rule.<id>` | the rule's | one of your alert rules breached | ```bash curl -s -H "$H" "https://cp.example.com/api/v1/alerts?state=open" curl -s -H "$H" -X POST https://cp.example.com/api/v1/alerts/<id>/ack ``` In the release after 0.3.6, `opodcp alerts ls --open` prints the same list as a table, and `--json` gives each alert's detail and remedy. See the [CLI reference](https://opod.io/docs/control-plane-reference/cli/#alerts-and-connectors). **Alert rules** of your own: `PUT /api/v1/alert-rules` (admin, the whole list, `If-Match` honoured) with up to 64 rules. `GET /api/v1/alert-rules` reads them. | Metric | What it measures | | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `endpoint.error_rate_pct` | errors ÷ requests × 100 over the window | | `endpoint.p95_latency_ms` | p95 request latency over the window | | `node.vram_headroom_gb` | the most free VRAM on any one GPU of the node | | `node.offline_minutes` | minutes since the node stopped being Ready | | `key.expiry_days` | days until an active endpoint key expires | | `endpoint.cert_expiry_days` | days until the endpoint's embedded certificate expires (negative = expired) | | `gpu.ecc_uncorrected` | uncorrected ECC errors a card reported since boot | | `usage.sink_lag_minutes` | the age of the oldest row the sink has not taken; no sink gives no reading | | `node.nic_down_count` | the release after 0.3.6: NICs on the node with link down | | `node.nic_drop_per_min` | the release after 0.3.6: the worst NIC's received plus sent drops per minute | | `node.peer_loss_pct` | the release after 0.3.6: the worst packet loss from the node's probe to any peer. A peer that is down (its own probe sent no fresh round) is left out, so one NotReady machine does not make every other machine fire | | `fabric.proof_gbps_below_floor` | the release after 0.3.6: how far the newest fabric proof of a node set is below the bandwidth floor, in GB/s | | `worker.heartbeat_age_seconds` | the release after 0.3.6: the oldest worker heartbeat of an endpoint; the router stops dispatching to a worker past 30 s. Scope by endpoint name | ```json [{ "id": "chat-errors", "name": "chat error rate", "metric": "endpoint.error_rate_pct", "op": "gt", "threshold": 2, "scope": "chat", "severity": "serious", "windowMinutes": 15, "enabled": true }] ``` `id` is lowercase letters, digits, `.`, `_` and `-` (1–64 characters). `op` is `gt` or `lt`; `threshold` is 0 or more. `windowMinutes` applies to the two endpoint rates only (default 15, at most 1,440). `scope` is an endpoint or node name; empty means every object. `severity` is `warning` (the default), `serious` or `critical`. Each breach is an alert of kind `rule.<id>`, fired once per object and healed after three healthy observations. **Delivery.** Deliver alerts to your pager with the `notifier` connector: `OPODCP_NOTIFY_URLS`, a comma-separated list of `https://…` (a webhook that receives `{event, alert}` JSON), `alertmanager+https://…` (Alertmanager v2), `slack+https://…` (a Slack incoming webhook) and `pagerduty://<routing key>` (Events API v2, trigger, acknowledge, resolve). The list is stored sealed. `POST /api/v1/connectors/notifier/test` (admin) sends one alert marked TEST to every sink and answers per sink; with no sink it answers `409 E-NO-NOTIFIER`. Delivery is bounded at 10 s and never blocks the control plane. See [Connectors](https://opod.io/docs/control-plane-operate/connectors/). ## Logs The control plane writes JSON records to stdout. The `logs` connector also ships three streams, chosen by `OPODCP_LOGS_STREAMS` (default all three): | Stream | What | Splunk sourcetype | | -------- | ---------------------------------------------------------------- | ----------------- | | `cp` | the control plane's own log records | `opodcp:cp` | | `audit` | actions somebody took, with the actor | `opodcp:audit` | | `events` | lifecycle events nobody took: rollout steps, autoscaling, alerts | `opodcp:events` | Choose the adapter with `OPODCP_LOGS_ADAPTER` on the Connectors page: | `OPODCP_LOGS_ADAPTER` | Settings | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `stdout` (default) | none | | `otlp` | `OPODCP_LOGS_URL=http://otel-collector:4318`; optional `OPODCP_LOGS_TOKEN` (sent as a bearer) and `OPODCP_LOGS_HEADERS` (`k=v,k=v`). Every leader also gets the URL as `OPOD_OTLP_LOGS_ENDPOINT` for its own records | | `splunk-hec` | `OPODCP_LOGS_URL=https://splunk.example.com:8088`, `OPODCP_LOGS_TOKEN` (the HEC token). Leaders get no log URL under this adapter | The token is stored sealed. Shipping never blocks: the queue holds 4,096 records and flushes every 2 s, each export call has 5 s, and a failed batch is counted and dropped, not retried. The doctor's `logs` row counts `sent`, `failed` and `dropped`. **Engine and pod stdout are your log agent's job**: collect `/var/log/pods/opod_*/*/*.log`. Useful pod labels for routing: `opod.io/endpoint`, `opod.io/endpoint-id`, `opod.io/role`, `opod.io/job`, `app.kubernetes.io/name=opodcp`. ## Traces Save `OPODCP_TRACES_URL` (an OTLP/HTTP collector) on the Connectors page, and optionally `OPODCP_TRACES_SAMPLE_RATIO` (0 to 1; empty traces every request, and a request its caller sampled is always kept). Every leader then exports its request spans there as `OPOD_OTLP_ENDPOINT`, and every worker pod gets `OTEL_SERVICE_NAME=<engine>` so the engine's own spans are named. The control plane sends no spans itself; the doctor's `traces` row says whether the collector answers a dial. A leader picks the setting up at its next rollout. --- title: "Machines" description: "Cordon, evacuate and drain a node safely, label it for leaders, time-slice it, prune its model cache, reset a card held outside opod, and clean remnants." url: "https://opod.io/docs/control-plane-operate/machines/" markdown_url: "https://opod.io/docs/control-plane-operate/machines.md" section: "Operate" last_updated: "2026-10-31" --- # Machines > Cordon, evacuate and drain a node safely, label it for leaders, time-slice it, prune its model cache, reset a card held outside opod, and clean remnants. ## In short The **Machines** page acts on one node at a time: take it out for maintenance, keep leaders off it, share its cards in turns, free its model cache, or reset a card that something outside opod left full. An evacuate moves only opod's own workloads, through one verified rollout per endpoint, so endpoints keep serving. A drain also evicts other teams' pods, and only after you confirm the exact list. ## When you need it - A machine needs a reboot, a driver update or a hardware fix. - A node's disk is full of old model weights (alert `node.cache-low`). - A card shows memory in use and nothing of ours on it (alert `gpu.held-outside`). - Leaders and front doors should stay on cheap CPU nodes, or off one particular node. - A node is gone for good and its Node object should go too. ## Do it To take node `node-c` out for maintenance and bring it back: 1. **Preview the evacuate** ```bash export CP=https://cp.example.com export H="Authorization: Bearer $(kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d)" curl -s -H "$H" $CP/api/v1/nodes/node-c/evacuate/preview \ | jq '{ours: (.ours|length), foreign: (.foreign|length), endpoints: [.endpoints[] | {name, workers, blocked}], leaders}' ``` Every endpoint should have no `blocked` reason. A `blocked` endpoint has nowhere else to go: free capacity first. 2. **Evacuate** ```bash curl -s -H "$H" -X POST $CP/api/v1/nodes/node-c/evacuate | jq '{node, cordoned}' ``` The node is cordoned at once. Each endpoint on it then moves in a rollout of its own; the leaders move last. 3. **Wait until nothing of ours is left** ```bash kubectl get pods -A -o wide --field-selector spec.nodeName=node-c -l opod.io/endpoint ``` An empty list means every worker and leader has moved. **Activity** shows each rollout as a run. 4. **Do the maintenance, then uncordon** ```bash curl -s -H "$H" -X POST $CP/api/v1/nodes/node-c/uncordon ``` The placer may use the node again. Nothing moves back by itself; the next placement or scale-up uses it. ## Check it worked ```bash kubectl get node node-c -o jsonpath='{.spec.unschedulable}{"\n"}' curl -s -H "$H" "$CP/api/v1/runs?limit=5" | jq -r '.[] | "\(.kind) \(.state) \(.endpointName)"' ``` After step 2 the first command prints `true`, and the runs list one rollout per moved endpoint, each `succeeded`. After step 4 it prints nothing (the field is unset). The **Machines** page shows the node's state and its holders. ## If it fails | Answer | Cause | Fix | | ------------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `E-LEADER-NOWHERE` | no other node may hold a leader | uncordon a node, or lift an `opod.io/leaders=avoid` fence | | An endpoint in the preview is `blocked` | nothing else in the cell can hold its workers | free capacity, raise the licence or quota, then evacuate | | `E-DRAIN-CONFIRM` | the foreign pods changed since the preview, or the token is older than five minutes | read the preview again and send its new `confirm` | | A drain is refused while `rbac.nodeDrain=false` | the release has no cluster-wide eviction right | evacuate instead, and drain the rest with `kubectl drain` | | `E-NODE-READY` or `E-NODE-HOLDS-OURS` on a remove | the node is Ready, or still runs our pods | cordon and evacuate first; remove only a NotReady node | | `E-SHARING-BUSY` | something holds the resource the switch takes away | move the workers off the node first | | `E-CARD-BUSY` on a card reset | a process is on the card | stop it first | | A cache prune Job stays `Pending` on a full node | the kubelet rejects it under DiskPressure | `--set priorityClasses.nodePressure=system-cluster-critical` | ## Node actions in detail The **Machines** page and `/api/v1/nodes/{name}/…` act on one node at a time. Every action needs the admin role and touches only objects the control plane owns, except a confirmed full drain. ## Cordon and uncordon `POST /api/v1/nodes/{name}/cordon` and `…/uncordon` set `spec.unschedulable` only. Nothing running moves; the placer skips a cordoned node, and a plan that names it is refused `E-NODE-CORDONED` with alternatives. ## Evacuate: move our workloads off a node ```bash curl -s -H "$H" https://cp.example.com/api/v1/nodes/node-c/evacuate/preview | jq '{ours, system, foreign, endpoints, leaders}' curl -s -H "$H" -X POST https://cp.example.com/api/v1/nodes/node-c/evacuate ``` The preview sorts every pod on the node into exactly one list: | List | What | An evacuate | | --------- | ------------------------------------------------------------------------------------------- | ----------- | | `ours` | our endpoint and job workloads, by label, inside our namespace | moves them | | `system` | ours but not a workload: the control plane's own pod, the telemetry DaemonSet, a helper Job | leaves them | | `foreign` | everything else | leaves them | `endpoints[]` says which endpoints would move and which are `blocked` (nothing else in the cell can hold them). An evacuate cordons the node, then runs **one verified rollout per endpoint** with the node excluded, checkpoints and re-queues preemptible jobs, and finally moves the leaders the node hosts. A leader moves by deleting its pod once that endpoint has no rollout running, so its workers have moved first; it costs that endpoint a few seconds of `503` until the new leader is Ready, unless the endpoint has front doors. If no other node can hold a leader, the evacuate is refused up front with `E-LEADER-NOWHERE`. A worker on a GPU-less node is re-pinned to the least loaded other GPU-less node. ## Drain: also evict the owner's pods `POST /api/v1/nodes/{name}/drain {"confirm": "<token>"}` evacuates, then evicts the `foreign` pods, then our `system` pods. The `confirm` token comes from the preview and is bound to the node and to the foreign pods it will evict: if one of those appears or leaves, the drain is refused `E-DRAIN-CONFIRM` and you read the preview again. The token is good for five minutes. DaemonSet pods, finished pods and mirror pods are left, as `kubectl drain` leaves them. `--set rbac.nodeDrain=false` removes the cluster-wide eviction right: evacuating our own workloads still works, and a full drain is refused. ## Labels for leaders and doors ```bash opodcp node label node-a opod.io/leaders=avoid # never a leader or a door here opodcp node label node-c opod.io/leaders=prefer # picked first opodcp node label --remove opod.io/leaders node-a opodcp nodes # the fence, and the leaders and doors on each node ``` Or `PATCH /api/v1/nodes/{name}/labels {"opod.io/leaders": "avoid"}` (`null` removes). Only `opod.io/*` labels may be changed. See [Configuration → Where leaders and front doors run](https://opod.io/docs/control-plane-install/configuration/). ## Time-slice an NVIDIA machine `POST /api/v1/nodes/{name}/sharing {"mode": "timeslice"}` (or `"budget"` to return) makes NVIDIA's plugin present each card as turns (`nvidia.com/gpu.shared`). The turn count per card comes from the node label `opod.io/gpu-slices` and the chart's `substrate.nvidiaDevicePlugin.timeSlicing.choices` (`2`, `4`, `8`; default `4`). Refused `E-SHARING-VENDOR` on a non-NVIDIA node and `E-SHARING-BUSY` while anything holds the resource the switch takes away. Memory is not isolated between turns. ## The model cache ```bash curl -s -H "$H" "https://cp.example.com/api/v1/nodes/node-c/cache?minAge=24h" # preview curl -s -H "$H" -X POST "https://cp.example.com/api/v1/nodes/node-c/cache/prune?minAge=24h" ``` The preview runs core's `opod cache prune` as a dry run in a short Job and deletes nothing. It keeps every file a plan with a worker there references (parked ones included), every file a prefetch is pulling now, and every model with a `staging` or `prod` version. The alert `node.cache-low` links to it. A node whose cache filled its disk carries DiskPressure, and the kubelet rejects any pod it does not read as critical, including the prune. Set `priorityClasses.nodePressure=system-cluster-critical` so the prune and the probe can run there. ## A card held outside opod A card with at least 1 GiB in use and nothing of ours on it is **held outside**: it is not free in the ledger and raises `gpu.held-outside`. When you know the memory is stale: ```bash curl -s -H "$H" https://cp.example.com/api/v1/nodes/node-c/gpus/0/reset # what a reset would do curl -s -H "$H" -X POST https://cp.example.com/api/v1/nodes/node-c/gpus/0/reset ``` The node is cordoned for the reset (and uncordoned after when this made the cordon), the driver is asked again for processes, and `nvidia-smi --gpu-reset` runs in the probe pod. The preview answers `200` with the plan, and its `code` and `refusal` when a reset would be refused. The reset itself is refused `400 invalid` with `details.code`: `E-CARD-NOT-OUTSIDE` (a card of ours), `E-CARD-BUSY` (any process on it, whoever's), `E-CARD-RESET-UNSUPPORTED`. **(planned)** Card reset on AMD, Intel and Tenstorrent. ## Remove a dead node `DELETE /api/v1/nodes/{name}` removes the Node object of a node that is NotReady and holds nothing of ours. A Ready node is refused `E-NODE-READY`; a node that still runs our pods is refused `E-NODE-HOLDS-OURS`. ## Remnants The janitor runs every minute and finds what nothing owns any more: objects of deleted endpoints, Jobs and pods of finished runs, a pod on a lost node, old terminated pods, stale partial weight downloads. It cleans the safe ones by itself, each clean a run of kind `cleanup`. The **Activity** page lists them under **Remnants**. ```bash curl -s -H "$H" "https://cp.example.com/api/v1/remnants?all=true" curl -s -H "$H" -X POST https://cp.example.com/api/v1/remnants/<id>/clean ``` A pod on a lost node cordons that node while it is open. Cleaning it says the machine is gone or the card is free, and lifts that cordon. ## Health fencing A card with uncorrected ECC errors or an active hardware slowdown is fenced for new placements and raises `gpu.unhealthy`. By default nothing running is stopped. **(arrives in the release after 0.3.6)** **Move our workers off an unhealthy card.** Turn on the cell policy `health.autoCordon` (admin; default `false`): ```bash curl -s -H "$H" -X PUT $CP/api/v1/settings/health -d '{"autoCordon": true}' curl -s -H "$H" $CP/api/v1/settings/health # {"autoCordon": true} ``` When a card reads unhealthy in two probe readings in a row (about 40 s), the control plane moves every endpoint that has workers on that card's node off it, by a verified rollout signed `health-cordon`: the new worker is placed, prefetched and smoke-tested before the old pod goes. One unhealthy reading does nothing, and a healthy reading starts the count again. The node itself is never cordoned: other workloads on it are not ours to touch. An endpoint's last ready worker (or gang) is never moved. It stays, and the `gpu.unhealthy` alert names it: add a worker on another node and it moves on the next pass. **Check it worked:** the machine page shows *auto-cordoned* on the card, with the reason, since when, what moved (with the run) and what was kept and why. `GET /api/v1/nodes` carries the same facts as `autoCordon` on the card. The events are `gpu.auto-cordoned`, `gpu.auto-cordon-kept` and `gpu.auto-cordon-cleared`. **If it fails:** a kept endpoint says why: a run already holds it (it is tried again when that run ends), no other node can take it, or its move failed once (move it by hand with Edit plan & roll). The record ends when the card reads healthy, leaves the fleet, or the policy is turned off. Nothing that was moved is moved back. **Drill:** to rehearse it without a faulted card, set `OPODCP_DRILL_GPU_UNHEALTHY=node-a/0` (node name / card index, comma-separated) on the control plane's Deployment. That restarts the control plane, the setting is gone on the next `helm upgrade`, and the reading says it was forced. **(planned)** GPU profiling counters and Xid events (from DCGM) and CPU pinning of workers. --- title: "Troubleshooting" description: "The symptoms operators meet most often, what causes each one, and the command that fixes it, with the exact error codes and alerts." url: "https://opod.io/docs/control-plane-operate/troubleshooting/" markdown_url: "https://opod.io/docs/control-plane-operate/troubleshooting.md" section: "Operate" last_updated: "2026-10-31" --- # Troubleshooting > The symptoms operators meet most often, what causes each one, and the command that fixes it, with the exact error codes and alerts. ## In short Most problems name themselves. A refusal carries an `E-…` code, a remedy and often the exact value to set; a red doctor row names its cause; a failed run step carries the engine's last lines. This page lists the symptoms operators meet most often, by area, each with its cause and fix. Start with the three reads below, then find the symptom in the tables. ## When you need it - An endpoint does not create, does not serve, or serves errors. - The console says *Connecting…*, shows **Connect your database**, or the API answers `503`. - An alert fired and you want to know what to do about it. - A rollout, an evacuate or a drain was refused. ## Do it 1. **Ask the doctor** ```bash kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor ``` Every `✘` row is a fault. `opodcp runbook ROW` prints its causes and fixes. 2. **Read the endpoint's status** ```bash export CP=https://cp.example.com export H="Authorization: Bearer $(kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d)" curl -s -H "$H" $CP/api/v1/endpoints/<id>/status | jq '{phase, waiting, lastError, proof, scaling}' ``` `waiting` names the pod and what it waits on; `lastError` is the last thing that failed. 3. **Read the last run's steps** ```bash curl -s -H "$H" "$CP/api/v1/runs?endpoint=<id>&limit=1" | jq '.[0].steps[] | {name, state, error, code, remedies}' ``` The failed step carries `code` (the `E-…` code) and `remedies`. Find the code in the tables below or in [Error codes](https://opod.io/docs/control-plane-reference/error-codes/). ## Check it worked After a fix, the doctor has no `✘` row, the endpoint's `phase` reads `serving`, and the alert resolves by itself after three healthy observations (about 45 s). The console's **Activity** page shows `alert.resolved`. ## If it fails: the tables Most refusals are a `400 invalid` with the `E-…` code in `details.code`; a few (such as `503 E-SETUP` and `409 E-NO-NOTIFIER`) carry it in the body's `code` itself. See [Error codes](https://opod.io/docs/control-plane-reference/error-codes/) for every one. Rows marked † describe `0.3.0`. ## The control plane | Symptom | Cause | Fix | | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | | The console shows **Connect your database**; API calls answer `503 E-SETUP` † | no database, or one that does not answer, is newer, or predates the schema baseline | `curl …/api/v1/setup` names the kind; see [Doctor → state](https://opod.io/docs/control-plane-operate/doctor/) | | Calls answer `503 E-DB-UNREACHABLE` † | the database went away while running; nothing was changed | bring it back; the control plane reconnects by itself | | `helm install` fails with `Job Failed` | the preflight hook found a fatal row | run `opodcp preflight --kubeconfig …` for the full report | | `helm install` fails naming `ports.<port>` † | a connector value the chart no longer carries | `--set ports.<port>=null`, then save it on the Connectors page | | Every page reads "connecting", or `401` | the console has no credential, or the bootstrap token was rotated | sign in again; read the token from Secret `<release>-opodcp-admin` | | `401 credential_in_url` | a token was sent in a URL | send it as `Authorization: Bearer`; a stream ticket (`?ticket=`) is the only credential a URL may carry | | `opodcp doctor` exits non-zero | at least one row is red | read the `✘` rows; `opodcp runbook <row>` | | The doctor's `controllers` row reads `blocked` | the replica cannot hold its Lease | grant `coordination.k8s.io/leases`, or `OPODCP_LEADER_ELECTION=0` for one replica | | The doctor's `events` row is red on a standby replica | more than one replica and no shared event bus | connect NATS on the Connectors page, or `--set ha.nats.provide=true` | | Stored connectors not applied after a reinstall; alert `connector.sealed` † | a new install key over a kept database | `--set installKey.existingSecret=<the old key's Secret>` | | Alert `connector.failing` † | a connected port keeps failing its doctor check | the port's doctor row names the error; fix it on the Connectors page | | A connector **Verify** answers `422 E-ADAPTER-TARGET` † | the adapter is planned, not built | choose a built adapter | | A notifier test answers `409 E-NO-NOTIFIER` † | no alert sink is connected | save `OPODCP_NOTIFY_URLS` on the Connectors page | ## Creating an endpoint | Symptom | Cause | Fix | | --------------------------------------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | `E-FIT` | no card has the room; the refusal quotes the measured numbers | free a card, use `shared` with a budget, a smaller quantisation, or tensor parallel; read `details.alternatives` | | `E-AUTO-NOFIT` | no rung of the auto ladder fits | the refusal lists the need, the free GPUs, the largest card and every rung's reason | | `E-TELEMETRY-WARMING` † | the control plane just started and has not read every card | retry after `details.retryAfterS`; a run waits it out by itself | | `E-NO-ACCELERATOR`, or nothing measured | no node carries `opod.io/gpu-vendor`, or the probes are not running | `kubectl get nodes -L opod.io/gpu-vendor`; `kubectl -n opodcp get pods -l app=opodcp-gpu-telemetry -o wide` | | `E-NODE-TAINTED` | the node has a taint no pod of ours tolerates | set the `workloads.tolerations` value in `details.set` | | `E-NODE-CORDONED` | the plan names a cordoned node | `kubectl uncordon <node>`, or name another node | | `E-DISK` | the node's model cache has no room for the weights | prune the node's model cache on **Machines**, or name another node | | `E-LICENCE` | the placement is beyond the licensed GPUs | install a larger key; see [Licensing](https://opod.io/docs/control-plane/licensing/) | | `E-QUOTA` | the team's GPU quota is full | an admin raises it on **Teams & quotas** | | `E-NO-ENGINE` | no worker image for this engine and vendor | choose another engine, or set the image in `engineImages` | | `E-ENGINE-RERANK` | a rerank endpoint on an engine that cannot score documents | use an engine from `details.engines` | | `E-SHARED-VENDOR` | a shared worker on a non-NVIDIA node | use `colocation: dedicated`, or an NVIDIA node | | `E-KV-RAM` | the node's KV tiers and workers exceed its host memory | a smaller tier, or another node | | `E-KV-OFFLOAD` | a KV tier the engine, vendor or image cannot carry | use `kvOffload.tier: cpu`, or an engine from `details.engines` | | `E-TP-HEADS`, `E-PP-LAYERS` | the split does not fit the model's heads or layers | take a degree from `details.alternatives` | | `E-GANG-VENDOR` | a vLLM or SGLang gang across vendors | every part on one vendor, or llama.cpp | | `E-GANG-SUBSTRATE` | the LeaderWorkerSet controller is down | `helm upgrade --reset-then-reuse-values` restores it | | `E-MODEL-UNAPPROVED` † | the cell requires approval and the version is not approved | approve the version, or pin an approved one | | `E-RUN-ACTIVE` † | another run holds the endpoint | wait, or cancel it: `POST /api/v1/runs/{id}/cancel` | ## An endpoint that does not serve | Symptom | Cause | Fix | | ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | Stuck `converging`; `waiting` names a pod | an image pull, a long model load, or a pod that cannot schedule | read `waiting` and the run log; the **Events** tab shows what Kubernetes said | | `degraded` with `Unschedulable … node taint not tolerated` | a taint was added after placement and the pod was recreated | remove the taint, tolerate it, or evacuate the node | | `degraded` with `apply: …` | the executor's apply keeps failing (RBAC, a refused object) | the doctor's `executor` row; `helm upgrade` to the chart that matches the image | | The create fails with the engine's own error | the engine died at start inside a Running pod | the step's error carries the engine's last lines; `GET …/logs?pod=<worker>&previous=true` | | A worker never becomes Ready † | its engine never answered | restarted after `workloads.worker.startBudgetMinutes` (90); the alert `endpoint.engine-unhealthy` names the pod | | A gang's parts run, its coordinator does not | the gang did not form | **Shards → Re-form**, or `opodcp endpoint reform NAME` † | | Alert `gang.gave-up` † | the gang could not form after three tries and is parked | fix the reason in the alert, then roll out or edit the plan to ask again | | Alert `plan.node-missing` | the plan is pinned to a node that left the cluster | edit the plan to name another node | | Prefetch fails `E-HUB-TOKEN-MISSING`, `E-HUB-TOKEN-REFUSED`, `E-HUB-ACCESS-DENIED` | a gated model and no token, a bad token, or terms not accepted | see [Models](https://opod.io/docs/control-plane-endpoints/models/) | | A rollout is refused `E-UNSIGNED`, `E-SIGNATURE`, `E-UNVERIFIED` | `images.verify=enforce` and an image whose signature fails | see [Supply chain](https://opod.io/docs/control-plane-security/supply-chain/) | | A rollout holds at prefetch † | a model signature is invalid | an admin accepts or rejects: `POST /api/v1/runs/{id}/signature/accept` (or `/reject`, which fails it `E-MODEL-SIGNATURE-REJECTED`) | | A rollout fails `E-CANARY` | the canary was judged and failed; the rollout rolled back | read the step's request and error counts; fix the revision and roll again | | A rollout fails `E-EVAL-GATE` | the eval scored below `plan.eval.minScore` | fix the revision, or lower the floor | | A canary decision answers `409 E-CANARY-NOT-HOLDING` or `E-CANARY-DECIDED` | the run holds no canary, or a decision already stands | read the run; a decision is not reversed | | A cancel answers `E-RUN-FINISHED` † or `E-RUN-NOT-CANCELLABLE` † | the run already ended, or it is a delete | nothing to cancel; a delete only goes forward | | A live LoRA adapter is refused `E-LORA-RANK` | its rank is above what the engines were started for | add it to the plan and roll, or use a smaller rank | | Alert `endpoint.images-unverified` | the endpoint runs images whose signature was not verified (`images.verify=warn`) | publish the signatures and roll out again | | Alert `worker.memory-near-limit` † | a worker with a KV tier is near its memory limit | a smaller tier, or more worker memory | ## Calls to an endpoint | Symptom | Cause | Fix | | -------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | `401` | keys are required and the caller sent none, or a revoked or expired key | mint a key; check `GET /api/v1/endpoints/{id}/keys` | | `401` on every keyed call, snapshot old | `auth.maxSnapshotAgeSec` passed while the control plane was away | bring the control plane back, or set the bound to 0 | | `503` with `Retry-After` | the endpoint is full and its admission hold ran out, or it is parked and waking | raise `admission.holdMs`, add workers, or keep `floor` above 0 | | About ten seconds of `503` after a leader restart | the leader is the only front | turn on front doors (`plan.gateways.enabled`) | | Answers carry `X-Opod-Fallback` | no serving capacity; the fallback URL answered | check the endpoint's workers | | `/v1/files` or `/v1/batches` answer `501 batch_store_not_configured` | no object store for the batch API (`E-BATCH-STORE`) | connect the `batchfiles` store on the Connectors page and restart | ## Scaling | Symptom | Cause | Fix | | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- | | `status.scaling.blocked`; alert `autoscale.no-capacity` | the next worker cannot be placed | free capacity, raise the licence or quota, or add a growth shape | | Alert `autoscale.grant-below-floor` | the ledger granted fewer workers than the plan's floor | free capacity, or lower the floor | | `ceiling` below `max` | what the ledger, licence and quota approve | nothing, unless you expected more | | Alert `autoscale.scaler-unhealthy` | KEDA's operator is down or its trigger cannot reach the leader | `kubectl -n opodcp get pods -l app=keda-operator`; `--set autoscaler.adapter=embedded` takes scaling back | | `the server could not find the requested resource` applying a ScaledObject | KEDA's CRDs are gone after `substrate.keda.enabled` was toggled off | `helm template … --set substrate.keda.enabled=true \| kubectl apply --server-side -f -` | | `E-SCALER-ROWS`, or `E-SCALER-PD` † | the plan has several worker rows, or prefill/decode pairs, under `autoscaler.adapter=keda` | one row, a fixed set (`autoscale.max: 0`), or `autoscaler.adapter=embedded` | | `E-PARK-FLOOR` | parked gangs leave fewer serving than the floor | set `autoscale.floor: 0`, or unpark a gang | ## Machines | Symptom | Cause | Fix | | ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | An evacuate or drain is refused `E-LEADER-NOWHERE` | no other node may hold a leader on this one | uncordon a node, or lift an `opod.io/leaders=avoid` fence | | A drain is refused `E-DRAIN-CONFIRM` | the foreign pods on the node changed since the preview | read the preview again and send its new `confirm` token | | Removing a node is refused `E-NODE-READY` or `E-NODE-HOLDS-OURS` | the node is still Ready, or still runs our pods | cordon and evacuate it first | | Alert `node.remnant` † | pods of ours left the API without proof their processes ended; the node is cordoned | it resolves once the node is Ready long enough; check the node's kubelet | | Alert `gpu.held-outside` † | something outside opod uses a card; nothing of ours is placed there | leave it, or reset the card from **Machines** when no process is on it | | Alert `endpoint.foreign-objects`, and a create is refused `E-FIT` with `held by workloads of ours that no endpoint in this store owns` † | worker pods labelled as ours, under an endpoint id this control plane does not hold, have the node's cards; the placer counts those cards as taken | `kubectl -n opodcp get deploy,lws -l opod.io/endpoint-id=<id>` names them; delete them if nothing owns them, and the cards are free on the next 20 s read | | A card reset is refused `E-CARD-BUSY` † | a process is on the card, whoever's | stop the processes first | | Alert `gpu.unhealthy` | the probe read uncorrected ECC errors or a hardware slowdown | the card is fenced for new placements; check the hardware | | Alert `node.cache-low` | the node's model cache is nearly full | prune the cache on **Machines**; a prune while `cache.gc.mode=off` is refused `E-CACHE-GC-OFF` | ## Usage and the database | Symptom | Cause | Fix | | ------------------------------------------------------ | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | | The database keeps growing | no usage sink, retention off, or a sink that refuses | connect a sink; set `OPODCP_USAGE_RETENTION`; fix the sink or skip rows explicitly | | Alert `usage.no-sink`; the doctor's `usage` row is red | no sink, and 10,000 or more rows buffered | connect the store you keep usage in (`OPODCP_USAGE_DSN`) | | Alert `usage.sink-holding` | the sink is behind and rows are kept past retention | fix the sink, or `POST /api/v1/usage/sink/skip?before=…` as an admin | | Usage `0` rows in a sink, many in the spool | the sink's user may not create its table, or manual mode with steps pending † | Connectors → usage → **Verify** shows the grant or the SQL | --- title: "Users, roles and SSO" description: "Sign in with local users or your OIDC provider, the three roles, team scoping, machine tokens for automation, and retiring the bootstrap admin token." url: "https://opod.io/docs/control-plane-security/authentication/" markdown_url: "https://opod.io/docs/control-plane-security/authentication.md" section: "Security" last_updated: "2026-11-12" --- # Users, roles and SSO > Sign in with local users or your OIDC provider, the three roles, team scoping, machine tokens for automation, and retiring the bootstrap admin token. Every `/api/v1` call and the console's event stream need `Authorization: Bearer <token>`. A token is one of: a session from a local sign-in, a session from OIDC, a machine token (`cpt-…`), or the bootstrap admin token. Request bodies never carry credentials for these routes, and a URL never does. ## In short Right after install there is one way in: the bootstrap admin token from the chart's Secret. Give each person their own sign-in instead, either a local user or your company's SSO (OIDC), and give each program a machine token with one narrow scope. Each person gets a role (`viewer`, `operator` or `admin`), and a team if they should see only their team's endpoints. Connecting OIDC retires the shared token for people. ## When you need it - A second person needs access: create a local user, or connect OIDC. - Your company signs in with Okta, Entra ID, Google, Keycloak or another OIDC provider. - A team must see and change only its own endpoints: give its users a `team`. - A CI job must deploy plans or mint keys: give it a machine token with `plans:write` or `tokens:write`. - Doctor's `identity` row is red. ## Do it 1. **Read the bootstrap admin token** ```bash kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d > admin.token H="Authorization: Bearer $(cat admin.token)" ``` The Secret is `<fullname>-admin`. A release whose name contains `opodcp` uses that name as the full name, so release `opodcp` gives `opodcp-admin`; any other release gets `<release>-opodcp-admin`, for example `prod-opodcp-admin`. 2. **Create a local user** ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/users \ -d '{"name":"alice","password":"<a long password>","role":"operator","team":"search"}' ``` Alice now signs in on the console with that name and password. 3. **Connect OIDC** Register the redirect URL `https://cp.example.com/api/v1/auth/oidc/callback` with your provider. Then save the **identity** settings on the Connectors page, for example: ```text OPODCP_OIDC_ISSUER https://login.example.com/realms/acme OPODCP_OIDC_CLIENT_ID opod OPODCP_OIDC_CLIENT_SECRET <client secret> OPODCP_OIDC_ROLE_MAP opod-admins=admin,ml-ops=operator OPODCP_PUBLIC_URL https://cp.example.com ``` On 0.2.1 these are chart values instead: `ports.identity.oidcIssuer`, `.oidcClientId`, `.oidcClientSecretRef`, `.oidcRoleMap`, `.oidcDefaultRole` and `.publicUrl`. 4. **Give automation a machine token** Machine tokens are new in 0.3.0. ```bash opodcp token create --scope plans:write --expires-in 2160h --cp https://cp.example.com --token "$(cat admin.token)" ci-deployer ``` The token (`cpt-…`) is printed once. Store it in your CI's secret store. ## Check it worked ```bash curl -s -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/login \ -d '{"name":"alice","password":"<a long password>"}' | jq '{name, role, team}' # {"name":"alice","role":"operator","team":"search"} curl -s https://cp.example.com/api/v1/auth/methods ``` A good answer: the login returns a token with the role and team you set, and `auth/methods` lists OIDC once it is connected. The console offers **Sign in with SSO**, and the account menu shows the user's name instead of `static-admin`. Doctor's `identity` row turns green once OIDC is connected. ## If it fails | Symptom | Cause | Fix | | ------------------------------------------------------------------- | ------------------------------------------------------------------------------ | ----------------------------------------------------------------- | | `401` on every call | the token is wrong or expired, or it is sent in the URL | send `Authorization: Bearer <token>`; sign in again | | `401 credential_in_url` | `?token=` in a URL | send the header; for `/events` and downloads, use a stream ticket | | `403` | the role is too low, or the object belongs to another team | an operator or admin role; an unscoped user for cross-team work | | `429` on sign-in, with `Retry-After` | more than ten attempts at once from one address | wait; behind a proxy, list it in `api.trustedProxies` | | `409` on deleting a user | it is the last admin | create another admin first | | SSO redirects fail | the redirect URL or `OPODCP_PUBLIC_URL` does not match what the provider has | register exactly `<public URL>/api/v1/auth/oidc/callback` | | Everyone signs in as `viewer` | no group in `OPODCP_OIDC_ROLE_MAP` matches, or the groups are in another claim | fix the map; set `OPODCP_OIDC_ROLE_CLAIM` | | The control plane does not start after you cleared the admin Secret | it needs `OPODCP_ADMIN_TOKEN` or `OPODCP_BOOTSTRAP_ADMIN_PASSWORD` | restore the Secret (see the warning below) | ## Roles | Role | May | | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | `viewer` | read everything the caller's team may see | | `operator` | create, change and delete endpoints, plans, rollouts, runs, keys, models, versions and jobs; acknowledge alerts | | `admin` | users, machine tokens, the licence, connectors, alert rules, team quotas, model approval, machine actions, backup and restore, the audit chain | Every route declares its minimum role. `GET /api/v1/openapi.json` lists each operation with its role (`x-opod-role`) and scope (`x-opod-scope`). ## Local users ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/users \ -d '{"name":"alice","password":"…","role":"operator","team":"search"}' curl -s -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/login \ -d '{"name":"alice","password":"…"}' # → { token, name, role, team, expiresAt } ``` Passwords are stored as bcrypt hashes; sessions are server-side and last 24 h, and `POST /api/v1/logout` ends one. `DELETE /api/v1/users/{id}` also ends the user's sessions, and the last admin cannot be deleted (`409`). The console's **Teams & quotas** page manages users. **Sign-in is rate limited** per client address: ten attempts at once, then one every six seconds; over it, `429` with `Retry-After`. A refused credential writes an `auth.login_failed` audit row with the name tried and the address, never the password. An unknown user costs the same hash comparison as a known one, and the answer is identical. Behind an Ingress, list the proxy's CIDRs in `api.trustedProxies`, so the client address comes from `X-Forwarded-For` of those peers only. ## Single sign-on (OIDC) Save these on the Connectors page (**identity**). On 0.2.1 they are chart values under `ports.identity` (`oidcIssuer`, `oidcClientId`, `oidcClientSecretRef`, `oidcRoleMap`, `oidcDefaultRole`, `publicUrl`). Any OIDC issuer works; sign-in uses the authorization code flow with PKCE. | Setting | Meaning | | --------------------------- | -------------------------------------------------------------------------------------- | | `OPODCP_OIDC_ISSUER` | the issuer URL; its `/.well-known/openid-configuration` must be reachable from the pod | | `OPODCP_OIDC_CLIENT_ID` | the client id | | `OPODCP_OIDC_CLIENT_SECRET` | stored sealed | | `OPODCP_OIDC_ROLE_MAP` | `group=role,…`, for example `opod-admins=admin,ml-ops=operator` | | `OPODCP_OIDC_DEFAULT_ROLE` | the role of a user no group maps; default `viewer` | | `OPODCP_PUBLIC_URL` | the console's URL as browsers see it, for redirects | Through `extraEnv`: `OPODCP_OIDC_ROLE_CLAIM` (the claim carrying groups; default `groups`), `OPODCP_OIDC_TEAM_CLAIM` (the claim naming the user's team; unset = unscoped), `OPODCP_OIDC_REDIRECT_URL` (default `<public URL>/api/v1/auth/oidc/callback`). Register that redirect URL with your provider. What to set up at your provider — the client, the groups claim in the ID token for Keycloak, Okta and Entra ID, and what Verify checks — is in [Connector setup → OIDC](https://opod.io/docs/control-plane-operate/connector-setup/#single-sign-on-oidc). The console then offers **Sign in with SSO**. `GET /api/v1/auth/methods` says which methods are on. Local users keep working beside OIDC. ## Retire the bootstrap token The chart's `admin.token` is a bootstrap credential. Every action taken with it is audited as the same pseudo-user, `static-admin`, so the audit chain stays intact but says nothing about who acted. The doctor's `identity` row stays red while it works: - `BOOTSTRAP: the shared admin token is the only way in` — expected right after install. - `SHARED ROOT BESIDE REAL USERS` — people exist and the shared token still works. **Connecting OIDC retires the token**: once an issuer is configured, the token no longer signs anyone in, and SSO is the way in. Without OIDC the token keeps working beside your local users, so that a mistyped password or a new colleague never locks anyone out, and the doctor row stays red to say so. > **Do not just empty admin.token** > > Emptying `admin.token` and upgrading does not remove the token: the chart keeps the one it generated in Secret `<release>-opodcp-admin`. Clearing the `token` item in that Secret stops the control plane from starting at all (`set OPODCP_ADMIN_TOKEN or OPODCP_BOOTSTRAP_ADMIN_PASSWORD`), unless `OPODCP_BOOTSTRAP_ADMIN_PASSWORD` is set through `extraEnv`. Connect OIDC instead, and keep the Secret out of reach. `OPODCP_BOOTSTRAP_ADMIN_PASSWORD` (through `extraEnv`) makes the control plane create a local user `admin` with that password at first start. It does not retire the token either: it is the same bootstrap credential in a second form. Give automation a machine token with the narrowest scope, never a key to everything. ## Teams A user created with a `team`, or an OIDC user whose team claim names one, sees only that team's rows: endpoints, runs, jobs, keys, policies, alerts, audit rows, usage and the team's own quota. Another team's object answers `403` with a message that names neither the object nor its team. An endpoint a scoped operator creates lands in their team. Admins and users with no team are unscoped. Team names are stored trimmed and lower-case, and an absent one is `default`. A team's GPU quota (`PUT /api/v1/team-quotas`, admin) is judged on new placements only. ## Machine tokens Machine tokens are new in 0.3.0. A machine token is a program's credential where a person would sign in. Every token reads as **viewer**; its one scope may add one narrow write: | Scope | Adds | Routes | | ------------------ | ------------------------------ | ------------------------------------------------------------------------- | | `viewer` (default) | nothing | — | | `fleet` | the fleet licence fact | `PUT /api/v1/licence/fleet` | | `tokens:write` | issue and revoke endpoint keys | `POST`, `DELETE /api/v1/endpoints/{id}/keys…` | | `plans:write` | write plans and start rollouts | `PUT /api/v1/endpoints/{id}/plan`, `POST /api/v1/endpoints/{id}/rollouts` | ```bash opodcp token create --scope plans:write --expires-in 2160h --cp https://cp.example.com --token <admin token> ci-deployer opodcp token ls opodcp token revoke tok_1a2b3c4d5e6f ``` Tokens are kept as SHA-256 hashes and shown once. They do not expire unless you give `--expires-in`. A token carries no team, so a write scope acts on every endpoint of the cell. Its writes are audited as `token:<name>`. A program that needs two kinds of write holds two tokens. The console's **Teams & quotas → Machine tokens** card does the same. ## Credentials never travel in a URL `?token=` on any role-gated route is refused `401 credential_in_url`, and its value is never read or logged. The four routes a browser drives without a header (`GET /events`, `/api/v1/usage/export`, `/api/v1/audit/export`, `/api/v1/audit/chain`) accept a single-use **ticket** instead: `POST /api/v1/stream-ticket` mints one that lives 30 s, carries the caller's identity, role and team, and is spent by the first request. Scripts send the header on those routes like any other. ## API rate limit `api.rateLimit.rps` and `.burst` (off by default) give every caller one token bucket, judged after the identity resolves. Over it, `429 rate_limited` with `Retry-After`; no other caller is affected. --- title: "Network and TLS" description: "Reach endpoints from outside through your Gateway or Ingress, turn on in-cluster TLS per endpoint, and close the network with NetworkPolicies and leader isolation." url: "https://opod.io/docs/control-plane-security/network-tls/" markdown_url: "https://opod.io/docs/control-plane-security/network-tls.md" section: "Security" last_updated: "2026-10-30" --- # Network and TLS > Reach endpoints from outside through your Gateway or Ingress, turn on in-cluster TLS per endpoint, and close the network with NetworkPolicies and leader isolation. ## In short Inside the cluster, endpoints serve plain HTTP by default, and your Gateway or Ingress terminates TLS at the edge with your certificate. Give the chart a host pattern and the control plane renders one route per endpoint. If the pod network is not a trust boundary, turn on TLS per endpoint. To close the network, turn on the chart's NetworkPolicies, and leader isolation for endpoints with front doors. ## When you need it - Clients outside the cluster must reach an endpoint: set `endpoints.expose` and a host pattern. - Policy requires encryption inside the cluster: `endpoints.tls.embedded=true`. - Your CNI denies traffic by default (Cilium, for example): `networkPolicy.enabled=true`. - Only an endpoint's own pods may reach its leader's join port: `networkPolicy.leaderIsolation.enabled=true`. ## Do it 1. **Publish every endpoint on a host name** ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ --set endpoints.expose=ingress \ --set endpoints.ingress.host='{endpoint}.{cell}.example.com' \ --set endpoints.ingress.className=nginx \ --set-string endpoints.ingress.annotations.cert-manager\\.io/cluster-issuer=letsencrypt ``` The endpoint `chat` in cell `prod-east` is then `https://chat.prod-east.example.com`. `endpoints.expose` is new in 0.3.0; on 0.2.1 leave that line out: a class and a host render the Ingress. 2. **Turn on TLS inside the cluster, if you need it** ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values --set endpoints.tls.embedded=true ``` Then roll out each endpoint, so the leader and workers restart onto the certificate. 3. **Check that your cluster enforces NetworkPolicies** ```bash opodcp preflight --kubeconfig ~/.kube/config # read the network.policy row ``` `not enforced` means a policy changes nothing on this cluster. Stop here, or install a CNI that enforces them. 4. **Turn on the policies** ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ --set networkPolicy.enabled=true --set networkPolicy.leaderIsolation.enabled=true ``` On a managed Kubernetes, also name the API server's addresses in `networkPolicy.leaderIsolation.from` (example below). ## Check it worked ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints | jq -r '.[] | [.name, .publicUrl, .tlsFingerprint] | @tsv' kubectl -n opodcp get networkpolicy -l opod.io/role=leader-policy \ -o custom-columns=NAME:.metadata.name,STATE:.metadata.annotations.opod\\.io/leader-isolation ``` A good answer: each endpoint has a `publicUrl`, and a `tlsFingerprint` when embedded TLS is on. Each fronted endpoint's policy reads `isolated`; one without doors reads `open`. From a pod without the endpoint's labels, `curl -m 5 http://opodcp-ep-<name>:8080/healthz` times out. Doctor's `north-tls` and `leader-isolation` rows say the same. ## If it fails | Symptom or code | Cause | Fix | | --------------------------------------------------- | ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | | No `publicUrl` | no host pattern is set, or `expose` is `none`, or `auto` found no Gateway and no Ingress class | set `endpoints.ingress.host` and a class, or a Gateway | | `E-GATEWAY-NOT-READY` | `expose: gateway` and no Gateway is Programmed | fix the Gateway, or `expose: auto` | | Every leader policy reads `open` | no front doors on the endpoints, or nothing names the API server's source | turn on `plan.gateways`; name the source in `from` | | Rollouts fail at `probe` after isolation | the API server's source is wrong, so the control plane's calls are cut | name the right `ipBlock` in `from`; on Cilium set `policy-cidr-match-mode` to include `nodes` | | Prometheus stops scraping leaders | the scraper is not in `from` | add its namespace and pod labels to `from` | | `from` seems ignored | it does not parse, so nothing is closed | fix the YAML; doctor's `leader-isolation` row shows the error | | Requests through nginx fail once embedded TLS is on | nginx speaks HTTP to an HTTPS leader | add `nginx.ingress.kubernetes.io/backend-protocol: HTTPS` | ## TLS: yours at the edge, off inside An endpoint's leader serves **plain HTTP inside the cluster** by default. The pods, the workers and the control plane are all on your network; the hop that leaves it is yours to terminate, at your gateway, with your certificate. Commands from a leader to its workers are HMAC-signed whatever the transport. ### Reach endpoints from outside Give a host pattern; the control plane then renders **one route per endpoint**: ```yaml endpoints: expose: auto # auto · gateway · ingress · none gateway: { name: public, namespace: gateways } # "" = the one Programmed Gateway in the cluster ingress: host: "{endpoint}.{cell}.example.com" className: nginx tlsSecret: "" # or cert-manager through annotations annotations: { cert-manager.io/cluster-issuer: letsencrypt } ``` `endpoints.expose` and `endpoints.gateway` are new in 0.3.0. In 0.2.1 the control plane renders an `Ingress` per endpoint when `endpoints.ingress.className` and `.host` are set, and nothing otherwise. | `endpoints.expose` | Renders | | ------------------ | -------------------------------------------------------------------------------------------------------------------------------- | | `auto` (default) | an `HTTPRoute` on your Programmed Gateway when one exists, else an `Ingress` through `endpoints.ingress.className`, else nothing | | `gateway` | an `HTTPRoute`; every endpoint apply is refused `E-GATEWAY-NOT-READY` while no Gateway is Programmed, and so is the install | | `ingress` | an `Ingress` | | `none` | no route | No host, no route, whatever `expose` says. The control plane never creates your Gateway. The endpoint then carries `publicUrl`: `https://` when a TLS Secret or a cert-manager issuer is set, `http://` when the class terminates nothing. Preflight's `endpoints.expose` row and the doctor's `north-tls` row say which route was chosen and why. **A route to a leader that serves TLS** (`endpoints.tls.embedded: true`; from 0.3.2). The leader then answers https on 8080, so the route must speak TLS to it and check its certificate. The control plane renders that beside the route: | Route | What it adds | When the cluster cannot | | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | | `HTTPRoute` | a `BackendTLSPolicy` (Gateway API v1.4 `v1`, or `v1alpha3` on v1.2–v1.3) that trusts the endpoint's certificate, from ConfigMap `opodcp-ep-<name>-<id6>-backend-ca`, and checks the name `opodcp-ep-<name>.<namespace>.svc` | no `BackendTLSPolicy` served: no route for that endpoint | | `Ingress`, ingress-nginx class | `backend-protocol: HTTPS`, `proxy-ssl-verify: on`, `proxy-ssl-name` and `proxy-ssl-secret` (a Secret with the certificate only, never the leader's key); a value you set in `endpoints.ingress.annotations` stays | — | | `Ingress`, any other class | nothing: set your controller's backend-protocol annotation in `endpoints.ingress.annotations` (a key ending `/backend-protocol`) | no such annotation: no route for that endpoint | With `expose: gateway` or `expose: ingress` an endpoint that cannot be routed is refused `E-NORTH-BACKEND-TLS`, and so is the install. With `auto` it gets no route and no `publicUrl`, and the doctor's `north-tls` row says why. On 0.3.0 the route sends plain HTTP to the TLS port and the endpoint does not answer through it. The console's own route is separate: `ingress.enabled`, `ingress.className`, `ingress.host`, `ingress.tls`, or `ingress.gateway.*` for an `HTTPRoute`. ### Turn on TLS inside the cluster Where the pod network is **not** a trust boundary (a cluster shared between tenants), or where policy asks for encryption inside the perimeter: ```bash helm upgrade opodcp … --reset-then-reuse-values --set endpoints.tls.embedded=true ``` The control plane then mints a self-signed certificate per endpoint into its auth Secret (`tls.crt`, `tls.key`). The leader serves HTTPS on 8080, workers trust exactly that certificate, and the control plane proxies as `https`. The endpoint carries `tlsFingerprint` (SHA-256) and `tlsNotAfter`; a client pins the fingerprint or trusts `tls.crt`. | Value | Default | Meaning | | ------------------------- | ------- | ------------------------------------------------------------------------------------------------------------- | | `endpoints.tls.embedded` | `false` | mint a certificate per endpoint | | `endpoints.tls.certDays` | `3650` | validity of a minted certificate | | `endpoints.tls.renewDays` | `30` | a rollout re-mints a certificate within this many days of expiry, and restarts the leader and workers onto it | Nothing re-mints without a rollout, and the fingerprint changes when one does. The alert-rule metric `endpoint.cert_expiry_days` says when a rollout is due. An endpoint pinned to an older leader image keeps plain HTTP until a rollout re-pins it; the advisory `leader-tls` says so. Behind nginx with embedded TLS on, add `nginx.ingress.kubernetes.io/backend-protocol: HTTPS` to the annotations. ## NetworkPolicies On a default-deny CNI, nothing in the namespace can talk until a policy says so, and worker-to-leader join breaks first. `networkPolicy.enabled=true` renders the policies that keep the install working: ingress on 8080 and 8081 into our pods, egress open for DNS, registries and model hubs. With the cell door on, the door gets its own. With the KV store on, only this release's workers and control plane may reach it. **First check that anything enforces them.** Every cluster accepts a NetworkPolicy, whether or not any rule follows from it. Preflight's `network.policy` row and the doctor's `network-policy` row say *enforced* (naming the CNI), *not enforced* (flannel alone, the AWS VPC CNI without its policy agent, k3s with `--disable-network-policy`) or *unknown*. Prove it per node: run a pod, confirm it reaches a ClusterIP, apply a policy with `policyTypes: [Egress]` and `egress: []`, and check that it is cut off. ## Leader isolation The join token between a leader and its workers is a shared secret. What keeps a pod that is not part of an endpoint away from the leader's port is the network. ```bash helm upgrade opodcp … --reset-then-reuse-values --set networkPolicy.leaderIsolation.enabled=true ``` The control plane then renders one NetworkPolicy per endpoint (`<endpoint>-leader`, owned and removed with it). The leader accepts its own endpoint's pods, the API server (every control-plane call to a leader rides the API server's Service proxy), the autoscaler when the adapter is `keda`, and the peers you name. Nothing else. | Value | Default | Meaning | | ---------------------------------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | | `networkPolicy.leaderIsolation.enabled` | `false` | render the per-endpoint policies | | `.detectAPIServer` | `true` | read where the API server's connections come from off the control-plane Node objects | | `.from` | `[]` | more peers, spelled as a NetworkPolicy spells them: a Prometheus, a managed API server's addresses | | `.scaler.namespace`, `.scaler.podLabels` | release namespace, `app.kubernetes.io/name: keda-operator` | where the external autoscaler runs | ```yaml networkPolicy: leaderIsolation: enabled: true from: - ipBlock: { cidr: 198.51.100.0/28 } # a managed API server - namespaceSelector: { matchLabels: { kubernetes.io/metadata.name: monitoring } } podSelector: { matchLabels: { app.kubernetes.io/name: prometheus } } ``` Three things to know: 1. **It closes a port, not a path.** A leader serves `/v1` and its join route on one port. Only an endpoint **with front doors** can be isolated: clients call the doors, and the leader leaves the front Service. An endpoint without doors gets a policy that says `open` and why, in its `opod.io/leader-isolation-reason` annotation. 2. **A managed control plane shows no node.** With nothing detected and nothing named, every policy stays open rather than cut the control plane off from its leaders. Name the API server's source in `from`. On Cilium, an `ipBlock` matches no node unless `policy-cidr-match-mode` includes `nodes`. 3. **`from` is read strictly.** An unknown field is refused, because a misspelt selector would otherwise be an empty one, which means every pod. Nothing is closed until the list parses. The doctor's `leader-isolation` row reports every endpoint's state. To verify one: from a pod without the endpoint's labels, `curl -m 5 http://opodcp-ep-<name>:8080/healthz` must time out, and the same call from one of its workers must answer. ## Ports a leader listens on | Port | Scheme | Carries | | ---- | ------------------------------------------- | ------------------------------------------------------- | | 8080 | HTTP, or HTTPS with embedded TLS | the OpenAI API and the workers' join route | | 8081 | always plain HTTP | `/healthz`, `/readyz`, `/loadz`, `/metrics` (read-only) | | 8082 | plain HTTP, only on an InferencePool member | the whole API, admitted only to your Gateway's proxies | --- title: "Worker identity" description: "How workers prove who they are to their leader — HMAC-signed commands, join tokens, and per-worker certificates you can revoke while the pod still runs." url: "https://opod.io/docs/control-plane-security/worker-identity/" markdown_url: "https://opod.io/docs/control-plane-security/worker-identity.md" section: "Security" last_updated: "2026-10-30" --- # Worker identity > How workers prove who they are to their leader — HMAC-signed commands, join tokens, and per-worker certificates you can revoke while the pod still runs. Inside an endpoint, three things protect the hop between the leader and its workers. | Mechanism | What it does | | ---------------------- | ------------------------------------------------------------------------------------------------------------------- | | **HMAC per node** | every command from a leader to a worker is signed with a per-node secret | | **Join token** | the shared secret a worker presents to register with its leader; scoped to one endpoint | | **Worker certificate** | a named, revocable identity: a certificate signed by the endpoint's own CA, with a SPIFFE URI SAN naming the worker | Engine ports bind to `127.0.0.1` inside the worker container; the worker agent is the only exposed surface. ## In short A worker proves to its leader that it belongs to the endpoint. By default it does so with the endpoint's join token, a shared secret, and every command the leader sends it is HMAC-signed. With certificates on, each worker also gets its own certificate, signed by a CA that belongs to that one endpoint. You can then revoke one worker by name, and the leader refuses it at once, while its pod still runs. On `0.2.1` that holds only for a worker that connected after certificates were turned on: one that was already connected keeps its old connection and is not refused. From `0.3.0`, turning certificates on closes each worker's join connection once, so it reconnects with its certificate and a revocation reaches it. ## When you need it - You must be able to cut off one worker without touching the others, for example after a node is compromised. - Your security review asks for a per-workload identity rather than a shared secret. - You want workers to join with no shared secret at all: `workers.mtls=require`. ## Do it 1. **Check the current mode** ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints/<id>/worker-identities | jq '{mtls, identities: [.identities[].nodeId]}' ``` `allow` is the default: a worker with a certificate uses it, one without uses its join token. 2. **Give the workers their certificates** Roll out each endpoint once. The rollout mints the endpoint's CA and one certificate per worker slot, and restarts the workers onto them. ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints/<id>/plan > plan.json curl -s -H "$H" -H 'Content-Type: application/json' -X POST \ "https://cp.example.com/api/v1/endpoints/<id>/rollouts?note=worker%20certificates" -d @plan.json ``` 3. **Revoke one worker** ```bash curl -s -H "$H" -X POST https://cp.example.com/api/v1/endpoints/<id>/worker-identities/n_3f9a1c_0_node-a/revoke ``` The leader refuses the old certificate at once. The worker is out of service until the next rollout moves its pod onto the new certificate. 4. **Require certificates, optionally** After every endpoint has rolled once on `allow`: ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values --set workers.mtls=require ``` ## Check it worked ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints/<id>/worker-identities | jq '.identities[] | {nodeId, revoked}' ``` A good answer lists one identity per single-replica worker row, and the revoked serial under `revoked` for the worker you revoked. The event `endpoint.worker-identity-revoked` names the node, both serials and who acted; the **Activity** page shows it. ## If it fails | Symptom or code | Cause | Fix | | ------------------------------------------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | | A worker row is missing from `identities` | the row has replicas; replicas share one template and join by token | one row per node, if it needs its own identity | | `400 invalid` on revoke | the node id is not in the plan, or `workers.mtls` is `off` | copy the id from `GET …/worker-identities`; use `allow` or `require` | | `E-MTLS-REPLICAS` | `require` and a worker row with more than one replica, or `autoscale.max` above 1 | one row per node and `max: 1`, or `allow` | | `E-MTLS-GANG` | `require` and an active gang | `allow`, or single workers | | Workers stop joining after `require` | they have not rolled onto a keypair yet | set `allow`, roll every endpoint, then `require` | | `--set workers.mtls=off` still behaves as `allow` | the 0.2.1 chart does not render `off` (see the warning below) | the chart after 0.2.1; on 0.2.1, set `OPODCP_WORKER_MTLS=off` through `extraEnv` | ## Certificate posture: `workers.mtls` | Value | Effect | | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `allow` (default) | a worker that presents a certificate this endpoint's CA signed is authenticated by it; one that does not falls back to its join token | | `off` | the join token alone identifies a worker | | `require` | a join or heartbeat without a certificate is refused, and a worker pod is rendered with no join token at all | With certificates on, the control plane mints a node CA per endpoint and one certificate per worker slot. The leader reads the worker's identity from the certificate. A certificate is valid at one leader only. `workers.mtls` reaches the control plane as `OPODCP_WORKER_MTLS`. Change it with `helm upgrade --set workers.mtls=require`. > **workers.mtls=off through the 0.2.1 chart** > > The 0.2.1 chart renders `OPODCP_WORKER_MTLS` only when the value is not `off`, and the binary reads an unset variable as `allow`. So on 0.2.1, `--set workers.mtls=off` behaves as `allow`: set the variable yourself, `extraEnv: [{ name: OPODCP_WORKER_MTLS, value: "off" }]`. The chart after 0.2.1 renders every value, `off` included. ## What the control plane mints | Item | Where | Details | | ------------------ | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Node CA | the endpoint's auth Secret (`opodcp-ep-…-auth`), items `node-ca.crt` and `node-ca.key` | ECDSA P-256, valid 5 years, one per endpoint. Its public half goes to the leader in the auth snapshot | | Worker certificate | the same Secret, items `node-<node id>.crt` and `.key` | ECDSA P-256, client authentication only, valid for `endpoints.tls.certDays` (default 3650 days). Exactly one identity: the URI SAN `spiffe://<cell>.opod/opod/node/<node id>`. No DNS name | | Node id | the worker pod's `OPOD_NODE_ID` | `n_<short endpoint id>_<worker index>_<node>`, stable across restarts and unique in the endpoint | The worker pod mounts its keypair at `/etc/opod-node/tls.crt` and `tls.key` (`OPOD_NODE_CERT`, `OPOD_NODE_KEY`). Both mounts are optional, so a pod whose Secret has no keypair starts as before. The pod template carries the certificate's serial in the annotation `opod.io/node-cert-serial`, so a re-minted certificate is a template change and the next rollout rolls the pod onto it. The CA is per endpoint, not per cell. A cell CA would make every worker certificate valid at every leader, and revoking one endpoint's CA would touch the others. The first apply of an endpoint mints the CA and the certificates before it renders the pods. An endpoint created before certificates were on gets them at its next rollout. What a certificate does that a shared token cannot: - it **names** the worker, so one worker cannot register as another; - it can be **revoked**, and the revocation lands while the pod still runs; - a worker joins with no shared secret at all. ## Revoke a worker ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints/<id>/worker-identities ``` ```json { "mtls": "allow", "identities": [ { "nodeId": "n_3f9a1c_0_node-a", "node": "node-a", "worker": 0, "revoked": [] } ] } ``` A worker row with replicas holds no identity and is not listed: it joins by its token. `revoked` lists every serial the endpoint's leader refuses. ```bash curl -s -H "$H" -X POST https://cp.example.com/api/v1/endpoints/<id>/worker-identities/n_3f9a1c_0_node-a/revoke ``` Revoking is an **operator** action, like revoking a key: it stops one worker and starts nothing. What happens: 1. The control plane mints a new certificate for the slot into the Secret and records the old serial against the endpoint. 2. It pushes the auth snapshot to the leader at once. From then on the leader refuses the old serial, so the running worker can no longer heartbeat, while its pod is still up. 3. The event `endpoint.worker-identity-revoked` records the node, the revoked and new serials, and who did it. 4. The next rollout rolls the pod onto the new certificate. Until then, that worker is out of service. A node id that is not in the plan, or an install with `workers.mtls=off`, is `400 invalid` with the reason. ## The limit Every replica of one worker row shares one pod template, and so one certificate; a gang's LeaderWorkerSet has one template per role. Under `allow` such a slot simply joins by its token and holds no certificate. Under `require` it is refused by name rather than issued: - `E-MTLS-REPLICAS` — a worker row with more than one replica. Use one worker row per node. - `E-MTLS-GANG` — an active gang. Use `allow`, or single workers. ## Moving to `require` The mode reaches a leader at once through the auth snapshot, but a worker only **gets** its keypair when its pod template rolls. An install that ran on `off` must set `allow` and roll every endpoint first; `require` before those rollouts would strand every worker that has not moved. An upgrade from a release whose default was `off` rolls each endpoint's workers once onto their keypair, through the normal template-drift path. ## The join token and HMAC The join token is item `join-token` of the endpoint's auth Secret, `opodcp-ep-<name>-<id suffix>-auth`, and reaches each worker pod as `OPOD_JOIN_TOKEN` from a Secret reference. It is per endpoint: a worker of one endpoint cannot join another. Under `workers.mtls=require` the worker pod gets no join token at all. The leader signs every command it sends a worker with a per-node HMAC secret. The control plane itself never calls a worker's API. ## HMAC only on a worker's API `workers.rejectBearer=true` makes a worker's API accept HMAC-signed calls only. Leave it `false` unless your worker images are recent enough to load their model in-process; an older worker image's entrypoint loads its model over the bearer path and would never serve. It reaches a running worker only through a rollout. --- title: "Supply chain" description: "Digest-pinned images, offline cosign keyless verification against a trust list, enforce or warn, and model signature checks during prefetch." url: "https://opod.io/docs/control-plane-security/supply-chain/" markdown_url: "https://opod.io/docs/control-plane-security/supply-chain.md" section: "Security" last_updated: "2026-10-30" --- # Supply chain > Digest-pinned images, offline cosign keyless verification against a trust list, enforce or warn, and model signature checks during prefetch. ## In short Every image an endpoint runs is pinned by digest, so the bytes cannot change behind you. The control plane checks each image's cosign signature offline and compares the signer with a trust list. By default (`warn`) it records a missing or bad signature and carries on. With `enforce`, it refuses the rollout. Model repositories that publish a signature are checked the same way during prefetch (0.3.0). ## When you need it - Your policy says only signed images may run: set `images.verify=enforce`. - You pull images from a private mirror: copy the signatures with the images and add a trust entry. - You run images you build and sign yourself. - Your network has no route to the public Sigstore: `images.trustRoot=embedded`, or a private root. ## Do it 1. **See what is verified today** Open **Images & artifacts** in the console, or run the doctor: ```bash kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor # read the images-signed row ``` 2. **Add a trust entry for your own registry, if you use one** ```yaml # values-trust.yaml images: trust: - repositoryPrefix: harbor.example.com/opod/ issuer: https://token.actions.githubusercontent.com identityRegex: ^https://github\.com/opod-io/opod-core/\.github/workflows/.+@refs/(heads|tags)/.+$ ``` 3. **Turn on enforce** ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ -f values-trust.yaml --set images.verify=enforce ``` 4. **Roll out an endpoint to test it** Post the stored plan to `POST /api/v1/endpoints/{id}/rollouts`. Its `validate` step checks every image the plan runs. ## Check it worked ```bash cosign verify --certificate-identity-regexp 'https://github.com/opod-io/' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com ghcr.io/opod-io/opodcp:0.3.6 ``` A good answer: the rollout's `validate` step is `passed`, **Images & artifacts** shows `verified` for each pinned image, and no endpoint carries the alert `endpoint.images-unverified`. The `cosign` command above checks the control-plane image yourself, outside the control plane. ## If it fails | Symptom or code | Cause | Fix | | ------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | | `E-UNSIGNED` | `enforce`, and no signature is published beside the image | copy the signatures with `cosign copy`, or sign the image | | `E-SIGNATURE` with `untrusted-identity` | the signature is valid, but no trust entry allows its signer | copy the signer and issuer from the detail into an `images.trust` entry | | `E-SIGNATURE` with `bad-signature` | the image was altered, or the signature is for another digest | use the original image; find where it changed | | `E-UNVERIFIED` | the signature could not be checked: `no-trust-root` or `unsupported-format` | set a trust root; key-signed images are not supported | | The control plane does not start after a values change | an `images.trust` entry lacks a field, or its `identityRegex` does not compile | fix the entry | | A rollout holds at `prefetch` (0.3.0) | a model signature is `invalid` | an admin accepts or rejects it ([Rollouts](https://opod.io/docs/control-plane-endpoints/rollouts/#a-model-signature-that-does-not-verify)) | ## Images are pinned by digest Every engine and leader image the chart names is pinned by digest, never a rolling tag. A plan pins the images it runs when it is created (`plan.images`), and only a rollout re-pins them, so a new build never rolls pods behind an operator's back. Images are never built on cluster nodes. The **Images & artifacts** page lists every image with its pin and its signature result. ## The control plane verifies every pinned image For each pinned image the control plane verifies the cosign **keyless** signature **offline**: the Fulcio certificate chain, the transparency log's signed timestamp, and the digest the payload names. Then it matches the identity that signed against `images.trust`. | Result | Meaning | | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `verified` | the signature verifies and an allowed identity made it | | `invalid` | `bad-signature` (altered, another digest, wrong root) or `untrusted-identity` (valid, but no trust entry allows the signer) | | `present-unverified` | a signature is there and could not be verified: `no-trust-root`, or `unsupported-format` (a key-signed image, no transparency-log bundle; trusting a cosign public key is not planned until an owner asks for it) | | `absent` | no signature is published beside the image | | `unknown` | the registry could not be asked — never treated as unsigned | ### Warn or enforce `images.verify` reaches the control plane as `OPODCP_IMAGES_VERIFY`. | `images.verify` | Effect | | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `off` | never ask the registry | | `warn` (default) | verify, record `image.unsigned` or `image.unverified`, and carry on; a serving endpoint running such images carries the alert `endpoint.images-unverified` | | `enforce` | refuse a rollout whose image is invalid (`E-SIGNATURE`), unsigned (`E-UNSIGNED`) or unverifiable (`E-UNVERIFIED`); an `unknown` is never refused and always recorded | `enforce` breaks a private mirror whose copies carry no signatures. Copy with `cosign copy` first; with the signatures in the mirror, verification needs no egress. ### Who may sign Two entries are built in, and `images.trust` is **added** to them: | Repository prefix | Signed by (issuer `https://token.actions.githubusercontent.com`) | | ------------------------ | ------------------------------------------------------------------------------------------------ | | `ghcr.io/opod-io/` | a workflow of `github.com/opod-io/opod-core`, on a branch or a tag: the leader and worker images | | `ghcr.io/opod-io/opodcp` | a workflow of `github.com/opod-io/opod-cp`, on a tag only: the control plane image | Nothing else is trusted until an entry says so. Each entry needs all three fields, and `identityRegex` must compile; a bad entry stops the control plane at start rather than quietly trusting nothing: ```yaml images: trust: - repositoryPrefix: harbor.example.com/opod/ # trailing slash = everything under it issuer: https://token.actions.githubusercontent.com identityRegex: ^https://github\.com/opod-io/opod-core/\.github/workflows/.+@refs/(heads|tags)/.+$ ``` A mirror filled with `cosign copy` keeps our signatures, so its entry names our identity. A mirror you re-sign names yours. A valid signature by an identity no entry covers reads `invalid` with reason `untrusted-identity`, and the detail names the signer and the issuer, so you can copy them into an entry. Both signature layouts are read and verified: cosign's `sha256-<hex>.sig` tag, and a Sigstore bundle attached as an OCI referrer. A registry in the middle of a move can hold both. ### The trust root | Value | Meaning | | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | `images.trustRoot: auto` (default) | refresh Sigstore's public root through TUF daily when reachable, else the copy built into the binary | | `images.trustRoot: embedded` | never go online | | `images.trustRootConfigMap` | a ConfigMap in the namespace with item `trusted_root.json`: a private Sigstore, or a current root after a key rotation | For example, a cluster with no route to the public Sigstore: ```bash helm upgrade opodcp … --reset-then-reuse-values --set images.trustRoot=embedded # or a private Sigstore: kubectl -n opodcp create configmap sigstore-root --from-file=trusted_root.json helm upgrade opodcp … --reset-then-reuse-values --set images.trustRootConfigMap=sigstore-root ``` The doctor's `images-signed` row says which root is in use and how old it is. The SBOM attestation is checked for presence only on 0.3.0. From 0.3.2 it is verified like the signature: its DSSE envelope's signature by the same chain and `images.trust` identities, and its statement's subject must be the pinned digest. The Images page reads `SBOM verified`, `SBOM invalid`, `present, unverified`, `none` or `unknown`. An attestation published only as a cosign v3 referrer is not read yet. ## Model signatures Model signature checks are new in 0.3.0. Each rollout's prefetch checks whether the model repository publishes a signature (`model.sig`, OpenSSF model signing v1.0), verifies it with the same trust root, and checks every file the node will serve against the signed manifest. A signed repository's GGUF file is held to the Hub's sha256 by the fetch. Model signers are matched against the same `images.trust` list, where a model's key is `hf.co/<org>/<repo>`. Nothing is trusted for models until an entry covers the repository. | Result | Effect | | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | | `verified` | none | | `invalid` (`bad-signature`, `untrusted-identity`, `digest-mismatch`) | **the rollout holds** at prefetch until an admin accepts (load anyway; recorded for exactly that commit) or rejects (`E-MODEL-SIGNATURE-REJECTED`) | | `unverified` | signed, and no trust entry covers it; recorded | | `unsigned` | recorded | | `unknown` | the Hub could not be asked, or refused the cluster's token; recorded | A gated repository is checked with the cluster's Hub token. With `weights.skipSourceCheck`, no model signature is checked. See [Models](https://opod.io/docs/control-plane-endpoints/models/) for model approval, which is a separate gate. ## Catalog signatures `weights.catalogPubKey` (a minisign public key) makes a catalog file with a signature beside it verify against that key, and `weights.catalogRequireSigned=true` refuses an unsigned catalog file too. ## Verify the control plane yourself ```bash cosign verify --certificate-identity-regexp 'https://github.com/opod-io/' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com ghcr.io/opod-io/opodcp:0.3.6 ``` See [Releases](https://opod.io/docs/get-started/releases/). --- title: "Audit log and evidence" description: "The hash-chained audit record of every change, its filters and export, chain verification and rebase, retention, and evidence files for an auditor." url: "https://opod.io/docs/control-plane-security/audit/" markdown_url: "https://opod.io/docs/control-plane-security/audit.md" section: "Security" last_updated: "2026-11-12" --- # Audit log and evidence > The hash-chained audit record of every change, its filters and export, chain verification and rebase, retention, and evidence files for an auditor. The audit log is one record of what changed and who did it. It joins two sources: - **Leader rows**: every state-changing `/admin/v1` call a leader received (with the key name and status), and its lifecycle events: plan, auth and policy updates, node, model and shard events. - **Control-plane rows**: endpoint changes, applied plans, keys, policies, runs, alerts, sign-ins, users, tokens, settings — with the actor. Reads and heartbeats are never audit rows. Every row is also a link in a **hash chain** written in the same transaction, so a removed or edited row breaks the chain. ## In short Every change to the control plane and its leaders is written to the audit log with who did it. Each row is also a link in a hash chain, so a row that is removed or edited breaks the chain, and a check finds it. You read and export the log by filter, check the chain, keep a copy of it outside the control plane, and set how long rows are kept. ## When you need it - To answer "who changed this endpoint, and when?". - An auditor asks for the change record, for proof that it is complete, or for a list of the models you run. - Your policy requires a retention period, for example six months or a year. ## Do it 1. **Find who changed an endpoint** ```bash curl -s -H "$H" "https://cp.example.com/api/v1/audit?since=7d&source=cp&q=chat&limit=50" \ | jq -r '.[] | [.ts, .actor, .type, .subject] | @tsv' ``` 2. **Export a period as CSV** ```bash curl -s -H "$H" "https://cp.example.com/api/v1/audit/export?since=30d" -o audit.csv ``` One call returns up to 2,000 rows. For more, call again with `until=<the oldest ts you hold>`. 3. **Check the chain** ```bash curl -s -H "$H" https://cp.example.com/api/v1/audit/verify | jq '{ok, entries, headSeq, firstBadSeq}' ``` 4. **Keep a copy outside the control plane** ```bash curl -s -H "$H" https://cp.example.com/api/v1/audit/chain -o "chain-$(date +%F).jsonl" ``` Store the file where the control plane cannot write, for example a bucket with object lock. 5. **Set the retention** ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X PUT https://cp.example.com/api/v1/audit/retention -d '{"days": 365}' ``` In the release after 0.3.6 the CLI does the same: `opodcp audit retention set 365`. A lower number asks first, or takes `--yes`. `opodcp audit retention` prints the current value. See the [CLI reference](https://opod.io/docs/control-plane-reference/cli/#audit-retention). ## Check it worked A good `verify` answer has `"ok": true`, and `entries` grows as people work. `GET /api/v1/audit/retention` answers `{"days": 365, "keepAll": false}`. In the console, the **Audit log** page shows the same rows, and an admin can run the chain check there. ## If it fails | Symptom | Cause | Fix | | ------------------------------------------ | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | `400 invalid` on a read | `source` is not `leader` or `cp`, or `limit` is not a positive integer | fix the parameter | | A search misses old rows | the rows are older than the retention window | a longer `days`, or `keep-all` | | `verify` answers `"ok": false` | a link does not follow from the one before; `firstBadSeq` and `detail` say where and how | compare with your outside copy; if no row was touched, an admin may rebase | | `400` on rebase | the reason is shorter than 10 or longer than 500 characters | write a real reason | | `403` | reading the chain, verifying and rebasing need admin | an admin's token | | A browser download fails with `401` | a download by navigation cannot send the header | the console uses a stream ticket; a script sends the header | | The evidence retention report reads `fail` | the defaults keep 90 days of audit and 30 of usage | set the values it names | ## Who did it The actor (`by`) is the caller the API resolved: a local user, an SSO user by name (the first of the claims `email`, `preferred_username`, `name`, `sub`), `token:<name>` for a machine token, or `static-admin` for the bootstrap token. When no person acted, it is the control loop that did, by name: `autoscaler`, `reconciler`. Those names, `static-admin` and `dev` cannot be used as local user names. ## Read and export ```bash curl -s -H "$H" "https://cp.example.com/api/v1/audit?since=7d&source=cp&type=endpoint.&q=chat&limit=500" curl -s -H "$H" "https://cp.example.com/api/v1/audit/export?since=30d" -o audit.csv ``` | Parameter | Meaning | | --------- | ------------------------------------------------------------------------- | | `since` | RFC 3339, or `24h`, `7d` | | `until` | the cursor to page back: the `ts` of the oldest row you hold (inclusive) | | `limit` | a positive integer; default 200, at most 2,000 | | `source` | `leader` or `cp`; anything else is `400 invalid` | | `type` | a prefix, for example `key.` | | `q` | a case-insensitive substring over type, subject, endpoint, actor and data | Every filter runs in the database, so `limit` counts matching rows and a search reaches rows far older than the newest page. A row is `{ts, source, endpoint, type, subject, actor, data}`. A team-scoped caller sees only rows of its own endpoints and subjects. The CSV export (operator) takes the same filters and has columns `ts, source, endpoint, type, subject, actor, data` (`ts` in RFC 3339 with nanoseconds, `data` as JSON), up to 2,000 rows per call; page back with `until`. A browser starts it with a single-use stream ticket (`?ticket=`), because a download by navigation cannot send a header. The console's **Audit log** page loads 500 rows and **Load older** from there. From 0.3.0, the **Activity** page and `GET /api/v1/activity` show the same record classified for a person: each row a change or an event, a category, a level and a plain title, with repeats folded. ## Verify the chain Each chain entry carries `seq`, `ts`, `source` (`leader`, `cp` or `anchor`), `type`, `subject`, `actor`, `tenant`, `team`, `cell`, `data`, `prevHash` and `hash`. The hash covers the entry and the hash before it, so a removed, edited or reordered row breaks every link after it. ```bash curl -s -H "$H" https://cp.example.com/api/v1/audit/verify # admin ``` ```json { "ok": true, "entries": 18342, "head": "9c1e…", "headSeq": 18342, "anchors": 3, "from": "2026-08-01T00:00:00Z" } ``` On a broken chain `ok` is `false`, `firstBadSeq` names the first link that does not follow from the one before, and `detail` says how. `from` is the oldest entry still kept. `rebase`, when present, is the newest rebase: `seq`, `at`, `by`, `reason` and `unverifiedBefore`, the count of earlier links this answer does not vouch for. ```bash curl -s -H "$H" https://cp.example.com/api/v1/audit/chain -o chain.jsonl # admin, one entry per line ``` `verify` walks the chain inside the control plane. Keep a copy of the chain **outside** it (`/api/v1/audit/chain`, newline-delimited JSON with the hashes) and repeat the walk there: a copy the control plane cannot reach is the only check against a database that was rewritten whole. **Retention and anchors.** When retention trims old rows, the control plane first writes an `anchor` entry that records the hash of the last trimmed link. The walk restarts from it, so a trimmed chain still verifies. `anchors` counts them. **Rebase** declares the chain verified from its current head on, for a chain that became unverifiable without being touched. It appends a link carrying who decided it and why; nothing is deleted or rewritten, and `verify` then names the links it no longer vouches for. ```bash curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/audit/rebase \ -d '{"reason":"links written before the hash format change"}' ``` The reason is 10 to 500 characters; anything else is refused. The answer is `201` with the rebase entry. The console offers **Rebase** to an admin only after a walk that failed. ## Retention | Route | Meaning | | ---------------------------------------------- | --------------------------- | | `GET /api/v1/audit/retention` | `{ days, keepAll }` | | `PUT /api/v1/audit/retention {"days": 365}` | 1 to 3,650 days; default 90 | | `PUT /api/v1/audit/keep-all {"keepAll": true}` | keep every row | The `audit-retention` loop trims every 10 minutes. Plan history and run logs follow the same window, except the current revision of a live endpoint. In the release after 0.3.6, resolved alerts do too: an alert resolved before the window is deleted, with its delivery record, while its `alert.fired` and `alert.resolved` events stay as long as the audit does. An open alert is never trimmed, sticky or not. Up to and including 0.3.6, resolved alerts are never deleted, and a flapping alert adds a row on each cycle. ## Evidence for an auditor The evidence routes are new in 0.3.0. The control plane pushes nothing; your compliance tool pulls these. | Route | What it is | | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `GET /api/v1/evidence/ml-bom` (admin) | the deployed models as a **CycloneDX 1.6 ML-BOM**: one `machine-learning-model` component per distinct set of bytes an endpoint runs, with its licence, hash, approval and signature result; one service per endpoint; and the dependency between them | | `GET /api/v1/evidence/retention` | each log store's retention against six months (184 days): `pass`, `fail` (with what to set) or `unknown` | | `GET /api/v1/audit/export` | the record, CSV | | `GET /api/v1/audit/verify` | proof that the record is intact | The retention report fails on the defaults (90 days of audit, 30 days of usage) and says what to set. With a usage sink connected, the usage store reads `unknown`: the rows live in your store, whose retention the control plane cannot read. --- title: "Threat model" description: "For a security reviewer — what the control plane protects, the trust boundaries and what enforces each, outage behaviour, what it does not claim, and the residual risks." url: "https://opod.io/docs/control-plane-security/threat-model/" markdown_url: "https://opod.io/docs/control-plane-security/threat-model.md" section: "Security" last_updated: "2026-10-30" --- # Threat model > For a security reviewer — what the control plane protects, the trust boundaries and what enforces each, outage behaviour, what it does not claim, and the residual risks. Scope: the control plane (`opodcp`, its console and its Helm chart) and the endpoints it runs — one core leader and its workers per endpoint, all inside your Kubernetes cluster. ## In short This page is for a security reviewer. It lists what the control plane protects, the seven trust boundaries and what enforces each one, what keeps working when the control plane is down, and the risks that remain. The checklist below turns each boundary into a setting you can confirm on a running install. Prompts and answers are never stored: they exist only in flight. ## When you need it - Before a production go-live, or for a vendor security questionnaire. - When you decide whether the pod network is your trust boundary. - When you decide between availability and fast revocation during an outage. ## Do it: review a running install 1. **Read the doctor** ```bash kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor ``` The rows `identity`, `north-tls`, `network-policy`, `leader-isolation`, `images-signed` and `auth-snapshots` map onto boundaries B4, B1, B2, B2, B6 and B1. 2. **B1: every endpoint requires keys** ```bash for id in $(curl -s -H "$H" https://cp.example.com/api/v1/endpoints | jq -r '.[].id'); do curl -s -H "$H" https://cp.example.com/api/v1/endpoints/$id/auth | jq -c --arg id $id '{id: $id, requireKeys}' done ``` 3. **B2: workers carry certificates** ```bash curl -s -H "$H" https://cp.example.com/api/v1/endpoints/<id>/worker-identities | jq .mtls ``` `allow` or `require`. See [Worker identity](https://opod.io/docs/control-plane-security/worker-identity/). 4. **B4: people sign in as themselves** Connect OIDC, so the shared admin token no longer signs people in. Give programs scoped machine tokens. See [Users, roles and SSO](https://opod.io/docs/control-plane-security/authentication/). 5. **B6: images are enforced** ```bash helm get values opodcp -n opodcp -a | grep -A2 '^images:' # verify: enforce ``` 6. **The record is intact** ```bash curl -s -H "$H" https://cp.example.com/api/v1/audit/verify | jq .ok ``` ## Check it worked A good review ends with: every endpoint `requireKeys: true`, doctor's `identity` row green, `network-policy` reading *enforced* with `leader-isolation` on for fronted endpoints, `images.verify: enforce`, and `audit/verify` answering `true`. Each row that is not so is one line in the residual-risk table below. ## If it fails | Finding | Risk | Fix | | ------------------------------------- | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | An endpoint with `requireKeys: false` | anyone who reaches it can call the model | mint a key, then require keys ([API keys](https://opod.io/docs/control-plane-endpoints/api-keys/)) | | `identity` row red | the shared admin token is still a way in for people | connect OIDC | | `network-policy` *not enforced* | a NetworkPolicy changes nothing; the pod network is open | a CNI that enforces policies, or treat the network as untrusted and turn on `endpoints.tls.embedded` | | `images.verify: warn` | an unsigned image runs, with an alert | `enforce`, after a trust entry for every mirror | | `audit/verify` answers `false` | a row was removed or changed | compare with your outside copy of the chain ([Audit](https://opod.io/docs/control-plane-security/audit/)) | ## What we protect | Asset | Where it lives | Why it matters | | ----------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------ | | Prompts and completions | only in flight: client → leader → worker → engine | the most sensitive data; **never stored** | | Endpoint API keys | SHA-256 hashes in the endpoint's auth Secret; plaintext shown once | the right to spend GPU time and read a model's output | | Join tokens and per-node HMAC secrets | the endpoint's auth Secret | a token lets a process register as a worker of that endpoint | | Worker certificates and the endpoint's CA | the auth Secret (keypair) and the auth snapshot (public half, revoked serials) | a worker identity that can be revoked while its pod runs | | Admin credentials | the admin Secret; local users (bcrypt) or your OIDC issuer | admin can change every endpoint | | The control plane's state | your Postgres; nothing on the pod's disk | plans, key hashes, users, the audit chain, usage in transit | | Connector credentials | your Postgres, sealed with the install key (a Kubernetes Secret) | access to your sinks and services | | Model weights | the node's cache, pulled from your source | a swapped file is a swapped model | | GPU capacity | the VRAM ledger | oversubscription crashes a co-tenant | ## Trust boundaries **B1 · Caller → endpoint.** When the endpoint requires keys, the leader checks the key's hash against its mounted snapshot and honours each key's expiry locally. The leader never asks the control plane whether a key is valid. TLS from outside the cluster terminates at your Gateway or Ingress; in-cluster TLS per endpoint is available (`endpoints.tls.embedded`) and off by default. **B2 · Leader ↔ worker.** Leader-to-worker commands are HMAC-signed per node. A worker may also hold a certificate signed by its endpoint's own CA; revoking one stops the worker while its pod still runs. Engine ports bind to `127.0.0.1` in the worker. **B3 · Control plane → leader.** The control plane is never on the request path. It writes the leader's plan, auth snapshot and policy into Kubernetes objects; the kubelet syncs them into the pod and the leader applies them without a restart. A leader's admin surface always requires a key. **B4 · Operator → control plane.** Every route declares a minimum role and a tenancy scope, and a test walks the whole route table as a scoped operator. Sign-in is local users with bcrypt and server-side sessions, or OIDC with PKCE. The console sends credentials as a header, never a cookie, so a cross-site request carries none. A credential in a URL is refused. **B5 · Control plane → Kubernetes.** Server-Side Apply under its own field manager, only in its namespace, on objects it labels. Its RBAC is a namespaced Role plus a small ClusterRole, and a test fails when the chart grants more or less than the code uses. It cannot read a Secret, exec into a pod or create a workload outside its namespace. **B6 · Registry → node.** Every image is pinned by digest and its keyless signature is verified offline against a trust list. `images.verify=enforce` refuses an invalid, absent or unverifiable signature; the default `warn` records it. Model signatures are checked at prefetch; an invalid one holds the rollout for an admin. **B7 · Pods → host.** The control plane and leaders meet Pod Security `restricted`. Workers mount the model cache as `hostPath`; vendor probes read the host driver tree read-only. The one privileged path, an AMD fallback for hosts without the device plugin, is opt-in and off by default. ## Behaviour under a control-plane outage A leader serves from the plan, auth and policy it has mounted, so serving and key checks continue. **Revocation does not need the control plane either**: the snapshot is a Kubernetes Secret, so anyone with RBAC on it can append a tombstone (`opodcp key revoke --direct`), and the kubelet delivers it within about a minute. A revoked key is never un-revoked by a later snapshot. By default a leader serves from whatever snapshot it holds, for as long as it holds it. An owner who prefers revocation to availability sets `auth.maxSnapshotAgeSec`; past that age the leader refuses keyed traffic and says why. ## What we do not claim - **We do not record request content.** Prompts and completions are not logged, stored or exported. Usage carries counts. - **We do not isolate tenants on one GPU.** Two endpoints sharing a card share its memory and fault domain. Time-slicing does not isolate memory either. - **opod enforces no per-key limit.** A key is an identity. Rate limits, quotas and budgets per key, user or team are your gateway's. A caller who skips the gateway skips them, so admit only the gateway: require keys and add a NetworkPolicy. - **The pod network is your boundary.** In-cluster TLS is off by default; HMAC still authenticates every leader-to-worker command. ## Residual risks | Risk | What limits it today | What would close it | | --------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | A leaked API key works until revoked or expired | keys expire in 90 days by default; revocation reaches the leader in one kubelet sync, with or without the control plane | by design: the leader verifies locally | | A leaked join token lets a process register as a worker from anywhere that reaches the leader | per-endpoint scope; HMAC on every command; leader isolation; `workers.mtls=require` | `require` by default, which needs per-pod identity at pod start | | Anyone with write on the endpoint's Secret controls who may call it | Kubernetes RBAC; the chart grants it to the control plane only | your RBAC review | | A fail-static leader serves a key revoked in the store but not yet in its Secret | the tombstone is written on every revoke; the endpoint page shows the snapshot's age | `auth.maxSnapshotAgeSec` | | An unsigned or unexpected image runs | digest pins, signature verification, `enforce`; from 0.3.2 the SBOM attestation's signature too | `enforce` by default | | The bootstrap admin token is a long-lived bearer | a mode-600 Secret; every action in the hash-chained audit | connect OIDC, which stops the token signing people in, and give automation scoped machine tokens; emptying the token does not remove it ([Users, roles and SSO](https://opod.io/docs/control-plane-security/authentication/#retire-the-bootstrap-token)) | | The install key and the database together open stored credentials | the install key is a Secret; k3s clusters built by `opodcp infra` encrypt Secrets at rest | your provider's Secret encryption on managed clusters | | Weights are swapped on a node | atomic, exclusive fetches; a GGUF file of a signed repository is held to the Hub's sha256 | digest checks for every unsigned source | ## Reporting Report a vulnerability privately to the address in core's `SECURITY.md`. Do not open a public issue. --- title: "REST API" description: "Every route the control plane serves, grouped by resource, with the minimum role each needs, plus auth, errors, conditional writes and the event stream." url: "https://opod.io/docs/control-plane-reference/api/" markdown_url: "https://opod.io/docs/control-plane-reference/api.md" section: "Reference" last_updated: "2026-11-01" --- # REST API > Every route the control plane serves, grouped by resource, with the minimum role each needs, plus auth, errors, conditional writes and the event stream. The control plane serves its API on port 8080 under `/api/v1`, beside the console (`/`), the event stream (`/events`), `/metrics`, `/healthz` and `/readyz`. The API is JSON and changes only by adding. > **Version** > > This page describes `0.3.6`, whose routes are the same as `0.3.0`'s. These routes arrive in `0.3.0` (45 operations): `/api/v1/runs` and every `/api/v1/runs/{id}/…` action (they replace `0.2.1`'s `/api/v1/rollouts`), `/api/v1/connectors` and every `/api/v1/connectors/…` route, `/api/v1/setup`, `/api/v1/api-tokens`, `/api/v1/activity`, `/api/v1/endpoints/{id}/revisions`, `/api/v1/endpoints/{id}/kv`, `…/kv/advice` and `…/kv/tier-advice`, `/api/v1/door/auto-routes` and its keys, `/api/v1/evidence/*`, `/api/v1/usage/gpu-daily`, `/api/v1/fleet/overview`, `PUT /api/v1/licence/fleet`, `/api/v1/remnants`, `/api/v1/nodes/{name}/sharing`, `/api/v1/nodes/{name}/gpus/{index}/reset`, the model approval routes (`…/versions/{v}/approve`, `/api/v1/settings/model-approval`) and `/api/v1/openapi.json`. Outside `/api/v1`, `POST /otlp/v1/logs` (a leader's usage push) arrives in the same release, and so do the push fields of `GET /api/v1/usage/streams` and `GET /api/v1/topology/flow`. **The machine-readable copy** is an OpenAPI 3.1 document generated from the route table: `GET /api/v1/openapi.json` (viewer), or `opodcp openapi` offline. Every operation carries its minimum role (`x-opod-role`), its tenancy scope (`x-opod-scope`) and a unique command name (`x-cli-name`), so a generic CLI such as Restish can drive every route. ## In short Everything the console does, it does through this API, so a script can do it too. Send a bearer token, send and receive JSON, and read the role column to know who may call a route. A refusal always has the same body, with an `E-…` code you can script on. ## How to read this page - **Conventions** first: auth, the error body, conditional writes, rate limits. They hold for every route. - Then one table per resource. Each row is a method and a path, the **minimum role** (`public`, `viewer`, `operator`, `admin`), and what it does, with its query parameters. A path written `…/x` continues the full path given first in the same row. - The `curl` lines under a table are runnable examples; they use `$CP` and `$H` from [Conventions](#conventions). - A route that is new in 0.3.0 is listed in the Version note above. - For every field of a request or answer, read `GET /api/v1/openapi.json`, or the guide page each section links to. ## A worked example, end to end Create an endpoint, wait for it, mint a key and call the model through the control plane: ```bash CP=https://cp.example.com H="Authorization: Bearer $OPODCP_TOKEN" # 1. create (operator) → 201 with the record ID=$(curl -s -H "$H" -H 'Content-Type: application/json' -X POST "$CP/api/v1/endpoints" \ -d '{"name":"chat","model":"qwen2.5-7b-instruct","plan":{"model":{"id":"qwen2.5-7b-instruct","engine":"vllm"},"workers":[{"replicas":1}]}}' \ | jq -r .id) # 2. wait until the phase is "serving" until [ "$(curl -s -H "$H" "$CP/api/v1/endpoints/$ID/status" | jq -r .phase)" = serving ]; do sleep 10; done # 3. mint a key (operator) → 201; the plaintext "key" is in this answer only KEY=$(curl -s -H "$H" -H 'Content-Type: application/json' -X POST "$CP/api/v1/endpoints/$ID/keys" \ -d '{"name":"smoke"}' | jq -r .key) # 4. call the model through the control plane's proxy, as a client with that key would curl -s -H "$H" -H "X-Opod-Endpoint-Key: $KEY" -H 'Content-Type: application/json' \ -X POST "$CP/api/v1/endpoints/$ID/gateway/v1/chat/completions" \ -d '{"model":"qwen2.5-7b-instruct","messages":[{"role":"user","content":"hello"}]}' | jq -r '.choices[0].message.content' # 5. the usage the call left, totals and per endpoint curl -s -H "$H" "$CP/api/v1/usage/summary?endpoint=$ID" | jq . ``` A step that fails answers the common error body: for example `409 conflict` when `chat` exists, or `400` with `details.code: "E-FIT"` when it does not fit. ## Conventions **Auth.** `Authorization: Bearer <token>` on every `/api/v1` route except the public ones marked below. See [Users, roles and SSO](https://opod.io/docs/control-plane-security/authentication/). Roles: `viewer` < `operator` < `admin`. A `machine token` with a write scope reaches only the routes its scope names. **Errors.** One body: `{ "error": "<message>", "code": "invalid|not_found|conflict|unauthorized|forbidden|rate_limited|internal", "details": { … } }`. A planner refusal is a `400` with `details.code` (an `E-…` code) and `details.alternatives`. See [Error codes](https://opod.io/docs/control-plane-reference/error-codes/). `403` covers both a role too low and another team's object; the message never names that team. An unknown `/api/` path is a JSON `404`. **Conditional writes.** `PUT /api/v1/endpoints/{id}/policy` and `PUT /api/v1/alert-rules` replace a whole document. Their `GET`s carry `revision` and a strong `ETag`; send it back as `If-Match` and the write applies only while the document is unchanged, else `409` with nothing written. **Rate limits.** With `api.rateLimit.rps` above 0, each caller (a user, the admin token, an OIDC subject, a machine token) has its own token bucket of `rps` and `burst`. Over it the answer is `429 rate_limited` with `Retry-After`; no other caller is affected. It is off by default. `POST /api/v1/login` always has its own bucket per client address: ten attempts at once, then one every six seconds. The address is the TCP peer, or the right-most `X-Forwarded-For` hop that is not a proxy listed in `api.trustedProxies`; an IPv6 client is counted by its /64. Every refused sign-in publishes `auth.login_failed`. **Body limits.** Most write routes read at most 64 KiB of JSON; a larger body is `400 invalid`. **A request, end to end.** Every example below uses these two variables: ```bash CP=https://cp.example.com H="Authorization: Bearer $OPODCP_TOKEN" curl -s -H "$H" "$CP/api/v1/me" # {"name":"alice","role":"operator","team":"search"} curl -s -H "$H" "$CP/api/v1/endpoints/does-not-exist" # {"error":"…","code":"not_found"} with status 404 ``` **Downloads and the stream.** `GET /events`, `GET /api/v1/audit/export`, `GET /api/v1/audit/chain` and `GET /api/v1/usage/export` also accept `?ticket=`: a single-use ticket from `POST /api/v1/stream-ticket`, good for 30 s and carrying the caller's own role. No other route accepts a credential in the URL. **Setup mode.** With no usable database, every `/api/` call but `GET /api/v1/setup`, `GET /api/v1/doctor` and `POST /api/v1/connectors/state/verify` answers `503 E-SETUP`. A database lost while running answers `503 E-DB-UNREACHABLE`. ## Public and meta | Method and path | Role | Purpose | | --------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- | | `GET /healthz` | public | liveness | | `GET /readyz` | public | readiness; stays Ready with no database so the pod can report it | | `GET /metrics` | public | Prometheus metrics | | `GET /api/v1/setup` | public | `ready` or setup mode, its kind and sentence | | `POST /api/v1/login` | public | local sign-in `{name, password}` → `{token, name, role, team, expiresAt}` | | `GET /api/v1/auth/methods` | public | which sign-in methods are on | | `GET /api/v1/auth/oidc/start`, `GET /api/v1/auth/oidc/callback` | public | the OIDC flow; your identity provider calls the callback with `?code=&state=`, or `?error=&error_description=` on a refusal | | `POST /api/v1/logout` | viewer | end the session | | `GET /api/v1/me` | viewer | the caller: `{name, role, team}` | | `POST /api/v1/stream-ticket` | viewer | a single-use 30 s ticket for `/events` and the three downloads (see Conventions) | | `GET /api/v1/version` | viewer | version, commit, supported leader versions, where this control plane runs, `mode` | | `GET /api/v1/openapi.json` | viewer | this API as OpenAPI 3.1 | | `GET /api/v1/capabilities` | viewer | capabilities that are `partial` or `target` | | `GET /api/v1/doctor` | viewer | the doctor rows | | `GET /api/v1/controllers` | viewer | every control loop: interval, runs, errors, last run | | `GET /api/v1/cell` | viewer | the cell: name, provider, Kubernetes version, nodes, GPUs, endpoints, door URL | | `GET /api/v1/config` | admin | every `OPODCP_*` variable, redacted, with the `helm upgrade` that changes it | | `GET /api/v1/metrics/fleet` | viewer | the one-minute fleet sample the Overview plots | | `GET /events` | viewer | server-sent events (below); `?since=<seq>` (or the `Last-Event-ID` header) replays up to 1,000 missed events first | ```bash curl -s "$CP/api/v1/setup" # public: {"state":"ready"}, or setup mode's state, kind and sentence curl -s -X POST "$CP/api/v1/login" -d '{"name":"admin","password":"…"}' # {"token":"…","name":"admin","role":"admin","team":"","expiresAt":"2026-10-31T09:00:00Z"} curl -N -H "$H" "$CP/events?since=4812" # replay from event 4812, then follow ``` ## Users and machine tokens | Method and path | Role | Purpose | | ------------------------------------------------------------------------------------- | ------ | -------------------------------------------- | | `GET /api/v1/users`, `POST /api/v1/users`, `DELETE /api/v1/users/{id}` | admin | local users | | `GET /api/v1/api-tokens`, `POST /api/v1/api-tokens`, `DELETE /api/v1/api-tokens/{id}` | admin | machine tokens | | `GET /api/v1/teams` | viewer | teams with their counts, GPUs held and quota | | `GET /api/v1/team-quotas` | viewer | GPU quotas | | `PUT /api/v1/team-quotas` | admin | replace the quota set | ## Endpoints | Method and path | Role | Purpose | | ------------------------------------------------------------------ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `GET /api/v1/endpoints` | viewer | list; `?expand=plan` attaches each plan | | `POST /api/v1/endpoints` | operator | create (a run) | | `POST /api/v1/endpoints/preview` | operator | the create's dry run | | `GET /api/v1/endpoints/status` | viewer | every visible endpoint's status in one call | | `GET /api/v1/endpoints/{id}` | viewer | one endpoint, with `url`, `publicUrl`, TLS fingerprint, resilience; `?expand=plan` attaches the plan | | `DELETE /api/v1/endpoints/{id}` | operator | delete (a run; `202`) | | `GET /api/v1/endpoints/{id}/plan` | viewer | the plan | | `PUT /api/v1/endpoints/{id}/plan` | operator, `plans:write` | edit the plan; `?dryRun=true` validates only | | `POST /api/v1/endpoints/{id}/rollouts` | operator, `plans:write` | start a verified rollout with the posted plan; `?note=` | | `GET /api/v1/endpoints/{id}/revisions`, `…/revisions/{rev}` | viewer | plan history, newest first; `?before=<rev>&limit=<n>` pages it (both positive integers) | | `GET /api/v1/endpoints/{id}/status` | viewer | observed phase, proof, pods, gangs, scaling | | `GET /api/v1/endpoints/{id}/logs` | viewer | a pod's log tail: `?pod=<name>&tail=<lines>&previous=true`; `tail` defaults to 200, at most 5000; `previous=true` reads the last crashed container | | `GET /api/v1/endpoints/{id}/load` | viewer | the leader's `/loadz`; in the release after 0.3.6 also `slow_workers` | | `GET /api/v1/endpoints/{id}/registry` | viewer | the leader's own worker rows | | `GET /api/v1/endpoints/{id}/shards` | viewer | the leader's gang rows | | `POST /api/v1/endpoints/{id}/shards/reform` | operator | re-form the gangs | | `GET /api/v1/endpoints/{id}/kv`, `…/kv/advice`, `…/kv/tier-advice` | viewer | KV cache per worker and measured advice; from 0.3.2 each worker row also carries `engineVersion`, the engine's own version as its worker reports it (`0.33.0` for vLLM, `b11028-972d2313b` for a llama-server build); in the release after 0.3.6 each worker's `load` also carries `kv_xfer_bytes_total`, `kv_xfer_seconds_total`, `kv_xfers_total`, `kv_fetch_waiting_to_start`, `kv_fetch_in_progress`, `kv_fetch_loaded` (absent when not reported) | | `PUT /api/v1/endpoints/{id}/slo` | operator | state or clear the SLO; rolls nothing | | `GET /api/v1/endpoints/{id}/autoscale/stats` | viewer | what parking saved, the last wake; `?since=<RFC 3339>` | | `POST /api/v1/endpoints/{id}/adapters`, `DELETE …/adapters/{name}` | operator | add or remove a LoRA adapter live | | `PUT /api/v1/endpoints/{id}/remote-key` | operator | rotate a remote endpoint's vendor key | | `GET`, `POST /api/v1/endpoints/{id}/gateway/{path}` | viewer, operator | proxy to the endpoint's leader (`X-Opod-Endpoint-Key` picks the credential) | | `POST /api/v1/apply` | operator | create or update from a scenario document | ```bash curl -s -H "$H" "$CP/api/v1/endpoints?expand=plan" | jq '.[] | {name, engine, revision: .plan.revision}' curl -s -H "$H" "$CP/api/v1/endpoints/ep_7f3a/revisions?limit=5" curl -s -H "$H" "$CP/api/v1/endpoints/ep_7f3a/revisions?before=12&limit=5" # the page before revision 12 curl -s -H "$H" "$CP/api/v1/endpoints/ep_7f3a/logs?pod=opodcp-ep-chat-w0-6d9f&tail=500&previous=true" curl -s -H "$H" "$CP/api/v1/endpoints/ep_7f3a/autoscale/stats?since=2026-10-29T00:00:00Z" curl -s -H "$H" -X PUT "$CP/api/v1/endpoints/ep_7f3a/plan?dryRun=true" -d @plan.json # validate only curl -s -H "$H" -X POST "$CP/api/v1/endpoints/ep_7f3a/rollouts?note=vllm%200.11" -d @plan.json ``` ## Keys, auth and policy | Method and path | Role | Purpose | | ------------------------------------------------------------- | ------------------------ | -------------------------------------- | | `GET /api/v1/keys` | viewer | every key the caller may see | | `GET /api/v1/endpoints/{id}/keys` | viewer | one endpoint's keys | | `POST /api/v1/endpoints/{id}/keys` | operator, `tokens:write` | mint a key (plaintext once) | | `DELETE /api/v1/endpoints/{id}/keys/{kid}` | operator, `tokens:write` | revoke | | `GET`, `PUT /api/v1/endpoints/{id}/auth` | viewer, operator | `requireKeys` and the snapshot's state | | `GET /api/v1/endpoints/{id}/worker-identities` | viewer | worker certificates | | `POST /api/v1/endpoints/{id}/worker-identities/{node}/revoke` | operator | revoke a worker's certificate | | `GET /api/v1/policies` | viewer | every endpoint's policy | | `GET`, `PUT /api/v1/endpoints/{id}/policy` | viewer, operator | one endpoint's policy (`If-Match`) | | `GET`, `PUT /api/v1/door/auto-routes` | viewer, admin | the cell door's auto routes | | `GET`, `POST /api/v1/door/auto-routes/{name}/keys` | viewer, admin | route keys | | `DELETE /api/v1/door/auto-routes/{name}/keys/{kid}` | operator | revoke a route key | ```bash curl -s -H "$H" -X POST "$CP/api/v1/endpoints/ep_7f3a/keys" -d '{"name":"ci-bot","expiresAt":"2027-01-31T00:00:00Z"}' curl -s -H "$H" "$CP/api/v1/endpoints/ep_7f3a/policy" -D - | grep -i etag # ETag: "3f9a0c2b71de" curl -s -H "$H" -H 'If-Match: "3f9a0c2b71de"' -X PUT "$CP/api/v1/endpoints/ep_7f3a/policy" -d @policy.json ``` ## Runs | Method and path | Role | Purpose | | ----------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `GET /api/v1/runs` | viewer | list; `?kind=a,b&endpoint=<id>&limit=` | | `GET /api/v1/runs/{id}` | viewer | one run with its steps | | `GET /api/v1/runs/{id}/log` | viewer | each step's lines; `?step=&after=&format=text` | | `POST /api/v1/runs/{id}/cancel` | operator | stop and give back; `?force=true` | | `POST /api/v1/runs/{id}/rollback` | operator | roll back to the plan the run captured | | `POST /api/v1/runs/{id}/promote`, `…/abort` | operator | end an unjudged canary hold | | `POST /api/v1/runs/{id}/signature/accept`, `…/reject` | admin | decide a model signature hold | | `GET /api/v1/activity` | viewer | changes and events, classified, newest first, repeats folded. `?endpoint=<id>`, `?filter=` (`changes`, `events`, `warnings`, `create`, `edit`, `rollout`, `scale`, `delete`, `worker`, `health`, `cell`), `?actor=people\|system`, plus the audit filters below (`source`, `type`, `q`, `since`, `until`, `limit`). Pass the answer's `next` back as `until` for the next page | | `GET /api/v1/events/recent` | viewer | the last 200 lifecycle events; it takes no query parameter | ```bash curl -s -H "$H" "$CP/api/v1/runs?kind=rollout,rollback&endpoint=ep_7f3a&limit=20" curl -s -H "$H" "$CP/api/v1/runs/run_91c2/log?step=verify&after=120&format=text" curl -s -H "$H" -X POST "$CP/api/v1/runs/run_91c2/cancel?force=true" curl -s -H "$H" "$CP/api/v1/activity?endpoint=ep_7f3a&filter=rollout&actor=people&since=7d&limit=50" curl -s -H "$H" "$CP/api/v1/activity?endpoint=ep_7f3a&until=2026-10-28T14:02:11.204Z" # the next page: the previous answer's next ``` ## Models | Method and path | Role | Purpose | | ------------------------------------------------------------ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET /api/v1/models`, `GET /api/v1/models/{id}` | viewer | the registry | | `POST /api/v1/models` | operator | add a model | | `DELETE /api/v1/models/{id}` | admin | remove a model not in use | | `GET /api/v1/models/validate` | viewer | probe a Hub repo and file: `?repo=<org/name>&file=<name.gguf>`; `repo` is required | | `GET`, `POST /api/v1/models/{id}/prefetch` | viewer, operator | warm a model onto a node, or read that warm's state; `?node=<name>` (required on `GET`). In the release after 0.3.6 the answer carries `bytesPerSec` and `source` (`hub` or `mirror <url>`) once the fetch ran, and fetch Jobs use the Hub mirror (`HF_ENDPOINT`) like workers do | | `GET`, `POST /api/v1/models/{id}/versions` | viewer, operator | versions | | `POST /api/v1/models/{id}/versions/{v}/promote`, `…/archive` | operator | move a version's label | | `POST`, `DELETE /api/v1/models/{id}/versions/{v}/approve` | admin | approve or clear approval | | `GET /api/v1/models/{id}/versions/{v}/rollback/preview` | viewer | what a version rollback would do | | `POST /api/v1/models/{id}/versions/{v}/rollback` | operator | roll endpoints back to a version | | `GET`, `PUT /api/v1/settings/model-approval` | viewer, admin | `requireApproval` | | `GET`, `PUT /api/v1/settings/hub-token` | viewer, admin | the cluster's Hugging Face token (never returned) | ```bash curl -s -H "$H" "$CP/api/v1/models/validate?repo=Qwen/Qwen2.5-7B-Instruct-GGUF&file=qwen2.5-7b-instruct-q4_k_m.gguf" curl -s -H "$H" -X POST "$CP/api/v1/models/qwen2.5-7b/prefetch?node=node-b" curl -s -H "$H" "$CP/api/v1/models/qwen2.5-7b/prefetch?node=node-b" # the warm's state ``` ## Nodes and capacity | Method and path | Role | Purpose | | ------------------------------------------------------ | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET /api/v1/nodes` | viewer | nodes with cards, holders, taints, host facts. In the release after 0.3.6, each node also carries `addresses` (`[{type, address}]` from the node's status), `podCIDRs`, `podIPCapacity` (usable pod IPs in those ranges), `podIPsUsed` (pods of every namespace holding a pod IP there, not on the host network and not finished; absent when the control plane could not list pods cluster-wide), `rdmaAllocatable`, and per NIC `mtu`, `oper` (`up`, `down`, `unknown`) and the rates `rxBps`, `txBps`, `rxErrPerMin`, `txErrPerMin`, `rxDropPerMin`, `txDropPerMin`, `rateWindowSeconds`. A rate is absent until two probe samples were read, and after a counter reset | | `GET /api/v1/capacity/ledger` | viewer | the placer's ledger | | `GET /api/v1/capacity/fits` | viewer | how many more of a model fit; `?model=` | | `GET /api/v1/topology/flow` | viewer | request flow from captured facts; `?since=<RFC 3339>`. Each usage lane carries `mode` (`push` or `pull`) and `lastSeenAt`, the newest pull, push or push check, so an idle pushing leader does not read as stale | | `POST /api/v1/nodes/{name}/cordon`, `…/uncordon` | admin | cordon | | `GET /api/v1/nodes/{name}/evacuate/preview` | admin | what an evacuate or drain would move | | `POST /api/v1/nodes/{name}/evacuate` | admin | move our workloads | | `POST /api/v1/nodes/{name}/drain` | admin | evacuate, then evict the rest; `{confirm}` | | `PATCH /api/v1/nodes/{name}/labels` | admin | change `opod.io/*` labels | | `DELETE /api/v1/nodes/{name}` | admin | remove a dead node | | `POST /api/v1/nodes/{name}/sharing` | admin | time-slice or budget | | `GET /api/v1/nodes/{name}/cache`, `POST …/cache/prune` | admin | preview and prune the model cache. `?minAge=<duration>` keeps files used more recently (default `24h`, so a rollback finds its weights warm); `POST …/cache/prune?dryRun=true` answers the preview and removes nothing | | `GET`, `POST /api/v1/nodes/{name}/gpus/{index}/reset` | admin | preview and reset a card held outside opod | | `GET /api/v1/remnants` | viewer | objects nothing owns; `?all=true` | | `POST /api/v1/remnants/{id}/clean` | admin | clean one | | `POST /api/v1/nodes/{name}/report` | node token | the telemetry probe's push. In the release after 0.3.6 it answers `200` with `{meshPeers}`, the peers this node's probe measures next. In that release only a control plane outside its cluster is pushed to; one inside reads each probe itself (`POST /v1/report` on the probe pod's port 9147, signed with the node report token), so every replica sees every node | ```bash curl -s -H "$H" "$CP/api/v1/capacity/fits?model=qwen2.5-7b" curl -s -H "$H" "$CP/api/v1/topology/flow?since=2026-10-30T08:00:00Z" curl -s -H "$H" "$CP/api/v1/nodes/node-b/cache?minAge=72h" # what a prune would remove curl -s -H "$H" -X POST "$CP/api/v1/nodes/node-b/cache/prune?minAge=72h" curl -s -H "$H" "$CP/api/v1/remnants?all=true" ``` ## Compatibility and fabric | Method and path | Role | Purpose | | ------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET /api/v1/compat` | viewer | the engine × vendor capability graph; from the release after 0.3.6 also `options[]`: per engine and vendor, whether each gated endpoint-form choice (the `cpu`, `auto`, `disk` and `peer` KV tiers, a prefill/decode role, `kvEvents`) is available, with the planner's `code`, `reason`, `remedy` and the Connectors port that fixes it (`connect`); and, in the release after 0.3.6, rows for every engine (`engine: ""`) for what the install refuses — an InferencePool without its CRD, Gateway or picker; a gang across machines without the LeaderWorkerSet controller; replicas, an autoscaled max above 1 or a gang under `workers.mtls=require`; under KEDA a prefill/decode split or a second worker row with autoscale above its floor, and speculative decoding with a gang — where `with: {field, value}` names the other choice a refusal needs | | `GET /api/v1/compat/resolve` | viewer | judge one shape: `?vendor=&engine=&model=&tensor=&pipeline=&data=`; `&node=<name>` judges it on that node (and takes its vendor); `&crossNode=true` asks for a shape across machines | | `GET /api/v1/compat/verified` | viewer | proven paths | | `POST /api/v1/compat/verified` | operator | record an integration proof (what `opodcp verify` sends) | | `GET /api/v1/compat/verified/history` | viewer | the release after 0.3.6: every kept proof of one path, oldest first (the newest 50); `?pathKey=` (required). `[]` for a path with none. A withdrawn path loses its history | | `DELETE /api/v1/compat/verified` | admin | withdraw a proof; `?pathKey=` | | `GET`, `PUT /api/v1/fabric-policy` | viewer, admin | the RDMA bandwidth floor and proven domains | | `GET /api/v1/network/mesh` | viewer | the release after 0.3.6: TCP connect round trips between the GPU probes over the pod network, once a minute: `pairs[]` with `lossPct`, `rttP50Ms`, `rttP99Ms`, and a DNS lookup per node. A pair not measured is absent. Empty where the probe does not run as the node agent | | `GET /api/v1/network/policies` | viewer | the release after 0.3.6: the NetworkPolicies the control plane wrote, with their selectors and ingress rules | | `GET /api/v1/network/explain` | viewer | the release after 0.3.6: can a pod reach another on a port, answered from the NetworkPolicies of both namespaces; `allowed` is `true`, `false` or `null` (cannot be decided). Sends no packet. `from` and `to` are `<namespace>/<pod>`, or a namespace plus `fromLabels` / `toLabels` in `kubectl -l` form (`app=x,role=y`; present and empty = any pod); `port` (1–65535, required); `protocol` `TCP` (default), `UDP` or `SCTP`. `400` names what is wrong | | `GET /api/v1/images` | viewer | every configured image, its pin and signature | ```bash curl -s -H "$H" "$CP/api/v1/compat" | jq '.options[] | select(.engine=="vllm" and .value=="peer" and (.vendor // "")=="")' # why peer is not selectable curl -s -H "$H" "$CP/api/v1/compat/resolve?vendor=nvidia&engine=vllm&model=qwen2.5-32b&tensor=2" curl -s -H "$H" "$CP/api/v1/compat/resolve?node=node-a&engine=vllm&model=qwen2.5-32b&tensor=2&pipeline=2&crossNode=true" curl -s -H "$H" -X DELETE "$CP/api/v1/compat/verified?pathKey=nvidia/vllm/tp2-pp1-dp1/…" # a pathKey from GET /api/v1/compat/verified curl -s -H "$H" "$CP/api/v1/network/mesh" # the release after 0.3.6 curl -s -H "$H" "$CP/api/v1/network/explain?from=team-a&fromLabels=app%3Dclient&to=opodcp/opodcp-ep-chat-leader-0&port=8080" # the release after 0.3.6 curl -s -H "$H" "$CP/api/v1/compat/verified/history?pathKey=nvidia%2Fvllm%2Ftp1-pp2-dp1%2F…" # the release after 0.3.6 ``` ## Jobs and batches | Method and path | Role | Purpose | | ------------------------------------------------------------------ | ------------------------------------ | ----------------------------------------------------------------------------------------------- | | `GET`, `POST /api/v1/jobs` | viewer, operator | list, submit | | `GET /api/v1/jobs/{id}`, `…/logs` | viewer | read, log; `?tail=<lines>` (default 200, at most 5000) | | `POST /api/v1/jobs/{id}/cancel` | operator | cancel | | `DELETE /api/v1/jobs/{id}` | operator | delete a finished job | | `GET /api/v1/batches` | viewer | batch records | | `POST`, `GET /v1/files`; `GET /v1/files/{id}`, `…/content` | operator, viewer, or an endpoint key | OpenAI files; `GET /v1/files?purpose=batch` filters by purpose | | `POST`, `GET /v1/batches`; `GET /v1/batches/{id}`; `POST …/cancel` | operator, viewer, or an endpoint key | OpenAI batches; `GET /v1/batches?limit=<n>&after=<id>` pages the list (default 20, at most 100) | ```bash curl -s -H "$H" "$CP/api/v1/jobs/job_44a1/logs?tail=1000" curl -s -H "Authorization: Bearer sk-orc-…" "$CP/v1/files?purpose=batch" curl -s -H "Authorization: Bearer sk-orc-…" "$CP/v1/batches?limit=50&after=batch_0192" ``` ## Usage | Method and path | Role | Purpose | | ------------------------------ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET /api/v1/usage/summary` | viewer | totals and per-endpoint, model, team, worker, job; `?since=<RFC 3339>`; `?endpoint=<id>` (repeatable) narrows it. `?until=<RFC 3339>` (exclusive) is checked for its form on 0.2.1 but not applied; 0.3.0 applies it to every aggregate except `rpm60`, which is always the last hour | | `GET /api/v1/usage/export` | operator | CSV in a window: `?since=&until=` (RFC 3339; `until` not before `since`) | | `GET /api/v1/usage/gpu-daily` | viewer | GPU-hours per UTC day, JSON or CSV: `?from=YYYY-MM-DD&to=YYYY-MM-DD&format=csv` (or `Accept: text/csv`) | | `GET /api/v1/usage/streams` | viewer | how each endpoint's usage arrives: `endpoint`, `cursor`, `lastPullAt`, `lastError`, `lastBatch`, `leaderBoot`, `bootResets`; and `mode` (`push` or `pull`), `lastPushAt`, `lastSeenAt`, `pushBoot`, `pushSeq`, `missing` (see below) | | `POST /otlp/v1/logs` | the endpoint's admin token | a leader's usage push, not a user route (see below) | | `GET /api/v1/usage/retention` | viewer | the window, the sink's lag | | `POST /api/v1/usage/sink/skip` | admin | accept that the sink never gets rows before `?before=` | ```bash curl -s -H "$H" "$CP/api/v1/usage/summary?since=2026-10-01T00:00:00Z&endpoint=ep_7f3a&endpoint=ep_19bd" curl -s -H "$H" "$CP/api/v1/usage/export?since=2026-10-01T00:00:00Z&until=2026-11-01T00:00:00Z" > usage-oct.csv curl -s -H "$H" "$CP/api/v1/usage/gpu-daily?from=2026-10-01&to=2026-10-31&format=csv" > gpu-hours-oct.csv curl -s -H "$H" -X POST "$CP/api/v1/usage/sink/skip?before=2026-10-15T00:00:00Z" ``` **The usage push.** `POST /otlp/v1/logs` and the push fields are new in 0.3.0. A leader from core v0.4.0 (feature `usage_push`) sends its usage records here as OTLP/HTTP protobuf, and the control plane pulls only a leader without that feature. The control plane renders the URL and the credential into every leader, so you never call this route yourself: ```text POST /otlp/v1/logs Content-Type: application/x-protobuf Authorization: Bearer <the endpoint's admin token> X-Opod-Endpoint: <endpoint id> ``` | Answer | Meaning | | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `200` | Stored. A resend of the same (`opod.leader.boot`, `opod.usage.seq`) is one row. `partialSuccess.rejectedLogRecords` counts records with no key, which the leader drops. | | `400` | The body is not an `ExportLogsServiceRequest`. The leader drops the batch. | | `401`, `404`, `415` | Wrong token, unknown endpoint, not protobuf. The leader keeps the records and sends them again. | | `413` | The body is larger than 4 MiB; a leader sends at most 1 MiB. | | `503` + `Retry-After: 10` | The control plane has just started and has not yet read the endpoint's workers. The leader sends again. | In `GET /api/v1/usage/streams`, `mode` is `push` or `pull`. `lastSeenAt` is the newest pull, push or push check: it says the lane works, because an idle pushing leader sends nothing. `pushBoot` and `pushSeq` are the leader boot and sequence last stored. `missing` counts the sequences of one boot that never arrived, which are the records the leader dropped at its queue's cap. The record is kept in the state store, so with `replicas` above 1 every replica answers the same, whichever one took the pushes or runs the pull. A leader restart loses what it held and shows as a new `pushBoot`, not in `missing`. A leader that pushed in the last 2 minutes is not pulled. ## Alerts, audit and evidence | Method and path | Role | Purpose | | ------------------------------------------------------------------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET /api/v1/alerts`, `GET /api/v1/alerts/{id}` | viewer | alerts; `?state=open\|resolved\|all`, `?object=endpoints/<id>` (exact), `?since=<RFC 3339>`, `?limit=<n>` (default 200) | | `POST /api/v1/alerts/{id}/ack` | operator | acknowledge | | `GET`, `PUT /api/v1/alert-rules` | viewer, admin | your alert rules (`If-Match`) | | `GET /api/v1/audit` | viewer | the audit record. `?source=leader\|cp`, `?type=<prefix>`, `?q=<text>` (case-insensitive, over type, subject, endpoint, actor and data), `?since=` (RFC 3339 or a duration back from now: `24h`, `7d`), `?until=<RFC 3339>` (inclusive cursor for older rows), `?limit=` (default 200, at most 2000) | | `GET /api/v1/audit/export` | operator | CSV, with the same filters as `GET /api/v1/audit` | | `GET /api/v1/audit/verify`, `GET /api/v1/audit/chain` | admin | walk the chain, export it | | `POST /api/v1/audit/rebase` | admin | declare the chain verified from its head | | `GET`, `PUT /api/v1/audit/retention`; `PUT /api/v1/audit/keep-all` | viewer, admin | audit retention | | `GET /api/v1/evidence/ml-bom` | admin | CycloneDX 1.6 ML-BOM of deployed models | | `GET /api/v1/evidence/retention` | viewer | log retention against six months | ```bash curl -s -H "$H" "$CP/api/v1/alerts?state=open&object=endpoints/ep_7f3a&limit=20" curl -s -H "$H" "$CP/api/v1/audit?source=cp&type=key.&q=ci-bot&since=24h" curl -s -H "$H" "$CP/api/v1/audit?until=2026-10-29T10:12:00.512Z&limit=200" # older rows curl -s -H "$H" "$CP/api/v1/audit/export?type=auth.&since=30d" > auth-30d.csv ``` ## Connectors, licence, fleet and store | Method and path | Role | Purpose | | ---------------------------------------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET /api/v1/connectors` | viewer | every port, its adapters and settings | | `POST /api/v1/connectors/{port}/verify` | admin | check the running adapter or a candidate | | `POST /api/v1/connectors/state/verify` | the admin token, in setup mode | check a candidate database before you set it: `{"fields": {"dsn": "postgres://…"}}` → `{port, ok, kind, detail}`. Outside setup mode the `{port}` route above answers the same path | | `PUT /api/v1/connectors/{port}/settings` | admin | save settings into the database; the replica that served it restarts (in the release after 0.3.6, every replica within about 15 s, and one following a run once that run ends, at most 3 min) | | `POST /api/v1/connectors/notifier/test` | admin | send a TEST alert to every sink | | `POST /api/v1/connectors/secrets/sync` | admin | record every existing token in the secret store | | `GET`, `PUT /api/v1/licence` | viewer, admin | the tier; install or clear a key | | `PUT /api/v1/licence/fleet` | admin, `fleet` token | the fleet's licence fact | | `GET /api/v1/fleet/overview` | viewer | fleet mode only | | `GET /api/v1/backup` | admin | a JSON-lines dump | | `POST /api/v1/restore` | admin | restore a dump; `?wipe=1` | ```bash curl -s -H "$H" "$CP/api/v1/backup" > opodcp-backup.jsonl curl -s -H "$H" -X POST "$CP/api/v1/restore?wipe=1" --data-binary @opodcp-backup.jsonl ``` ## Events `GET /events` is a server-sent event stream: `event: <type>` and `data: {"ts","type","subject","data"}`, with a heartbeat comment every 15 s. A browser authenticates with a stream ticket (`?ticket=`); a script sends the header. Types include `endpoint.created`, `endpoint.updated`, `endpoint.deleted`, `plan.applied`, `status.changed`, `run.started`, `run.step`, `run.step-progress`, `run.finished`, `alert.fired`, `alert.resolved`, `alert.acked`, `licence.updated`, `model.added`, `model.deleted`, `key.created`, `key.revoked`, `auth.login`, `auth.login_failed`, `user.created`, `auth.user_deleted`, `endpoint.cert-renewed`, `endpoint.template-drift`, `connector.saved`, `connector.changed`. --- title: "opodcp CLI" description: "Every opodcp command and flag, with its type, default and a runnable example — install, preflight, audit, serve, doctor, keys, tokens, endpoints, models, scenarios, backup, restore, licence and more." url: "https://opod.io/docs/control-plane-reference/cli/" markdown_url: "https://opod.io/docs/control-plane-reference/cli.md" section: "Reference" last_updated: "2026-11-14" --- # opodcp CLI > Every opodcp command and flag, with its type, default and a runnable example — install, preflight, audit, serve, doctor, keys, tokens, endpoints, models, scenarios, backup, restore, licence and more. `opodcp` is one binary: the control plane itself (`serve`) and the commands that drive it. It ships inside the image. ```bash docker run --rm ghcr.io/opod-io/opodcp:<version> -h # every command docker run --rm ghcr.io/opod-io/opodcp:<version> endpoint autoscale -h # one command's purpose, flags and examples kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor # inside the running pod ``` `-h` on any command prints its purpose, its usage lines, its flags and examples, and exits 0. A command made of verbs (`key`, `endpoint`, `model`, …) prints its help when the verb is missing. Exit status is `0` done, `1` the command failed, `2` an unknown command or verb. From the release after 0.3.6, `2` is also every usage error — a bad flag or value, a missing or extra argument — said in one line on stderr, `error: <what is wrong> — opodcp <command> -h for every flag`; before, a missing argument exited `1` and a bad flag printed the whole help on stdout. Flags are listed as `--name`, and help screens say in words what they used to cite by an internal number. Flags take one dash or two (`-f` and `--f` are the same) and go before the positional arguments: `opodcp key create --endpoint chat ci-bot`, not `opodcp key create ci-bot --endpoint chat`. Only `restore` accepts its file on either side of `--wipe`. A `duration` is Go's form: `90s`, `20m`, `720h`. > **Version** > > This page describes `0.3.6`. `endpoint policy --load-refresh` is new in `0.3.3`. From `0.3.1` the `--namespace` defaults are `opodcp` (`opodcp-audit` for `audit`); `0.3.0` used `opod` and `opod-audit`. The `0.2.1` binary has `infra`, `preflight`, `audit`, `serve`, `doctor`, `key`, `apply`, `verify`, `backup`, `restore`, `runbook`, `images`, `selfcheck`, `licence`, `node-agent` and `version`. These are new in `0.3.0`: `token`, `endpoint`, `door`, `preview`, `node`, `nodes`, `model`, `store`, `secrets`, `ha`, `openapi` and `completion`, and the flags `preflight --leader-pool`, `preflight --replicas` and `serve --mode`. ## In short One binary does it all. On a laptop or a jump host, `opodcp` installs a cluster on bare machines, checks that a cluster is ready, and drives a running control plane through its API. In the control plane's pod, `opodcp serve` is the control plane itself, and `opodcp doctor` says what is wrong with it. ## How to read this page - Each section is one command or one family of verbs. Its table lists every flag with its type, its default and what it does, followed by runnable examples. - Commands that call the API share `--cp` and `--token`, set once in [Talking to a control plane](#talking-to-a-control-plane). - A command or flag that is new in 0.3.0 is listed in the Version note above. - `-h` on any command prints the same flags from the binary you hold. When this page and `-h` disagree, `-h` is right for your version. ## A worked example, end to end From bare machines to a verified endpoint, with commands that are all in 0.2.1: ```bash # 1. bare machines → a k3s cluster (skip both on EKS, GKE or AKS) opodcp infra plan -f machines.yaml # host facts and the host gate; changes nothing opodcp infra up -f machines.yaml # k3s server and agents, labels, kubeconfig # 2. is the cluster ready for the chart? (infra up wrote the kubeconfig to ~/.opodcp/<cell>/kubeconfig) export KUBECONFIG=~/.opodcp/prod-east/kubeconfig opodcp preflight # 3. install, then check from inside the pod helm install opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --create-namespace --set cell.name=prod-east kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor # 4. point the CLI at the control plane, once per shell export OPODCP_URL=https://cp.example.com export OPODCP_TOKEN="$(kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d)" # 5. create an endpoint from a scenario, wait for it, and prove it answers opodcp apply -f scenario.yaml opodcp verify -f scenario.yaml --out report.json # 6. a key for the first client; the key alone goes to stdout opodcp key create --endpoint chat-rag --expires-in 720h first-app > first-app.key ``` The scenario file is the one in [Create an endpoint → From the CLI](https://opod.io/docs/control-plane-endpoints/create/#from-the-cli). Each command exits `0` when it is done and `1` when it failed, so the block runs as a script with `set -e`. ## Talking to a control plane Every command that calls the API takes the same two flags. | Flag | Type | Default | Meaning | | --------- | ------ | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | `--cp` | string | `$OPODCP_URL`, else `http://127.0.0.1:8080` | the control plane's URL | | `--token` | string | `$OPODCP_TOKEN`, else `$OPODCP_ADMIN_TOKEN` | the bearer token: a user's session token, the admin token or a machine token | | `--ca` | file | the system's roots | a PEM file of the CA that signed the control plane's certificate, for a private CA. Arrives in the release after 0.3.6 | The commands that take them: `apply`, `verify`, `preview`, `key create`, `key revoke`, `token *`, `node label`, `nodes`, `endpoint *`, `model *` and `secrets sync`. Inside the control plane's own pod the admin token is already in the environment. A token default is never printed on a help screen. ```bash # from a laptop, once per shell export OPODCP_URL=https://cp.example.com export OPODCP_TOKEN="$(cat ~/.opod/cp.token)" opodcp nodes # uses both variables opodcp nodes --cp http://localhost:8080 --token "$ADMIN" # flags win over the variables opodcp nodes --cp https://cp.example.com --ca ./cp-ca.pem # a control plane behind a private CA ``` From the release after 0.3.6, a failed call says what failed, why and what to do, on stderr with exit 1: | What happened | What it prints | | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | no token was sent (401) | `<verb>: the control plane at <url> needs a token and none was sent — pass --token or set OPODCP_TOKEN; the admin token is Secret opodcp-admin in namespace opodcp (kubectl …)` | | the token was not accepted (401) | `<verb>: the control plane at <url> did not accept the token (<reason>) — pass --token or set OPODCP_TOKEN; the admin token is Secret opodcp-admin in namespace opodcp (kubectl …)` | | the token's role may not do it (403) | `<verb>: the control plane refused it for this token (<reason>) — use a token whose role may do this …` | | the planner refused it | `<verb>: <reason> [E-…]`, then `would pass: …` and, when the refusal names a Helm value, `set: --set …` | | it changed since it was read (409) | `<verb>: <reason>`, then `it changed since it was read, or a run holds it — read it again and retry` | | the answer is not the control plane's JSON (a proxy page, an empty 5xx) | `<verb>: the server at <url> answered HTTP 502, not the control plane's JSON — is --cp the control plane? (it said: …)` | | nothing answered | `<METHOD> <path>: no control plane at <url> (<cause>) — pass --cp URL or set OPODCP_URL` | | the certificate is not trusted | `<METHOD> <path>: the certificate of <url> is not trusted (…) — pass --ca FILE, the CA that signed it` | | no answer in 150 s | after 10 s, `waiting for the control plane at <url> to answer <METHOD> <path>… (gives up after 2m30s)`; then `no answer from <url> in 2m30s — the control plane may be overloaded or the tunnel down (opodcp doctor --cp <url>)` | Before it, these printed the route, the status and the raw JSON body (`/api/v1/nodes: 401 {"code":"unauthorized",…}`) or Go's bare dial or certificate error. ### JSON output From the release after 0.3.6, every list and show verb that talks to a control plane takes `--json`: `nodes`, `endpoint placement | autoscale | kv | policy | expose | speculative`, `door routes`, `preview`, `apply`, `doctor`, `token ls | create`, `key create`, `model versions` and `secrets sync`. Stdout is then the control plane's answer as JSON and nothing else; a sentence a person reads (`… set, plan revision 4`, `already … — nothing changed`, `next: …`) goes to stderr. The exit code is the same as without `--json`. In 0.3.6 only `token ls` and `model versions` (and the `infra`, `preflight` and `audit` reports) take it. ```bash opodcp endpoint kv --json chat | jq '.workers[].kvOffload' opodcp doctor --json | jq -r '.[] | select(.ok | not) | .port' ``` ## Install and inspect a cluster ### `infra plan | up | verify | down` Build a k3s cell on bare machines over SSH. See [Bare machines](https://opod.io/docs/control-plane-install/bare-metal/). Every verb takes the same flags. | Flag | Type | Default | Meaning | | -------------------- | -------- | ----------------------- | ----------------------------------------------------------------------------------------------- | | `-f` | string | `machines.yaml` | the inventory file | | `--local` | bool | `false` | the server is this machine: its steps run here, the agents over SSH | | `--state` | string | `~/.opodcp/<cell>` | the state directory: the run log and the kubeconfig | | `--json` | bool | `false` | print the run as JSON on stdout | | `--timeout` | duration | `20m` | the limit for each remote command | | `--yes` | bool | `false` | skip the confirmation of `down` | | `--known-hosts` | string | `~/.opodcp/known_hosts` | the SSH known_hosts file the installer keeps; a machine may also pin `hostKey` in the inventory | | `--strict-host-keys` | bool | `false` | refuse a host whose key is neither pinned nor already known (no trust on first use) | `plan` gathers facts and runs the host gate with no change. `up` converges. `verify` runs the host gate and then, once a kubeconfig exists in the state directory, the cluster preflight. `down` uninstalls k3s from every machine after it asks. ```bash opodcp infra plan -f machines.yaml opodcp infra up -f machines.yaml --local --strict-host-keys --timeout 30m opodcp infra verify -f machines.yaml --json > verify.json opodcp infra down -f machines.yaml --yes ``` ### `preflight` Is this cluster ready for `helm install opodcp`? Every flag and every row is on [Preflight](https://opod.io/docs/control-plane-install/preflight/#flags): `--kubeconfig` (string, `$KUBECONFIG`), `--json` (bool), `--namespace` (string, `$OPODCP_NAMESPACE`, else `opodcp`), `--cloud` (string, `$OPODCP_CLOUD`, else `onprem`), `--upgrade` (bool), `--leader-pool` (string, `$OPODCP_LEADER_POOL`) and `--replicas` (int, `1`). ```bash opodcp preflight --kubeconfig ~/.kube/config opodcp preflight --replicas 2 --leader-pool opod.io/pool=fronts opodcp preflight --json | jq '.[] | select(.pass == false)' ``` ### `audit` A read-only idle-VRAM report on any cluster. It needs no licence, and it removes everything it creates. From the release after 0.3.6 `audit` prints one line per sample, and Ctrl-C says it wrote no report and that the probe namespace was removed. | Flag | Type | Default | Meaning | | -------------- | -------- | -------------- | --------------------------------------------------------------------- | | `--kubeconfig` | string | `$KUBECONFIG` | kubeconfig path; empty = in-cluster | | `--namespace` | string | `opodcp-audit` | the throwaway namespace for the probe pods, created and removed | | `--duration` | duration | `60s` | how long to sample; one sample every 10 s | | `--price` | float | `0` | your price per GPU-hour, to price the idle VRAM; `0` = GPU-hours only | | `--json` | bool | `false` | JSON output | | `--keep` | bool | `false` | leave the probe pods and the namespace in place | ```bash opodcp audit --kubeconfig ~/.kube/config opodcp audit --duration 5m --price 2.10 --json > audit.json ``` ### `audit retention` How many days the control plane keeps its audit records, read or set through `GET` and `PUT /api/v1/audit/retention`. It arrives in the release after 0.3.6; on 0.3.6, use the API or the console's **Audit log** page. `opodcp audit` with no verb is still the idle-VRAM report above. | Form | Flag | Type | Default | Meaning | | ------------------------------------------ | -------- | ---- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `audit retention` or `audit retention get` | `--json` | bool | `false` | print `{days, keepAll}`; the default is 90 days | | `audit retention set DAYS` | — | | | 1 to 3,650 days. Setting needs an admin's `--token`. The same number again says `already 90 days — nothing changed` and sends nothing | | `audit retention set DAYS` | `--yes` | bool | `false` | a lower number deletes the older records within 10 minutes, so it asks `[y/N]` on a terminal; without a terminal it refuses and names the command with `--yes` | When the never-trim mode is on (`keepAll`), both forms say so: nothing is deleted, whatever the days say. The trim and what follows its window are on [Audit](https://opod.io/docs/control-plane-security/audit/). ```bash opodcp audit retention # audit records are kept 90 days; the trim runs every 10 minutes # change it: opodcp audit retention set 180 opodcp audit retention set 365 opodcp audit retention set --yes 30 # lower: records older than 30 days go within 10 minutes opodcp audit retention --json | jq .days ``` ## Run and check ### `serve` The control plane. It reads its settings from `OPODCP_*` variables; the chart is how it is normally started. `serve -h` lists every variable it reads, and [Configuration](https://opod.io/docs/control-plane-install/configuration/#environment-variables) explains each one. | Flag | Type | Default | Meaning | | -------- | ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `--mode` | string | `$OPODCP_MODE`, else `cell` | `cell` manages this cluster; `fleet` reads the cells in `OPODCP_FLEET_CELLS` and manages none. See [Fleet](https://opod.io/docs/control-plane/fleet/) | ```bash OPODCP_ADDR=:9090 OPODCP_CELL=lab KUBECONFIG=~/.kube/config opodcp serve OPODCP_FLEET_CELLS='[{"name":"lab","url":"https://lab.example.com","tokenFile":"lab.token"}]' opodcp serve --mode fleet ``` ### `doctor` Every port and check: embedded or connected, green or red. See [Doctor](https://opod.io/docs/control-plane-operate/doctor/). | Flag | Type | Default | Meaning | | --------- | ------ | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `--cp` | string | `$OPODCP_URL`, else this machine's `OPODCP_ADDR` on localhost | the control plane to ask, as every other command spells it (is new in 0.3.0) | | `--url` | string | the same | the same as `--cp`, its older name; the only spelling on 0.2.1 | | `--token` | string | `$OPODCP_TOKEN`, else `$OPODCP_ADMIN_TOKEN` (0.3.6: `$OPODCP_ADMIN_TOKEN` only) | the admin token for that control plane | | `--ca` | string | the system's roots | the CA of a private certificate (the release after 0.3.6) | | `--local` | bool | `false` | ask no running control plane; report only what this process can see | A control plane you name with `--cp`, `--url` or `OPODCP_URL` that does not answer is an error that ends `for what this machine alone can see: opodcp doctor --local`. Only the default address falls back to a local report. In 0.3.6 `--cp` fell back too; the fix arrives in the release after 0.3.6. ```bash opodcp doctor --cp https://cp.example.com --token "$ADMIN" # --url on 0.2.1 kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor opodcp doctor --local ``` ### Commands with no flags | Command | Purpose | | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | `opodcp runbook [port]` | the runbook: every doctor row's symptom, cause and remedy; with a port name, that port's entry only | | `opodcp openapi` | the API's OpenAPI 3.1 document, YAML on stdout. A running control plane serves the same document at `GET /api/v1/openapi.json` | | `opodcp images matrix` | the engine × vendor image matrix the executor uses, as YAML: each pair's configured image, or `TARGET`, and the telemetry probes | | `opodcp selfcheck` | can this binary render, deep-copy and reconcile what an apply needs, against a loopback API; it needs no cluster | | `opodcp version` | version and commit | | `opodcp completion bash\|zsh\|fish` | a shell completion script for every command and verb | ```bash opodcp runbook state opodcp runbook > RUNBOOK.md opodcp openapi > openapi.yaml opodcp images matrix opodcp selfcheck opodcp version eval "$(opodcp completion bash)" # ~/.bashrc (bash 3.2, the macOS default, cannot source <(…)) source <(opodcp completion zsh) # ~/.zshrc opodcp completion fish | source # ~/.config/fish/config.fish ``` ## Endpoints ### `preview`, `apply`, `verify` | Command | Flag | Type | Default | Meaning | | --------- | ----------- | ------ | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `preview` | `-f` | string | none (required) | the create body as JSON, `{name, model, plan}`: what `POST /api/v1/endpoints` takes; from the release after 0.3.6 also a scenario document, judged as `apply --dry-run` judges it | | `apply` | `-f` | string | none (required) | a scenario document, YAML or JSON | | `apply` | `--dry-run` | bool | `false` | judge the file as `apply` would and write nothing (the release after 0.3.6) | | `verify` | `-f` | string | none (required) | the same scenario document | | `verify` | `--out` | string | `""` | write the JSON report to this file | `preview` is the create's dry run: the claims, the nodes the leader and doors are pinned to, and the advisories. It writes nothing. `apply` creates or updates the endpoint the scenario names, and from the release after 0.3.6 ends with `next: opodcp verify -f FILE`. `apply --dry-run` previews a new endpoint with `POST /api/v1/endpoints/preview` and checks an existing endpoint's plan with `PUT /api/v1/endpoints/{id}/plan?dryRun=true`, so its own claims are not counted twice; it does not apply a `setup` block. `verify` waits for it to serve, sends a chat and runs the scenario's `verify` block (balance, autoscale). See [Create an endpoint](https://opod.io/docs/control-plane-endpoints/create/). ```bash opodcp preview -f chat.json opodcp apply --dry-run -f scenario.yaml # the file you apply, judged; nothing written (the release after 0.3.6) opodcp apply -f scenario.yaml --cp https://cp.example.com opodcp verify -f scenario.yaml --out report.json ``` ### `endpoint create` Arrives in the release after 0.3.6. `endpoint create NAME` builds the body the console's create form sends, asks the create's dry run (`POST /api/v1/endpoints/preview`), prints where each worker lands, and then creates. A refusal is the preview's, with its code and what would pass, and nothing is created. Without `--node` the control plane places it (auto); with `--node` the one worker is yours to shape. | Flag | Type | Default | Meaning | | ------------- | ------ | --------------- | ---------------------------------------------------------------------- | | `--model` | string | none (required) | the catalog model id | | `--node` | string | `""` | place the worker on this node (explicit); empty = auto | | `--engine` | string | `""` | `vllm`, `llamacpp`, `sglang` …; empty = the catalog's choice | | `--shared` | bool | `false` | pack the worker on one card by a VRAM budget | | `--budget-gb` | int | `0` | with `--shared`: the VRAM budget, GB (required then) | | `--gpu` | int | `0` | with `--shared` and `--node`: the card the budget goes on | | `--tp` | int | `1` | with `--node`: tensor parallel over this many cards | | `--replicas` | int | `1` | with `--node`: copies of the worker | | `--dry-run` | bool | `false` | print the preview and create nothing | | `--json` | bool | `false` | print the created endpoint (or, with `--dry-run`, the preview) as JSON | ```bash opodcp endpoint create --model qwen2.5-7b --dry-run chat # where it would land opodcp endpoint create --model qwen2.5-7b chat # auto placement opodcp endpoint create --model qwen2.5-7b --node node-a --engine vllm --tp 2 chat opodcp endpoint create --model qwen2.5-0.5b-gguf --shared --budget-gb 4 --node node-c --gpu 1 small ``` ### `endpoint rollout | reform | doors | placement | autoscale` Each verb takes one endpoint `NAME` (or id) after its flags. | Verb | Flag | Type | Default | Meaning | | ----------- | ------------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `rollout` | `--note` | string | `""` | the one-line reason the run records | | `rollout` | `--wait` | bool | `false` | follow the run to its end; exit non-zero unless it succeeded. From the release after 0.3.6 it prints each step as it changes; Ctrl-C prints `stopped waiting; run <id> continues on the control plane`, and a `--timeout` that runs out says the same — the run is never stopped by the CLI | | `rollout` | `--timeout` | duration | `20m` | with `--wait` only: how long to follow the run | | `reform` | — | | | re-form the endpoint's gangs (the console's **Shards → Re-form**). An endpoint with no gang says so and sends nothing (the release after 0.3.6) | | `doors` | `--replicas` | int | `0` | pin the door count; `0` = follow the workers: `max(2, ⌈units/4⌉)`, a unit = one worker or one gang (a gang counted per part until the release after 0.3.6) | | `doors` | `--max` | int | `0` | cap a count that follows the workers; `0` = the default, 8 | | `placement` | — | | | print the node of the leader and of each door, and the rule that chose it | `endpoint doors … NAME on|off` turns front doors on or off through the plan's `gateways` block. `endpoint rollout` starts a verified rollout of the stored plan, as the console's **Roll out plan…** does. ```bash opodcp endpoint rollout --wait --note 'objects lost in a rebuild' chat opodcp endpoint rollout --wait --timeout 45m --note 'new vLLM image' chat opodcp endpoint reform chat opodcp endpoint doors --max 4 chat on opodcp endpoint doors --replicas 3 chat on opodcp endpoint doors chat off ``` `--replicas` pins the door count and `--max` caps a count that follows the workers, so the two together are refused, and so is either one with `off`. In 0.3.6 the extra flag is dropped without a word; the refusal arrives in the release after 0.3.6. ```bash opodcp endpoint placement chat ``` `endpoint autoscale NAME` with no flags prints the autoscaling policy, who scales the endpoint and why it is held. Each flag you give changes one plan field and only that one, as the console's **Edit policy** does. See [Autoscaling](https://opod.io/docs/control-plane-endpoints/autoscaling/) for the rules and limits. | Flag | Type | Plan field | Meaning | | ------------------- | ------ | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--floor` | int | `autoscale.floor` | minimum workers (or gangs); `0` = may scale to zero | | `--max` | int | `autoscale.max` | maximum workers (or gangs); `0` = autoscaling off | | `--unit` | string | `autoscale.unit` | `workers` or `gangs` | | `--target-inflight` | int | `autoscale.targetInflight` | in-flight requests one worker carries before another is added | | `--idle` | int | `autoscale.idleSeconds` | idle seconds before a worker is parked | | `--kv-pressure` | int | `autoscale.kvPressurePct` | grow when the busiest worker's KV cache reaches this percent; `0` = off | | `--sleep` | int | `autoscale.sleepSeconds` | idle seconds before the engine sleeps (vLLM); `0` = no sleep tier | | `--sleep-card` | string | `autoscale.sleepCard` | `keep` or `free`: what a sleeping worker of a shared plan does with its card | | `--ttft-budget` | int | `autoscale.ttftBudgetMs` | TTFT p95 budget in ms; over it the endpoint grows; `0` = none | | `--wake-slo` | int | `autoscale.wakeSloMs` | advisory wake target in ms; `0` = none | | `--grant-headroom` | int | `autoscale.grantHeadroom` | workers reserved beyond what runs, for KEDA during an outage; `0` = the default, 1 | | `--scale-in` | string | `autoscale.scaleIn` | `drain` (the default: finish running requests first) or `now` (stop at once; clears `--drain`) | | `--drain` | int | `autoscale.drainSeconds` | seconds a stopped worker may spend finishing its requests; `0` = the default, 120 | | `--growth-file` | string | `autoscale.growth` | a YAML or JSON list of growth shapes, tried in order: `name`, `vendor`, `max`, `vramBudgetGb`, `flags`, `parallelism`, `image`; an empty list removes them | Every flag defaults to "unchanged": a flag you do not give leaves its field as it is. ```bash opodcp endpoint autoscale chat # print only opodcp endpoint autoscale --floor 0 --max 4 --sleep 300 chat # scale to zero, sleep tier first opodcp endpoint autoscale --target-inflight 4 --kv-pressure 80 --ttft-budget 800 chat opodcp endpoint autoscale --scale-in drain --drain 300 chat opodcp endpoint autoscale --growth-file shapes.yaml chat ``` ```yaml # shapes.yaml: grow on NVIDIA first, then on AMD cards with a smaller budget - { name: a6000, vendor: nvidia, max: 4 } - { name: radeon, vendor: amd, max: 2, vramBudgetGb: 20, flags: { ctx: "8192" } } ``` ### `endpoint kv | policy | expose` Each prints what is stored when you give no flags. Each flag you give changes one field and only that one. A flag you do not give leaves its field as it is, and `--cp`, `--token` and `--ca` are not changes: in 0.3.6 `endpoint kv` with only those rewrote the plan unchanged, and from the release after 0.3.6 it only reads. The control plane judges the write as it judges any plan or policy write, and refuses it with an error code. A plan change rolls the endpoint like any plan edit. From the release after 0.3.6 the CLI checks every word value (`--tier`, `--events`, `--isolation`, `--prefix-affinity`, `--prefix-block-tier`, `--vertex`, `--method`) and `--tokens` (1–16) before it sends a request, so a typo is the error even when the control plane is down. A flag that sets the value already stored sends no write and prints `already as given — nothing changed`; `endpoint doors`, `endpoint autoscale` and `door routes` do the same. `endpoint kv NAME` changes the endpoint's KV cache settings. The tier and precision flags apply to every worker, unless you name one worker with `--worker` or one gang with `--gang`. See [KV cache](https://opod.io/docs/control-plane-endpoints/kv-cache/) and [KV cache tiers](https://opod.io/docs/control-plane-endpoints/kv-tiers/). | Flag | Type | Plan field | Meaning | | --------------- | ------ | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--worker` | int | — | the worker index the tier and precision flags change; `-1` (the default) = every worker | | `--gang` | string | — | change this gang's tier instead; a gang's `sizeGb` is its total, split over its ranks | | `--tier` | string | `workers[].kvOffload.tier` | `cpu`, `disk`, `peer` or `auto`; `none` removes the tier | | `--size-gb` | int | `workers[].kvOffload.sizeGb` | the tier's host memory in GiB; an `auto` tier's starting size | | `--max-gb` | int | `workers[].kvOffload.maxGb` | an `auto` tier's cap in GiB (dropped on any other tier) | | `--disk-gb` | int | `workers[].kvOffload.diskGb` | a `disk` tier's cap on the node's disk in GiB (dropped on any other tier) | | `--dtype` | string | `workers[].flags.kv_cache_dtype` (llama.cpp: `kv_cache_type`) | the KV cache's element type: vLLM `fp8`, `fp8_e4m3`, `fp8_e5m2`; SGLang `fp8_e4m3`, `fp8_e5m2`; TensorRT-LLM `fp8`; llama.cpp `q8_0`, `q4_0`. `16bit` removes the flag | | `--events` | string | `kvEvents` | `on` or `off`: the engine reports its KV blocks and the leader routes on them (vLLM, SGLang) | | `--isolation` | string | `routing.cacheIsolation` | `team` (the default), `key` or `none`: whose requests may share the prefix cache | | `--max-context` | int | `workload.maxContext` | the longest request in tokens the KV cache is sized for; `0` = the model's window | `endpoint policy NAME` changes the routing policy, as the console's **Routing** page does. The write is conditional on the policy revision it read. If someone changed the policy in between, the command fails and you run it again. See [Routing](https://opod.io/docs/control-plane-endpoints/routing/). | Flag | Type | Policy field | Meaning | | ----------------------- | ------ | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--kv-weight` | float | `routing.kvWeight` | how much a worker's KV cache use counts against it when the leader picks one; `0` = the default | | `--kv-saturation` | int | `routing.kvSaturationPct` | the KV cache percent at which a worker is passed over while another has room; `0` = the default | | `--prefix-affinity` | string | `routing.prefixAffinity` | `on` or `off`: keep a key's requests on the worker that holds its prompt prefix | | `--prefix-block-weight` | float | `routing.prefixBlockWeight` | what one held KV block of the prompt is worth, in in-flight requests; needs `kvEvents`; `0` = off | | `--prefix-block-tier` | string | `routing.prefixBlockTier` | `gpu` (unset = this) or `cpu-lower`: with `cpu-lower` a block in the worker's CPU tier also counts under the held-block weight, at 0.8 of a block on the card; needs `kvEvents` and a CPU tier | | `--load-refresh` | string | `routing.loadRefreshMs` | how often the leader and every front door pull each worker's load: a duration (`500ms`, `2s`) or milliseconds; `0` = the leader's default, 500 ms; at most `1m`; below 100 ms the leader uses 100 ms | | `--token-weight` | float | `routing.tokenWeight` | 0–100; `0` = off. Arrives in the release after 0.3.6 | | `--prefix-depth` | int | `routing.prefixDepthKiB` | KiB, `0` (= 256) or 4–1024. Arrives in the release after 0.3.6 | | `--slow-factor` | float | `routing.slowFactor` | `0` = off, else above 1. Arrives in the release after 0.3.6 | | `--sticky-ttl` | string | `routing.stickyTtlSeconds` | how long a session or a prompt prefix stays on the worker that last served it: a duration (`15m`, `1h`) or seconds; `0` = the leader's own start value; at most `24h`. Applies live, to pins placed from then on | ```bash opodcp endpoint policy --prefix-affinity on --kv-weight 2 chat opodcp endpoint policy --prefix-block-weight 1 --prefix-block-tier cpu-lower --sticky-ttl 30m --load-refresh 250ms chat ``` The command prints the stored policy after the write. With no flag it only prints it. Flags go before the name. `endpoint expose NAME` changes how clients reach the endpoint. `-` removes a name. See [Gateways](https://opod.io/docs/control-plane-endpoints/gateways/). | Flag | Type | Plan field | Meaning | | ------------------ | ------ | ------------------------ | ------------------------------------------------------------------ | | `--door-alias` | string | `door.alias` | the `model` a client sends to the cell door to reach this endpoint | | `--inference-pool` | string | `exposure.inferencePool` | the Gateway API InferencePool the leader joins; `-` removes it | | `--vertex` | string | `exposure.vertex` | `on` or `off`: the leader also serves Vertex AI's container routes | ```bash opodcp endpoint kv chat # print only opodcp endpoint kv --tier cpu --size-gb 4 chat # a 4 GiB CPU tier on every worker opodcp endpoint kv --worker 0 --tier auto --size-gb 4 --max-gb 32 chat opodcp endpoint kv --tier disk --size-gb 4 --disk-gb 200 chat # needs a pinned model revision opodcp endpoint kv --dtype fp8 --events on --isolation key chat opodcp endpoint kv --tier none --dtype 16bit chat # back to a 16-bit cache in VRAM only opodcp endpoint policy --prefix-affinity on --kv-weight 2 chat opodcp endpoint expose --door-alias chat-prod chat opodcp endpoint expose --inference-pool - --vertex off chat ``` ### `door routes` `door routes` prints the cell door's auto routes: names a client sends as `model` that fall back down a list of endpoints. `-f FILE` replaces the whole list with the file's and prints which routes it added, removed and kept. An empty file is refused, and `[]` removes every route only with `--yes`. It needs the admin role. The refusals, `--yes` and the summary arrive in the release after 0.3.6; 0.3.6 writes what the file holds. See [Gateways](https://opod.io/docs/control-plane-endpoints/gateways/). | Flag | Type | Default | Meaning | | ------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------- | | `-f` | string | `""` | a YAML or JSON list of `{name, endpoints, pick, maxHops}`; `pick` is `first` (the default) or `least-loaded`; `maxHops` `0` = 1 | | `--yes` | bool | `false` | allow a list that removes every route (`[]`) | ```bash opodcp door routes opodcp door routes -f routes.yaml opodcp door routes -f empty.yaml --yes # empty.yaml holds [] — removes every route (the release after 0.3.6) ``` ```yaml # routes.yaml: "auto" tries the big model first, then the small one - name: auto endpoints: [chat-big, chat-small] pick: first maxHops: 1 ``` ## Keys and tokens ### `key create | revoke` An endpoint API key (`sk-orc-…`). See [API keys](https://opod.io/docs/control-plane-endpoints/api-keys/). | Verb | Flag | Type | Default | Meaning | | -------- | --------------- | -------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------ | | `create` | `--endpoint` | string | none (required) | endpoint name or id | | `create` | `--expires-in` | duration | the control plane's 90 days | expire after this long | | `create` | `--no-expiry` | bool | `false` | a key that never expires; the choice is recorded on the `key.created` event | | `revoke` | `--endpoint` | string | none | endpoint name (or id, through the API) | | `revoke` | `--direct` | bool | `false` | no control plane: append a tombstone to the endpoint's auth Secret with only a kubeconfig | | `revoke` | `--kubeconfig` | string | `$KUBECONFIG` | with `--direct`: kubeconfig path; empty = in-cluster | | `revoke` | `--namespace` | string | `opodcp` | with `--direct`: the control plane's namespace | | `revoke` | `--endpoint-id` | string | `""` | with `--direct`: which incarnation, when two endpoints of one name have a Secret | | `revoke` | `--secret` | string | `""` | with `--direct`: the auth Secret's name in place of `--endpoint`, for a grant scoped by `resourceNames` that cannot list | `key create … NAME` prints the key once. `key revoke … KEY` takes the key's id, or its name when exactly one live key carries it — never the key itself. From the release after 0.3.6, a name only revoked keys carry prints `already revoked; nothing changed` and exits `0`, and a key the control plane chose not to expire reads `expires never` (0.3.6 added `(--no-expiry)` either way). Through the API, a name is looked up first in 0.3.0 (on 0.2.1 only an id works there). ```bash opodcp key create --endpoint chat --expires-in 720h ci-bot opodcp key create --endpoint chat --no-expiry batch-runner opodcp key revoke --endpoint chat ci-bot opodcp key revoke --direct --endpoint chat --kubeconfig ~/.kube/config k_3f9a… ``` ### `token create | ls | revoke` A machine token: a program's credential for this cell. Minting needs an admin's `--token`. | Verb | Flag | Type | Default | Meaning | | -------- | -------------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `create` | `--scope` | string | `viewer` | one scope per token: `viewer` (read only), `fleet` (also tells this cell its fleet licence fact; the fleet control plane's token), `tokens:write` (also issue and revoke endpoint keys), `plans:write` (also write plans and start rollouts). Any other word is refused before a request is sent (the release after 0.3.6) | | `create` | `--expires-in` | duration | never | expire after this long; a machine token is revoked, not timed out | | `ls` | `--json` | bool | `false` | print JSON; revoked tokens are included. With none, it says so and names `token create` | | `revoke` | — | | | revoke token `ID`; its next request is refused. A token revoked before says so and changes nothing (the release after 0.3.6) | ```bash opodcp token create --scope fleet fleet-view # for the fleet control plane's fleet.cells entry opodcp token create --scope plans:write --expires-in 2160h ci-deployer opodcp token ls --json opodcp token revoke tok_1a2b3c4d5e6f ``` ## Nodes | Command | Flag | Type | Default | Meaning | | ------------------------------- | ---------- | ------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `node label NODE [KEY=VALUE …]` | `--remove` | string, repeatable | none | a label to remove; only `opod.io/*` labels may be changed, and from the release after 0.3.6 another key is refused before a request is sent | | `nodes` | — | | | per node: its leader fence, whether it may hold a front, and the leaders and doors on it. On 0.2.1 it accepts `--leaders`, which changes nothing; from 0.3.0 that flag is gone. From the release after 0.3.6 it also shows, from `GET /api/v1/capacity/ledger`, the vendor, the GPUs, the whole cards a dedicated worker could take (`FREE CARDS`), the room for a shared budget summed over the measured cards (`FREE GB`, `-` when none is measured) and whether the placer may use the node (`no: <reason>`); an empty cell says so | | `nodes` | `--json` | bool | `false` | the same rows as JSON: `node`, `vendor`, `gpus`, `freeCards`, `freeGb`, `placeable`, `why`, `fence`, `mayHoldFront`, `leaders`, `doors` (the release after 0.3.6) | `opod.io/leaders=avoid` keeps leaders and doors off a node; `=prefer` makes the placement rule pick it first. See [Configuration → Where leaders and front doors run](https://opod.io/docs/control-plane-install/configuration/#where-leaders-and-front-doors-run). ```bash opodcp node label node-a opod.io/leaders=avoid opodcp node label node-c opod.io/leaders=prefer opod.io/pool=fronts opodcp node label --remove opod.io/leaders --remove opod.io/pool node-a opodcp nodes opodcp nodes --json | jq '.[] | select(.placeable)' # the release after 0.3.6 ``` ## Alerts and connectors Both arrive in the release after 0.3.6. On 0.3.6, use the API or the console. | Command | Flag | Type | Default | Meaning | | ------------------------ | -------- | ---- | ------- | -------------------------------------------------------------------------------------------------------------------------- | | `alerts ls` | `--open` | bool | `false` | only the alerts still firing; without it, open and resolved, newest first (`GET /api/v1/alerts?state=all`, the newest 200) | | `alerts ls` | `--json` | bool | `false` | the alerts as the API returns them, with each one's `detail` and `remedy` | | `connectors verify PORT` | `--json` | bool | `false` | the answer as JSON on stdout; the sentences go to stderr | `alerts ls` prints one row per alert: id, severity, state (`open`, `open, acked by …` or `resolved <time>`), object, when it fired and its title, then how many are open. With none, it says so. Acknowledge an alert on the console's **Overview** page or with `POST /api/v1/alerts/{id}/ack`. See [Alerts inside the control plane](https://opod.io/docs/control-plane-operate/observability/#alerts-inside-the-control-plane). `connectors verify PORT` runs the live check of the adapter the port runs now, from the control plane's pod, as the **Verify** button does with no candidate (`POST /api/v1/connectors/{port}/verify`, an admin's `--token`). The port is one of `state`, `events`, `usage`, `metrics`, `logs`, `traces`, `secrets`, `kvstore`, `batchfiles`, `checkpoints`, `notifier`, `registry`, `identity`, `fabric`, `gangs`, `autoscaler`, `executor` or `cloud`; another word is refused before a request is sent. A pass prints the adapter, what it found and, for a usage sink with a table, the schema state, and exits `0`. An embedded default passes with nothing to verify. An adapter with no live check (a notifier, which a test alert checks instead) says so and exits `0`. A failure exits `1` and names its kind (`unreachable`, `refused`, `missing`, `invalid`), the redacted detail and `opodcp runbook PORT`. To verify a candidate before you save it, use the console's Connectors page or the API with `adapter` in the body. See [Connectors](https://opod.io/docs/control-plane-operate/connectors/). ```bash opodcp alerts ls --open opodcp alerts ls --json | jq '.[] | select(.severity == "critical") | {id, title, remedy}' opodcp connectors verify usage # connector usage (postgres) verified: connected to postgres 16.4 as opodcp # its schema is current (step 3) opodcp connectors verify events || echo "the events bus failed its check" opodcp connectors verify state --json | jq .ok ``` ## Models | Verb | Flag | Type | Default | Meaning | | ------------------------- | -------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `versions MODEL` | `--json` | bool | `false` | every version: state, revision, licence, approval, the last signature report | | `approve MODEL VERSION` | `--note` | string | `""` | why it may run: the review, the eval, the ticket. Needs an admin's token | | `unapprove MODEL VERSION` | — | | | clears the approval; endpoints that pin the version keep running it. Spelled `revoke` up to 0.3.6; it is `unapprove` from the release after 0.3.6, because `revoke` elsewhere invalidates a credential | | `approval [on\|off]` | — | | | with no argument, print `models.requireApproval`; `on` means a new plan may pin only an approved version (`E-MODEL-UNAPPROVED`) | See [Models → Approval](https://opod.io/docs/control-plane-endpoints/models/#approval). ```bash opodcp model versions qwen2.5-7b opodcp model approve --note 'eval 0.82, licence reviewed' qwen2.5-7b v2 opodcp model revoke qwen2.5-7b v1 # 0.3.6; the release after 0.3.6: opodcp model unapprove qwen2.5-7b v1 opodcp model approval on ``` ## The store | Command | Flag | Type | Default | Meaning | | -------------- | ----------- | ------ | -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `backup` | `-o` | string | `opodcp-backup-<UTC time>.jsonl` | the output file; `-` = stdout | | `restore FILE` | `--wipe` | bool | `false` | empty every table before inserting; without it the store must be empty. Stop `serve` first. Asks first on a terminal | | `restore FILE` | `--yes` | bool | `false` | with `--wipe`: do not ask. Needed without a terminal (a script, a Job) | | `store move` | `--to` | string | none | the target Postgres DSN (`postgres://…`). A move that stops part way says the source is unchanged and the target may be partly written — empty it before you retry (the release after 0.3.6) | | `store move` | `--to-file` | string | none | a file holding the target DSN, so no password is on the command line; give it or `--to` | | `secrets sync` | — | | | record every token the Kubernetes Secrets hold into the connected secret store (`--cp`, `--token`) | `backup`, `restore` and `store move` open the store named by `OPODCP_STATE_DSN`. From the release after 0.3.6, `restore --wipe` names the store it empties, asks `[y/N]` on a terminal, and without a terminal refuses unless `--yes` is given; 0.3.6 wipes without asking. `store move` runs backup, restore and verify; the source is untouched. See [Backup and restore](https://opod.io/docs/control-plane-install/backup-restore/). ```bash export OPODCP_STATE_DSN="$(kubectl -n opodcp get secret opod-state-dsn -o jsonpath='{.data.dsn}' | base64 -d)" opodcp backup -o opodcp-backup.jsonl opodcp backup -o - | gzip > opodcp-backup.jsonl.gz opodcp restore opodcp-backup.jsonl # into an empty store opodcp restore --wipe opodcp-backup.jsonl # empty every table first; asks on a terminal opodcp restore --wipe --yes opodcp-backup.jsonl # the same in a script or a Job (the release after 0.3.6) opodcp store move --to-file /run/secrets/postgres-dsn opodcp secrets sync --cp https://cp.example.com ``` ## Licence | Verb | Flag | Type | Default | Meaning | | ---------------------- | -------- | ------ | ------- | ------------------------------------ | | `inspect [token \| -]` | `--cell` | string | `""` | evaluate the tier for this cell name | `license` is an alias. `inspect` verifies a key against the keys built into this binary and shows the tier it grants — from the release after 0.3.6 as two lines (`licence <id> for <org> — N GPUs, plan …, expires …` and `tier here: <state> — <detail>`), with `--json` for the JSON object 0.3.6 prints; `-` reads the key from stdin; on a terminal it says to paste the key and press Ctrl-D (the release after 0.3.6). Install a key with the chart or `PUT /api/v1/licence`; see [Licensing](https://opod.io/docs/control-plane/licensing/). ```bash opodcp licence inspect --cell prod < licence.txt ``` `licence keygen` and `licence sign` are the vendor's side of key issuing. They need the private signing seed, which no install has; a key they sign verifies only against the public keys built into a release. Their flags, for completeness: | Verb | Flag | Type | Default | Meaning | | -------- | -------------- | ------ | ------------- | ------------------------------------------------------------------------------------------------------- | | `keygen` | `--out` | string | `licence.key` | where to write the private seed (hex, mode 0600); an existing file is refused (the release after 0.3.6) | | `keygen` | `--force` | bool | `false` | replace an existing seed; every licence signed with the old seed stops verifying | | `sign` | `--key` | string | `licence.key` | the production seed file; a different seed signs licences no shipped control plane accepts | | `sign` | `--org` | string | none | the customer organisation | | `sign` | `--cell` | string | `*` | the cell the key is bound to; `*` = any | | `sign` | `--gpus` | int | `0` | the GPU ceiling | | `sign` | `--plan` | string | `team` | the plan name | | `sign` | `--years` | float | `1` | validity from now | | `sign` | `--grace-days` | int | `60` | grace after expiry before the free tier applies to new placements | | `sign` | `--id` | string | generated | the key's id | ## Used by the chart You do not run these by hand; the chart's pods do. ### `node-agent` The telemetry probe's reporter: it runs the vendor probe and the host facts every `--every` and keeps the newest result. The control plane's telemetry DaemonSets set its environment. In 0.3.6 it pushes each result to `--url`. From the release after 0.3.6, every control-plane replica in the cluster reads it instead, with a signed request to `POST /v1/report` on its port 9147 (`$OPOD_MESH_PORT`), so each replica sees every node. It pushes only when `--url` is set, which the control plane does only when it runs outside the cluster. | Flag | Type | Default | Meaning | | -------------- | -------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--vendor` | string | `$OPOD_VENDOR` | `nvidia`, `amd`, `intel` or `tt` | | `--node` | string | `$OPOD_NODE_NAME` | the node name (downward API) | | `--url` | string | `$OPODCP_URL` | the control plane's base URL to push to. Required in 0.3.6. From the release after 0.3.6: empty means "answer reads only", and it must be set with `--once` | | `--token-file` | string | `$OPOD_NODE_TOKEN_FILE` | a file holding the node report token; without one, `$OPOD_NODE_TOKEN`. A file it cannot read is named with the reason (0.3.6 said `token missing`) | | `--every` | duration | `20s` | the report cadence | | `--once` | bool | `false` | report once and exit; a failed report exits `1` (the release after 0.3.6; 0.3.6 exits `0`) | | `--install` | string | `""` | copy this binary to the path and exit (the init container) | ```bash opodcp node-agent --vendor nvidia --node node-a --url http://opod.opod.svc:8080 --once opodcp node-agent --install /shared/opodcp ``` ### `ha postgres` The hook for `ha.postgres.provide`: it applies a CloudNativePG `Cluster` once the operator answers, then waits for its Secret. | Flag | Type | Default | Meaning | | ----------------- | -------- | --------------- | ----------------------------------------------------------------- | | `--name` | string | none (required) | the Cluster's name; its Secret is `<name>-app` | | `--namespace` | string | none (required) | the namespace the control plane runs in; the Secret must be there | | `--image` | string | none (required) | the Postgres image, pinned by digest | | `--instances` | int | `3` | Postgres instances: one primary, the rest replicas | | `--storage` | string | `10Gi` | volume size per instance | | `--storage-class` | string | `""` | StorageClass; empty = the cluster's default | | `--timeout` | duration | `14m` | how long to wait for the operator and the Secret | | `--kubeconfig` | string | `$KUBECONFIG` | kubeconfig path; empty = in-cluster | ```bash opodcp ha postgres --name opod-pg --namespace opodcp --image ghcr.io/cloudnative-pg/postgresql@sha256:… --instances 3 --storage 20Gi ``` --- title: "Helm values" description: "Every value of the opod chart with its default, what it does and what the chart refuses, for 0.3.0." url: "https://opod.io/docs/control-plane-reference/helm-values/" markdown_url: "https://opod.io/docs/control-plane-reference/helm-values.md" section: "Reference" last_updated: "2026-11-01" --- # Helm values > Every value of the opod chart with its default, what it does and what the chart refuses, for 0.3.0. The chart is `oci://ghcr.io/opod-io/charts/opodcp`. Print the commented file for a version with `helm show values oci://ghcr.io/opod-io/charts/opodcp --version <X.Y.Z>`. This page describes `0.3.6`. Its values are the same as `0.3.0`'s but for the image digests and the names: `0.3.0` was chart `opod`, and its default object names began `opod-` (`opod-serving`, `opod-rdma`). See [Releases](https://opod.io/docs/get-started/releases/) for what `0.2.1` does differently. Change values with `helm upgrade … --reset-then-reuse-values`. A value marked **New** is new in `0.3.0`: the published `0.2.1` chart does not have it. [Changes from 0.2.1](#changes-from-021) lists the values that left the chart. Connector settings other than the database are **not chart values**: they are saved on the Connectors page. See [Connectors](https://opod.io/docs/control-plane-operate/connectors/). Each chart value reaches the control plane as an `OPODCP_*` variable; the [Configuration](https://opod.io/docs/control-plane-install/configuration/#environment-variables) page lists them. ## In short The chart's values decide how the control plane is installed: its image, its database, how endpoints are reached, which substrate the chart installs (device plugins, LeaderWorkerSet, KEDA), and the security defaults. Most installs set a cell name, a database, and how clients reach endpoints. Everything else has a working default. ## How to read this page - One section per area of the chart. Each table row is a value path (`endpoints.tls.embedded`), its default, and what it does. A path that starts with `.` continues the one above it. - **New** marks a value the published `0.2.1` chart does not have. - Each section ends with an example you can paste, and the rules the chart refuses at render time. - Keep your changes in one values file and pass it on every upgrade. `--reset-then-reuse-values` keeps your earlier values and still takes the chart's new defaults; plain `--reuse-values` drops new defaults. ## A worked example, end to end A production cell: a named cell, Postgres for the state, endpoints published through nginx with cert-manager, enforced image signatures and closed leader ports. ```yaml # values-prod.yaml cell: { name: prod-east } ports: state: { dsnSecret: { name: opod-state-dsn } } # Secret with the Postgres DSN endpoints: ingress: host: "{endpoint}.{cell}.example.com" className: nginx annotations: { cert-manager.io/cluster-issuer: letsencrypt } images: verify: enforce networkPolicy: enabled: true leaderIsolation: { enabled: true } ``` ```bash helm show values oci://ghcr.io/opod-io/charts/opodcp --version <X.Y.Z> > defaults.yaml # what you start from helm upgrade --install opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --create-namespace -f values-prod.yaml helm get values opodcp -n opodcp # what you set kubectl -n opodcp exec deploy/opodcp -- /opodcp doctor # what it did ``` The example is for `0.3.0`: `ports.state.dsnSecret` is **New**. On `0.2.1` the database is `ports.state.dsn` (empty = SQLite on the control plane's volume), and the other values above are the same. A value the chart refuses fails the `helm` command with a sentence that names the value. `GET /api/v1/config` (admin) lists every `OPODCP_*` variable the values became, redacted, with the `helm upgrade` that changes each. ## Control plane | Value | Default | Meaning | | -------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `image.repository` | `ghcr.io/opod-io/opodcp` | the control plane image | | `image.tag` | `""` | defaults to the chart's app version | | `image.digest` | `""` | a digest pin; wins over the tag; the release workflow writes it | | `image.pullPolicy` | `IfNotPresent` | also used by the preflight Job | | `imagePullSecrets` | `[]` | pull secrets for the `opodcp` pod and the preflight Job; the first is also used for every endpoint pod | | `mode` | `cell` | **New.** `cell` manages this cluster; `fleet` manages none and reads the cells in `fleet.cells`. Any other value fails the render | | `fleet.cells` | `[]` | **New.** fleet mode: `[{name, url, tokenSecret: {name, key}}]`; `tokenSecret` defaults to `<release>-opodcp-fleet-<name>`, item `token`. Mint the token on that cell with `opodcp token create --scope fleet` | | `cell.name` | `default` | the `opod.io/cell` label on every object | | `cell.serviceDomain` | `""` | default `<namespace>.svc` | | `replicas` | `1` | above 1 needs a shared event bus (a saved events connector or `ha.nats.provide`); it renders a required one-per-node anti-affinity and a PodDisruptionBudget | | `terminationGracePeriodSeconds` | `200` | in the release after 0.3.6: how long a stopping control-plane replica may take. A `helm upgrade`, a roll or a drain lets the replica finish the runs it follows (a delete, a scale, a wake) for up to 3 minutes, so none fails with nobody following it. Keep it above 180. Example: `--set terminationGracePeriodSeconds=300` | | `resources` | requests 100m, 256Mi; limit 1Gi memory | the `opodcp` pod | | `nodeSelector`, `tolerations` | `{}`, `[]` | the `opodcp` pod and the preflight Job only. In `0.3.0`, with no `nodeSelector` the `opodcp` pod prefers a node with no accelerator (`opod.io/gpu-vendor: none`, or no such label). It is a preference, never a rule, so a cluster of GPU nodes only still installs; a `nodeSelector` wins | | `extraEnv` | `[]` | extra environment, Kubernetes `EnvVar` form; a name the chart already sets is rejected by the API server as a duplicate | | `controllers` | `[]` | diagnostics only: run an allowlist of control loops; empty = all | | `serviceAccount.create`, `.name` | `true`, `""` | `""` = `<release>-opodcp` | Two control-plane replicas, with a proxy for outbound calls: ```bash helm upgrade --install opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --create-namespace \ --set cell.name=prod-east \ --set replicas=2 --set ha.nats.provide=true \ --set-json 'extraEnv=[{"name":"HTTPS_PROXY","value":"http://proxy.example.com:3128"},{"name":"NO_PROXY","value":".svc,.cluster.local,10.0.0.0/8"}]' ``` A fleet release that reads two cells and manages none: ```yaml mode: fleet substrate: { leaderWorkerSet: { enabled: false } } fleet: cells: - { name: east, url: https://cp-east.example.com } # token in <release>-opodcp-fleet-east, item token - { name: west, url: https://cp-west.example.com, tokenSecret: { name: west-view, key: token } } ``` The chart refuses: - `mode=fleet` with `replicas` above 1. A fleet has no leader election. - `mode=fleet` with `substrate.leaderWorkerSet.enabled`, `substrate.keda.enabled`, `ha.postgres.provide` or `ha.nats.provide` true. `substrate.leaderWorkerSet.enabled` defaults to `true`, so a fleet release must set it to `false`. - `replicas` above 1 with a `kubernetes.io/hostname` key in `nodeSelector`. Each replica needs its own node. In fleet mode the chart renders only the `opodcp` pod: no device plugin, PriorityClass, cluster RBAC, preflight hook, door or KV store. See [Fleet](https://opod.io/docs/control-plane/fleet/). ## Credentials and the database | Value | Default | Meaning | | ---------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `admin.token` | `""` | bootstrap admin token; empty = generated once into `<release>-opodcp-admin` and kept across upgrades and uninstalls | | `admin.existingSecret` | `""` | a Secret with item `token`; the chart then creates none | | `installKey.keys` | `""` | **New.** base64 install keys, comma-separated, newest first; empty = 32 random bytes minted once into `<release>-opodcp-install-key` and kept across upgrades and uninstalls | | `installKey.existingSecret` | `""` | **New.** a Secret with item `keys` | | `licence.key` | `""` | a licence key, stored in `<release>-opodcp-licence`; empty = the free tier | | `licence.existingSecret` | `""` | a Secret with item `key`; `PUT /api/v1/licence` outranks both | | `ports.state.dsnSecret.name` | `""` | **New.** the Secret holding the whole Postgres DSN | | `ports.state.dsnSecret.key` | `dsn` | **New.** its item | | `ports.state.dsn` | `""` | a plain `postgres://host/db` with no credential in it | | `ports.state.adapter` | `""` | your declaration of the adapter, checked against the DSN's scheme at boot; `0.2.1` defaulted it to `sqlite` | ```bash kubectl -n opodcp create secret generic opod-admin --from-literal=token="$(openssl rand -hex 32)" kubectl -n opodcp create secret generic opod-licence --from-file=key=licence.txt helm upgrade --install opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --create-namespace \ --set admin.existingSecret=opod-admin \ --set licence.existingSecret=opod-licence \ --set installKey.existingSecret=opod-install-key \ --set ports.state.dsnSecret.name=opod-state-dsn --set ports.state.adapter=postgres ``` Give the database as `dsn` or as `dsnSecret`, or let `ha.postgres.provide` create one. With none of them, the control plane starts in setup mode and asks for a database until one answers. The chart refuses: - `ports.state.dsn` and `ports.state.dsnSecret.name` both set. - A plain `ports.state.dsn` with a user or a password in its address, or a credential (`password=`, `token=`, `secret=`, `sslkey=` and similar) in its query. Put the whole DSN in a Secret. - Any `ports.<port>` value other than `ports.state`. To clear an old one with `--reset-then-reuse-values`, add `--set ports.<port>=null`. - `ha.postgres.provide` with `ports.state.dsn` or its Secret set. ## The console's own route | Value | Default | Meaning | | ---------------------------------------------------- | ------------------ | --------------------------------------------------------------------------------------------------- | | `service.type` | `ClusterIP` | `NodePort` for a LAN without an Ingress | | `service.port` | `8080` | | | `service.nodePort` | `null` | | | `ingress.enabled` | `false` | an Ingress, or an HTTPRoute with `ingress.gateway.name` | | `ingress.className` | `""` | Ingress only | | `ingress.host` | `opod.example.com` | | | `ingress.tls` | `[]` | Ingress only | | `ingress.gateway.name`, `.namespace`, `.sectionName` | `""` | **New.** render the console's route as an `HTTPRoute` on that Gateway | | `api.rateLimit.rps`, `.burst` | `0`, `0` | a per-caller API rate limit; over it, `429` with `Retry-After`; 0 = off | | `api.trustedProxies` | `[]` | CIDRs whose `X-Forwarded-For` is believed for the sign-in limit; empty = the TCP peer is the client | | `kube.qps`, `kube.burst` | `0`, `0` | client budget against the API server; 0 = 50 and 100 | The console on a LAN without an Ingress, then behind your Gateway with a client limit: ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ --set service.type=NodePort --set service.nodePort=30080 helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ --set ingress.enabled=true --set ingress.host=cp.example.com \ --set ingress.gateway.name=public --set ingress.gateway.namespace=gateway-system \ --set api.rateLimit.rps=20 --set api.rateLimit.burst=40 \ --set-json 'api.trustedProxies=["10.0.0.0/8"]' ``` ## Endpoints' north side | Value | Default | Meaning | | ------------------------------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------- | | `endpoints.expose` | `auto` | **New.** `auto`, `gateway`, `ingress` or `none` | | `endpoints.gateway.name`, `.namespace`, `.sectionName` | `""` | **New.** the Gateway endpoints attach to; `""` = the one Programmed Gateway | | `endpoints.ingress.host` | `""` | the host pattern (`{endpoint}`, `{cell}`); `""` = no route. `0.2.1` defaulted it to `{endpoint}.{cell}.example.com` | | `endpoints.ingress.className` | `""` | the Ingress class | | `endpoints.ingress.tlsSecret` | `""` | the TLS Secret for the Ingress; read only when `className` is set | | `endpoints.ingress.annotations` | `{}` | for example a cert-manager issuer; read only when `className` is set | | `endpoints.tls.embedded` | `false` | mint a self-signed certificate per endpoint; HTTPS in-cluster | | `endpoints.tls.certDays` | `3650` | validity of a minted certificate | | `endpoints.tls.renewDays` | `30` | a rollout re-mints within this many days of expiry | ```yaml endpoints: expose: ingress ingress: host: "{endpoint}.{cell}.example.com" # chat.prod-east.example.com className: nginx tlsSecret: wildcard-example-com annotations: { nginx.ingress.kubernetes.io/proxy-read-timeout: "600" } tls: { embedded: true, certDays: 825, renewDays: 30 } # HTTPS inside the cluster too ``` With `expose: gateway`, every endpoint apply is refused `E-GATEWAY-NOT-READY` while no Gateway is ready. With no host, there is no route whatever `expose` says. See [Network and TLS](https://opod.io/docs/control-plane-security/network-tls/). ## Workers and workloads | Value | Default | Meaning | | ------------------------------------- | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `workers.mtls` | `allow` | worker certificates: `allow`, `off` or `require`. The chart does not render `off` today, so `off` behaves as `allow`. `require` refuses a plan with replicas or a gang (`E-MTLS-REPLICAS`, `E-MTLS-GANG`). See [Worker identity](https://opod.io/docs/control-plane-security/worker-identity/) | | `workers.rejectBearer` | `false` | HMAC only on a worker's API; leave it off until your worker images carry the in-process model load | | `workerResources.requests` | 500m CPU, 2Gi | each worker's floor | | `workerResources.limits.memory` | `""` | a memory ceiling per worker; `""` = no limit | | `kvOffload.maxNodePct` | `50` | **New.** the share of a node's memory its KV tiers may take; a plan past it is refused `E-KV-RAM` | | `workloads.tolerations` | `[]` | tolerations on every pod the control plane creates; operators `Exists` and `Equal` only | | `workloads.leaderPool` | `""` | **New.** a label selector: leaders and doors run only on matching nodes | | `workloads.leader.resources` | requests 100m, 256Mi; `limits.memory` `""` | **New.** each leader; `""` = no memory limit | | `workloads.gateway.resources` | requests 100m, 192Mi; `limits.memory` `""` | **New.** each front door; `""` = no memory limit | | `workloads.worker.startBudgetMinutes` | `90` | **New.** restart a worker never Ready this long; 0 = off | | `allowNodeConsolidation` | `false` | let Karpenter and cluster-autoscaler move our pods. In `0.2.1` the control plane ignored this value | | `priorityClasses.create` | `true` | `false` = use classes that already exist | | `priorityClasses.serving` | `opodcp-serving` | value 100000: leaders, workers, gang parts, probes | | `priorityClasses.batch` | `opodcp-batch` | value 10000: jobs that keep their claim | | `priorityClasses.batchPreemptible` | `opodcp-batch-preemptible` | value 1000: jobs that yield to serving | | `priorityClasses.nodePressure` | `""` | `system-cluster-critical` lets the cache prune and the probe run under DiskPressure; the chart never creates this class | ```yaml workers: { mtls: allow, rejectBearer: false } workerResources: { requests: { cpu: "2", memory: 16Gi }, limits: { memory: 48Gi } } kvOffload: { maxNodePct: 40 } workloads: tolerations: [ { key: sku, operator: Equal, value: gpu, effect: NoSchedule } ] leaderPool: opod.io/pool=fronts leader: { resources: { requests: { cpu: 250m, memory: 512Mi }, limits: { memory: 1Gi } } } gateway: { resources: { requests: { cpu: 200m, memory: 256Mi }, limits: { memory: "" } } } worker: { startBudgetMinutes: 120 } allowNodeConsolidation: false priorityClasses: { create: true, nodePressure: system-cluster-critical } ``` An empty name in `priorityClasses` means that kind of pod asks for no priority. A change to any `workers`, `workerResources` or `workloads` value is a pod-template change: running endpoints take it on their next rollout. ## Weights | Value | Default | Meaning | | ------------------------------ | ------- | ------------------------------------------------------------------------------ | | `weights.hubEndpoint` | `""` | a Hugging Face mirror's base URL (`HF_ENDPOINT`) | | `weights.skipSourceCheck` | `false` | never check a model's upstream; for an air-gapped mirror | | `weights.catalogPubKey` | `""` | a minisign public key (the base64 line, or a path to a file) for catalog files | | `weights.catalogRequireSigned` | `false` | refuse an unsigned catalog file; ignored without `catalogPubKey` | An air-gapped cell that reads weights from an internal mirror and accepts only signed catalog files: ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ --set weights.hubEndpoint=https://hf-mirror.example.com \ --set weights.skipSourceCheck=true \ --set weights.catalogPubKey="$(tail -1 catalog.pub)" \ --set weights.catalogRequireSigned=true ``` A gated Hugging Face repository needs a token. The chart has no value for it: set it once per cluster in the console (**Settings → Hugging Face token**) or with `PUT /api/v1/settings/hub-token` (admin), and the control plane keeps it in Secret `opodcp-hub`. See [Gated models](https://opod.io/docs/control-plane-endpoints/models/#gated-models-the-hugging-face-token). ## Engine images Each is a digest-pinned reference. An empty value means the planner refuses that engine × vendor pair by name. The digests are the images the matching core release built, so they differ between chart versions. | Value | Default | | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `engineImages.leader` | `ghcr.io/opod-io/opod-leader@sha256:…` (amd64, arm64) | | `engineImages.llamacppNvidia`, `llamacppAmd`, `llamacppIntel` | `ghcr.io/opod-io/opod-worker-llamacpp-<vendor>@sha256:…` | | `engineImages.llamacppCpu` | `ghcr.io/opod-io/opod-worker-llamacpp-cpu@sha256:…` (a GPU-less node the plan names; amd64, arm64) | | `engineImages.vllmNvidia`, `vllmAmd`, `vllmIntel`, `vllmTt` | `ghcr.io/opod-io/opod-worker-vllm-<vendor>@sha256:…` | | `engineImages.sglangNvidia`, `sglangAmd` | `ghcr.io/opod-io/opod-worker-sglang-<vendor>@sha256:…` | | `engineImages.sglangIntel` | **New.** `ghcr.io/opod-io/opod-worker-sglang-intel@sha256:…` (upstream's XPU build). 0.3.0 sets it; on 0.2.1 set `OPODCP_IMAGE_SGLANG_INTEL` through `extraEnv` | | `engineImages.trtllmNvidia` | **New.** `""`; setting it is your acceptance of NVIDIA's NGC container licence | | `engineImages.epp` | **New.** llm-d's endpoint picker, pinned; for InferencePools; `""` = a plan that names a pool is refused | | `engineImages.fabricProbe` | `""`; the fabric proof's image; empty = the step reports it cannot run | ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ --set engineImages.vllmNvidia=registry.example.com/opod/opod-worker-vllm-nvidia@sha256:… \ --set engineImages.fabricProbe=registry.example.com/opod/fabric-probe@sha256:… opodcp images matrix # confirms the pair now names your image ``` To serve a pair with no named value, set `OPODCP_IMAGE_<ENGINE>_<VENDOR>` through `extraEnv`. ## Image verification | Value | Default | Meaning | | --------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------ | | `images.verify` | `warn` | `off`, `warn` or `enforce` | | `images.trust` | `[]` | `[{repositoryPrefix, issuer, identityRegex}]`, added to the built-in `ghcr.io/opod-io/` entry; `hf.co/<org>/` for models | | `images.trustRoot` | `auto` | `auto` (refresh Sigstore's root daily when reachable) or `embedded` (never go online) | | `images.trustRootConfigMap` | `""` | a ConfigMap with `trusted_root.json`; overrides `trustRoot` | ```yaml images: verify: enforce # refuse an image whose signature does not verify trustRoot: embedded # never fetch Sigstore's root: an air-gapped cell trust: - { repositoryPrefix: registry.example.com/opod/, issuer: https://token.actions.githubusercontent.com, identityRegex: "^https://github.com/example/images/.github/workflows/release.yml@refs/tags/v.*$" } ``` In `0.2.1` the chart carried `images.trust`, `.trustRoot` and `.trustRootConfigMap` under a `rollouts:` key that nothing read. See [Supply chain](https://opod.io/docs/control-plane-security/supply-chain/). ## Scaling and cloud | Value | Default | Meaning | | -------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `autoscaler.adapter` | `embedded` | `embedded` or `keda` | | `cloud.provider` | `onprem` | the provider adapter: its storage, registry and identity defaults and its `cloud.<provider>.*` preflight rows. `0.2.1` has only `onprem`. `aws`, `gcp` and `azure` are new in `0.3.0`, built and not yet proven on a real cluster; none provisions nodes. Example: `-f values-eks.yaml` sets `cloud.provider: aws` | | `cloud.nodeScaling` | `false` | the node-zero tier: for an endpoint KEDA owns, ask the node autoscaler for a GPU node at the ceiling. The embedded loop never asks. In `0.2.1` the control plane ignored this value | ```bash helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \ --set substrate.keda.enabled=true --set autoscaler.adapter=keda \ --set cloud.nodeScaling=true ``` ## Substrate | Value | Default | Meaning | | --------------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `substrate.preflight` | `true` | the pre-install and pre-upgrade check Job | | `substrate.nvidiaDevicePlugin.enabled` | `true` | on nodes labelled `opod.io/gpu-vendor=nvidia` | | `substrate.nvidiaDevicePlugin.image` | NVIDIA k8s-device-plugin v0.17.1, pinned | | | `substrate.nvidiaDevicePlugin.runtimeClassName` | `nvidia` | | | `substrate.nvidiaDevicePlugin.timeSlicing.replicas` | `4` | **New.** default turns per card on a time-sliced machine | | `substrate.nvidiaDevicePlugin.timeSlicing.choices` | `[2, 4, 8]` | **New.** turn counts a node may choose (label `opod.io/gpu-slices=N`); one plugin DaemonSet each | | `substrate.amdDevicePlugin.enabled` | `true` | on AMD nodes | | `substrate.amdDevicePlugin.image` | ROCm k8s-device-plugin, pinned | | | `substrate.amdDevicePlugin.privilegedFallback` | `false` | run an AMD worker privileged when no plugin advertises the card | | `substrate.intelDevicePlugin.enabled` | `true` | on Intel nodes | | `substrate.intelDevicePlugin.image` | intel-gpu-plugin 0.36.0, pinned | | | `substrate.intelDevicePlugin.sharedDevNum` | `1` | leave at 1: co-location is the ledger's job | | `substrate.intelDevicePlugin.denyIds` | a list of integrated-GPU device ids | integrated graphics the plugin must not advertise | | `substrate.ttDevicePlugin.enabled` | `true` | on Tenstorrent nodes (a generic device plugin) | | `substrate.ttDevicePlugin.image` | generic-device-plugin, pinned | | | `substrate.ttDevicePlugin.deviceName` | `tt` | the resource becomes `tenstorrent.com/tt` | | `substrate.rdmaDevicePlugin.enabled` | `false` | the RDMA shared device plugin | | `substrate.rdmaDevicePlugin.image`, `.config` | pinned v1.5.2; a config with empty `selectors.ifNames` | fill the selectors with your RDMA NICs | | `substrate.multus.enabled` | `false` | Multus (thick), for a gang's fabric interface | | `substrate.multus.image` | Multus v4.1.4-thick, pinned | | | `substrate.leaderWorkerSet.enabled` | `true` | the LeaderWorkerSet controller (subchart `lws` v0.7.0); off = gang parts render as one Deployment each | | `substrate.keda.enabled` | `false` | KEDA (subchart `keda` 2.17.2); toggle once, at install: turning it off removes KEDA's CRDs and every ScaledObject. In `0.2.1` the control plane ignored this value | A cell with time-sliced NVIDIA cards, an RDMA fabric for gangs, and no Intel or Tenstorrent nodes: ```yaml substrate: nvidiaDevicePlugin: { enabled: true, timeSlicing: { replicas: 4, choices: [2, 4, 8] } } intelDevicePlugin: { enabled: false } ttDevicePlugin: { enabled: false } rdmaDevicePlugin: enabled: true config: '{"periodicUpdateInterval": 300, "configList": [{"resourceName": "hca_shared_devices_a", "rdmaHcaMax": 1000, "selectors": {"ifNames": ["ens1f0np0"]}}]}' multus: { enabled: true } leaderWorkerSet: { enabled: true } ``` ```bash kubectl label node node-d opod.io/gpu-slices=8 # this node's cards take 8 turns each ``` The chart refuses a `timeSlicing.replicas` that is not one of `timeSlicing.choices`. ## Fabric | Value | Default | Meaning | | ------------------------------------------- | --------------------------- | ------------------------------------------------------------ | | `fabric.hostNetwork` | `false` | gang pods on the host network instead of a Multus attachment | | `fabric.rdmaResource` | `rdma/hca_shared_devices_a` | the RDMA resource a gang part requests | | `fabric.networkAttachment` | `opodcp-rdma` | the NetworkAttachmentDefinition name | | `fabric.networkAttachmentDefinition.create` | `false` | render it from `config` | | `fabric.networkAttachmentDefinition.config` | `""` | your CNI config JSON | ```yaml fabric: rdmaResource: rdma/hca_shared_devices_a networkAttachment: opodcp-rdma networkAttachmentDefinition: create: true config: '{"cniVersion": "0.3.2", "type": "macvlan", "master": "ens1f0np0", "ipam": {"type": "whereabouts", "range": "192.0.2.0/24"}}' ``` ## Optional components | Value | Default | Meaning | | ------------------------------------------------------ | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `door.enabled` | `false` | the cell door; the chart renders its Service, the control plane its Deployment | | `door.replicas` | `2` | one per node | | `door.image` | `""` | `""` = `engineImages.leader`; the image must advertise the `door` feature | | `door.service.type`, `.port`, `.nodePort` | `ClusterIP`, `8080`, `null` | | | `door.resources.requests` | 100m, 64Mi | | | `kvStore.enabled` | `false` | a Valkey store for peer KV tiers; its password is minted once into `<release>-kvstore-auth`. The peer tier itself is not available yet **(planned)** | | `kvStore.image` | Valkey 9.1.2-alpine, pinned | | | `kvStore.port` | `6379` | | | `kvStore.maxMemory` | `8gb` | LRU eviction past it | | `kvStore.resources` | 500m; 10Gi request and limit | keep the limit about 25 % above `maxMemory` | | `kvStore.nodeSelector`, `.tolerations` | `{}`, `[]` | | | `inferencePool.enabled` | `false` | **New.** let plans join Gateway API InferencePools; the CRDs come with your gateway | | `inferencePool.gatewayPods.namespace` | `envoy-gateway-system` | **New.** where your Gateway's proxies run; required when the pool is on | | `inferencePool.gatewayPods.podLabels` | `{}` | **New.** their labels; empty = Envoy Gateway's own | | `ha.postgres.provide` | `false` | **New.** a CloudNativePG operator and Postgres cluster; its `<fullname>-pg-app` Secret (`opodcp-pg-app` for release `opodcp`) becomes the state store | | `ha.postgres.instances` | `3` | **New.** | | `ha.postgres.storage` | `10Gi` | **New.** per instance | | `ha.postgres.storageClass` | `""` | **New.** `""` = the default class | | `ha.postgres.image` | Postgres 16.10, pinned | **New.** | | `ha.nats.provide` | `false` | **New.** a three-node NATS JetStream cluster; it becomes the events URL unless one is saved on the Connectors page | | `observability.grafanaDashboards.enabled` | `false` | **New.** render the two dashboards as a ConfigMap | | `observability.grafanaDashboards.label`, `.labelValue` | `grafana_dashboard`, `"1"` | **New.** the sidecar's label | | `observability.prometheusRules.enabled` | `false` | **New.** render the alert rules as a ConfigMap holding `rules.yaml` | ```yaml door: { enabled: true, replicas: 2, service: { type: LoadBalancer, port: 8080 } } kvStore: { enabled: true, maxMemory: 16gb, resources: { requests: { cpu: "1", memory: 20Gi }, limits: { memory: 20Gi } } } inferencePool: { enabled: true, gatewayPods: { namespace: envoy-gateway-system } } ha: postgres: { provide: true, instances: 3, storage: 50Gi, storageClass: fast-ssd } nats: { provide: true } observability: grafanaDashboards: { enabled: true, label: grafana_dashboard, labelValue: "1" } prometheusRules: { enabled: true } ``` See [High availability](https://opod.io/docs/control-plane-install/high-availability/) and [Observability](https://opod.io/docs/control-plane-operate/observability/). ## Network and RBAC | Value | Default | Meaning | | ------------------------------------------------ | --------------------------------------- | -------------------------------------------------------------------------- | | `networkPolicy.enabled` | `false` | the policies a default-deny CNI needs | | `networkPolicy.leaderIsolation.enabled` | `false` | one policy per endpoint closing its leader's port | | `networkPolicy.leaderIsolation.detectAPIServer` | `true` | read the API server's source off control-plane nodes | | `networkPolicy.leaderIsolation.from` | `[]` | more peers, as NetworkPolicy peers; an unknown field is refused | | `networkPolicy.leaderIsolation.scaler.namespace` | `""` | the autoscaler's namespace; `""` = the release's | | `networkPolicy.leaderIsolation.scaler.podLabels` | `app.kubernetes.io/name: keda-operator` | the autoscaler's labels | | `rbac.create` | `true` | | | `rbac.nodeDrain` | `true` | `false` removes cluster-wide `pods/eviction`; a full drain is then refused | ```yaml networkPolicy: enabled: true leaderIsolation: enabled: true detectAPIServer: true from: [ { namespaceSelector: { matchLabels: { kubernetes.io/metadata.name: monitoring } } } ] scaler: { namespace: keda, podLabels: { app.kubernetes.io/name: keda-operator } } rbac: { create: true, nodeDrain: false } # no cluster-wide eviction: a full drain is refused serviceAccount: { create: true, name: "" } ``` The chart refuses `leaderIsolation.enabled` with an empty `scaler.podLabels`: a namespace alone would admit every pod in it. ## Subchart values `cloudnative-pg`, `nats`, `keda` and `lws` pass through to their subcharts. The chart sets their namespaces (`opod-cnpg`, `opod-nats`), pins their images by digest, restricts KEDA's Secret access to its own namespace, and lowers the requests of KEDA's operator and metric server and of the LeaderWorkerSet controller to 100m and 128Mi. ```yaml # subchart pass-through: these keys go to the subcharts as they are keda: resources: { operator: { requests: { cpu: 200m, memory: 256Mi } } } lws: resources: { requests: { cpu: 100m, memory: 128Mi } } ``` ## Changes from 0.2.1 These `0.2.1` values are gone. A value still given under `ports.<port>` fails the render. | `0.2.1` value | What replaces it | | ------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | | `persistence.enabled`, `.size`, `.storageClass` | nothing: the control plane keeps no state on a volume; the database holds it | | `ports.events`, `usage`, `metrics`, `traces`, `logs`, `identity`, `notifier`, `checkpoints`, `batchFiles`, `kvstore`, `secrets` | the [Connectors](https://opod.io/docs/control-plane-operate/connectors/) page | | `rollouts.journalCreates` | nothing: every create is a run | | `rollouts.trust`, `.trustRoot`, `.trustRootConfigMap` | `images.trust`, `.trustRoot`, `.trustRootConfigMap` | To move a `0.2.1` install, see [Upgrade](https://opod.io/docs/control-plane-install/upgrade/). --- title: "Error codes" description: "Every E- code the control plane returns, grouped by area, with its HTTP status, what causes it and what to do. Also the generic codes of the error body." url: "https://opod.io/docs/control-plane-reference/error-codes/" markdown_url: "https://opod.io/docs/control-plane-reference/error-codes.md" section: "Reference" last_updated: "2026-10-30" --- # Error codes > Every E- code the control plane returns, grouped by area, with its HTTP status, what causes it and what to do. Also the generic codes of the error body. Every refusal carries a code you can script on. The error body is always the same shape: ```json { "code": "invalid", "error": "<the sentence for a person>", "details": { "code": "E-…", "alternatives": [ "…" ], "field": "…" } } ``` Where the `E-…` code sits depends on the kind of refusal: | Kind | Status | `code` | `E-…` code | | ------------------------------------------------------------------------------------------- | ------------------- | --------------------- | ---------------------------------- | | A plan or request the control plane refuses (the planner, a model or machine action, a run) | `400` | `invalid` | `details.code` | | A decision on a rollout hold that does not apply | `409` | `conflict` | `details.code` | | Setup mode, a lost database, a planned adapter, a missing notifier | `503`, `422`, `409` | the `E-…` code itself | `code` | | A rollout or prefetch step that fails | in the run | — | the step's `code`, with `remedies` | `details.alternatives` lists choices that would pass. Preview and create answer identically. A rollout that is refused carries the same code on its failed step. The metric `opodcp_plan_judgements_total{result}` counts plans by code. Unless a table gives a status, a code is a `400` planner refusal, and the remedy is in `details.alternatives`. Codes marked † are new in `0.3.0`. ## In short When the control plane refuses something, the answer names the rule in an `E-…` code and, most often, lists choices that would pass. Look the code up here: each row says what causes it and what to do. Preview, create and a rollout's `validate` step give the same code for the same plan, so you can find a refusal before anything moves. ## How to read this page - Find the code with your browser's search. The sections follow the areas of the product: store, placement, gangs, KV cache, scaling, exposure, runs, models, machines. - **Status** is the HTTP status. A row without one is a `400` planner refusal. - **What to do** names the fix. The answer's `details.alternatives` often holds a ready-made one for your plan. - A code marked † is new in `0.3.0`. ## A worked example Preview a plan, and branch on the code in a script: ```bash OUT=$(curl -s -H "$H" -H 'Content-Type: application/json' -X POST https://cp.example.com/api/v1/endpoints/preview -d @chat.json) case "$(echo "$OUT" | jq -r '.details.code // empty')" in "") echo "fits:"; echo "$OUT" | jq -c '.claims' ;; E-FIT) echo "does not fit:"; echo "$OUT" | jq -r '.error, .details.alternatives[]?' ;; *) echo "refused:"; echo "$OUT" | jq -r '.details.code, .error' ;; esac ``` A refused answer has this shape (the sentences here are examples): ```json { "code": "invalid", "error": "node-a: card 0 has 22.5 GB free, the plan needs 30 GB", "details": { "code": "E-FIT", "alternatives": [ "node-b/0 has 46 GB free" ] } } ``` The wording of `error` and of each alternative is for a person and may change between releases. Script on `details.code`. ## Control plane and store | Code | Status | Cause | What to do | | --------------------- | ------ | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | `E-SETUP` † | 503 | setup mode: no database the control plane can use; the sentence says which | `GET /api/v1/setup` names the kind; see [Doctor](https://opod.io/docs/control-plane-operate/doctor/) | | `E-DB-UNREACHABLE` † | 503 | the database went away while running; nothing was changed | bring it back; the control plane reconnects by itself | | `E-ADAPTER-TARGET` † | 422 | a connector verify named an adapter that is planned, not built | choose a built adapter | | `E-NO-NOTIFIER` † | 409 | a notifier test with no alert sink connected | save `OPODCP_NOTIFY_URLS` on the Connectors page | | `E-NO-SECRET-STORE` † | 400 | a secrets sync with no secret store connected | connect `OPODCP_SECRETS_URL` first | | `E-BATCH-STORE` | 501 | the batch API has no object store, or one it cannot use; OpenAI body, `code` `batch_store_not_configured` | connect the `batchfiles` store on the Connectors page and restart | | `E-LICENCE` | 400 | the placement is beyond the licensed GPUs, or the fleet says the key's cells are over it | install a larger key; see [Licensing](https://opod.io/docs/control-plane/licensing/) | | `E-QUOTA` | 400 | the team's GPU quota is full | raise the quota (`PUT /api/v1/team-quotas`) or free a GPU the team holds | ## Capacity and placement | Code | Cause | | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | | `E-FIT` | no card has the room; the reason quotes the measured numbers. Also a node that would hold dedicated and shared workers at once | | `E-TELEMETRY-WARMING` † | the control plane just started and has not read every card; `details.retryAfterS`, and a run waits it out by itself | | `E-NO-ACCELERATOR` | no node of any GPU vendor exists for a worker left to the placer | | `E-AUTO-SHAPE` | an auto plan names a node, a split, gangs or several workers | | `E-AUTO-SIZE` | a shared auto plan with nothing to size the model by | | `E-AUTO-NOFIT` | no rung of the auto ladder fits | | `E-UNVERIFIED` | `verifiedOnly` and a path this control plane has not proven; also a rollout under `images.verify=enforce` whose image signature cannot be verified | | `E-DISK` | the node's model cache has no room for the weights or a disk KV tier | | `E-NODE-CORDONED` | the plan names a cordoned node | | `E-NODE-TAINTED` | the node has a taint nothing tolerates; `details.set` is the toleration to set | | `E-VENDOR-UNKNOWN` | a node's vendor label, or a growth shape's vendor, names a vendor this build does not know | | `E-SHARED-VENDOR` | a shared (budgeted) worker on a non-NVIDIA node | | `E-SLICE-BUDGET` † | a shared worker on a time-sliced node asks more than one turn's VRAM | | `E-IMAGE-FAMILY` | the worker image is not built for the node's GPU family | | `E-NO-ENGINE` | no worker image or support for this engine on this vendor; also LoRA on a non-vLLM engine | | `E-ENGINE-MODEL` | the engine cannot load this model's format on this silicon | | `E-ENGINE-RERANK` | a rerank endpoint on an engine that cannot score documents; `details.engines` names those that can | ## Parallelism and gangs | Code | Cause | | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `E-SHAPE` | a parallelism a worker cannot express (pipeline or expert parallel on a worker, a tensor degree that is not a power of two, tensor split on llama.cpp) | | `E-TP-DOMAIN` | a tensor group wider than the node's devices, or an image that cannot host the split (for example vLLM tensor parallel on AMD, in 0.3.0, and vLLM pipeline parallel on AMD from 0.3.2) | | `E-TP-HEADS` | the tensor degree does not divide the model's attention heads, or does not fit its KV heads | | `E-PP-LAYERS` | more pipeline stages than the model has layers | | `E-ENGINE-NO-GANG` | the engine has no multi-node backend | | `E-GANG-VENDOR` | a vLLM or SGLang gang across vendors | | `E-GANG-HEAD` | the head names a node none of the gang's parts names | | `E-GANG-NAME` | the gang id is too long to name its Kubernetes objects | | `E-GANG-MULTI` | several gangs and a leader that routes to one | | `E-GANG-SUBSTRATE` | the LeaderWorkerSet controller the chart enabled is down | | `E-EP-ENGINE`, `E-EP-DENSE`, `E-EP-SHARED`, `E-EP-DOMAIN` | expert parallelism: not an engine that spreads experts; a model with no experts; a shared plan; parts across machines without an all-to-all proof | | `E-PD-ENGINE` †, `E-PD-DOMAIN`, `E-PD-VENDOR` †, `E-PD-TP` †, `E-PD-TIER` † | prefill/decode: an engine with no KV connector, or a vLLM pair on a vendor its handoff is not proven on (every vendor but NVIDIA; 0.3.0); a half with no node, or a pair across nodes without a fabric proof; two vendors; tensor degrees that do not divide; a tier the engine cannot carry beside the split | | `E-TT-SPEC`, `E-TT-WEIGHTS`, `E-TT-HUGEPAGES`, `E-TT-GANG` | Tenstorrent: missing or wrong model spec; weights not on the node; no 1 GiB huge pages; a gang | ## KV cache | Code | Cause | | ------------------ | --------------------------------------------------------------------------------- | | `E-KV-OFFLOAD` | a KV tier the engine, vendor or image cannot carry; the `peer` tier | | `E-KV-RAM` | the node's KV tiers and workers exceed its host memory, or `kvOffload.maxNodePct` | | `E-KV-DTYPE` † | an 8-bit KV cache over weights it is not proven with | | `E-KV-EVENTS` | `kvEvents` on an engine that does not publish cache events | | `E-KV-SIGNAL` | a KV-pressure trigger on an engine with no KV signal | | `E-CACHE-REMOTE` † | team or key cache isolation on a remote endpoint | ## Scaling | Code | Cause | | ------------------- | -------------------------------------------------------------------------------- | | `E-TTFT-SIGNAL` | a TTFT budget on a model that never streams, or a leader without the measurement | | `E-SLEEP-CARD` † | `sleepCard: free` on a dedicated plan | | `E-GROWTH-ENGINE` † | a growth shape names a vendor where the engine has no image | | `E-SCALER-ROWS` | several worker rows under `autoscaler.adapter=keda` | | `E-SCALER-PD` † | a prefill/decode plan that autoscales under KEDA | | `E-PARK-FLOOR` | parked gangs leave fewer serving than the plan's floor | ## Exposure, doors and identity | Code | Cause | | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `E-GATEWAY-NOT-READY` † | `endpoints.expose=gateway`, or an InferencePool, and no Programmed Gateway | | `E-NORTH-BACKEND-TLS` † | `endpoints.expose=gateway` or `ingress`, the leader serves TLS, and the route cannot verify it: no `BackendTLSPolicy` served, or an Ingress class other than ingress-nginx without a backend-protocol annotation (from 0.3.2) | | `E-GATEWAY-UNSUPPORTED` | front doors on a leader that does not support them | | `E-DOORS-NODES` † | a pinned door count above the nodes that may hold a door | | `E-DOOR-ALIAS` | a cell-door alias already used, or not a valid model name | | `E-DOOR-AUTO` † | an invalid auto route, or an auto route on an install with no cell door | | `E-INFERENCEPOOL-CRD` † | an InferencePool the install cannot render (pools off, no picker image, or no CRD) | | `E-POOL-MODEL-MISMATCH` † | an InferencePool already holds another model | | `E-VERTEX-KEYS` †, `E-VERTEX-PROTOCOL` †, `E-VERTEX-DOORS` †, `E-VERTEX-UNSUPPORTED` † | Vertex routes with keys required; not a chat endpoint; with front doors; a leader without them | | `E-MTLS-REPLICAS`, `E-MTLS-GANG` | `workers.mtls=require` (or `allow`, for replicas) and a worker row with replicas, or a gang | ## Runs and rollouts | Code | Status | Cause | What to do | | ---------------------------------------------------- | ------ | --------------------------------------------------------------- | ----------------------------------------------------------------------------- | | `E-RUN-ACTIVE` † | 400 | a run that writes templates already holds the endpoint | wait for it, or cancel it | | `E-RUN-FINISHED` † | 400 | a cancel of a run that already ended | nothing to cancel | | `E-RUN-NOT-CANCELLABLE` † | 400 | a cancel of a delete | a delete only goes forward | | `E-CANARY` | — | the canary was judged and failed; the rollout rolls back | read the step's numbers, fix the revision, roll again | | `E-CANARY-ABORTED` | — | an operator aborted the canary hold | roll again when ready | | `E-CANARY-NOT-HOLDING`, `E-CANARY-DECIDED` | 409 | no canary hold to end; a decision already stands | read the run; a decision is not reversed | | `E-EVAL-GATE` | — | the eval scored below `plan.eval.minScore` | fix the revision, or lower the floor | | `E-SIGNATURE`, `E-UNSIGNED` | — | `images.verify=enforce`: an invalid or absent image signature | see [Supply chain](https://opod.io/docs/control-plane-security/supply-chain/) | | `E-MODEL-SIGNATURE-REJECTED` † | — | an admin rejected an invalid model signature | publish a valid signature, then roll again | | `E-SIGNATURE-NOT-HOLDING` †, `E-SIGNATURE-DECIDED` † | 409 | no signature hold to decide; a decision already stands | read the run | | `E-LORA-RANK` | 400 | a live adapter's rank exceeds what the engines were started for | add it to the plan and roll, or use a smaller rank | ## Models | Code | Cause | What to do | | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | | `E-MODEL-IN-USE` | deleting a model an endpoint names | delete the endpoints first | | `E-MODEL-UNAPPROVED` † | `requireApproval` and a new pin of an unapproved version, or of no version | approve the version, or pin an approved one | | `E-VERSION-UNKNOWN` | a version that does not exist | pick one of `alternatives` | | `E-VERSION-ARCHIVED` | pinning or rolling back to an archived version | promote it back to staging, or pin another | | `E-VERSION-IN-USE` | archiving a version an endpoint pins | move those endpoints first | | `E-HUB-TOKEN-MISSING`, `E-HUB-TOKEN-REFUSED`, `E-HUB-ACCESS-DENIED` | a prefetch step: a gated model and no Hugging Face token; a token the Hub refuses; terms not accepted | see [Models](https://opod.io/docs/control-plane-endpoints/models/) | ## Machines All machine refusals are `400`. | Code | Cause | What to do | | --------------------------------------------------------------------- | ------------------------------------------------------------------------------- | --------------------------------------------------------- | | `E-LEADER-NOWHERE` | an evacuate or drain, and no other node can hold a leader on this one | uncordon a node, or lift an `opod.io/leaders=avoid` fence | | `E-DRAIN-CONFIRM` | the drain's confirmation no longer matches the foreign pods on the node | read the preview again and send its `confirm` token | | `E-NODE-READY` | removing a node that is still Ready | cordon and evacuate it instead | | `E-NODE-HOLDS-OURS` | removing a node that still runs our pods | evacuate it first | | `E-NODE-UNKNOWN` † | a sharing switch for a node that does not exist | check the name | | `E-SHARING-VENDOR` †, `E-SHARING-BUSY` † | time-slicing a non-NVIDIA node; a node that holds what the switch takes away | evacuate our workers first | | `E-CARD-NOT-OUTSIDE` †, `E-CARD-BUSY` †, `E-CARD-RESET-UNSUPPORTED` † | resetting a card of ours; a card with any process on it; a vendor without reset | stop the card through its endpoint, or stop the processes | | `E-CACHE-GC-OFF` | a cache prune while cache GC is turned off (`cache.gc.mode=off`) | turn cache GC on | ## Generic codes Outside the `E-…` codes, the `code` field is one of these: | `code` | Status | Meaning | | ----------------------- | ------ | ------------------------------------------------------------------------------- | | `invalid` | 400 | a request or plan the control plane refuses | | `unauthorized` | 401 | no credential, or one that is unknown | | `credential_in_url` | 401 | a token in a URL | | `ticket_refused` | 401 | an unknown, expired or spent stream ticket | | `forbidden` | 403 | the role does not allow the action | | `not_found` | 404 | no such object, or no such API route | | `conflict` | 409 | the object changed, already exists, or is not in a state that takes the request | | `not_fleet`, `not_cell` | 409 | a fleet route on a cell, or a cell route on a fleet control plane | | `rate_limited` | 429 | too many attempts; the sentence says when to retry | | `upstream` | 502 | the OIDC issuer did not answer | | `unavailable` | 503 | no state store, so a stream ticket cannot be minted | | `internal` | 500 | anything else; the control plane logs it | The OpenAI-compatible routes `/v1/files` and `/v1/batches` answer OpenAI's body, `{ "error": { "message", "type", "param", "code" } }`. `code` is `invalid_api_key` (401), `permission_denied` (403), `rate_limit_exceeded` (429), `invalid_request_error` (400), `not_found` (404), `batch_store_not_configured` (501) or `server_error` (500). `type` is `authentication_error`, `invalid_request_error` or `server_error`.