Configuration

Back to home

V1 Honesty: OffRouter routes delegated work. It does not replace your harness's primary model call.

Configuration Files

OffRouter loads configuration from a few places. The hierarchy is merged in this order:

  1. Defaults (deny *-work, empty allowlist, no providers)
  2. $OFFROUTER_HOME/config.toml or ~/.offrouter/config.toml
  3. $OFFROUTER_HOME/profiles/*.toml (Profile overlays)
  4. <workspace>/.offrouter/config.toml (Project config — only loaded if workspace is trusted)

Environment Variables

config.toml Schema

The root config file allows you to define allowlists, denylists, global policy, and provider setup.

Global Settings

[policy] Block

Global behavior defaults.

[telemetry] Block

Optional declared preference only. Consent and the anonymous id live in ~/.offrouter/telemetry.json (managed by offrouter telemetry / interactive init). Setting this block alone never starts sending events. See the telemetry docs.

[providers.<id>] Block

Configuration for external provider runtimes or API accounts.

[[routing.rules]] Array of Tables

User-defined routing rules let you pin a model, provider, or tier for a specific caller role or classifier family. Rules are explicit user intent; they run after policy gates and before the automatic subscription-first ranking. A rule can only pick among policy-allowed candidates — a pinned model that is denied stays denied, and routing falls through to the next matching rule, then auto.

Rules are evaluated in declaration order; the first matching rule wins. If no rule matches, OffRouter falls back to auto routing (subscription-first + health + classifier). Unknown keys inside a rule produce a config warning and are stripped. A rule that references a provider not configured in [providers] is also warned and ignored.

[[routing.rules]]
role = "plan"
model = "anthropic/claude-fable-5"

[[routing.rules]]
family = "fast-coder"
tier = "local"

[[routing.rules]]
role = "bulk"
provider = "moonshot"

reserve_subscription_for (when present) is an auto-mode behavior that applies only when no rule matched. Rules are evaluated first; if none match, the auto pipeline and any reserve logic decide the route.

Profile Overlays (profiles/*.toml)

You can create named profile overrides in ~/.offrouter/profiles/<profile-id>.toml. It supports:

Full Example: ~/.offrouter/config.toml

# Root configuration

# Allow routing for personal profiles
allowlisted_profiles = ["claude-personal", "codex-personal"]
# Ensure work profiles are blocked
denied_profile_patterns = ["*-work"]

[policy]
# Use paid subscriptions first
subscription_first = true
# Allow fallback to explicit API keys
allow_api_key_fallback = true
# Warn when less than 10% of allowance remains
near_limit_threshold = 0.1
# Deny some specific providers entirely
denied_providers = ["untrusted-provider-id"]

# Provider definitions
[providers.ollama]
enabled = true
base_url = "http://localhost:11434/v1"
[[providers.ollama.accounts]]
id = "local"
label = "Local Ollama Instance"

[providers.anthropic]
enabled = true
[[providers.anthropic.accounts]]
id = "anthropic-key"
label = "Anthropic API Key"