Core environment variables are centralized in api/constants.py. Variables marked Required in the description must be explicitly set — the application will either fail to boot or behave insecurely without them.

Deployment Modes

VR3 AI supports two deployment modes, set via DEPLOYMENT_MODE:
  • OSS: The default mode and the one VR3 AI runs in. Designed for self-hosted deployments using Docker Compose — the fastest way to get VR3 AI running. Uses local JWT authentication and MinIO for storage.
  • SaaS: An alternate mode intended for customised deployments outside of Docker, where authentication and API key management are delegated to an external Managed Platform Services (MPS) backend. Self-hosted VR3 AI deployments use the OSS mode above.
The relevant required variables for each mode are noted in the descriptions below.

Application

VariableDefaultDescription
ENVIRONMENTlocalRuntime environment. Affects logging and behaviour. One of local, production, test
DEPLOYMENT_MODEossDeployment mode. Use oss for self-hosted
AUTH_PROVIDERlocalAuthentication provider. local (default) uses the built-in email/password flow. Set to stack to delegate to Stack Auth for social login — see Authentication for the full setup

Database

VariableDefaultDescription
DATABASE_URLN/ARequired. PostgreSQL connection string. e.g. postgresql+asyncpg://user:pass@host:5432/dbname
REDIS_URLN/ARequired. Redis connection string. e.g. redis://localhost:6379

Authentication (OSS)

VariableDefaultDescription
OSS_JWT_SECRETN/ARequired for OSS deployments. Secret used to sign JWT tokens. Must be set to a strong random value in production
OSS_JWT_EXPIRY_HOURS720JWT token lifetime in hours (default: 30 days)
Never use the placeholder OSS_JWT_SECRET in a production deployment. Generate a strong random secret and store it securely.

Authentication (Stack Auth)

Set these when AUTH_PROVIDER=stack to delegate sign-in to Stack Auth for social login. The project id and publishable client key are public and are served to the browser at runtime via /api/v1/health; the secret server key stays server-side. See Authentication for the full walkthrough.
VariableDefaultDescription
STACK_AUTH_PROJECT_IDnullRequired for stack. Stack project ID (public)
STACK_PUBLISHABLE_CLIENT_KEYnullRequired for stack. Stack publishable client key (public)
STACK_SECRET_SERVER_KEYnullRequired for stack. Stack secret server key — server-side only, also set on the ui service. Keep secret
STACK_AUTH_API_URLnullRequired for stack. Stack REST API base URL (e.g. https://api.stack-auth.com)

URLs

VariableDefaultDescription
BACKEND_API_ENDPOINThttp://localhost:8000Internal URL of the backend API
UI_APP_URLhttp://localhost:3010URL of the frontend application
MPS_API_URLhttps://services.dograh.comManaged Platform Services URL (only used in SaaS mode)
DOGRAH_MPS_SECRET_KEYnullRequired for non-OSS deployments. Secret key for authenticating with MPS
CORS_ALLOWED_ORIGINSnullRequired for non-OSS deployments. Comma-separated list of origins allowed to make credentialed cross-origin requests (e.g. https://app.example.com,https://admin.example.com). Ignored in OSS mode, which serves a permissive same-origin policy without credentials

Storage

VR3 AI uses MinIO by default, which is bundled with the self-hosted deployment and requires no external setup. Set ENABLE_AWS_S3=true to switch to AWS S3 — typically used for cloud or managed deployments where S3 is already part of the infrastructure.

MinIO (OSS default)

VariableDefaultDescription
MINIO_ENDPOINTlocalhost:9000MinIO server host and port
MINIO_PUBLIC_ENDPOINTnullPublicly accessible MinIO URL (for download links)
MINIO_ACCESS_KEYN/ARequired for OSS deployments. MinIO access key. Must be set to a secure value in production
MINIO_SECRET_KEYN/ARequired for OSS deployments. MinIO secret key. Must be set to a secure value in production
MINIO_BUCKETvoice-audioBucket name for audio files
MINIO_SECUREfalseUse HTTPS for MinIO connections

AWS S3 (alternative)

VariableDefaultDescription
ENABLE_AWS_S3falseSet to true to use AWS S3 instead of MinIO
S3_BUCKETnullS3 bucket name
S3_REGIONus-east-1AWS region

WebRTC

VariableDefaultDescription
TURN_HOSTlocalhostTURN server hostname for WebRTC NAT traversal
TURN_PORT3478TURN server port
TURN_TLS_PORT5349TURN server TLS port
TURN_SECRETnullRequired for WebRTC. Shared secret for TURN credential generation
TURN_CREDENTIAL_TTL86400TURN credential validity in seconds (default: 24h)
FORCE_TURN_RELAYfalseDiagnostic flag. When true, restricts ICE to relay-only candidates on both server (SDP filter) and browser (iceTransportPolicy: 'relay'). Use to verify TURN connectivity end-to-end — calls fail cleanly if TURN is misconfigured instead of silently falling back to a direct path.

Tracing (Langfuse)

VariableDefaultDescription
LANGFUSE_HOSTnullLangfuse OTEL ingest URL the backend pushes traces to (may be internal-only when self-hosting)
LANGFUSE_PUBLIC_URLLANGFUSE_HOSTBrowser-reachable Langfuse web URL for “View Trace” links; set when LANGFUSE_HOST is internal-only
LANGFUSE_PUBLIC_KEYnullLangfuse public key
LANGFUSE_SECRET_KEYnullLangfuse secret key
Tracing activates automatically as soon as credentials are available — either via these environment variables (applied to all organizations) or per-organization in the UI under Platform Settings. If neither is set, spans are dropped silently. See the Tracing guide for setup instructions.

Monitoring

VariableDefaultDescription
SENTRY_DSNnullSentry DSN for error tracking
ENABLE_TELEMETRYfalseEnable anonymous telemetry collection

Logging

VariableDefaultDescription
LOG_LEVELDEBUGLog level: DEBUG, INFO, WARNING, ERROR
LOG_FILE_PATHnullWrite logs to this file path (in addition to stdout)
LOG_ROTATION_SIZE100 MBRotate log file when it reaches this size
LOG_RETENTION7 daysHow long to keep rotated log files
LOG_COMPRESSIONgzCompression format for rotated logs
SERIALIZE_LOG_OUTPUTfalseOutput logs as JSON (useful for log aggregation)

Campaigns

VariableDefaultDescription
DEFAULT_ORG_CONCURRENCY_LIMIT2Maximum concurrent outbound calls per organization

Further Customisation

The variables documented here cover the standard configuration surface. For advanced customisation — such as integrating additional services or tuning internal behaviour — consult the relevant module alongside api/constants.py to understand how each variable is consumed.