docs / deployment / production

Production deployment

What changes between dev and production: process supervision, TLS, database backing, monitoring, and capacity planning.

Process supervision

Run under a process manager (systemd, supervisord, Kubernetes) so Soriku restarts on crash. Use a real ASGI server config: 2-4 Uvicorn workers behind a reverse proxy.

uvicorn server:app \
--host 0.0.0.0 \
--port 8765 \
--workers 4 \
--proxy-headers \
--forwarded-allow-ips '*'

TLS

Terminate TLS at the reverse proxy (Caddy, nginx, Traefik). Soriku doesn't terminate TLS itself, by design: the proxy handles renewal.

Database

Local SQLite is fine for single-user. For multi-tenant production, point at Postgres via DATABASE_URL. Migrations run automatically on first start.

Monitoring

Capacity

Local model inference is RAM-bound. For each concurrent 7B model loaded, budget 5-6 GB. The router enforces RAM-aware loading and won't load two big models at once unless you have the memory.