[llm]
LLM provider configuration — Ollama, OpenAI, Anthropic, OpenRouter.
Provider configuration for grith run / built-in REPL. If you only supervise external
agents (Claude Code, Codex, Aider), they manage their own model connections — this
section can stay at defaults.
[llm]
| Key | Type | Default | Description |
|---|---|---|---|
| default_provider | string | "ollama" | — |
[llm.ollama]
| Key | Type | Default | Description |
|---|---|---|---|
| base_url | string | "http://localhost:11434" | — |
| model | string | "llama3.1:8b" | — |
[llm.openai]
| Key | Type | Default | Description |
|---|---|---|---|
| model | string | "gpt-4o-mini" | — |
[llm.anthropic]
| Key | Type | Default | Description |
|---|---|---|---|
| model | string | "claude-sonnet-4-5-20250514" | — |
[llm.openrouter]
| Key | Type | Default | Description |
|---|---|---|---|
| model | string | "anthropic/claude-sonnet-4-5-20250514" | — |
API keys
API keys can live in two places:
- Inline in the config file, e.g.
api_key = "sk-...". Permissioned to0600on the user config file. - Environment variable — provider-prefixed:
OPENAI_API_KEY,ANTHROPIC_API_KEY,OPENROUTER_API_KEY. Env vars take precedence over inline values.
For Pro teams, an encrypted shared keystore is available; see Encrypted key management.
Switching providers per call
grith run --provider anthropic "explain mutexes"
grith run --provider ollama "explain mutexes"
--provider overrides default_provider for that invocation. The other provider
configs stay in the config file but aren't touched.
See also
- Connect a model — getting-started guide
grith run- Encrypted key management (Pro)
Last updated: 2026-05-14Edit this page on GitHub →