Skip to content

Latest commit

 

History

History
274 lines (194 loc) · 14 KB

File metadata and controls

274 lines (194 loc) · 14 KB
title sidebarTitle description
Environment Variables
environment
Complete reference for all Milady environment variables.

Milady reads environment variables at startup to configure paths, ports, API access, feature flags, and runtime behavior. Variables take precedence over config file values for path and server settings. This page documents every recognized environment variable.

Path and State

These variables control where Milady stores its state, config, and credentials.

Variable Description Default
MILADY_STATE_DIR Override the state directory. All resolved paths default to subdirectories of this directory. ~/.milady/
MILADY_CONFIG_PATH Override the config file path. Takes precedence over MILADY_STATE_DIR for config resolution. ~/.milady/milady.json
MILADY_PROFILE Active configuration profile name. When set, the state directory becomes ~/.milady-<profile>/. Equivalent to the --profile CLI flag. (none)
MILADY_OAUTH_DIR Override the OAuth credentials directory. ~/.milady/credentials/
MILADY_WORKSPACE_ROOT Override the workspace root directory used by the registry client. (auto-resolved from config)

Path Resolution

MILADY_CONFIG_PATH takes the highest precedence. If not set, MILADY_STATE_DIR determines where milady.json is looked for. If neither is set, the default ~/.milady/milady.json is used.

When a --profile <name> flag or MILADY_PROFILE is set, the state directory becomes ~/.milady-<name>/ and all path defaults shift accordingly.


Server Configuration

These variables control the API server and network behavior.

Variable Description Default
MILADY_PORT API server port when running milady start. 2138
MILADY_API_BIND Bind address for the API server. Set to 0.0.0.0 to accept external connections (requires MILADY_API_TOKEN for security). 127.0.0.1
MILADY_GATEWAY_PORT Gateway port. Automatically set to 19001 when the --dev flag is used. (unset)
MILADY_API_TOKEN Static API token for authenticating requests to the agent API server. When set, all API requests must include this token. Auto-generated if unset and bind is non-loopback. (unset)
MILADY_ALLOW_WS_QUERY_TOKEN When set to 1, allows the API token to be passed as a WebSocket query parameter (less secure; useful for some clients). (unset)
MILADY_PAIRING_DISABLED When set to 1, disables the pairing endpoint on the API server (requires MILADY_API_TOKEN to be set). (unset)
MILADY_ALLOWED_ORIGINS Comma-separated list of additional CORS origins allowed by the API server. (unset)
MILADY_ALLOW_NULL_ORIGIN When set to 1, allows the null origin in CORS (useful for file:// or desktop clients). (unset)
MILADY_WALLET_EXPORT_TOKEN Auth token for the wallet export API endpoint. When unset, wallet exports are disabled. (unset)
API_PORT / SERVER_PORT Alternative port overrides used by some runtime actions. Prefer MILADY_PORT. (unset)

Update and Registry

These variables affect the update checker and plugin registry client.

Variable Description Default
MILADY_UPDATE_CHANNEL Override the active release channel (stable, beta, or nightly). Takes precedence over the update.channel value in milady.json. Invalid values are ignored and fall back to the config value. (from config)
MILADY_SKILLS_CATALOG Override the path to the skills catalog JSON file. (auto-resolved from package root)
MILADY_DISABLE_LAZY_SUBCOMMANDS When set to 1 (or any truthy value), all subcommands (plugins, models) are eagerly registered at startup instead of on first invocation. Useful for shell completion scripts. (unset)

Display and CLI Behavior

These variables affect the CLI output and banner behavior.

Variable Description Default
MILADY_HIDE_BANNER When set to 1, suppresses the Milady ASCII banner that normally prints before each command. The banner is also suppressed for the update and completion commands regardless of this variable. (unset)
FORCE_COLOR Force colored terminal output even when stdout is not a TTY. Set to any non-empty, non-0 string to enable. (unset)
NO_COLOR Disable all ANSI colors when set (any value). Standard convention; takes effect before FORCE_COLOR. (unset)
LOG_LEVEL Set the logging verbosity level. Accepted values: debug, info, warn, error. info
NODE_NO_WARNINGS Suppresses Node.js runtime warnings. Automatically set to 1 by the CLI when --verbose / --debug is not active. (auto-set)

Model Provider API Keys

These variables configure access to AI model providers. Set at least one to enable model inference.

Variable Provider Notes
ANTHROPIC_API_KEY Anthropic (Claude) Claude 3 and 4 model families
CLAUDE_API_KEY Anthropic (Claude) Alias for ANTHROPIC_API_KEY
OPENAI_API_KEY OpenAI (GPT) GPT-4o, GPT-4, and other OpenAI models
AI_GATEWAY_API_KEY Vercel AI Gateway Routes requests through the Vercel AI Gateway
AIGATEWAY_API_KEY Vercel AI Gateway Alias for AI_GATEWAY_API_KEY
GOOGLE_API_KEY Google (Gemini) Gemini model family
GOOGLE_GENERATIVE_AI_API_KEY Google (Gemini) Alias for GOOGLE_API_KEY
GROQ_API_KEY Groq Fast inference via Groq hardware
XAI_API_KEY xAI (Grok) Grok model family
GROK_API_KEY xAI (Grok) Alias for XAI_API_KEY
OPENROUTER_API_KEY OpenRouter Unified API routing for many providers
DEEPSEEK_API_KEY DeepSeek DeepSeek model family
TOGETHER_API_KEY Together AI Together AI inference
MISTRAL_API_KEY Mistral Mistral model family
COHERE_API_KEY Cohere Cohere model family
PERPLEXITY_API_KEY Perplexity Perplexity model family
ZAI_API_KEY Zai Zai model provider
Z_AI_API_KEY Zai Alias -- automatically copied to ZAI_API_KEY at startup if ZAI_API_KEY is unset
OLLAMA_BASE_URL Ollama (local) Base URL for a local Ollama server (not an API key)
ELIZAOS_CLOUD_API_KEY elizaOS Cloud Cloud-hosted model inference via elizaOS
ELIZAOS_CLOUD_ENABLED elizaOS Cloud Set to 1 to enable elizaOS Cloud (requires API key)
ELIZAOS_CLOUD_BASE_URL elizaOS Cloud Override the elizaOS Cloud endpoint URL. Set automatically from config when cloud is enabled.

Use milady models to check which providers are currently configured.


Authentication and Credentials

These variables affect how Milady stores and applies credentials.

Variable Description Default
MILADY_HOME Base directory for credentials storage used by the auth layer. ~/.milady/

Editor

Variable Description Default
EDITOR Editor command used by milady plugins open. Accepts a full command string (e.g. code, vim, nano -w). code

Database

These variables configure the database backend used by the elizaOS runtime.

Variable Description Default
POSTGRES_URL PostgreSQL connection URL. When set, switches the database provider from PGLite to PostgreSQL. (unset -- PGLite used)
PGLITE_DATA_DIR Override the PGLite data directory. Automatically set by the runtime when using PGLite mode. ~/.milady/pglite/

Model Override

These variables override the default model selections used by the runtime.

Variable Description Default
SMALL_MODEL Override the small/fast model used for lightweight tasks. (from provider defaults)
LARGE_MODEL Override the large/capable model used for complex tasks. (from provider defaults)
ELIZAOS_CLOUD_SMALL_MODEL Override the small model when using elizaOS Cloud. (from cloud defaults)
ELIZAOS_CLOUD_LARGE_MODEL Override the large model when using elizaOS Cloud. (from cloud defaults)

Local Embedding

These variables configure local embedding model inference. Only relevant when using local embeddings instead of a cloud provider.

Variable Description Default
LOCAL_EMBEDDING_MODEL GGUF model filename for local embeddings. (auto-selected)
LOCAL_EMBEDDING_MODEL_REPO Hugging Face repo containing the embedding model. (auto-selected)
LOCAL_EMBEDDING_DIMENSIONS Embedding vector dimensions. (auto-detected from model)
LOCAL_EMBEDDING_CONTEXT_SIZE Maximum context size for the embedding model. (auto-detected from model)
LOCAL_EMBEDDING_GPU_LAYERS Number of GPU layers to offload. Set to auto on Apple Silicon. 0 (CPU-only)
LOCAL_EMBEDDING_USE_MMAP Enable memory-mapped file access for the model. (auto)

Runtime Behavior

These variables control elizaOS runtime initialization behavior.

Variable Description Default
ELIZA_ALLOW_DESTRUCTIVE_MIGRATIONS Allow destructive database migrations on startup. Automatically set to true by Milady. true (set by Milady)
ELIZA_CONFIG_PATH Override the path to milady.json. ~/.milady/milady.json
MILADY_DISABLE_WORKSPACE_PLUGIN_OVERRIDES When set to 1, disables loading plugin overrides from workspace directories. (unset)
MILADY_BUNDLED_VERSION Override the bundled version string returned by the version resolver. Used in special packaging scenarios. (unset)
MILADY_DISABLE_EDGE_TTS When set to 1, true, or yes, Milady does not auto-load @elizaos/plugin-edge-tts when @elizaos/plugin-agent-orchestrator is enabled (orchestrator-driven flows use TEXT_TO_SPEECH). Without this, the bundled node-edge-tts client contacts Microsoft’s Edge TTS cloud service even though no API key is required—there is still an outbound network call to Microsoft. To opt out while keeping other plugins: set this variable, or set plugins.entries["edge-tts"].enabled to false in milady.json. Alias: ELIZA_DISABLE_EDGE_TTS. (unset — Edge TTS is auto-loaded with the agent orchestrator)

Triggers

These variables configure the runtime trigger system.

Variable Description Default
MILADY_TRIGGERS_ENABLED Enable or disable the trigger system. Set to 0 to disable, 1 to enable. Also configurable via the runtime setting MILADY_TRIGGERS_ENABLED. (unset -- auto-detected)
MILADY_TRIGGERS_MAX_ACTIVE Maximum number of concurrently active triggers. Also configurable via the runtime setting MILADY_TRIGGERS_MAX_ACTIVE. (unset -- uses internal default)

Terminal Sandbox

These variables configure limits for terminal command execution via the API.

Variable Description Default
MILADY_TERMINAL_MAX_CONCURRENT Maximum number of concurrent terminal sessions allowed via the API. (internal default)
MILADY_TERMINAL_MAX_DURATION_MS Maximum duration in milliseconds for a single terminal command run. (internal default)

Skills and Marketplace

These variables configure the skills registry and marketplace integration.

Variable Description Default
SKILLS_REGISTRY URL of the skills registry. Falls back to CLAWHUB_REGISTRY, then SKILLS_MARKETPLACE_URL. https://clawhub.ai
CLAWHUB_REGISTRY Alias for SKILLS_REGISTRY. (unset)
SKILLS_MARKETPLACE_URL Alias for SKILLS_REGISTRY (lowest priority). (unset)
SKILLSMP_API_KEY API key for authenticating with the skills marketplace. (unset)

Messaging Platform Connectors

These variables configure messaging platform integrations. Set them in your config file or environment to enable the corresponding connector plugin.

Variable Description Default
DISCORD_BOT_TOKEN Discord bot token for the Discord connector. (unset)
TELEGRAM_BOT_TOKEN Telegram bot token for the Telegram connector. (unset)
SLACK_BOT_TOKEN Slack bot token (xoxb-...) for the Slack connector. (unset)
SLACK_APP_TOKEN Slack app-level token (xapp-...) for Socket Mode. (unset)
BOT_NAME Display name for the bot in connectors that support it. (unset)

Wallet and Blockchain

These variables configure blockchain wallet keys used by wallet plugins.

Variable Description Default
EVM_PRIVATE_KEY Private key for EVM-compatible chains (Ethereum, Polygon, etc.). (unset)
SOLANA_PRIVATE_KEY Private key for the Solana blockchain. (unset)

Truthy Value Convention

Several Milady environment variables use a "truthy value" convention. A variable is considered truthy when it is set to a non-empty string that is not 0, false, no, or off (case-insensitive). Unset variables are always falsy.

Examples:

  • MILADY_API_TOKEN=secret123 -- truthy
  • MILADY_ALLOW_WS_QUERY_TOKEN=1 -- truthy
  • MILADY_ALLOW_WS_QUERY_TOKEN=0 -- falsy
  • MILADY_ALLOW_WS_QUERY_TOKEN= -- falsy (empty string)

Setting Variables

Set environment variables in your shell profile for persistent configuration:

# ~/.zshrc or ~/.bashrc
export ANTHROPIC_API_KEY="sk-ant-..."
export MILADY_PORT=3000
export MILADY_STATE_DIR="/srv/milady/state"

Or set them inline for a single command:

ANTHROPIC_API_KEY="sk-ant-..." MILADY_PORT=3000 milady start

Or use a .env file in your working directory (Milady loads .env files via the runtime configuration system).

Related