LensHub
Get startedlenshub.ai
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.

VariableWhat it does
API_PORTOptionalPort to listen on. Defaults to 8080
BASE_URLImportantYour public address. Agent sign-in breaks if wrong
CODE_EMBED_BASE_URLOptionalEndpoint for the code search lane
CODE_EMBED_MODELOptionalModel for the code search lane
COOKIE_DOMAINOptionalCookie domain, if you need it set explicitly
COOKIE_SECUREImportanttrue when serving over HTTPS
DATABASE_URLRequiredPostgreSQL connection string
ENCRYPTION_KEYRequiredEncrypts connector credentials. Exactly 32 bytes, base64
JWT_SECRETRequiredSigns sessions. 32+ characters
LENSHUB_ENVOptionalproduction enables stricter startup checks
LLM_API_KEYOptionalKey for your provider
LLM_BASE_URLOptionalAPI root. Empty for OpenAI itself
LLM_CHAT_MODELOptionalChat model name
LLM_EMBED_BASE_URLOptionalEmbedding endpoint. Keep local to avoid sending content out
LLM_EMBED_MODELOptionalEmbedding model. Empty keeps the bundled local one
LLM_PROVIDEROptionalopenai for anything OpenAI-compatible, or vllm
OPENAI_API_KEYOptionalFallback if LLM_API_KEY is unset
RERANK_DEFAULTOptionalRerank without being asked
RERANK_OVERSAMPLEOptionalCandidates considered before reranking
RERANK_URLOptionalResult 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.