> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gomajordomo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration Reference

> All environment variables for the Majordomo Steward.

Steward is configured entirely through environment variables. There is no config file. Pass variables via your orchestrator (`docker run -e`, Kubernetes Secrets, ECS task definitions, etc.) or a `.env` file for local development.

## Required

| Variable            | Description                                                                                                  |
| ------------------- | ------------------------------------------------------------------------------------------------------------ |
| `ENCRYPTION_KEY`    | 64-character hex string. Used to encrypt provider credentials at rest. Generate with `openssl rand -hex 32`. |
| `POSTGRES_HOST`     | PostgreSQL host.                                                                                             |
| `POSTGRES_USER`     | PostgreSQL user.                                                                                             |
| `POSTGRES_PASSWORD` | PostgreSQL password.                                                                                         |
| `POSTGRES_DB`       | PostgreSQL database name. Default: `majordomo_steward`.                                                      |

## Server

| Variable           | Default   | Description                                                          |
| ------------------ | --------- | -------------------------------------------------------------------- |
| `HOST`             | `0.0.0.0` | Bind address.                                                        |
| `PORT`             | `7680`    | HTTP port.                                                           |
| `READ_TIMEOUT`     | `30s`     | Max duration for reading the full request.                           |
| `WRITE_TIMEOUT`    | `600s`    | Max duration for writing the full response (set high for streaming). |
| `UPSTREAM_TIMEOUT` | `600s`    | Max duration to wait for the upstream LLM provider.                  |

## PostgreSQL

| Variable             | Default   | Description                                         |
| -------------------- | --------- | --------------------------------------------------- |
| `POSTGRES_PORT`      | `5432`    | PostgreSQL port.                                    |
| `POSTGRES_SSLMODE`   | `disable` | SSL mode: `disable`, `require`, `verify-full`, etc. |
| `POSTGRES_MAX_CONNS` | `20`      | Connection pool size.                               |

## Logging

| Variable                  | Default | Description                                                                    |
| ------------------------- | ------- | ------------------------------------------------------------------------------ |
| `LOG_LEVEL`               | `info`  | Log verbosity: `debug`, `info`, `warn`, `error`.                               |
| `LOG_STORE_REQUEST_BODY`  | `false` | Store request bodies in Postgres. Off by default — use cloud storage instead.  |
| `LOG_STORE_RESPONSE_BODY` | `false` | Store response bodies in Postgres. Off by default — use cloud storage instead. |

## Metadata sync

| Variable            | Default | Description                                         |
| ------------------- | ------- | --------------------------------------------------- |
| `BATCH_INTERVAL`    | `60s`   | How often Steward syncs usage metadata to Butler.   |
| `BATCH_MAX_SIZE`    | `500`   | Maximum rows per sync batch.                        |
| `KEY_SYNC_INTERVAL` | `5m`    | How often Steward polls Butler for API key updates. |

## Pricing

| Variable                   | Default                                      | Description                                           |
| -------------------------- | -------------------------------------------- | ----------------------------------------------------- |
| `PRICING_REMOTE_URL`       | `https://www.llm-prices.com/current-v1.json` | Source for live model pricing. Fetched hourly.        |
| `PRICING_REFRESH_INTERVAL` | `1h`                                         | How often to refresh pricing data.                    |
| `PRICING_FALLBACK_FILE`    | `./pricing.json`                             | Local fallback if remote fetch fails.                 |
| `PRICING_ALIASES_FILE`     | `./model_aliases.json`                       | Maps provider model names to canonical pricing names. |

## Provider overrides

Override the base URL for any LLM provider. Useful when routing through an internal gateway or private endpoint.

| Variable             | Default                                     |
| -------------------- | ------------------------------------------- |
| `OPENAI_BASE_URL`    | `https://api.openai.com`                    |
| `ANTHROPIC_BASE_URL` | `https://api.anthropic.com`                 |
| `GEMINI_BASE_URL`    | `https://generativelanguage.googleapis.com` |

## Admin API

| Variable              | Default | Description                                                                             |
| --------------------- | ------- | --------------------------------------------------------------------------------------- |
| `STEWARD_ADMIN_TOKEN` | —       | When set, enables the admin API for managing org registration and checking sync status. |

## Secrets management

Set `ENCRYPTION_KEY` and `POSTGRES_PASSWORD` via your secrets manager — never in source control. In Kubernetes, mount them as Secrets. In ECS, reference them from Parameter Store or Secrets Manager. In Docker, use an `.env` file outside of version control.
