Usage>Configuration

Configuration

Prism is configured entirely through environment variables. You only need to set credentials for Postgres and a JWT secret. Everything else has a sensible default optimized for production use.

Environment variables

VariableDefaultDescription
POSTGRES_PASSWORDRequiredPassword for the Postgres database. Ensure this matches what is defined in the Docker compose services.
JWT_SECRETRequiredSecret used for signing internal tokens. Use a secure 64-character string (e.g. openssl rand -hex 32).
OPENAI_API_KEYemptyYour OpenAI API key. Forwarded to the upstream provider on cache misses, or used for embeddings if EMBEDDING_PROVIDER=openai.
OLLAMA_URLhttp://ollama:11434URL to your local or remote Ollama instance.
EMBEDDING_MODELnomic-embed-textModel to use for generating embeddings. Must be available in Ollama or via OpenAI.
EMBEDDING_PROVIDERollamaChoose between ollama and openai.
L1_MAX_BYTES134217728Max memory allowed for L1 in-memory cache, in bytes (default 128MB).
L1_DEFAULT_TTL3600Time-to-live for L1 cache entries, in seconds (default 1 hour).
RATE_LIMIT_RPM1000Maximum requests per minute per tenant. Set to 0 to disable.
CB_MAX_FAILURES5Consecutive upstream failures before the circuit breaker opens.
CB_TIMEOUT30sDuration the circuit breaker stays open before attempting to retry.
LOG_LEVELinfoLogging verbosity. Options: debug, info, warn, error.

Complete .env example

.env
# ── Database ───────────────────────────────────────────
POSTGRES_USER=cache
POSTGRES_PASSWORD=my_secure_postgres_pass
POSTGRES_DB=cache
# ── Redis ──────────────────────────────────────────────
REDIS_PASSWORD=
# ── Security ───────────────────────────────────────────
JWT_SECRET=c2f58e8b693bc2f5...
# ── Embeddings ─────────────────────────────────────────
OLLAMA_URL=http://ollama:11434
EMBEDDING_MODEL=nomic-embed-text
EMBEDDING_PROVIDER=ollama
OPENAI_API_KEY=sk-proj-...
# ── Cache Tuning ───────────────────────────────────────
L1_MAX_BYTES=268435456 # 256MB
L1_DEFAULT_TTL=7200 # 2 hours
# ── Rate Limiting & Circuit Breaker ────────────────────
RATE_LIMIT_RPM=2000
CB_MAX_FAILURES=3
CB_TIMEOUT=15s
# ── Observability ──────────────────────────────────────
LOG_LEVEL=info
GRAFANA_ADMIN_USER=admin
GRAFANA_ADMIN_PASSWORD=my_grafana_pass