Model sources
Connect subscriptions, hosted providers, or local inference servers to BitRouter.
A model source is where inference runs and how it is authenticated. BitRouter puts each source behind the same model ids and routing policy, so the calling agent does not need source-specific code.
Claude subscription
Use a Claude Pro or Max login through the claude-code provider.
Codex subscription
Use a ChatGPT Plus or Pro login through the openai-codex provider.
Local inference
Connect Ollama, vLLM, Unsloth, or another OpenAI-compatible server.
Custom provider
Add a hosted API or provider account with a key.
Pick the source shape
| Source | Authentication | Setup |
|---|---|---|
| Claude or Codex subscription | Provider OAuth | bro providers login <provider> |
| Built-in BYOK provider | Environment variable or stored key | Export its key or use bro providers login <provider> --api-key ... |
| Custom hosted API | API key | Add a providers: entry |
| Local inference server | Usually loopback; optional key | Add a providers: entry |
Subscription providers do not need a YAML block. Other sources use the same minimal shape:
providers:
my-source:
api_base: https://example.com/v1
api_key: ${MY_SOURCE_API_KEY}
api_protocol:
- "*": chat_completions
models:
- id: example/modelUse the upstream's actual served model id in models. Keep secrets in environment variables rather than committing them to the file.
Verify a source
bro config validate
bro models --provider my-source
bro route my-source:example/model
bro startconfig validatecatches malformed configuration and unsafe upstream URLs.modelsconfirms the source is in the resolved catalog.routepreviews resolution without making an inference request.- The provider-qualified form pins one source; the bare model id lets BitRouter select among every source that serves it.
To combine sources, define a virtual model or fallback chain. A common pattern is local inference first and a hosted source second.
How is this guide?