~/.openfang/config.toml. This file controls all aspects of the system including models, channels, security, memory, and networking.
Quick Start
Create your configuration file:Configuration File Location
- Default path:
~/.openfang/config.toml - Custom path: Set via
OPENFANG_CONFIGenvironment 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: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 changehot: Hot-reload safe sections only (channels, skills, heartbeat)hybrid: Hot-reload where possible, flag restart-required otherwise
Validation
Validate your configuration before starting:Configuration Hierarchy
Configuration is loaded with the following precedence (highest to lowest):- Environment variables (for API keys)
- Command-line flags (e.g.,
--api-listen) config.toml(user configuration)- 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