# ───────────────────────────────────────────────────────────────────────────── # Mosaic — Environment Variables Reference # Copy this file to .env and fill in the values for your deployment. # Lines beginning with # are comments; optional vars are commented out. # ───────────────────────────────────────────────────────────────────────────── # ─── Database (PostgreSQL 17 + pgvector) ───────────────────────────────────── # Full connection string used by the gateway, ORM, and migration runner. # Port 5433 avoids conflict with a host-side PostgreSQL instance. DATABASE_URL=postgresql://mosaic:mosaic@localhost:5433/mosaic # Docker Compose host-port override for the PostgreSQL container (default: 5433) # PG_HOST_PORT=5433 # ─── Queue (Valkey 8 / Redis-compatible) ───────────────────────────────────── # Port 6380 avoids conflict with a host-side Redis/Valkey instance. VALKEY_URL=redis://localhost:6380 # Docker Compose host-port override for the Valkey container (default: 6380) # VALKEY_HOST_PORT=6380 # ─── Gateway ───────────────────────────────────────────────────────────────── # TCP port the NestJS/Fastify gateway listens on (default: 4000) GATEWAY_PORT=4000 # Comma-separated list of allowed CORS origins. # Must include the web app origin in production. GATEWAY_CORS_ORIGIN=http://localhost:3000 # ─── Auth (BetterAuth) ─────────────────────────────────────────────────────── # REQUIRED — random secret used to sign sessions and tokens. # Generate with: openssl rand -base64 32 BETTER_AUTH_SECRET=change-me-to-a-random-32-char-string # Public base URL of the gateway (used by BetterAuth for callback URLs) BETTER_AUTH_URL=http://localhost:4000 # ─── Web App (Next.js) ─────────────────────────────────────────────────────── # Public gateway URL — accessible from the browser, not just the server. NEXT_PUBLIC_GATEWAY_URL=http://localhost:4000 # ─── OpenTelemetry ─────────────────────────────────────────────────────────── # OTLP HTTP endpoint (otel-collector or any OpenTelemetry-compatible backend) OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 # Service name shown in traces OTEL_SERVICE_NAME=mosaic-gateway # ─── AI Providers ──────────────────────────────────────────────────────────── # Ollama (local models — set OLLAMA_BASE_URL to enable) # OLLAMA_BASE_URL=http://localhost:11434 # OLLAMA_HOST is a legacy alias for OLLAMA_BASE_URL # OLLAMA_HOST=http://localhost:11434 # Comma-separated list of Ollama model IDs to register (default: llama3.2,codellama,mistral) # OLLAMA_MODELS=llama3.2,codellama,mistral # Anthropic (claude-sonnet-4-6, claude-opus-4-6, claude-haiku-4-5) # ANTHROPIC_API_KEY=sk-ant-... # OpenAI (gpt-4o, gpt-4o-mini, o3-mini) # OPENAI_API_KEY=sk-... # Z.ai / GLM (glm-4.5, glm-4.5-air, glm-4.5-flash) # ZAI_API_KEY=... # Custom providers — JSON array of provider configs # Format: [{"id":"","baseUrl":"","apiKey":"","models":[{"id":"","name":"