For AI agents, the documentation index lists all pages. Append .md to a documentation URL for Markdown, or request text/markdown.

Skip to Content

Virtual Models

Give configured model endpoints a reusable name, then call that name from an application or harness.

4 min readEdit this page

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-6

coding 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 coding

See 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.

SelectorMeaning
codingA matching virtual model defined under models
openai/gpt-5.4A logical model id that may be served by multiple connected providers
openai:openai/gpt-5.4An explicit route through one configured provider
bitrouter/fastA named local router that supplies model selection and request defaults
@fastA compatible legacy preset
@fast:primaryA preset with a configured variant
bitrouter/autoThe 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:

  1. Resolve a named bitrouter/<name> router or a legacy @preset with an optional :variant.
  2. Treat provider:model as an explicit provider route.
  3. Resolve a matching entry under models as a virtual model.
  4. 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.2

Call 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 25

bro 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?

On this page