Environment Variables
All configuration variables for the HyperSaaS backend.
Environment variables are stored in .envs/.local/ for development and .envs/.production/ for production. The backend uses django-environ to load them.
| Variable | Default | Description |
|---|
DJANGO_SETTINGS_MODULE | config.settings.local | Settings module to use |
DJANGO_SECRET_KEY | — | Secret key (auto-generated in dev) |
DJANGO_DEBUG | True (local) | Enable debug mode |
DJANGO_ALLOWED_HOSTS | ["localhost", "0.0.0.0", "127.0.0.1"] | Allowed host headers |
DATABASE_URL | postgres://... | PostgreSQL connection string |
REDIS_URL | redis://redis:6379/0 | Redis connection string |
| Variable | Default | Description |
|---|
OPENAI_API_KEY | — | OpenAI API key (required for embeddings) |
GOOGLE_API_KEY | — | Google AI API key |
ANTHROPIC_API_KEY | — | Anthropic API key |
SERPAPI_API_KEY | — | SerpApi key for the web search tool |
WEATHERAPI_COM_API_KEY | — | WeatherAPI key for weather tool |
GOOGLE_MAPS_API_KEY | — | Google Maps key for location tool |
| Variable | Default | Description |
|---|
STRIPE_API_SECRET | — | Stripe secret key |
STRIPE_PUBLISHABLE_KEY | — | Stripe publishable key |
STRIPE_WEBHOOK_SECRET | — | Stripe webhook signing secret |
Plans, prices and products come from subscriptions/plans.py, not environment variables; see Plans.
| Variable | Default | Description |
|---|
DJANGO_AWS_ACCESS_KEY_ID | — | AWS access key |
DJANGO_AWS_SECRET_ACCESS_KEY | — | AWS secret key |
DJANGO_AWS_STORAGE_BUCKET_NAME | — | S3 bucket name |
AWS_S3_REGION_NAME | — | S3 region |
| Variable | Default | Description |
|---|
DJANGO_EMAIL_BACKEND | Resend | Email backend. Locally, django.core.mail.backends.smtp.EmailBackend sends to Mailpit at http://localhost:8025 |
RESEND_API_KEY | — | Resend API key for transactional email |
DEFAULT_FROM_EMAIL | support@kognitivatlas.com | Sender email address |
| Variable | Default | Description |
|---|
FRONT_END_BASE_URL | http://localhost:3000 | Frontend URL (for email links, CORS) |
BACK_END_BASE_URL | http://localhost:8000/ | Backend URL |
| Variable | Default | Description |
|---|
DJANGO_ACCOUNT_ALLOW_REGISTRATION | False | Open allauth's server-rendered sign-up. Sign-up through the API is unaffected |
DJANGO_ADMIN_FORCE_ALLAUTH | False | Send the Django admin's sign-in through allauth |
| Variable | Default | Description |
|---|
AGENT_ASYNC_ENABLED | False | Run agent replies to non-streaming requests in Celery |
CHAT_HISTORY_TOKEN_BUDGET | 24000 | Tokens of history sent with each message |
CHAT_HISTORY_SUMMARIES | True | Summarise older turns that don't fit |
CHAT_SUMMARY_MODEL | gpt-4o-mini | Model for those summaries |
CHAT_AUTO_TITLES | True | Name unnamed chats after their first exchange |
CHAT_TITLE_MODEL | gpt-4o-mini | Model for titles |
| Variable | Default | Description |
|---|
THROTTLE_AUTH_ATTEMPTS | 10/minute | Sign-in and account emails, per account |
THROTTLE_CHAT_MESSAGES | 20/minute | Sending, regenerating and editing chat messages, per user |
THROTTLE_TRANSCRIPTIONS | 10/minute | Speech to text, per user |
THROTTLE_TRANSLATIONS | 20/minute | Translation, per user |
THROTTLE_DOCUMENT_UPLOADS | 30/hour | Uploads, web-page imports and reprocessing, per user |
| Variable | Default | Description |
|---|
LANGFUSE_PUBLIC_KEY | — | Langfuse public key; tracing is off without it |
LANGFUSE_SECRET_KEY | — | Langfuse secret key |
LANGFUSE_BASE_URL | — | Only for self-hosted Langfuse or the US region |
SENTRY_DSN | — | Sentry error reporting (production) |
| Variable | Default | Description |
|---|
CELERY_WORKER_MAX_MEMORY_PER_CHILD | — | Replace a worker process after a task once it uses this many KB; recommended for document parsing |
| Variable | Default | Description |
|---|
DOCUMENT_EMBEDDING_MODEL | text-embedding-3-small | OpenAI embedding model |
DOCUMENT_EMBEDDING_DIMENSIONS | 1536 | Vector dimensions |
DOCUMENT_EMBEDDING_BATCH_SIZE | 512 | Texts per embedding API call |
DOCUMENT_CHUNK_MAX_TOKENS | 512 | Max tokens per document chunk |
DOCUMENT_MAX_UPLOAD_SIZE | 52428800 | Largest file any plan allows (50 MB) |
DOCUMENT_PRESIGNED_URL_EXPIRY | 3600 | Presigned URL TTL in seconds |
DOCUMENT_DOCLING_PARSE_TIMEOUT | 240 | Seconds before the fallback parser takes over |
DOCUMENT_ALLOWED_EXTENSIONS | pdf,docx,txt,csv,md,pptx,xlsx | Allowed file types |
| Variable | Default | Description |
|---|
DOCUMENT_QUERY_REWRITE | llm | Rewrite questions before search; none to search as asked |
DOCUMENT_QUERY_REWRITE_MODEL | gpt-4o-mini | Model for rewriting |
DOCUMENT_QUERY_REWRITE_ALTERNATIVES | 2 | Extra phrasings searched |
DOCUMENT_RERANKER | llm | Rerank results; none to turn it off |
DOCUMENT_RERANK_MODEL | gpt-4o-mini | Model for reranking |
DOCUMENT_RERANK_CANDIDATES | 20 | Candidates handed to the reranker |
DOCUMENT_RERANK_QUERY | original | Judge against the user's words (original) or the rewrite (rewritten) |
DOCUMENT_RERANK_CHARS | 1500 | Characters of each chunk the reranker reads |
DOCUMENT_MIN_SIMILARITY | 0.3 | Semantic matches below this are dropped |
DOCUMENT_FTS_LANGUAGE | simple | Full-text search config |
DOCUMENT_HNSW_ITERATIVE_SCAN | relaxed_order | Keep the vector index searching under a document filter (pgvector 0.8+) |
DOCUMENT_CONTEXT_NEIGHBOURS | 0 | Neighbouring chunks added around each result (measured: no gain) |