.env file created during safia setup. You can re-open that file at any time using the interactive editor, or edit it directly with a text editor. All variables below correspond to entries in .env.
Required
These four variables are the minimum needed to run the bot.
A minimal
.env for getting started:
LLM Settings
SAFIA supports four LLM providers out of the box. Each provider’s base URL is set automatically — you only need to supplyLLM_PROVIDER and LLM_API_KEY.
- Lunos
- Groq
- OpenAI
- Custom (OpenAI-Compatible)
https://api.lunosrouter.com/v1) is set automatically.Speech-to-text always uses Whisper via Groq, regardless of which LLM provider you select for chat. If you use a non-Groq LLM provider, set
GROQ_API_KEY separately to enable voice message transcription.Voice Transcription and Web Search
Two optional integrations expand what SAFIA can do:Database & Cache
SAFIA stores all financial data in a relational database. Chat history, price caches, and per-user rate limits run in an in-memory cache that is transparently persisted to SQLite, so state survives restarts without an external cache server.
SQLite (default) — no additional setup required. The database file is created automatically at
data/safia.db.
PostgreSQL — swap DATABASE_URL with an asyncpg connection string:
Admin Dashboard
The admin dashboard runs athttp://127.0.0.1:5454 and provides usage metrics, a user registry, and knowledge base management. Protect it with HTTP Basic Auth before using it.
Knowledge Base
The knowledge base (RAG) lets you upload documents that SAFIA uses to ground its responses. Embeddings and vector storage run locally by default.
Optional: Remote Qdrant
The local embedding model downloads automatically on first use and runs on CPU via ONNX Runtime. No GPU is required. Switching to remote embeddings is only necessary if your machine has very limited disk space or you want to use a higher-dimensional model.