~/.leon/) → project config (.leon/ in workspace root). CLI arguments override everything.
Config file overview
JSON config files (three-tier merge):
| File | Purpose |
|---|---|
runtime.json | Tools, memory, MCP, skills, security |
models.json | Providers, API keys, model mapping |
observation.json | Langfuse / LangSmith tracing |
Other config files:
| File | Purpose |
|---|---|
config.env | Quick API key setup |
sandboxes/<name>.json | Per-provider sandbox config |
.mcp.json (member) | Per-member MCP servers |
.leon/<file> in workspace → ~/.leon/<file> → built-in defaults → CLI flags win over all.
Merge strategy per domain:
| Domain | Strategy |
|---|---|
runtime, memory, tools | Deep merge — higher-priority tiers override individual fields |
mcp, skills | Lookup — first tier that defines a key wins; no merging |
system_prompt | Lookup — project → user → system |
providers, mapping (models.json) | Deep merge per-key |
pool (models.json) | Last wins — no list merging |
catalog, virtual_models (models.json) | System-only — never overridden |
First run
Create~/.leon/config.env:
runtime.json
Runtime fields
Runtime fields
| Field | Default | Description |
|---|---|---|
temperature | null | Sampling temperature (0–2). null = model default |
max_tokens | null | Max output tokens. null = model default |
context_limit | 0 | Context window in tokens. 0 = auto-detect |
enable_audit_log | true | Audit logging for file operations |
allowed_extensions | null | Restrict file access by extension. null = all |
block_dangerous_commands | true | Block rm -rf, sudo, etc. |
block_network_commands | false | Block network commands |
Memory — pruning and compaction
Memory — pruning and compaction
Pruning trims large tool results:
Compaction summarizes old history via LLM when context fills:
See Memory for full details.
| Field | Default | Description |
|---|---|---|
soft_trim_chars | 3,000 | Trim results longer than this |
hard_clear_threshold | 10,000 | Clear results longer than this |
protect_recent | 3 | Keep last N tool messages untrimmed |
| Field | Default | Description |
|---|---|---|
reserve_tokens | 16,384 | Reserve for new messages |
keep_recent_tokens | 20,000 | Keep recent tokens verbatim |
min_messages | 20 | Minimum messages before trigger |
Tool configuration
Tool configuration
Each tool group has an Complete tool catalog:
enabled flag. Both the group and individual tool must be enabled.| Tool | Group | Mode |
|---|---|---|
| Read, Write, Edit, list_dir | filesystem | inline |
| Grep, Glob | search | inline |
| Bash | command | inline |
| WebSearch, WebFetch | web | inline |
| Agent, SendMessage, TaskOutput, TaskStop | agent | inline |
| TaskCreate, TaskGet, TaskList, TaskUpdate | todo | deferred |
| load_skill | skills | inline |
| tool_search | system | inline |
deferred tools are not injected into every request. The agent discovers them via tool_search when needed — saving tokens in conversations that don’t require task management.Project-level example
Project-level example
.leon/runtime.json in your workspace root:models.json
Virtual model aliases
Virtual model aliases
Mycel provides four
Set via Settings → Models in the Web UI, or in Override a mapping in
leon:* aliases:| Alias | Model | Use case |
|---|---|---|
leon:mini | claude-haiku-4-5-20250929 | Fast, simple tasks |
leon:medium | claude-sonnet-4-5-20250929 | Balanced, daily work |
leon:large | claude-opus-4-6 | Complex reasoning |
leon:max | claude-opus-4-6 + temp=0 | Maximum precision |
~/.leon/models.json:~/.leon/models.json:Provider setup
Provider setup
ANTHROPIC_API_KEYset → provider =anthropicOPENAI_API_KEYset → provider =openaiOPENROUTER_API_KEYset → provider =openai(OpenRouter-compatible)
Custom models
Custom models
based_on tells Mycel which tokenizer to use. context_limit overrides auto-detection.MCP servers
Connect external services via the Model Context Protocol. MCP tools appear asmcp__{server_name}__{tool_name}.
- stdio (local process)
- HTTP (remote server)
- Member-level (.mcp.json)
Skills
Observation (tracing)
- Langfuse
- LangSmith
- Disabled
Environment variables
All string values in JSON config files support${VAR} expansion and ~ for home directory.
| Variable | Purpose |
|---|---|
ANTHROPIC_API_KEY | Anthropic API key |
OPENAI_API_KEY | OpenAI-compatible API key |
OPENAI_BASE_URL | API base URL |
OPENROUTER_API_KEY | OpenRouter API key |
MODEL_NAME | Override active model |
LEON_SANDBOX | Default sandbox name |
TAVILY_API_KEY | Tavily web search |
EXA_API_KEY | Exa search |
JINA_API_KEY | Jina AI fetch |
E2B_API_KEY | E2B sandbox |
DAYTONA_API_KEY | Daytona sandbox |
AGENTBAY_API_KEY | AgentBay sandbox |