HyperSaaS
BackendGetting Started

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.

Django Core

VariableDefaultDescription
DJANGO_SETTINGS_MODULEconfig.settings.localSettings module to use
DJANGO_SECRET_KEY—Secret key (auto-generated in dev)
DJANGO_DEBUGTrue (local)Enable debug mode
DJANGO_ALLOWED_HOSTS["localhost", "0.0.0.0", "127.0.0.1"]Allowed host headers
DATABASE_URLpostgres://...PostgreSQL connection string
REDIS_URLredis://redis:6379/0Redis connection string

AI Providers

VariableDefaultDescription
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

Stripe Billing

VariableDefaultDescription
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.

AWS / S3

VariableDefaultDescription
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

Email

VariableDefaultDescription
DJANGO_EMAIL_BACKENDResendEmail 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_EMAILsupport@kognitivatlas.comSender email address

Application URLs

VariableDefaultDescription
FRONT_END_BASE_URLhttp://localhost:3000Frontend URL (for email links, CORS)
BACK_END_BASE_URLhttp://localhost:8000/Backend URL

Accounts

VariableDefaultDescription
DJANGO_ACCOUNT_ALLOW_REGISTRATIONFalseOpen allauth's server-rendered sign-up. Sign-up through the API is unaffected
DJANGO_ADMIN_FORCE_ALLAUTHFalseSend the Django admin's sign-in through allauth

Chat

VariableDefaultDescription
AGENT_ASYNC_ENABLEDFalseRun agent replies to non-streaming requests in Celery
CHAT_HISTORY_TOKEN_BUDGET24000Tokens of history sent with each message
CHAT_HISTORY_SUMMARIESTrueSummarise older turns that don't fit
CHAT_SUMMARY_MODELgpt-4o-miniModel for those summaries
CHAT_AUTO_TITLESTrueName unnamed chats after their first exchange
CHAT_TITLE_MODELgpt-4o-miniModel for titles

Rate Limits

VariableDefaultDescription
THROTTLE_AUTH_ATTEMPTS10/minuteSign-in and account emails, per account
THROTTLE_CHAT_MESSAGES20/minuteSending, regenerating and editing chat messages, per user
THROTTLE_TRANSCRIPTIONS10/minuteSpeech to text, per user
THROTTLE_TRANSLATIONS20/minuteTranslation, per user
THROTTLE_DOCUMENT_UPLOADS30/hourUploads, web-page imports and reprocessing, per user

Observability

VariableDefaultDescription
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)

Celery

VariableDefaultDescription
CELERY_WORKER_MAX_MEMORY_PER_CHILD—Replace a worker process after a task once it uses this many KB; recommended for document parsing

Document Processing

VariableDefaultDescription
DOCUMENT_EMBEDDING_MODELtext-embedding-3-smallOpenAI embedding model
DOCUMENT_EMBEDDING_DIMENSIONS1536Vector dimensions
DOCUMENT_EMBEDDING_BATCH_SIZE512Texts per embedding API call
DOCUMENT_CHUNK_MAX_TOKENS512Max tokens per document chunk
DOCUMENT_MAX_UPLOAD_SIZE52428800Largest file any plan allows (50 MB)
DOCUMENT_PRESIGNED_URL_EXPIRY3600Presigned URL TTL in seconds
DOCUMENT_DOCLING_PARSE_TIMEOUT240Seconds before the fallback parser takes over
DOCUMENT_ALLOWED_EXTENSIONSpdf,docx,txt,csv,md,pptx,xlsxAllowed file types

Retrieval

VariableDefaultDescription
DOCUMENT_QUERY_REWRITEllmRewrite questions before search; none to search as asked
DOCUMENT_QUERY_REWRITE_MODELgpt-4o-miniModel for rewriting
DOCUMENT_QUERY_REWRITE_ALTERNATIVES2Extra phrasings searched
DOCUMENT_RERANKERllmRerank results; none to turn it off
DOCUMENT_RERANK_MODELgpt-4o-miniModel for reranking
DOCUMENT_RERANK_CANDIDATES20Candidates handed to the reranker
DOCUMENT_RERANK_QUERYoriginalJudge against the user's words (original) or the rewrite (rewritten)
DOCUMENT_RERANK_CHARS1500Characters of each chunk the reranker reads
DOCUMENT_MIN_SIMILARITY0.3Semantic matches below this are dropped
DOCUMENT_FTS_LANGUAGEsimpleFull-text search config
DOCUMENT_HNSW_ITERATIVE_SCANrelaxed_orderKeep the vector index searching under a document filter (pgvector 0.8+)
DOCUMENT_CONTEXT_NEIGHBOURS0Neighbouring chunks added around each result (measured: no gain)

On this page