OpenWeights

Configuration

Every environment variable each service reads, with its default.

All configuration comes from environment variables. The Compose stack reads them from the root .env through --env-file .env, and the template is ops/.env.example.

.env is the secret store. make setup writes it with permissions 0600.

openweights-cas

The CAS parses its configuration into one struct at boot. A missing required variable exits 2; any other boot failure exits 1.

Required

VariableNotes
DATABASE_URLPostgres connection string
REDIS_URLRedis connection string
INDEXD_URLSia indexer app API. Compose passes OPENWEIGHTS_INDEXER_URL into it
OPENWEIGHTS_APP_ID64 hex characters
OPENWEIGHTS_APP_KEYBase64 of exactly 32 bytes. Produced by openweights-cas-register
GATEWAY_URL_SIGNING_KEYBase64 of exactly 32 bytes

Optional

VariableDefaultNotes
BIND_ADDR0.0.0.0:8080Listen address
GATEWAY_URL_SIGNING_KEY_PREVemptySecond verification key during rotation
GATEWAY_URL_TTL_SECS7200Signed-URL lifetime
GATEWAY_BASE_URLhttp://127.0.0.1:9090URL base stamped into signed URLs
V2_RECONSTRUCTION_ENABLEDfalse in code, true in ComposeV2 reconstruction. Off means 501 and clients fall back to V1
PG_MAX_CONNECTIONS20Postgres pool size
CAS_PUBLIC_URLhttp://localhost:8080The CAS URL as the client reaches it. Returned as casUrl
CONSOLE_BASE_URLhttp://localhost:5173OAuth redirect target and the single allowed CORS origin
XET_JWT_SIGNING_KEYemptyHS256 secret for Xet tokens. While empty the token endpoints return 500
OPENWEIGHTS_ADMIN_PASSWORDemptyPassword sign-in. Empty disables it
OPENWEIGHTS_ADMIN_USERNAMEadminDisplay name for the password admin
GITHUB_OAUTH_CLIENT_IDemptyGitHub OAuth. Both id and secret must be set to enable it
GITHUB_OAUTH_CLIENT_SECRETempty
GITHUB_OAUTH_CALLBACK_URLhttp://localhost:8080/auth/github/callbackMust match the OAuth app registration exactly
INDEXD_ADMIN_URLemptyAdmin API of your own indexd, for the console host map and setup panels
INDEXD_ADMIN_PASSWORDemptyAdmin API password
RUST_LOGinfotrace, debug, info, warn, or error

Read outside the config struct

VariableDefaultNotes
OPENWEIGHTS_GATEWAY_READStrue in ComposeExactly true advertises the gateway read path. Any other value has the CAS serve reads itself
OPENWEIGHTS_SIA_UPLOAD_BUDGET_SECS300 in code, 20 in ComposeHow long an upload waits for Sia before handing off to the reconciler
OPENWEIGHTS_SIA_OP_TIMEOUT_SECS600 in code, 3600 in ComposeBound on one reconciler attempt
OPENWEIGHTS_DATA_SHARDS10Erasure-coding data shards. An invalid value fails at startup
OPENWEIGHTS_PARITY_SHARDS20Erasure-coding parity shards
OPENWEIGHTS_SIA_MOCKunsetExactly true wires an in-memory mock Sia adapter. Requires the sia-mock cargo feature at build time. Bytes are not durable; for local development only

The base Compose file passes CONSOLE_BASE_URL, the GITHUB_OAUTH_* variables, and the INDEXD_ADMIN_* variables into the CAS container (each reads from .env with a sensible default), so you configure them by setting them in .env. Only OPENWEIGHTS_DATA_SHARDS / OPENWEIGHTS_PARITY_SHARDS are absent from the base file — set those via a Compose override if you need to change the scheme.

openweights-gateway

Only GATEWAY_URL_SIGNING_KEY is required. Everything else has a default, and Postgres, Sia, and the cache each degrade to a warning at boot rather than crashing.

VariableDefaultNotes
GATEWAY_URL_SIGNING_KEYrequiredBase64 of exactly 32 bytes. Must match the CAS
GATEWAY_URL_SIGNING_KEY_PREVemptyAccepted as a second verification key
GATEWAY_ADDR:8081Public listener
GATEWAY_METRICS_ADDR127.0.0.1:9100Metrics listener, /metrics only
GATEWAY_URL_TTL_SECS7200Parsed for shape. Verification uses the URL's own exp
GATEWAY_BASE_URLemptyInformational. Verification covers the canonical string, not the URL prefix
POSTGRES_URLemptyConnect as the openweights_gw role
GATEWAY_CACHE_DIR/var/cache/openweightsCache root. Empty disables the cache
GATEWAY_CACHE_SIZE_BYTES107374182400 (100 GiB)Eviction budget. Zero disables the cache

The gateway also loads a .env file if one is present next to the binary, which is a convenience for running it outside Compose.

Aliases

Each pair resolves to the first non-empty value, canonical name first.

CanonicalAlias
OPENWEIGHTS_INDEXER_URLSIA_INDEXER_URL
OPENWEIGHTS_APP_KEYAPP_KEY
GATEWAY_CACHE_DIRCACHE_DIR
GATEWAY_CACHE_SIZE_BYTESCACHE_SIZE_BYTES

OPENWEIGHTS_APP_ID has no alias. The gateway accepts the same base64 App Key value the CAS uses and expands it internally, so both derive the identical object-encryption key.

openweights-hf-proxy

VariableDefaultNotes
OPENWEIGHTS_CAS_PUBLIC_URLrequiredThe CAS URL as the client reaches it. Exits 2 if unset. Compose marks it required
HF_UPSTREAM_URLhttps://huggingface.coMust be absolute
LISTEN_ADDR:28090Listen address

openweights-console

The console resolves its URLs in three steps: runtime /config.js first, then build-time VITE_*, then localhost defaults. This is what lets one published image serve any deployment.

Runtime, read by the container entrypoint

VariableFalls back to
OPENWEIGHTS_CONSOLE_CAS_URLVITE_CAS_URL, then http://localhost:8080
OPENWEIGHTS_CONSOLE_GATEWAY_URLVITE_GATEWAY_URL, then http://localhost:9090
OPENWEIGHTS_CONSOLE_HF_PROXY_URLVITE_HF_PROXY_URL, then http://localhost:28090

The nginx entrypoint writes these into /config.js at container start as window.__OPENWEIGHTS_CONFIG__. An empty value falls through to the build-time default.

Build-time

VITE_CAS_URL, VITE_GATEWAY_URL, VITE_HF_PROXY_URL, and VITE_CONFORMANCE_BADGE_URL are Compose build arguments, baked in when you build the image yourself. They are browser-visible and hold no secrets.

Infrastructure

Compose refuses to start without these four.

VariableUsed by
POSTGRES_SUPERUSER_PASSWORDPostgres
OPENWEIGHTS_POSTGRES_PASSWORDPostgres and the CAS
OPENWEIGHTS_GW_POSTGRES_PASSWORDPostgres and the gateway
REDIS_PASSWORDRedis and the CAS

make setup generates any of them that is empty, as 32 random bytes hex-encoded.

Stack-level

VariableDefaultNotes
OPENWEIGHTS_INDEXER_URLhttps://sia.storageThe indexer for the whole stack
OPENWEIGHTS_RECOVERY_PHRASEnoneBIP-39 phrase. Never leaves .env
OPENWEIGHTS_VERSIONlatestImage tag pulled from GHCR
GATEWAY_POSTGRES_URLderivedFull override for the gateway's connection string
OPENWEIGHTS_ACME_EMAILrequired in the prod overlayLet's Encrypt account address

Which URL variable is which

Four variables hold a URL for the same service, and mixing them up is the most common configuration mistake.

VariableWhose viewLocal value
INDEXD_URLThe CAS, inside the Compose networkyour indexer URL
CAS_PUBLIC_URLThe client machine, returned as casUrlhttp://localhost:8080
OPENWEIGHTS_CAS_PUBLIC_URLThe client machine, substituted by hf-proxyhttp://localhost:8080
GATEWAY_BASE_URLThe client machine, stamped into signed URLshttp://127.0.0.1:9090

Anything labelled "the client machine" must be reachable from where hf runs, not from inside a container.

On this page