Configuration Reference

Full reference for the [merlin] block in fledge.toml. See Configuration for narrative.

Schema

[merlin]
default_provider = "..."          # required: name of a [merlin.providers.*] entry
verify_before_complete = true     # optional, default true
max_retries = 3                   # optional, default 3

[merlin.providers.<name>]
type = "anthropic" | "openai" | "ollama"   # required
api_key_env = "..."                         # optional, type-specific default
model = "..."                               # required: model identifier
base_url = "..."                            # optional: override API base URL
chat_path = "..."                           # optional: override chat endpoint path
max_context_tokens = 200000                 # optional: context window limit
max_requests_per_minute = 60                # optional: rate limit

[merlin.algochat]
network = "localnet"              # optional, default "localnet"
auto_respond = true               # optional, default true

[merlin.memory]
ephemeral_ttl_days = 7            # optional, default 7

Provider Type Defaults

Typeapi_key_env defaultNotes
"anthropic"ANTHROPIC_API_KEYReal SSE streaming with text and tool deltas
"openai"OPENAI_API_KEYOpenAI-compatible API (also used for OpenRouter, Groq, Together via base_url)
"ollama"(none)Ollama native API; set base_url + api_key_env for Ollama Cloud

Full 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"

[merlin.providers.opus]
type = "anthropic"
api_key_env = "ANTHROPIC_API_KEY"
model = "claude-opus-4-7"

[merlin.providers.gpt]
type = "openai"
api_key_env = "OPENAI_API_KEY"
model = "gpt-4.1-mini"

[merlin.providers.local]
type = "ollama"
model = "qwen3.5:cloud"

[merlin.algochat]
network = "localnet"
auto_respond = true

[merlin.memory]
ephemeral_ttl_days = 7

Discovery

Config is loaded by walking up from the current directory looking for fledge.toml. The first match is treated as the project root. If no fledge.toml is found, Merlin exits with an error.

Code

The Rust types live in crates/merlin-core/src/config.rsMerlinConfig, ProviderConfig, AlgoChatConfig, MemoryConfig. All are deserialized via serde with serde(default) on optional fields.