Skip to main content

Environment variables

The engine reads these at the moment it needs them, so a change applies to the next run.

Model providers​

VariableUsed for
ANTHROPIC_API_KEYmodel.anthropic(...)
OPENAI_API_KEYmodel.openai(...), and createEmbeddings({ provider: "openai" })
GEMINI_API_KEY or GOOGLE_API_KEYmodel.gemini(...)
MISTRAL_API_KEYmodel.mistral(...), and createEmbeddings() (Mistral is the default provider)
OPENROUTER_API_KEYmodel.openrouter(...)
MINIMAX_API_KEYmodel.minimax(...)
HF_TOKEN or HUGGINGFACE_API_KEYmodel.huggingface(...)
AILU_USE_OLLAMA=1, AILU_OLLAMA_BASE_URLTurn on model.ollama(...); the server URL (default http://localhost:11434/v1).
AILU_USE_LMSTUDIO=1, AILU_LMSTUDIO_BASE_URLTurn on model.lmstudio(...); the server URL (default http://localhost:1234/v1).
The variable you name in apiKeyEnvThe key for a custom endpoint, or a TypeScript standalone provider-key override. Requires an explicit allowlist match.
AILU_API_KEY_ENV_ALLOWLISTHost-authorized variable names for apiKeyEnv: comma-separated exact names and trailing-star prefixes (AILU_ENDPOINT_*,GATEWAY_KEY). Unset or empty denies named reads. A bare * permits every name. Includes TypeScript standalone provider overrides without baseURL; Python uses its selector only with base_url. This is a breaking default change; see migration and matching rules.
AILU_MODEL_ENDPOINT_ALLOWLISTHost-authorized custom model base URLs, separated by commas. Exact parsed URL matches only; unset, empty or invalid denies all custom endpoints. Explicitly listed local/private HTTP servers are supported. See Models and providers.
AILU_LLM_MOCK=1Offline mode: calls without a key answer from the deterministic mock instead of failing. For tests and CI.
AILU_HTTP_READ_TIMEOUT_SECSHow long to wait for a model response. Default 600.

Governance​

VariableUsed for
AILU_SECRETS_POLICY=blockFail a model call that contains a secret, instead of masking the secret.
AILU_SECRETS_REDACTOR_URL, AILU_SECRETS_REDACTOR_TOKENAn extra secrets-detection service, after the built-in one.
AILU_PII_REDACTOR_URL, AILU_PII_REDACTOR_TOKENA personal-data redaction service. The engine posts { texts, runId } (runId only when the call names its run) and expects { texts, blocked? }.
AILU_PII_REDACTOR_FAIL_CLOSED=1Don't send the text when the redaction service is unreachable.
AILU_LLM_RECORD=1Record model calls and timestamps, for replay.

Agents and retrieval​

VariableUsed for
AILU_FS_BACKEND_URL, AILU_FS_BACKEND_TOKENA storage service for the agents' virtual filesystem, instead of memory.
AILU_RERANK_ENDPOINTA cross-encoder service for components.reranker.
AILU_LLMLINGUA_URLWhere the prompt-compression service of the compress middleware is. Setting it compresses nothing by itself: only an agent whose middleware names compress (or whose profile includes it) is compressed.
AILU_LLMLINGUA_BODYThe shape of the request body: text (default) sends { "text", "rate" }; inputs sends { "inputs", "parameters": { "rate" } }, for a Hugging Face Inference Endpoint, which refuses a body without inputs and writes the refused body to its logs. The answer is { "compressed" } in both. Any other value turns compression off.
AILU_LLMLINGUA_TOKENA bearer token sent to that service (Authorization: Bearer …). Never logged.
AILU_LLMLINGUA_TIMEOUT_MSHow long one compression call may take, in milliseconds. Default 2000. Past it, the original text is sent to the model. Independent of AILU_HTTP_READ_TIMEOUT_SECS.
AILU_LLMLINGUA_RATE, AILU_LLMLINGUA_MIN_CHARSThe share of tokens to keep (default 0.5) and the shortest message it compresses (default 240 characters).
TAVILY_API_KEYcomponents.webSearch.

Observability​

VariableUsed for
AILU_OTEL_EXPORTER_URLThe default endpoint of exportTracesToOtlp.