docs/book/src/providers/overview.md
Model providers are ZeroClaw's abstraction over any LLM endpoint the agent can call. Every chat-completion request goes through a Provider trait implementation (zeroclaw-api::Provider), whether the target is a remote API, a self-hosted inference server, or a local Ollama model.
Why "model" provider? We use the phrase "model provider" consistently — there may be other kinds of providers in the future (memory providers, tool providers, etc.) and keeping the word specific avoids ambiguity.
Three categories:
One-off implementations that talk to a provider's native API:
sk-ant-oat*) and API keys./api/chat endpoint with schema-based structured output.gemini_cli provider for CLI-based auth.One Rust implementation (compatible.rs) handles every OpenAI-compatible endpoint. A partial list:
To add one of these, you don't implement a new provider — you add a config entry pointing at its base URL.
reliable — wraps any provider with a fallback chain. First failure falls to the next provider in the list.router — a multi-provider router that picks a backend based on per-request hints (hint:reasoning, hint:cheap, hint:vision, etc.).Every provider is configured under [providers.models.<name>]:
[providers.models.claude]
kind = "anthropic"
model = "claude-haiku-4-5-20251001"
api_key = "sk-ant-..."
[providers.models.local]
kind = "ollama"
base_url = "http://localhost:11434"
model = "qwen3.6:35b-a3b"
[providers.models.groq]
kind = "openai-compatible"
base_url = "https://api.groq.com/openai"
model = "llama-3.3-70b-versatile"
api_key = "gsk_..."
See Configuration for the full schema.
Two mechanisms:
default_model in the top-level config picks which provider the agent loop uses by default.provider = "claude" to use Claude for that channel's responses while default_model stays set to a cheaper option for the rest.Two practical reasons:
kind = "openai" for kind = "anthropic" in one file. The rest of the system doesn't care.[sonnet, haiku, local] means you use the best model when it's available, fall back to cheaper hosted when it's not, and keep running on local Ollama during an API outage.[providers.*] schema