Skip to content

Configuration

dEXploarer edited this page Mar 27, 2026 · 2 revisions

Configuration

Milady's configuration lives in ~/.milady/milady.json. The file is JSON5 (comments and trailing commas are allowed). It is written with mode 0600 (owner read/write only), since it may contain API keys in the env section. A second optional file, ~/.milady/.env, can hold secrets using standard dotenv syntax. Values from .env are merged into the process environment at startup.

Config file location

The config path is resolved by src/config/paths.ts. By default it is ~/.milady/milady.json. You can read or set individual keys without editing the file by hand:

milady config get agent.name
milady config set agent.name "mila"

Or run the interactive wizard:

milady configure

Top-level structure

The MiladyConfig type (defined in src/config/types.milady.ts) is the authoritative schema. The most commonly used top-level keys are:

Key Type Purpose
agent object Agent name, model selection (see Model Providers)
env object Inline env vars applied at startup (API keys, etc.)
connectors object Messaging connector config (Telegram, Discord, etc.)
plugins object Plugin allowlist, denylist, extra load paths
models object Model provider definitions, small/large model selection
gateway object Gateway port and bind address overrides
logging object Log level, file output, console style
database object Database provider (pglite or postgres)
memory object Memory backend selection
browser object Browser automation settings
skills object Skill loading, allowlist/denylist, extra dirs
cloud object ElizaCloud integration (disabled by default)
ui object Dashboard theme and assistant display settings
update object Auto-update channel and check interval
mcp object MCP server definitions

Minimal working config

{
  "agent": {
    "name": "mila",
    "model": "anthropic/claude-opus-4-5"
  },
  "env": {
    "ANTHROPIC_API_KEY": "sk-ant-..."
  }
}

The model field should be a provider-prefixed model ID as returned by milady models.

Ports

Service Default port Environment variable override
API + WebSocket 31337 MILADY_API_PORT
Gateway (API + WebSocket) 18789 MILADY_GATEWAY_PORT
Dashboard (Web UI) 2138 MILADY_PORT
Home Dashboard 2142 MILADY_HOME_PORT
MILADY_GATEWAY_PORT=19000 MILADY_PORT=3000 milady start

These can also be set in the gateway config block:

{
  "gateway": {
    "port": 19000
  }
}

Network binding and API token

By default the Gateway binds to 127.0.0.1 (loopback only). If you expose it to a network interface (e.g. in a container or cloud deployment), set an API token to prevent unauthorized access:

echo "MILADY_API_TOKEN=$(openssl rand -hex 32)" >> ~/.milady/.env

Or set MILADY_API_BIND=0.0.0.0 to expose, and MILADY_API_TOKEN to secure.

Without a token on a non-loopback bind, anyone who can reach the server has full access to the dashboard, agent, and all API endpoints.

For remote backend deployments, also set MILADY_ALLOWED_ORIGINS to restrict which origins the API accepts:

export MILADY_API_BIND=0.0.0.0
export MILADY_API_TOKEN="$(openssl rand -hex 32)"
export MILADY_ALLOWED_ORIGINS="https://app.milady.ai,https://milady.ai"
milady start

Logging

{
  "logging": {
    "level": "error",
    "consoleStyle": "pretty",
    "redactSensitive": "tools"
  }
}

Valid log levels (from LoggingConfig): silent, fatal, error, warn, info, debug, trace. The --verbose flag at startup sets level to info. The --debug flag sets it to debug. Default is error.

Database

Milady uses PGLite (an embedded WebAssembly Postgres) by default. No external database is required.

{
  "database": {
    "provider": "pglite",
    "pglite": {
      "dataDir": "~/.milady/workspace/.eliza/.elizadb"
    }
  }
}

To use a remote PostgreSQL instance instead:

{
  "database": {
    "provider": "postgres",
    "postgres": {
      "connectionString": "postgresql://user:pass@host:5432/dbname"
    }
  }
}

Database migrations are applied automatically by @elizaos/plugin-sql. There are no manual migration files.

Skills

Skills are stored in ~/.milady/workspace/skills/. An additional skills config file at ~/.eliza/skills.json is auto-created on first run and allows you to add extra skill directories without editing the main config:

{
  "extraDirs": ["/path/to/my-custom-skills"]
}

To disable specific bundled skills:

{
  "skills": {
    "denyBundled": ["skill-name-here"]
  }
}

Config includes

The config supports a $include directive to split configuration across multiple files:

{
  "$include": "./secrets.json"
}

$include directives are stripped before the config is written back to disk (defense-in-depth against config-include injection).

Config file security

  • File is written with mode 0600 (owner read/write only)
  • $include directives are stripped on every write
  • The API server validates and blocks $include keys on all config-write endpoints
  • Secrets should be placed in ~/.milady/.env rather than directly in milady.json where possible

Clone this wiki locally