Local
Run AI Gateway on your machine for development.
On this page
For development, run Postgres and Redis in Docker and the gateway on the host with hot reload.
Dependencies
git clone https://github.com/boelabs/ai-gateway.git && cd ai-gateway
bun install
docker compose -f docker/compose.yaml -f docker/compose.local.yaml up -d postgres redisThis starts only Postgres and Redis locally (plaintext on localhost), which the gateway reaches
without TLS — so there is no Bun TLS issue.
Configure and run
Create apps/api/.env (see Setup) with the local connection strings:
DATABASE_URL=postgres://gateway:gateway@localhost:5432/ai_gateway
REDIS_URL=redis://localhost:6379Apply migrations and start it on Bun with hot reload:
bun run --filter @boelabs/ai-gateway-api db:migrate
bun run --filter @boelabs/ai-gateway-api dev
curl http://localhost:4000/health/readydev runs the gateway on Bun with --watch (restart on change). Next, the
Quickstart registers a provider and makes your first call.
Full stack locally
To run everything (gateway + dashboard + dependencies) in containers instead of on the host:
docker compose -f docker/compose.yaml -f docker/compose.local.yaml up -dThe override binds Postgres, Redis, the gateway, and the dashboard to 127.0.0.1; it is intentionally not
loaded by production PaaS deployments.