Skip to content

Upgrades & Backups ​

Upgrading ​

Docker Compose ​

bash
docker compose pull
docker compose up -d
  • stable tracks the newest tagged release. Pin an exact tag (such as ghcr.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 ​

bash
git pull
uv sync
uv run llm-proxy --build-frontend

Before you upgrade ​

  1. Back up the database (see below). Database changes are irreversible.
  2. Read the CHANGELOG for breaking changes in the target version.
  3. 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:

bash
docker compose exec -T db pg_dump -U llmproxy llmproxy > llm-proxy-$(date +%F).sql

Restore into a fresh volume:

bash
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 -d

SQLite ​

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.

ActionConsequence
Rotate JWT_SECRETAll console sessions are invalidated; users must sign in again
Rotate ENCRYPTION_KEYStored 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 databaseSessions, decryptable provider keys, logs, usage, and configuration are lost

To read the secrets from the database for migration or escrow:

PostgreSQL:

sql
SELECT key, value->>'key' AS secret FROM server_config WHERE key IN ('jwt_secret','encryption_key_store');

SQLite:

sql
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 ​

TopologyRequirements
Single processSQLite is sufficient; rate limits and circuit breakers run in memory
Multiple workers or replicasPostgreSQL + 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 CDNKeep response keepalive enabled (default) to avoid 524 timeouts. See Reverse Proxy & TLS

MIT licensed