Core reference
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.
OPOD_LISTEN=:8090 OPOD_LOG_LEVEL=debug opod upOpod 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:
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 upA one-machine leader that serves a model itself, with its data elsewhere:
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=<vllm key> \
OPOD_DEFAULT_MODEL=qwen2.5-7b-instruct OPOD_PULL_DEFAULT_MODEL=1 \
opod upRouter, placement and safety knobs:
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 upOther 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-<admin-key>, OPOD_JOIN_TOKEN=sk-orc-<node-token>, 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 <collector token>. 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. |
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-<printed once>. 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:
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 <collector token>' \
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-<admin-key> opod up
OPOD_ROLE=door OPOD_DOOR_ROUTES=/etc/opod-door/routes.json opod upThe OPOD_USAGE_* lines need a leader from core v0.4.0; v0.3.0 ignores them and serves usage on the usage stream.
A leader in a Vertex AI custom container:
OPOD_VERTEX=1 AIP_PREDICT_ROUTE=/v1/vertex:predict AIP_HEALTH_ROUTE=/v1/vertex/health opod upProcess 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. |
OPOD_ADAPTERS | JSON list of LoRA adapters [{"name","source","rank"}], served as <model>:<name>. |
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. |
OPOD_NODE_ID | A stable node id across restarts. |
POD_NAME | Without OPOD_NODE_ID and node.yaml, the id becomes n_<POD_NAME>. |
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://<domain>/opod/node/<id> 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:
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-<node-token>"A prefill worker with a CPU KV tier, joining a TLS leader with a certificate instead of a token:
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:8080A worker that loads a GGUF from another repo than the catalog's, and a prefetch that reports its result:
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-<node-token>"
# 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/modelsIn 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 <repo>@<rev>. Empty = main. |
OPOD_MODEL_SHA256 | Expected SHA-256 of the model file. A mismatch removes the file and fails the load. |
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_<your token> 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-<node-token>"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. |
OPOD_TOKEN=sk-orc-<alice-key> OPOD_BASE_URL=http://leader.example.com:8080 opod connect cursor
OPOD_API_KEY=sk-orc-<key> 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 editThe container images' entrypoint reads a few more (OPOD_ROLE=worker, OPOD_MODELS_DIR, POD_IP, OPOD_ENGINE_START). See Images.
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. |
Last updated · Source: content/docs/core-reference/environment.mdx · View as Markdown