Six layers decide the route
Public Preview

Understand model routing and the stable application contract

Model routing keeps one application contract across an approved set of external model routes through six control layers.

Model routing keeps one application contract across approved external model routes, using contextual route choice while the application validates terminal results and owns business acceptance.

  • Six control layers move a task from approved deployment through route choice to application validation.
  • A route's declared feature list is operator-written; Duale AI validates responses against the application's schema.
  • Three lifecycles—request, model configuration, and business process—change independently and each needs an owner.
  • Wrong feature claims can spend provider calls and time until the deadline ends the task.

Summaries were generated by AI. Generative AI is experimental.

Use model routing to keep one application contract across an approved set of external model routes. First define the hard deployment and tenant boundary. The application can then add contextual preferences without naming a provider or model.

Integrate model routing in an application shows the request fields, terminal-result checks, and failure path that keep this contract independent of one provider.

The effective model pool contains the enabled routes from the selected tenant configuration that the task runtime has applied. The endpoint and API token select the task boundary; a routing policy only influences choices inside the pool. Routing contract and limits owns the hard boundary, soft preferences, attempt variability, and pool-change rule.

Control model changes gives the evaluation and rollback sequence for a material pool change.

Six layers decide the route

Model routing moves a task through six control layers. The organization sets the approved boundary, model pool, and agent tools before the request arrives. The request adds the task, output contract, deadline, and preferences. Duale AI then chooses routes and makes attempts. The application validates the terminal result and decides how the business process can use it. Route choice is contextual; result acceptance stays with the application.

Model routing control boundariesThe organization defines the deployment, tenant, model pool, and agent tools. The application sends a task, an output contract, a deadline, and routing preferences. Duale AI uses routes from the effective pool. The application validates the terminal result before the business process uses it.

The diagram and table use the same six layers:

LayerPurposeMain rule
Approved deployment and tenantSet the physical data boundary and the logical identity and configuration boundaryInclude every external path; a tenant is not physical or regional isolation
Enabled model routesDefine the provider routes available to the tenantTreat every enabled route as potentially selectable
Agent tools and permissionsDefine the tools the agent can callA request cannot add a tool allowlist
Task, output contract, and routing preferencesDescribe the work, deadline, required result, and contextual preferencesA routing preference is not a command to use one route
Contextual route choice and attemptsSelect eligible routes and seek a valid result within the task deadlineDo not assume sequential attempts or an attempt against every enabled route
Application validation and business controlsValidate the terminal result and decide whether the business process can use itKeep acceptance and irreversible actions outside routing
  • Layer
    Approved deployment and tenant
    Purpose
    Set the physical data boundary and the logical identity and configuration boundary
    Main rule
    Include every external path; a tenant is not physical or regional isolation
  • Layer
    Enabled model routes
    Purpose
    Define the provider routes available to the tenant
    Main rule
    Treat every enabled route as potentially selectable
  • Layer
    Agent tools and permissions
    Purpose
    Define the tools the agent can call
    Main rule
    A request cannot add a tool allowlist
  • Layer
    Task, output contract, and routing preferences
    Purpose
    Describe the work, deadline, required result, and contextual preferences
    Main rule
    A routing preference is not a command to use one route
  • Layer
    Contextual route choice and attempts
    Purpose
    Select eligible routes and seek a valid result within the task deadline
    Main rule
    Do not assume sequential attempts or an attempt against every enabled route
  • Layer
    Application validation and business controls
    Purpose
    Validate the terminal result and decide whether the business process can use it
    Main rule
    Keep acceptance and irreversible actions outside routing

Use Model routing architecture patterns when a customer, region, provider, or evaluation boundary needs a separate tenant or deployment.

This design provides provider portability, contextual selection, and more fallback options. Model routing controls which external model answers a completion; it does not control document storage, tool destinations, telemetry, or regional hosting. Plan the deployment covers those paths.

Know what a route claims, and what a wrong claim costs

Each route in the pool carries a declared feature list, and an operator writes that list. A model identifier adds no feature by itself. Duale AI validates the route document but does not probe the configured endpoint, so a route can claim a feature that its endpoint or model does not honor. Plan the deployment and model portfolio states what saving a route does check.

A wrong claim does not corrupt your result. Duale AI validates every answer against the response schema your application sent, whichever route ran it, so your application receives a matching result or an error. It never receives a wrong shape.

The declaration and adapter path decide how your response schema reaches the provider:

Route conditionWhat happens
The route declares native structured output and the endpoint honors itThe schema travels in the provider’s structured-output field. The provider enforces the sanitized schema.
The adapter has no native response-schema pathDuale AI adds the schema to the model instructions. The provider does not enforce it.
The route declares native structured output but the endpoint does not honor itThe provider call can fail. Local validation rejects a wrong-shaped answer, so the task can spend more attempts.
  • Route condition
    The route declares native structured output and the endpoint honors it
    What happens
    The schema travels in the provider’s structured-output field. The provider enforces the sanitized schema.
  • Route condition
    The adapter has no native response-schema path
    What happens
    Duale AI adds the schema to the model instructions. The provider does not enforce it.
  • Route condition
    The route declares native structured output but the endpoint does not honor it
    What happens
    The provider call can fail. Local validation rejects a wrong-shaped answer, so the task can spend more attempts.

One pool can contain routes that use either valid schema path for the same request. The third row is a configuration error to find during route evaluation, not a supported fallback path.

The cost is less visible. A wrong claim can spend provider calls, time, and money until another attempt succeeds or the deadline ends the task. It can look like poor model quality rather than a configuration error. Routing contract and limits states what the routing contract does and does not promise about those attempts.

A claim does not decide which routes stay in the pool either. Image support is the exception: a request whose tool results carry images narrows the pool to routes that can carry at least one image. When no route can, every route stays and every image is dropped.

Provider capability and compatibility lists what each provider type accepts and how an operator declares it.

Keep three lifecycles separate

Model routing joins three lifecycles that can change independently. A stable request interface can therefore hide a model change that affects the business result. Assign an owner, acceptance evidence, and a stop action to each lifecycle:

  • Request lifecycle: one task is submitted, routed, completed, stopped, or failed. The application owns its deadline, terminal result validation, and failure path.
  • Model and configuration lifecycle: a route is evaluated, approved, enabled, observed, disabled, and retired. The authorized configuration owner controls tenant-owned fields. Preset and provider owners can control other effective fields.
  • Business-process lifecycle: a workflow is designed, accepted, monitored, changed, and withdrawn. Its owner remains accountable for the outcome even when the application code does not change.

Require technical checks and business acceptance for each material change.

Ownership and approvals maps those decisions to customer-held records. Operate model routing and manage risk shows how to observe the resulting business, route, and control health.