# Strategies (/docs/routing/strategies)

> For AI agents, the [documentation index](https://bitrouter-docs-staging.up.railway.app/llms.txt) lists all pages. Append .md to a documentation URL to read its Markdown.

Routing strategies determine **which models and providers are eligible for a call and how their candidates are ordered**. A [virtual model](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/virtual-models) defines a reusable model endpoint; routing resolves the caller's selector, forms the eligible candidate set, and applies the configured selection behavior. [Context Routing](https://bitrouter-docs-staging.up.railway.app/docs/routing/context-routing) independently determines what retained evidence the next native model call sees.

## How a call is routed \[#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 selector                          | Selection behavior                                                                 |
| ------------------------------------------- | ---------------------------------------------------------------------------------- |
| `bitrouter/auto`                            | Use the policy bound to the local `auto` router; initialize the binding before use |
| A virtual model such as `coding`            | Resolve its configured endpoints using its declared strategy                       |
| A logical model id such as `openai/gpt-5.4` | Select that model across eligible connected providers                              |
| `openai:openai/gpt-5.4`                     | Pin one configured provider and model                                              |

Use [Auto Router](https://bitrouter-docs-staging.up.railway.app/docs/routing/auto-router) for policy-bound model selection, or configure candidate rules below. [Virtual Models](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/virtual-models#model-selector-forms) documents selector syntax and resolution order.

## Choose a routing approach \[#choose-a-routing-approach]

| Approach                  | Choose it when                                                                       | Configuration surface                                                                      |
| ------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| Ordered endpoints         | You want a declared primary endpoint and explicit replacements                       | A virtual model with `strategy: priority`                                                  |
| Candidate-based selection | Endpoints are interchangeable and provider preferences should filter or reorder them | A bare logical model or a virtual model with `strategy: cascade`, plus routing preferences |
| Policy-bound selection    | Different request fingerprints should use configured strong/economy tiers            | A 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](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/model-fallback#account-fallback).

### Ordered endpoints \[#ordered-endpoints]

Define a [virtual model](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/virtual-models#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 \[#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 \[#policy-bound-selection]

Use [Auto Router](https://bitrouter-docs-staging.up.railway.app/docs/routing/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 \[#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](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/byok-subscriptions) or [Local Models](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/local-models).

## Inspect the connected sources \[#inspect-the-connected-sources]

```bash
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](https://bitrouter-docs-staging.up.railway.app/docs/cli/request-receipts) identify the model and provider that actually served a call.

## Candidate eligibility \[#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 \[#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 \[#request-presets]

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

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

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

```bash
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](https://bitrouter-docs-staging.up.railway.app/docs/routing/auto-router#initialize-a-policy-binding).
[Virtual Models](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/virtual-models#presets) 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 \[#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:

```yaml
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 \[#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:

| Value          | alpha.33 behavior                                                  |
| -------------- | ------------------------------------------------------------------ |
| `alphabetical` | Provider priority, then provider ID                                |
| `cost`         | Accepted, but currently uses the same deterministic fallback order |
| `latency`      | Accepted, but currently uses the same deterministic fallback order |

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

## Capability and protocol constraints \[#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](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/byok-subscriptions#custom-endpoints-and-models). 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](https://bitrouter-docs-staging.up.railway.app/docs/usage/responses-api#structured-outputs-across-protocols) 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 \[#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](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/model-fallback) controls replacement after a retryable failure; it does not make an incompatible model eligible.

[Context Routing](https://bitrouter-docs-staging.up.railway.app/docs/routing/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 \[#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](https://bitrouter-docs-staging.up.railway.app/docs/routing/auto-router#initialize-a-policy-binding) covers initialization. [Workload Optimization](https://bitrouter-docs-staging.up.railway.app/docs/routing/workload-optimization#existing-policy-tools) 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-and-policy-ownership]

[Decisions API](https://bitrouter-docs-staging.up.railway.app/docs/reference/decisions) 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.

* [Configuration (YAML)](https://bitrouter-docs-staging.up.railway.app/docs/routing/configuration) — Find, validate, and apply the configuration and its policy binding.

* [Auto Router](https://bitrouter-docs-staging.up.railway.app/docs/routing/auto-router) — Initialize bitrouter/auto and inspect a policy-bound request.

* [Routing Traces](https://bitrouter-docs-staging.up.railway.app/docs/routing/routing-traces) — Inspect routing behavior and upstream attempts across a workflow.

* [State Affinity](https://bitrouter-docs-staging.up.railway.app/docs/routing/state-affinity) — State-aware source selection; documentation coming soon.

* [Model Fallbacks](https://bitrouter-docs-staging.up.railway.app/docs/models-routing/model-fallback) — Understand when failed attempts advance to another endpoint.

* [Context Routing](https://bitrouter-docs-staging.up.railway.app/docs/routing/context-routing) — Select evidence for the next native model call.

## Auto routing setup \[#auto-routing-setup]

<a id="routing-rules" />
<a id="choose-a-strategy" />
<a id="customize-a-strategy" />
<a id="policy-tiers-and-runtime-adequacy" />
<a id="initialize-a-policy-binding" />
<a id="override-one-call" />
<a id="verify-and-apply-a-strategy" />
<a id="verify-and-apply-the-policy" />

[Auto Router](https://bitrouter-docs-staging.up.railway.app/docs/routing/auto-router) explains how to initialize the auto binding, override a call, and inspect the serving route.

## Policy lifecycle and evidence \[#policy-lifecycle-and-evidence]

<a id="let-evidence-improve-the-policy" />
<a id="review-and-publish-a-change" />
<a id="evaluations" />
<a id="two-evidence-paths" />
<a id="evidence-lifecycle" />
<a id="1-define-and-seal-a-subject" />
<a id="2-evaluate-outside-the-router" />
<a id="3-submit-the-result" />
<a id="4-freeze-a-snapshot" />
<a id="5-consume-the-evidence-explicitly" />
<a id="reproducibility-boundary" />
<a id="what-evaluation-does-not-establish" />

[Workload Optimization](https://bitrouter-docs-staging.up.railway.app/docs/routing/workload-optimization#existing-policy-tools) covers policy compilation, objective-scored [evaluations](https://bitrouter-docs-staging.up.railway.app/docs/routing/workload-optimization#evaluations), frozen evidence snapshots, and [reviewed publication](https://bitrouter-docs-staging.up.railway.app/docs/routing/workload-optimization#review-and-publish-a-change).