Badger Providers
Providers
Section titled “Providers”Badger ships an Anthropic-first, general-purpose provider chain. The harness-rewrite tradition was first articulated against Anthropic models, so badger keeps that as the default.
Resolution chain
Section titled “Resolution chain”First match wins:
- Explicit
--model. $BADGER_MODELenv var.$ANTHROPIC_API_KEYset → defaultclaude-sonnet-4-6.$OPENAI_API_KEYset → defaultgpt-4o.$OPENROUTER_API_KEYset → defaultanthropic/claude-sonnet-4-6.$OLLAMA_HOSTset → defaultqwen3:32b.- Friendly
ValueErrorwith a list of the env vars above.
Examples
Section titled “Examples”# Anthropic — the badger defaultexport ANTHROPIC_API_KEY=sk-ant-...chimera badger -p "Implement the resolver"
# OpenAIexport OPENAI_API_KEY=sk-...chimera badger -p "Implement the resolver"
# OpenRouter (vendor/name routing)export OPENROUTER_API_KEY=sk-or-...chimera badger --model openai/gpt-4o -p "..."
# Local Ollamaexport OLLAMA_HOST=http://localhost:11434chimera badger --model qwen3:32b -p "..."Routing rules
Section titled “Routing rules”- OpenRouter: a model id with a
/plus$OPENROUTER_API_KEY→ routed viachimera/providers/compatible.pyagainsthttps://openrouter.ai/api/v1. - Ollama: a model id with a
:(e.g.qwen3:32b,kimi-k2.6:cloud) routes throughOllamaProvider. The base URL defaults to$OLLAMA_HOSTorhttp://localhost:11434. - Otherwise: the generic
chimera.providers.factory.create_providerpicks Anthropic / OpenAI / Google / xAI by model prefix.
Cosmetic OpenRouter headers
Section titled “Cosmetic OpenRouter headers”Badger ships sensible defaults for OpenRouter’s two cosmetic headers
(HTTP-Referer, X-Title). They identify the client in the
OpenRouter dashboard:
| Variable | Default |
|---|---|
OPENROUTER_REFERER | https://github.com/0bserver07/chimera |
OPENROUTER_TITLE | chimera badger 0.5.0 |
Override either via env var.
tests/badger/test_providers.py covers the resolution chain in
isolation (no live API calls). Mark tests for live providers as
@pytest.mark.live so the default suite stays hermetic.