Reference
Environment variables
Every setting the API reads.
Self-hosted only — on the managed service these are set for you. Organization settings in the interface override the model-related ones.
| Variable | What it does | |
|---|---|---|
API_PORT | Optional | Port to listen on. Defaults to 8080 |
BASE_URL | Important | Your public address. Agent sign-in breaks if wrong |
CODE_EMBED_BASE_URL | Optional | Endpoint for the code search lane |
CODE_EMBED_MODEL | Optional | Model for the code search lane |
COOKIE_DOMAIN | Optional | Cookie domain, if you need it set explicitly |
COOKIE_SECURE | Important | true when serving over HTTPS |
DATABASE_URL | Required | PostgreSQL connection string |
ENCRYPTION_KEY | Required | Encrypts connector credentials. Exactly 32 bytes, base64 |
JWT_SECRET | Required | Signs sessions. 32+ characters |
LENSHUB_ENV | Optional | production enables stricter startup checks |
LLM_API_KEY | Optional | Key for your provider |
LLM_BASE_URL | Optional | API root. Empty for OpenAI itself |
LLM_CHAT_MODEL | Optional | Chat model name |
LLM_EMBED_BASE_URL | Optional | Embedding endpoint. Keep local to avoid sending content out |
LLM_EMBED_MODEL | Optional | Embedding model. Empty keeps the bundled local one |
LLM_PROVIDER | Optional | openai for anything OpenAI-compatible, or vllm |
OPENAI_API_KEY | Optional | Fallback if LLM_API_KEY is unset |
RERANK_DEFAULT | Optional | Rerank without being asked |
RERANK_OVERSAMPLE | Optional | Candidates considered before reranking |
RERANK_URL | Optional | Result reranking service, if you run one |
The worker reads DATABASE_URL, ENCRYPTION_KEY, the LLM_* group, and
WORKER_CONCURRENCY.
See Configuration for which ones actually matter and when.