Skip to main content
OpenFang is configured via a single TOML file located at ~/.openfang/config.toml. This file controls all aspects of the system including models, channels, security, memory, and networking.

Quick Start

Create your configuration file:
Or initialize with the setup wizard:

Configuration File Location

  • Default path: ~/.openfang/config.toml
  • Custom path: Set via OPENFANG_CONFIG environment variable
  • Example file: Included in installation at ~/.openfang/config.toml.example

Core Configuration Sections

Models

Configure LLM providers, model routing, and fallback chains

Providers

Setup API keys and endpoints for 27 LLM providers

Channels

Connect to 40+ messaging platforms and configure behavior

Security

Enable authentication, rate limiting, and security features

Minimal Configuration

The absolute minimum configuration requires only a default model:
Set the API key as an environment variable:

Full Configuration Example

Environment Variables

OpenFang uses environment variables for sensitive credentials:

API Keys

Never hardcode API keys in config.toml. Always use environment variables referenced via api_key_env fields.

Hot Reload

OpenFang can automatically reload configuration changes without restarting:

Reload Modes

  • off: No automatic reloading (default for production)
  • restart: Full daemon restart on config change
  • hot: Hot-reload safe sections only (channels, skills, heartbeat)
  • hybrid: Hot-reload where possible, flag restart-required otherwise
Some settings like api_listen and security settings require a full restart and cannot be hot-reloaded.

Validation

Validate your configuration before starting:
View merged configuration (includes defaults):

Configuration Hierarchy

Configuration is loaded with the following precedence (highest to lowest):
  1. Environment variables (for API keys)
  2. Command-line flags (e.g., --api-listen)
  3. config.toml (user configuration)
  4. Built-in defaults (in code)

Next Steps

Configure Models

Set up LLM providers and model routing

Setup Providers

Configure all 27 supported LLM providers

Enable Channels

Connect messaging platforms

Secure Your Instance

Enable authentication and security features