# magi-rs configuration — reference example.
#
# Copy this file to `magi.toml` (per-workspace) and edit. `magi.toml` is
# gitignored; only `magi.toml.example` is tracked.
#
# IMPORTANT: API keys NEVER live in this file. They come from environment
# variables (ANTHROPIC_API_KEY / OPENAI_API_KEY), the OS keyring, or
# `key.txt` (for the Anthropic key). This file holds non-secret runtime
# configuration only. Placing `api_key` (or any other unknown field) in
# this file is a PARSE ERROR under `deny_unknown_fields`, not silent
# acceptance — magi-rs will reject the TOML at startup and fall back to
# defaults with a surfaced warning.
#
# Precedence for every setting: env var > magi.toml > built-in default.
# Which provider backend to use. Default when omitted: "anthropic".
# - "anthropic" — Anthropic Messages API (the default magi-rs path)
# - "openai" — any OpenAI-compatible Chat Completions endpoint
# (OpenAI, Ollama, Groq, OpenRouter, …)
provider = "openai"
[openai]
# OpenAI-compatible base URL. Examples:
# http://localhost:11434/v1 (Ollama, local, dummy api_key accepted)
# https://api.openai.com/v1 (OpenAI)
# https://api.groq.com/openai/v1 (Groq)
# https://openrouter.ai/api/v1 (OpenRouter)
base_url = "http://localhost:11434/v1"
# Model name. REQUIRED when `provider = "openai"` (no implicit default —
# magi-rs errors at startup if neither this field nor OPENAI_MODEL is set).
model = "phi4-mini"
[anthropic]
# Anthropic model to use when `provider = "anthropic"`. Optional — when
# omitted, magi-rs falls back to its built-in default (claude-sonnet-4-6).
model = "claude-sonnet-4-6"
# ---------------------------------------------------------------------------
# [magi] — per-agent model selection (opt-in; absent = all three share the
# principal model above, identical to v0.4.0 behavior).
#
# Why: the three MAGI perspectives reach a stronger consensus when they have
# genuine lineage diversity — different model families reason and fail
# differently, so agreement across them is more meaningful. Overrides reuse the
# principal provider's base_url + api_key and change ONLY the model name, so
# true cross-family diversity (e.g. GLM + GPT + DeepSeek) requires the principal
# to be an Ollama-style endpoint serving all three families. With an Anthropic
# principal you can still vary across Anthropic models (tier diversity).
#
# Precedence per agent: MAGI_MODEL_<AGENT> env var > this section > principal model.
# A blank value is treated as unset.
#
# Suggested tiers (served via one Ollama OpenAI-compatible endpoint):
# Tier Melchior Balthasar Caspar VRAM
# Light qwen3:8b gpt-oss:20b deepseek-r1:8b 16-24 GB
# Balanced qwen3:32b gpt-oss:20b deepseek-r1:32b 48-64 GB
# Maximum glm-5:cloud gpt-oss:120b-cloud deepseek-v4-pro:cloud Cloud
#
# [magi]
# melchior_model = "qwen3:8b" # Scientist — theoretical analysis
# balthasar_model = "gpt-oss:20b" # Pragmatist — practical trade-offs
# caspar_model = "deepseek-r1:8b" # Critic — adversarial review