Configuration
All Merlin configuration lives under the [merlin] section of your
project’s fledge.toml. There is no separate config file.
Minimal Example
[merlin]
default_provider = "claude"
verify_before_complete = true
max_retries = 3
[merlin.providers.claude]
type = "anthropic"
api_key_env = "ANTHROPIC_API_KEY"
model = "claude-sonnet-4-6"
Local overlay — fledge.local.toml
When you want a setting different from the checked-in fledge.toml
on your own machine — for example bumping max_retries or swapping
default_provider for local experiments without committing the
change — drop a fledge.local.toml next to it. The two files are
deep-merged at load time: every field in the overlay wins, every
field absent from the overlay keeps its value from the base.
fledge.local.toml is gitignored, so it doesn’t get committed or
fight with teammates’ overrides.
Project Instructions — .gemini/GEMINI.md
For project-specific conventions and instructions that should apply
to every agent task (e.g., “always use async/await”, “prefer
anyhow for error handling”), create a .gemini/GEMINI.md file in
your project root.
Merlin automatically discovers this file and prepends its content to
the system prompt. This allows you to steer the agent’s behavior
at the project level without needing to modify the global persona or
the fledge.toml.
Diagnostic Tool — merlin doctor
Use merlin doctor to verify your environment and configuration.
It performs a comprehensive check of:
- Required tools (
cargo,fledge,git, etc.) fledge.tomlvalidity and project root resolution- External and internal plugin registration
- API key availability (env vars and OS keychain)
- Project-specific instructions (
.gemini/GEMINI.md)
merlin doctor
Top-Level Keys
| Key | Type | Default | Description |
|---|---|---|---|
default_provider | string | (required) | Name of the provider to use when --provider is not passed |
verify_before_complete | bool | true | Run fledge lanes run verify as a gate before reporting tasks complete |
max_retries | u32 | 3 | Maximum number of times to retry the agent loop after a failed verification |
persona | string | (none) | Path to a persona file (e.g. "AGENT.md") injected into the system prompt as identity/personality |
Providers
Register one or more providers under [merlin.providers.<name>]:
[merlin.providers.claude]
type = "anthropic"
api_key_env = "ANTHROPIC_API_KEY"
model = "claude-sonnet-4-6"
[merlin.providers.openai]
type = "openai"
api_key_env = "OPENAI_API_KEY"
model = "gpt-4.1-mini"
[merlin.providers.ollama]
type = "ollama"
api_key_env = "OLLAMA_API_KEY"
model = "qwen3-coder:480b"
base_url = "https://api.ollama.com"
Switch providers at the command line:
merlin --provider ollama "explain this function"
Or mid-session with the /model slash command:
> /model
active: anthropic (claude-sonnet-4-6)
claude (anthropic, model: claude-sonnet-4-6)
ollama (ollama, model: qwen3-coder:480b)
> /model ollama
✓ Switched to ollama (model: qwen3-coder:480b)
| Provider key | type | Required env var | Model field |
|---|---|---|---|
| Anthropic | "anthropic" | api_key_env (default ANTHROPIC_API_KEY) | model (e.g. claude-sonnet-4-6) |
| OpenAI | "openai" | api_key_env (default OPENAI_API_KEY) | model (e.g. gpt-4.1-mini) |
| Ollama | "ollama" | api_key_env (optional) | model (e.g. qwen3-coder:480b) |
Configured providers (default fledge.toml)
31 providers ship in the repo’s default fledge.toml — direct Anthropic
- OpenAI (12 SKUs), OpenRouter (×5 vendors with one key), Groq, Together,
and 11 Ollama Cloud models. Set the matching env var in
.env(or viamerlin keys set <NAME>) to enable each.
| Provider key | Model | API key env | Notes |
|---|---|---|---|
claude | claude-sonnet-4-6 | ANTHROPIC_API_KEY | Direct Anthropic |
openai | gpt-4.1-mini | OPENAI_API_KEY | Direct OpenAI |
openrouter | claude-sonnet-4-6 | OPENROUTER_API_KEY | 100+ models via one key |
groq | llama-3.3-70b-versatile | GROQ_API_KEY | Fastest inference |
ollama | qwen3-coder:480b | OLLAMA_API_KEY | Ollama Cloud — default |
Additional Provider Fields
| Field | Type | Description |
|---|---|---|
base_url | string | Override the API base URL (required for OpenRouter, Groq, Together) |
chat_path | string | Override the chat completions path (default /chat/completions for OpenAI type) |
max_context_tokens | u32 | Maximum context window size in tokens |
max_requests_per_minute | u32 | Rate limit (requests per minute) |
Memory
[merlin.memory]
ephemeral_ttl_days = 7
| Key | Type | Default | Description |
|---|---|---|---|
ephemeral_ttl_days | u32 | 7 | TTL for ephemeral task summaries written at the end of each successful run |
See Memory & AlgoChat for tier semantics (ephemeral, mutable, permanent).
AlgoChat
[merlin.algochat]
network = "localnet"
auto_respond = true
| Key | Type | Default | Description |
|---|---|---|---|
network | string | "localnet" | AlgoChat network — only localnet is currently supported |
auto_respond | bool | true | When --listen is on, auto-execute incoming messages and reply with the task summary |
Session
[merlin.session]
ttl_days = 30
enabled = true
| Key | Type | Default | Description |
|---|---|---|---|
ttl_days | u32 | 30 | How long session history is retained before cleanup |
enabled | bool | true | Whether to persist sessions at all. Set false for ephemeral use |
CLI Overrides
Several config values can be overridden on the command line:
| Flag | Overrides | Notes |
|---|---|---|
--provider <name> | default_provider | Must be a key in [merlin.providers.*] |
--no-verify | verify_before_complete = false | Useful for quick prototyping |
--yes | (auto-approve dangerous tools) | Currently advisory |
--listen | (entry mode) | Polls AlgoChat inbox every 5s and auto-runs incoming messages |
Project Discovery
Merlin walks up from the current directory looking for fledge.toml and
treats the directory containing it as the project root. If no fledge.toml
is found, Merlin falls back to built-in defaults (no fledge.toml required
to run merlin from any directory — just set an API key env var).