Never commit real runtime configuration or credentials. Only placeholder examples belong in the repository.
Precedence
- Built-in defaults.
LLMGW_CONFIG, or<state>/config.yamlwhen unset.LLMGW_*environment overrides.
LLMGW_CONFIG_SEED copies once when the writable config is missing. Local Compose uses it for the read-only repository seed.
Provider instances
providers:
local-chat:
type: ollama
base_url: http://127.0.0.1:11434
hosted-chat:
type: openai_compatible
registry_id: openrouter
base_url: https://openrouter.ai/api/v1
api_key: ${ENV:OPENROUTER_API_KEY}
timeout: 120Other fields include region, project, location, default voice, disabled status, and experimental API adaptation. See provider integrations.
Endpoints
endpoints:
coding:
failover:
- { provider: hosted-chat, model: <model-a> }
- { provider: local-chat, model: <model-b> }categories remains a deprecated fallback only when endpoints is absent.
Provider resilience policy
policies defaults apply to every provider, and exact provider IDs can override retry and circuit settings.Endpoint failover is separately configured under endpoints. Circuit counters and cooldown state are process-local and reset on restart. Use the supported fields in the example configuration and read the routing boundary.
Important environment variables
| Variable | Purpose |
|---|---|
LLMGW_API_KEY | Static administrator/recovery key; LLMGW_API_KEYS adds more. The data plane accepts them without key or project policy and quotas, so give clients project keys. |
LLMGW_CREDENTIAL_ENCRYPTION_KEY | Exactly 32 decoded bytes for private connections and recoverable keys. A start with a key other than the one the database was encrypted with fails. |
LLMGW_NEW_CREDENTIAL_ENCRYPTION_KEY | Read only by llmgw credentials rekey: the new key it re-encrypts stored credentials with. Rotation removes it afterwards. |
LLMGW_STATE_DIR | Writable state root. |
LLMGW_GOOGLE_ANTIGRAVITY_CLIENT_ID | Operator-authorized OAuth client ID for experimental Antigravity connections. |
LLMGW_GOOGLE_ANTIGRAVITY_CLIENT_SECRET | Matching runtime-only OAuth client secret. |
LLMGW_OAUTH_PUBLIC_BASE_URL | Public origin used for browser OAuth. Register <origin>/oauth/callback/google_antigravity as the exact redirect URI. |
LLMGW_SSO_* | Trusted reverse-proxy identity boundary. |
LLMGW_EXTENSION_URL, LLMGW_EXTENSION_SECRET | No longer read: add the optional, separately distributed companion daemon as an extension on the console's Providers page or with POST /admin/api/extensions. While either is set, the gateway logs a startup warning. |
LLMGW_LOG_REQUESTS | Metadata request logging. |
LLMGW_LOG_REQUEST_BODIES | Unsafe explicit opt-in for prompt and response body capture. |
LLMGW_RETENTION_* | Usage, audit, and delivered-outbox windows. |
LLMGW_BACKUP_KEEP | Verified default-directory archive count. |
State layout
gateway.db is authoritative for IAM, keys, encrypted connections, usage, quotas, audit, alerts, and outbox. Other files include catalog.json, telemetry.db, optional usage.db, plaintext compatibility secrets.json, OAuth cache, logs, and backups.
config.yaml, secrets.json, databases, caches, logs, and archives must never be committed.