> ## Documentation Index
> Fetch the complete documentation index at: https://docs.domesystems.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Pools

> Routing strategies, failover limits, pool resolution order, and match_when dialect

This page lists routing strategies, failover limits, resolution order, and the `match_when` predicate dialect.

Refer to [Pools](/concepts/resources/model-pools) concept for how routing works. Configure on [Pools](/connect/resources/models/pools).

## Routing strategies

| Strategy            | Primary selection                                                              | Member fields it uses |
| ------------------- | ------------------------------------------------------------------------------ | --------------------- |
| `priority_weighted` | Chooses by weight from the lowest priority tier                                | Priority and weight   |
| `round_robin`       | Rotates through all members in order                                           | Neither               |
| `least_loaded`      | Chooses the member with the fewest in-flight requests and breaks ties randomly | Neither               |

`strategy_scope`: `workspace` shares round-robin and least-loaded state across agents; `caller` tracks per agent. Priority-weighted routing ignores `strategy_scope`.

## Failover

| Value             | Runtime behavior                                 |
| ----------------- | ------------------------------------------------ |
| No limit or `all` | Try every eligible member until one succeeds     |
| `0`               | Try only the primary                             |
| `N`               | Try the primary and up to `N` additional members |

Authorization and streaming failover rules are on [Pools](/connect/resources/models/pools#failover).

## Pool resolution

Dome resolves a request's `model` value in this order:

1. A pool with that exact name
2. A direct model connection with that exact name
3. A direct connection whose upstream model identifier matches
4. The first pool in the configured order whose `match_when` predicate matches
5. The workspace default pool

Exact names beat conditional routes. `match_when` inputs:

| Input                                                 | Supported matching                                                       |
| ----------------------------------------------------- | ------------------------------------------------------------------------ |
| `prompt_tokens`                                       | Estimated prompt size, characters ÷ 4, with numeric `gt`, `lt`, and `eq` |
| `requested_max_tokens`, `tool_count`                  | Numeric `gt`, `lt`, and `eq`                                             |
| `endpoint` and `header.<name>`                        | Equality, `in`, `prefix`, `suffix`, and RE2 `regex`                      |
| `principal.metadata.<key>`                            | String or numeric matching                                               |
| `principal.act_as.sub`, `.email`, and `.claims.<key>` | String or numeric matching                                               |
| `principal.act_as.roles` and `.groups`                | `contains`, `containsAny`, and `containsAll`                             |
| Nested predicates                                     | `any`, `all`, and `not`                                                  |

By default every condition must match. Use `any`, `all`, or `not` to combine differently. An unknown condition, missing value, or unverified act-as attribute never matches. Routing does not replace authorization.

## Next steps

Create pools and attach them to Gateways:

* [Pools](/concepts/resources/model-pools) concept for members, routing, and reachability
* [Pools](/connect/resources/models/pools) to create pools, manage members, and attach Gateways
* [Models](/reference/resources/models) reference for provider and credential catalogs
* [LLM gateway](/concepts/gateways/llm-gateway) concept for dispatch on the wire
