Upgrades & Backups
Upgrading
Docker Compose
docker compose pull
docker compose up -dstabletracks the newest tagged release. Pin an exact tag (such asghcr.io/zwldarren/llm-proxy:0.5.3) if you want explicit control over version changes.- Database migrations run automatically at startup and advance the schema to
head. If a migration fails, the container exits and stays down; check the logs, fix the database, and start it again. - Schema migrations are forward-only with no downgrade path.
From source
git pull
uv sync
uv run llm-proxy --build-frontendBefore you upgrade
- Back up the database (see below). Database changes are irreversible.
- Read the CHANGELOG for breaking changes in the target version.
- If you pin image tags, note the current tag so you can roll back the image if needed (the database schema does not roll back with it).
Version awareness
Admins can check for updates under Settings → General → About (GET /api/system/info). The running version is compared against the latest GitHub tag and cached for 6 hours (?force=true bypasses the cache at most once per minute). Set UPDATE_CHECK__ENABLED=false to disable outbound update checks.
Backups
PostgreSQL
With the shipped compose file, PostgreSQL data lives in the postgres_data volume:
docker compose exec -T db pg_dump -U llmproxy llmproxy > llm-proxy-$(date +%F).sqlRestore into a fresh volume:
docker compose down
docker compose up -d db
docker compose exec -T db psql -U llmproxy -d llmproxy < llm-proxy-2026-01-01.sql
docker compose up -dSQLite
The database consists of a single file plus its -wal and -shm sibling files. Stop the service and copy all three, or run sqlite3 config.db ".backup out.db". Default path: ~/.local/share/llm-proxy/config.db.
Redis
Redis stores only reconstructible state (rate-limit windows, sticky routing, stored Responses) with AOF persistence. Backing it up is optional.
What a backup contains
A database backup contains all persistent data: providers, models, pricing, API keys (SHA-256 digests), users, logs, usage records, and the two auto-generated secrets (jwt_secret and encryption_key_store rows in server_config). Restoring the backup restores active sessions and decryptable provider keys.
Secrets: what rotation breaks
Both secrets are generated automatically on first run and stored in the database. Environment overrides (JWT_SECRET, ENCRYPTION_KEY) must be at least 32 characters; shorter values are ignored.
| Action | Consequence |
|---|---|
Rotate JWT_SECRET | All console sessions are invalidated; users must sign in again |
Rotate ENCRYPTION_KEY | Stored provider API keys can no longer be decrypted. Logs warn "The ENCRYPTION_KEY may have changed." Re-enter every provider key after rotating |
| Lose the database | Sessions, decryptable provider keys, logs, usage, and configuration are lost |
To read the secrets from the database for migration or escrow:
PostgreSQL:
SELECT key, value->>'key' AS secret FROM server_config WHERE key IN ('jwt_secret','encryption_key_store');SQLite:
SELECT key, json_extract(value, '$.key') AS secret FROM server_config WHERE key IN ('jwt_secret','encryption_key_store');server_config.value stores a JSON object whose key field holds the actual secret.
Scaling notes
| Topology | Requirements |
|---|---|
| Single process | SQLite is sufficient; rate limits and circuit breakers run in memory |
| Multiple workers or replicas | PostgreSQL + REDIS_ENABLED=true + REDIS_RATE_LIMIT_ENABLED=true (both set in the shipped compose file). Workers auto-scale on PostgreSQL. Run migrations once before adding replicas |
| Behind a CDN | Keep response keepalive enabled (default) to avoid 524 timeouts. See Reverse Proxy & TLS |