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
| Variable | Default | Description |
|---|---|---|
| POSTGRES_PASSWORD | Required | Password for the Postgres database. Ensure this matches what is defined in the Docker compose services. |
| JWT_SECRET | Required | Secret used for signing internal tokens. Use a secure 64-character string (e.g. openssl rand -hex 32). |
| OPENAI_API_KEY | empty | Your OpenAI API key. Forwarded to the upstream provider on cache misses, or used for embeddings if EMBEDDING_PROVIDER=openai. |
| OLLAMA_URL | http://ollama:11434 | URL to your local or remote Ollama instance. |
| EMBEDDING_MODEL | nomic-embed-text | Model to use for generating embeddings. Must be available in Ollama or via OpenAI. |
| EMBEDDING_PROVIDER | ollama | Choose between ollama and openai. |
| L1_MAX_BYTES | 134217728 | Max memory allowed for L1 in-memory cache, in bytes (default 128MB). |
| L1_DEFAULT_TTL | 3600 | Time-to-live for L1 cache entries, in seconds (default 1 hour). |
| RATE_LIMIT_RPM | 1000 | Maximum requests per minute per tenant. Set to 0 to disable. |
| CB_MAX_FAILURES | 5 | Consecutive upstream failures before the circuit breaker opens. |
| CB_TIMEOUT | 30s | Duration the circuit breaker stays open before attempting to retry. |
| LOG_LEVEL | info | Logging verbosity. Options: debug, info, warn, error. |
Complete .env example
.env
# ── Database ───────────────────────────────────────────POSTGRES_USER=cachePOSTGRES_PASSWORD=my_secure_postgres_passPOSTGRES_DB=cache# ── Redis ──────────────────────────────────────────────REDIS_PASSWORD=# ── Security ───────────────────────────────────────────JWT_SECRET=c2f58e8b693bc2f5...# ── Embeddings ─────────────────────────────────────────OLLAMA_URL=http://ollama:11434EMBEDDING_MODEL=nomic-embed-textEMBEDDING_PROVIDER=ollamaOPENAI_API_KEY=sk-proj-...# ── Cache Tuning ───────────────────────────────────────L1_MAX_BYTES=268435456 # 256MBL1_DEFAULT_TTL=7200 # 2 hours# ── Rate Limiting & Circuit Breaker ────────────────────RATE_LIMIT_RPM=2000CB_MAX_FAILURES=3CB_TIMEOUT=15s# ── Observability ──────────────────────────────────────LOG_LEVEL=infoGRAFANA_ADMIN_USER=adminGRAFANA_ADMIN_PASSWORD=my_grafana_pass