Virtual Models
Give configured model endpoints a reusable name, then call that name from an application or harness.
A virtual model is a named entry under models in bitrouter.yaml. It exposes configured provider/model endpoints through one callable name, such as coding, so an application can keep using that name when you change its backing endpoints.
Connect the sources first with BYOK & Subscriptions or Local Models. Use Model Fallbacks for the failure conditions and replacement behavior of a multi-endpoint route.
Define a virtual model
models:
coding:
strategy: priority
endpoints:
- provider: openai
service_id: gpt-5
- provider: anthropic
service_id: claude-sonnet-4-6coding is the name callers use. Each endpoint identifies a configured provider and a model id that provider serves. With strategy: priority, eligible endpoints are tried in the configured order; Model Fallbacks explains when another endpoint is attempted.
A virtual model defines a named route. It does not by itself evaluate answer quality or introduce an automatic cost optimizer.
Call the name
Use the virtual model wherever the API accepts a model selector:
curl http://127.0.0.1:4356/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "coding",
"messages": [{"role": "user", "content": "Summarize this change."}]
}'An authenticated deployment also requires a BitRouter credential. A native harness launch can use the same name:
bro claude --model coding
bro codex --model codingSee bro [harness] for launch configuration and Responses API for the Responses request format.
Model selector forms
For hosted Cloud model IDs, use GET /v1/models. Catalog discovery does not grant account access or guarantee that a provider can serve a particular request.
| Selector | Meaning |
|---|---|
coding | A matching virtual model defined under models |
openai/gpt-5.4 | A logical model id that may be served by multiple connected providers |
openai:openai/gpt-5.4 | An explicit route through one configured provider |
bitrouter/fast | A named local router that supplies model selection and request defaults |
@fast | A compatible legacy preset |
@fast:primary | A preset with a configured variant |
bitrouter/auto | The local auto router with a routing-policy binding |
The slash in a logical model id is part of the model's identity; it does not pin the serving provider. The colon form explicitly selects a provider. Subscription sources require an explicit provider-qualified route, as described in BYOK & Subscriptions.
Resolution order
The self-hosted proxy resolves a selector in this order:
- Resolve a named
bitrouter/<name>router or a legacy@presetwith an optional:variant. - Treat
provider:modelas an explicit provider route. - Resolve a matching entry under
modelsas a virtual model. - Otherwise, resolve the logical model id across active providers that declare it.
Choose a virtual name that does not collide with a logical model id when both should remain separately addressable.
Presets
A named local router can select a virtual model and add reusable request defaults:
routers:
fast:
selection:
kind: model
model: coding
defaults:
system_prompt: "Be concise."
params:
temperature: 0.2Call bitrouter/fast to apply those defaults. Request fields take precedence. Existing local @fast selectors still address legacy presets. Use bro config migrate-routers --candidate <path> to preview a migration. Cloud uses catalog model IDs or enabled workspace presets addressed as @<name>.
bitrouter/auto requires a policy binding on the named local router. See the Auto Router guide for initializing that binding.
Variants
A configured variant applies routing preferences to a selector, for example coding:private or @fast:primary. It does not create another virtual-model definition. An unknown suffix remains part of the selector instead of being silently removed.
Variants do not grant access, bypass guardrails, or supply provider credentials. Configure candidate filters in Strategies.
Protocol compatibility
Every endpoint must support the capabilities required by the request. Giving several endpoints one virtual name does not make their tools, structured outputs, or provider continuity interchangeable.
For custom endpoints, declare only verified model capabilities in BYOK & Subscriptions. Responses API explains response-format fields across supported protocols. Use a schema supported by every model that may serve a fallback request.
Inspect and verify
bro config validate -c bitrouter.yaml
bro route coding -c bitrouter.yaml
bro route bitrouter/fast -c bitrouter.yaml
bro requests --limit 25bro route previews resolution without sending an inference request. It uses the running daemon when available and otherwise resolves from the selected configuration file. Request receipts identify the model and provider that actually served a call.
How is this guide?