← All Plugins
AI Routing

Info-Aware Routing

Send every request to the best provider right now.

Info-Aware Routing lets Agent Router (EAIG) choose a provider and model per request, using live cost, latency, health, region, and request metadata, and fail over automatically when a provider degrades.

What Info-Aware Routing does

What it does

The plugin maintains a live view of every configured provider and model: health, observed latency, error rate, price per token, and region. For each request, a routing decision engine filters out providers that are not eligible, scores the remaining candidates using your routing policy, and sends the request to the best one, with ordered fallbacks if it fails.

The enterprise problem

Static routing to a single provider means paying premium prices for simple requests, absorbing that provider's latency spikes, and suffering full outages when it goes down. Teams that hand-code failover in each application end up with inconsistent, brittle logic.

Where it fits in Agent Router

Info-Aware Routing runs in Agent Router after authentication, quota, and guardrail checks, at the point where a backend is selected. Applications call one endpoint, and the gateway decides where each request goes.

How It Works

The request and response flow

  1. 1
    Request

    Read request context

    Agent Router reads the requested model family, priority, tenant, region, data-classification tag, and any routing headers.

  2. 2
    Control

    Filter eligible providers

    Providers are removed if they are unhealthy, out of the allowed region, not approved for the data classification, or over their capacity.

  3. 3
    Control

    Score candidates

    Remaining providers are scored on cost, recent p95 latency, and error rate using the weights in the routing policy.

  4. 4
    Request

    Route and fail over

    The request goes to the highest-scoring provider. On timeouts or 5xx errors, Agent Router retries the next candidate automatically.

  5. 5
    Response

    Feed back live signals

    Response latency, errors, and token cost are recorded and update each provider's health and latency scores for the next decision.

Architecture

Info-Aware Routing in Agent Router

Info-Aware Routing architecture: Chat applications, Batch pipelines, AI agents, Regional services send requests to Agent Router, which applies Request metadata, then Routing decision engine, then Cost · latency · health · region, and connects to Provider A, Provider B, Provider C, Provider D.ApplicationOne endpointRequest metadatapriority=highregion=usdata-class=publicAgent RouterRouting decision engineProviderHealthp95CostScoreProvider A850 ms$$0.86Provider B1.1 s$$$0.71Provider C0.9 s$$EU onlyProvider D1.4 s$PrivateFilter: health · region · data class → Score: cost · latency · errorsProvider ASelected · lowest costProvider BFailover if A failsProvider CEU region requestsProvider DConfidential dataRoute
Applications
Chat applicationsBatch pipelinesAI agentsRegional services
Agent Router
Info-Aware Routing plugin
Request metadata
Routing decision engine
Cost · latency · health · region
Providers
Provider APrimary · healthy · low cost
Provider BFailover
Provider CEU region
Provider DSelf-hosted · private data

The decision engine filters and scores providers on live signals, then routes each request to the best candidate.

Key Features

Built for production AI traffic

Cost-based routing

Prefer the lowest price per token among providers that meet quality and latency requirements.

Latency-based routing

Use observed p95 latency to route interactive traffic to the fastest healthy provider.

Health-aware failover

Detect errors and timeouts, eject unhealthy providers, and retry the next candidate automatically.

Region and data residency

Keep requests within allowed regions and send sensitive data only to approved or self-hosted models.

Metadata and priority routing

Route by tenant, priority, or data-classification headers, for example premium traffic to dedicated capacity.

Weighted load distribution

Spread traffic across providers by weight to use committed capacity and avoid rate limits.

Benefits

Engineering and business outcomes

Reliability

Survive provider outages

Automatic failover keeps applications running when a provider or region degrades.

Cost

Pay less for routine requests

Simple, high-volume traffic goes to cost-efficient providers while demanding requests get premium models.

Latency

Faster interactive responses

Live latency scoring steers user-facing traffic away from slow providers.

Compliance

Residency by policy

Region and data-classification rules are enforced on every request, not left to each application.

Routing Decisions

How the decision engine chooses

Concrete examples of the conditions Agent Router evaluates and the routing decision it makes.

ScenarioConditions observedDecision
Normal operationProvider A healthy, p95 latency 850 ms, lowest cost per tokenRoute to Provider A
Provider A degradesProvider A error rate above threshold, health check failingEject A, fail over to Provider B
Latency spikeProvider A p95 rises above the 2 s latency budget for interactive trafficRoute interactive requests to Provider B, keep batch on A
EU customer requestRequest tagged region=eu, data residency policy appliesRoute to Provider C (EU region) only
Confidential dataRequest tagged data-class=confidentialRoute to Provider D (self-hosted) only
Batch job, low priorityHeader priority=low, cost weight dominantRoute to cheapest healthy provider
All external providers downA, B, and C failing health checksServe from Provider D, return degraded-mode header
Use Cases

Where enterprises use Info-Aware Routing

01

Multi-provider resilience

Run OpenAI, Azure OpenAI, Anthropic, and Bedrock side by side and fail over between them automatically.

02

Cost-optimized batch processing

Send overnight summarization and classification jobs to the lowest-cost healthy provider.

03

Data residency for global products

Keep EU customer prompts on EU-hosted models and US traffic on US regions.

04

Tiered service levels

Route premium-tier customers to dedicated low-latency capacity and free-tier traffic to shared pools.

05

Hybrid cloud and self-hosted models

Send confidential workloads to vLLM on your own GPUs while general traffic uses cloud providers.

Configuration

Cost, latency, and health-aware routing policy

Candidate providersProviders and models that can serve the route.
A (OpenAI), B (Azure OpenAI), C (Bedrock EU), D (self-hosted vLLM)
Eligibility filtersRules that remove providers before scoring, for example unhealthy or out-of-region ones.
Health, region, data classification
Scoring weightsHow strongly each signal counts when ranking eligible providers.
Cost 50% · latency 35% · error rate 15%
Latency budgetProviders slower than this are deprioritized for interactive requests.
2 seconds (p95) for interactive traffic
Failover triggersResponses that cause Agent Router to retry the next provider.
5xx errors, timeouts, HTTP 429
Maximum attemptsHow many providers are tried before the request fails.
3
Outlier ejectionWhen an unhealthy provider is temporarily taken out of rotation.
5 consecutive errors → remove for 30 s

Illustrative example. Settings and values show what can be configured and are not exact configuration syntax.

Enterprise Workflow

How it fits your AI platform

  1. 01

    Platform team

    Registers providers and models and defines routing weights, filters, and failover rules.

  2. 02

    Applications

    Call one Agent Router endpoint and optionally pass priority, region, or data-class headers.

  3. 03

    Agent Router

    Evaluates live signals and request metadata and routes each request to the best provider.

  4. 04

    Models & providers

    Receive traffic according to health, cost, and policy, with failover when one degrades.

  5. 05

    SRE & FinOps

    Monitor routing decisions, failovers, latency, and cost per provider from gateway metrics.

Route every AI request intelligently

IMESH can help you design routing policies, failover strategies, and multi-provider architectures on Agent Router (EAIG).