Skip to content

Environment variables

The list below is verified against the source. Variables Lime stores under ~/.lime/ (via lime login) override the corresponding environment variables when present.

Provider credentials

VariablePurpose
OPENAI_API_KEYOpenAI key. Also used for any OpenAI-compatible service that doesn’t have a dedicated env var.
OPENAI_BASE_URLCustom OpenAI base URL — proxies, Azure, or any OpenAI-compatible server.
ANTHROPIC_API_KEYAnthropic key.
GEMINI_API_KEYGoogle Gemini key. Takes priority over GOOGLE_API_KEY when both are set.
GOOGLE_API_KEYGoogle Gemini key (fallback).
GROQ_API_KEYGroq key (OpenAI-compat preset).
OPENROUTER_API_KEYOpenRouter key (OpenAI-compat preset).
TOGETHER_API_KEYTogether AI key (OpenAI-compat preset).
MISTRAL_API_KEYMistral key (OpenAI-compat preset).
DEEPINFRA_API_KEYDeepInfra key (OpenAI-compat preset).
CEREBRAS_API_KEYCerebras key (OpenAI-compat preset).
XAI_API_KEYxAI key (OpenAI-compat preset).
PERPLEXITY_API_KEYPerplexity key (OpenAI-compat preset).
COHERE_API_KEYCohere key (OpenAI-compat preset).
NVIDIA_API_KEYNVIDIA NIM key (OpenAI-compat preset).

For Ollama (local), no key is required.

Lime runtime knobs

VariablePurpose
LIME_CONFIG_HOMEOverride the config search root (default ~/.lime).
LIME_MODELOverride the active model slug.
LIME_MODELS_FILEOverride the path to the user models.json (primarily for testing).
LIME_MAX_RETRIESPer-provider retry budget. Default 6.
LIME_CODE_AUTO_COMPACT_INPUT_TOKENSForce a specific token threshold for auto-compaction across all models.
LIME_AUTOCOMPACT_PCT_OVERRIDEOverride the auto-compact percentage of the model’s context window.
LIME_TIME_BASED_MICROCOMPACT_MINIdle gap (minutes) before a time-based microcompact runs. Default 60. Set 0 to disable.
LIME_AUTO_MEMORY_DISABLEDWhen set, disables automatic memory extraction at session end.
LIME_DEBUG_COMPACTION_THRESHOLDDiagnostic knob that lowers the compaction threshold for testing.
LIME_MANAGED_SETTINGSPath to a managed-settings file (enterprise/policy layer).
LIME_PERMISSION_MODEDefault permission mode (default, read-only, accept-edits, bypass-permissions, plan). Highest precedence — overrides permissions.defaultMode in config.
LIME_HOMEOverride the runtime data root (~/.lime). Affects bridge state, agent files, device pairing, web-push state, IDE adapters, and LIME_CONFIG_HOME fallback.
LIME_SESSION_IDSet by the runtime when invoking AI tools — read by skill content for ${LIME_SESSION_ID} substitution. Don’t set this by hand.
LIME_TASK_DIROverride the directory where the task store persists in-flight task lists (default: under ~/.lime/). Used in tests and headless runs.
LIME_WEB_SEARCH_BASE_URLCustom base URL for the built-in web_search tool. Useful when fronting search behind a proxy.
LIME_BRIDGE_ALLOWED_ORIGINSComma-separated list of additional Origin headers the bridge WebSocket will accept. Local origins are always allowed.
LIME_WORKER_STALL_TIMEOUT_SECSOverride the worker stall-detection timeout in seconds. Set high for long-running tools; default is conservative.
LIME_CODE_AUTO_COMPACT_WINDOWSet the auto-compact threshold by fraction of the model’s context window (e.g. 0.85). Replaces the legacy LIME_CODE_AUTO_COMPACT_INPUT_TOKENS.

MCP runtime knobs

VariablePurpose
LIME_MAX_MCP_OUTPUT_TOKENSCap on tokens returned per MCP tool call.
LIME_MCP_IO_THREADSWorker thread count for the MCP runtime pool.
LIME_MCP_CONNECT_TIMEOUT_MSConnect timeout for new MCP transports.
LIME_MCP_CONNECTION_BATCH_SIZEConcurrency cap for the eager-startup connect wave.
LIME_MCP_REMOTE_CONNECTION_BATCH_SIZEConcurrency cap for the remote-transport connect wave.

Build-time

VariablePurpose
GIT_SHAEmbed a short commit hash in lime --version. Set at build time:
Terminal window
GIT_SHA=$(git rev-parse --short HEAD) cargo build --release

Inspect what’s resolved

/config env Show how the runtime resolved provider credentials and
Lime knobs.

/config env redacts secret values by default — only the source (env var vs stored credential vs config file) and a fingerprint are printed.