# Configuration

> Note: USE_LOCAL_HELPER_AGENT is deprecated: Ollama inclusion is now controlled by the active strategy's secondary provider list.

Source: https://bifrost5.com/foundry/docs/configuration/

# Configuration

Information

Skip the tuning: Production-Grade starts from a team-ready setup, with support if you want a second opinion.

[See editions](/foundry/docs/editions)

## Environment Variables

| Variable | Purpose |
| --- | --- |
| `CURSOR_CLI_PATH` | Path to `cursor` binary (default: `cursor`) |
| `OPENROUTER_API_KEY` | For OpenRouter integration |
| `PROVIDER_STRATEGY` | `1` (claude-primary), `2` (cursor-primary), or `3` (gemini-primary). Default: `1` |
| `CLI_PROVIDER_PRIORITY` | Override primary adapter list, comma-separated (e.g. `claude,cursor,gemini`) |
| `OLLAMA_BASE_URL` | For local Ollama (default `http://localhost:11434`) |
| `LOCAL_HELPER_MODEL` | Ollama model for helper agent (e.g. `phi4-mini`) |
| `CIRCUIT_BREAKER_TTL_SECONDS` | Circuit breaker TTL (default `86400`) |
| `DISABLE_SESSION_REUSE` | Disable session reuse if rollback needed |

*Note: `USE_LOCAL_HELPER_AGENT` is deprecated: Ollama inclusion is now controlled by the active strategy's secondary provider list.*

## CLI Global Options

Every command expects:

- `--redis-host` (default `localhost`)

- `--redis-port` (default `6499`)

- `--state-key` (e.g. `supervisor:state`)

- `--queue-name` (e.g. `tasks`)

- `--queue-db` (queue DB index, e.g. `2`; must differ from state DB)

- `--state-db` (optional, default `0`)

- `--sandbox-root` (optional, default `./sandbox`)

## Settings Persistence (Postgres)

Configurable settings (Provider Strategy, Sandbox Root, Ollama Base URL, Circuit Breaker TTL) are stored in the Postgres `settings` table and editable via the **UI Settings page** (`/settings`).

**Precedence:** `.env` > Postgres > hardcoded defaults. The UI writes to Postgres only.

## Strategies & Execution Modes

Provider strategies and execution modes are stored in Postgres tables. 3 built-in strategies and 4 built-in execution modes are seeded on first startup (marked `builtin = true`, cannot be deleted). Custom entries can be created, edited, and deleted via the Settings UI.
