System configuration
Configure the LLM gateway, PeerDB replication, and Temporal workers for your self-hosted instance.
In this page
A few parts of the stack are configured outside .env: the LLM gateway needs a config.yaml listing its providers, PeerDB needs its replication mirrors running, and Temporal workers can be tuned for throughput. This page covers all three. Set your secrets and provider keys in Environment Variables first, since the config here references them.
LLM Gateway
The gateway is a Go proxy that routes every model call the platform makes. It reads a config.yaml that lists which providers it may use and which models each exposes.
Warning
Model calls fail until this file exists. The gateway ships with config.example.yaml (OpenAI enabled) but not a live config.yaml. You create one in the steps below.
Copy the Example Config
cp agentcc-gateway/config.example.yaml \
agentcc-gateway/config.yaml Add Providers and Keys
Edit config.yaml: uncomment the providers you want and reference their keys with ${VAR} interpolation. Set the matching keys (OPENAI_API_KEY, ANTHROPIC_API_KEY, …) in .env. See the provider examples below.
Mount the Config and Restart
Point the gateway volume at your config.yaml in docker-compose.yml:
volumes:
- ./agentcc-gateway/config.yaml:/app/config.yaml:rodocker compose up -d --force-recreate gateway Warning
config.yaml is gitignored and holds live API keys. Treat it as a secret. Never commit it.
Provider Examples
providers:
openai:
api_key: "${OPENAI_API_KEY}"
api_format: "openai"
models: [gpt-4o, gpt-4o-mini]
anthropic:
api_key: "${ANTHROPIC_API_KEY}"
api_format: "anthropic"
models: [claude-opus-4-5, claude-sonnet-4-5]
gemini:
api_key: "${GOOGLE_API_KEY}"
api_format: "gemini"
models: [gemini-2.0-flash, gemini-1.5-pro] providers:
bedrock:
api_key: "${AWS_SECRET_ACCESS_KEY}"
api_format: "bedrock"
region: "${AWS_REGION}"
access_key: "${AWS_ACCESS_KEY_ID}"
models: [anthropic.claude-3-5-sonnet-20241022-v2:0] providers:
vertex:
base_url: "https://us-central1-aiplatform.googleapis.com"
api_key: "${GOOGLE_ACCESS_TOKEN}"
api_format: "gemini"
headers:
x-gcp-project: "${GCP_PROJECT_ID}"
x-gcp-location: "us-central1"
models: [gemini-2.0-flash-001]Vertex uses a Bearer token, not a static API key. Rotate GOOGLE_ACCESS_TOKEN with a sidecar that calls gcloud auth print-access-token.
For routing rules, rate limits, caching, and the full config reference, see Agent Command Center → Self-Hosted.
PeerDB Replication
PeerDB continuously replicates Postgres tables into ClickHouse (change-data-capture) so trace and eval analytics stay fast. It runs on its own. The only thing you typically touch is a first-boot timing fix.
Warning
First-boot timing. peerdb-init runs the moment the stack starts, sometimes before Django has finished its migrations. If mirrors show “not started” in the PeerDB UI, re-run init once the backend is up:
docker compose logs -f backend # wait for "Application startup complete"
docker compose run --rm peerdb-init bash /setup.sh # re-run init Verify at http://localhost:3001. Mirrors should move to running within seconds. Re-run the same init command after any upgrade that changes replicated tables.
Temporal Workers
Temporal runs the platform’s background jobs and evaluation pipelines. How those jobs are distributed across workers depends on one flag.
All-queue (default). One worker polls every task queue. Controlled by TEMPORAL_ALL_QUEUES=true in .env. This is the right setup for most self-hosted deployments.
Per-queue (dev overlay). Six dedicated workers, one per queue, brought up by the dev overlay:
| Service | Queue | Typical concurrency |
|---|---|---|
worker-default | default | 100 |
worker-tasks-s | tasks_s | 200 |
worker-tasks-l | tasks_l | 50 |
worker-tasks-xl | tasks_xl | 10 |
worker-trace-ingestion | trace_ingestion | 100 |
worker-agent-compass | agent_compass | 50 |
Tune throughput with TEMPORAL_MAX_CONCURRENT_ACTIVITIES and TEMPORAL_MAX_CONCURRENT_WORKFLOW_TASKS in .env. The Temporal UI is available in dev mode at http://localhost:8085.
Dive Deeper
Questions & Discussion