# magi-rs configuration — reference example.
#
# NOTE: as of v0.6.0 the values below ARE the built-in defaults — what magi-rs
# uses with NO `magi.toml` and no env vars (Ollama-first: provider = "openai",
# http://localhost:11434/v1, kimi-k2.6:cloud + the qwen3.5 / gpt-oss / deepseek
# trio). Running `magi-rs --init-config` or the `/init-config` TUI command
# generates exactly this profile. To use Anthropic instead, set
# provider = "anthropic" (or MAGI_PROVIDER=anthropic).
#
# 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: "openai" (Ollama-first).
# - "openai" — any OpenAI-compatible Chat Completions endpoint
# (Ollama [default], OpenAI, Groq, OpenRouter, …)
# - "anthropic" — Anthropic Messages API (opt-in as of v0.6.0)
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. Built-in default when omitted: "kimi-k2.6:cloud" (env OPENAI_MODEL
# and this field both override it). NOTE: the default is an Ollama tag — point
# `base_url` at a non-Ollama service and you MUST set a model that exists there.
model = "kimi-k2.6:cloud"
[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. Qwen + 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).
#
# Note: the Ollama cloud catalog models are all reasoning ("thinking") models, so
# at the Maximum tier the diversity is by LINEAGE (Alibaba / OpenAI / DeepSeek),
# each distinct from the others and from a typical principal (e.g. Moonshot kimi).
#
# 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.6:27b gpt-oss:20b deepseek-r1:8b 16-24 GB
# Balanced qwen3.6:35b-a3b gpt-oss:20b deepseek-r1:32b 48-64 GB
# Maximum qwen3.5:397b-cloud gpt-oss:120b-cloud deepseek-v4-pro:cloud Cloud
#
# (Qwen 3.6 is local-only — no :cloud tag — so Maximum uses qwen3.5:397b-cloud, the
# flagship Qwen on Ollama cloud. Tags verified on ollama.com, 2026-06.)
#
# [magi]
# melchior_model = "qwen3.6:27b" # Scientist (Alibaba) — theoretical analysis
# balthasar_model = "gpt-oss:20b" # Pragmatist (OpenAI) — practical trade-offs
# caspar_model = "deepseek-r1:8b" # Critic (DeepSeek) — adversarial review