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

Skip to Content

Strategies

Resolve selectors, constrain eligible providers, and reuse routing rules through presets and named variants.

9 min readEdit this page

Routing strategies determine which models and providers are eligible for a call and how their candidates are ordered. A virtual model defines a reusable model endpoint; routing resolves the caller's selector, forms the eligible candidate set, and applies the configured selection behavior. Context Routing independently determines what retained evidence the next native model call sees.

How a call is routed

  1. Resolve the selector. Resolve a named router, virtual model, legacy preset, or explicit provider/model route.
  2. Apply a bound policy when present. A policy-bound local router selects a configured tier from the request's routing fingerprint. An unmatched fingerprint uses the conservative default tier.
  3. Resolve eligible endpoints. Apply the selected route's endpoint rules, capabilities, protocol, credentials, and caller-access requirements.
  4. Execute and inspect. Retryable upstream failures may advance the eligible chain. A settled receipt records the route that actually served the call.
Requested selectorSelection behavior
bitrouter/autoUse the policy bound to the local auto router; initialize the binding before use
A virtual model such as codingResolve its configured endpoints using its declared strategy
A logical model id such as openai/gpt-5.4Select that model across eligible connected providers
openai:openai/gpt-5.4Pin one configured provider and model

Use Auto Router for policy-bound model selection, or configure candidate rules below. Virtual Models documents selector syntax and resolution order.

Choose a routing approach

ApproachChoose it whenConfiguration surface
Ordered endpointsYou want a declared primary endpoint and explicit replacementsA virtual model with strategy: priority
Candidate-based selectionEndpoints are interchangeable and provider preferences should filter or reorder themA bare logical model or a virtual model with strategy: cascade, plus routing preferences
Policy-bound selectionDifferent request fingerprints should use configured strong/economy tiersA named router bound to policy-lock.yaml, such as bitrouter/auto

The available building blocks have different scopes. A named local router supplies model selection and request defaults. Legacy presets remain available for compatibility. The strategy field on a virtual model controls its endpoint resolution. A policy binding adds tier selection. Account strategies select credentials within a provider and are described in Model Fallbacks.

Ordered endpoints

Define a virtual model with strategy: priority and put its endpoints in the order you want them attempted. Change the endpoint list to customize that order. A retryable failure may advance the chain; an unsatisfactory successful answer does not itself trigger fallback.

Candidate-based selection

Use strategy: cascade when endpoint preferences may filter and reorder a virtual model's alternatives. A bare logical model resolves across connected providers declaring that model. Both paths can use the routing preferences below; connected models still need compatible capabilities and protocols.

Policy-bound selection

Use Auto Router when model selection should depend on request fingerprints and configured policy tiers. Calling bitrouter/auto without the binding fails visibly; the model name alone does not install a usable policy.

Inference pool

The inference pool is the set of connected models and provider routes a request may consider. Supply can come from your own provider credentials, local or private endpoints, or inference access obtained through BitRouter. Buying or selling inference is optional; routing uses existing access and does not purchase supply.

Connection alone does not make a source eligible for every request. Membership uses the existing provider, router, preset, and variant settings in bitrouter.yaml; there is no separate pool: block.

Connect sources with BYOK & Subscriptions or Local Models.

Inspect the connected sources

bro providers list
bro models
bro models --provider openai
bro route openai/gpt-5.4

bro models shows available model identities. bro route previews the candidate chain for a selector without sending an inference request. Request receipts identify the model and provider that actually served a call.

Candidate eligibility

For a bare model, BitRouter filters active providers by only, ignore, required tags, request capabilities, and protocol compatibility. It then orders candidates by explicit provider priority or the registry's provider-class priority, followed by provider ID.

A cascade virtual model also applies routing preferences to its candidate endpoints. A priority virtual model preserves its explicitly declared endpoint chain: preference filters such as only, ignore, and require_tags do not prune that chain. To restrict a priority chain, edit its endpoints. Capability and protocol compatibility still apply.

Configure the filters and release-specific ordering behavior below.

Configure routing rules

Choose the models and providers first, then configure candidate constraints and endpoint order for the selected approach. This guide covers composing existing settings and policy artifacts; it does not define an arbitrary user-code plugin interface for new selection algorithms.

Request presets

Define a reusable local router under routers. For example, this fragment selects one logical model and restricts its provider candidates:

routers:
  openai_only:
    selection:
      kind: model
      model: openai/gpt-5.4
      routing:
        only: [openai]

Configure the openai provider separately, then inspect the named router:

bro config validate -c bitrouter.yaml
bro route bitrouter/openai_only -c bitrouter.yaml
bro claude --model bitrouter/openai_only

Change the model or provider list to customize this profile. To choose among different models by request fingerprint, initialize an Auto Router policy binding. Virtual Models covers request defaults and their precedence. Legacy @name selectors address presets. On Cloud, use a catalog model ID or an enabled workspace preset addressed as @<name>.

Variants

A named routing variant applies reusable candidate preferences. Define it under variants: and apply it with a :variant suffix. It modifies routing behavior without creating a model version or another virtual-model definition:

variants:
  private:
    routing:
      require_tags: [private]
  primary:
    routing:
      only: [openai]

Append a known variant to a logical model or preset, for example openai/gpt-5.4:primary or @fast:primary. Configure the referenced providers and presets first. The private variant requires matching provider tags; its name does not establish a privacy guarantee. Named local routers do not generally accept variant suffixes. bitrouter/auto retains its compatibility variants. An unknown suffix remains part of the selector.

Router, legacy preset, and variant routing blocks accept only, ignore, and require_tags. These constrain bare-model and cascade selection. They do not prune a priority virtual model's authoritative endpoint list: remove disallowed endpoints from that list instead. Filters do not grant access, bypass guardrails, or supply credentials.

Ordering and release limits

Use provider priority for explicit provider order in candidate-based selection, or strategy: priority and endpoint order for an explicit virtual-model chain. Presets and variants also accept these sort values:

Valuealpha.33 behavior
alphabeticalProvider priority, then provider ID
costAccepted, but currently uses the same deterministic fallback order
latencyAccepted, but currently uses the same deterministic fallback order

The self-hosted alpha.33 proxy uses deterministic ordering. Hosted :cost, :latency, and :throughput profiles bias a separate Cloud ranking.

Capability and protocol constraints

The request can require tool calling, structured outputs, or another model capability. An endpoint that explicitly lacks a required capability cannot become eligible merely because it is included in a virtual model or a preferred provider list.

For custom sources, declare only verified capabilities in BYOK & Subscriptions. BitRouter normalizes the request, derives its requirements, and renders the selected route in its outbound protocol. A protocol's ability to encode a feature does not establish that a specific model implements it.

Responses API documents response-format fields across supported protocols. Use the subset supported by every endpoint that may receive the request; translation cannot invent fields the destination cannot represent.

Scope and routing boundaries

  • A provider-qualified selector pins one provider; it does not expand into the rest of the pool.
  • Subscription sources require an explicit provider-qualified route. Bare model selection does not silently consume a personal subscription.
  • A virtual model names configured endpoints; it does not automatically include every connected model.
  • Routing filters narrow candidates. They do not grant credentials or caller access.
  • Model Fallbacks controls replacement after a retryable failure; it does not make an incompatible model eligible.

Context Routing selects the evidence supplied to the next native model call. That context view is a separate selection from the model/provider candidate pool.

Policy-driven selection and evidence

A bound model policy maps request fingerprints to configured tiers. In alpha.33, frozen and adaptive modes both use the lock for request-time routing. Adequacy fields remain inputs for policy compilation. Objective-scored evaluations use explicitly admitted evidence.

Auto Router covers initialization. Workload Optimization covers policy compilation, reviewed publication, and evaluation evidence. Evidence collection does not automatically publish a candidate policy. The policy artifact does not establish a context-loading contract for an external harness.

Decisions API and policy ownership

Decisions API evaluates typed questions over supplied evidence. A decision response alone does not create a routing policy, admit evaluation results, or publish a candidate. The routing runtime applies its own policy and execution constraints.

Auto routing setup

Auto Router explains how to initialize the auto binding, override a call, and inspect the serving route.

Policy lifecycle and evidence

Workload Optimization covers policy compilation, objective-scored evaluations, frozen evidence snapshots, and reviewed publication.

How is this guide?

On this page