Traceloop Hub can be run in two distinct configuration modes, determined by the HUB_MODE environment variable. This choice dictates how the gateway retrieves its configuration (providers, models, and pipelines) and whether a management API is available.
YAML Mode
In this mode, the gateway loads configuration from a static file. This is suitable for simple deployments where configuration changes are managed via file updates and service restarts.
- Trigger: Set
HUB_MODE=yaml or leave it unset (default). - Configuration File: Controlled by the
CONFIG_FILE_PATH environment variable. If not set, it defaults to config.yaml.
Database Mode
In this mode, the gateway fetches configuration from a PostgreSQL database and periodically polls for updates. This allows for dynamic, live configuration changes without restarting the gateway. It also enables a Management API server.
- Trigger: Set
HUB_MODE=database. - Database Connection: Requires the
DATABASE_URL environment variable to be set. - Polling: The frequency of configuration updates is controlled by
DB_POLL_INTERVAL_SECONDS (defaults to 30 seconds).
# Example: Running in YAML mode with a custom config path
export HUB_MODE=yaml
export CONFIG_FILE_PATH=/path/to/my/config.yaml
./hub
# Example: Running in Database mode
export HUB_MODE=database
export DATABASE_URL=postgres://user:pass@localhost:5432/dbname
./hub