Intelligent LLM routing for AI coding agents

Every AI Request Deserves the Right Model.

Intelligent routing for AI coding agents. Optimize every step, preserve prompt caches, reduce repeated context, and help stop runaway costs.

Agent-Aware Routing

One Agent. Different Steps. Smarter Models.

Why use an expensive model for every step? Air Router can route routine agent operations to lower-cost models while reserving stronger models for demanding work.

Step-Aware Routing

User request“Build an Authentication System”

    Illustrative example. Real routes depend on each request.

    Pay for intelligence where it matters.

    Autonomous Agent Protection

    Stop Agent Loops Before They Drain Your Budget.

    Detect repeated searches, edits, and tool calls. Air Router is designed to interrupt unproductive loops before they consume more tokens.

    agent session · via air router

    Loop guard

    Contained
    Repeated operations3 / 3
    1. Loop Detected
    2. Agent Redirected
    3. Execution Stopped

    Stopped with clear feedback for the agent.

    Loop Detection

    Identify repeated agent behavior.

    Smart Intervention

    Nudge agents away from unproductive repetition.

    Execution Protection

    Can stop persistent loops with clear feedback.

    Prompt Cache Intelligence

    The Lowest-Priced Model Isn’t Always the Cheapest Request.

    Air Router considers existing prompt caches before switching models, helping avoid expensive cache rebuilds.

    Router’s pick Scenario A

    Switch Models

    Model AModel B
    • Lower advertised token price
    • Cold prompt cache
    • Context must be processed again
    • Potentially higher effective cost
    Effective input cost60 units
    100K tokens processed fresh
    Router’s pick Scenario B

    Stay Cache-Aware

    Model AModel A
    • Existing warm cache
    • Reused eligible context
    • Lower effective input cost
    Effective input cost19 units
    90K cached10K new
    This request routes toModel A, warm cacheEffective input cost 19 units

    Illustrative units, not real prices. 100K-token context. Model A: 1.0 per 1K tokens, cached input 0.1. Model B: 0.6 per 1K tokens, nothing cached yet.

    Optimize the actual bill, not just the model price list.

    Complexity-Aware Model Selection

    Big Context Doesn’t Always Mean a Big Task.

    A simple edit inside a massive repository shouldn’t automatically require your most expensive model.

    Request AFast

    Task

    Rename a variable

    Context150K tokens

    ComplexityLow

    Recommended TierFast

    Request BAdvanced

    Task

    Design distributed architecture

    Context12K tokens

    ComplexityHigh

    Recommended TierAdvanced

    Complexity meter
    • Task intentLow
    • Reasoning requirementsLow
    • Coding complexityLow
    • Context requirementsLarge

    Large context, simple changeFast

    Route by task difficulty, not prompt length alone.

    Quality-Aware Routing

    Start Efficiently. Escalate When Needed.

    Once an active task requires a stronger model tier, Air Router avoids moving that task to a weaker tier.

    Passing on Advanced · lower tiers locked

    Tier 3Advanced task hereminimum tier
    Tier 2Balanced task hereminimum tier
    Tier 1Fast task hereminimum tier
    Downgrade blocked for this task
    1. Smart Starting Tier

      Simple first steps start on a fast model.

    2. Failure-Based Escalation

      Failed checks can move the task up a tier.

    3. No Mid-Task Downgrades

      Lower tiers stay locked until the task ends.

    Save on simple work while demanding tasks stay on stronger models.

    Context Efficiency Engine

    Stop Sending the Same Context Again and Again.

    Reduce repeated file content, completed tool history, and unnecessary prompt overhead before model execution.

    Context sent to the model

    Before optimization

    System Instructions6K
    Repository Files48K
    Repeated File Content34K
    Previous Tool Calls30K
    Duplicate Search Results24K
    Current User Request8K

    150K tokens

    After optimization

    System Instructions6K
    Relevant Repository Context31K
    Repeated File Content34K
    Condensed Tool History20K
    Duplicate Search Results24K
    Current User Request8K

    65K tokens

    Illustrative example150K → 65K tokens

    Illustrative example — actual reduction depends on the request.

    Context Deduplication

    Send repeated files and search results once.

    Tool History Compaction

    Condense completed tool calls into a short history.

    Language-Aware Code Compression

    Compact code context with its language in mind.

    Send less redundant context. Preserve what matters.

    Hybrid AI Infrastructure

    AirGPU, AirLLM’s Own GPUs. The Cloud When Needed.

    Air Router can run eligible routine workloads on AirGPU, AirLLM’s own GPU infrastructure, with fallback to cloud model providers when needed.

    Coding Agent Request “Summarize test results” Routine · Fast tier
    AIR ROUTER AirGPU unavailable · cloud fallback

    AirGPU

    Unavailable
    • Routine workloads
    • Lower infrastructure cost
    • Fast-model execution

    Cloud AI Providers

    Fallback serving
    • Advanced models
    • Higher-complexity tasks
    • Automatic fallback

    Rerouted to an eligible cloud provider.

    Only eligible routine requests run on AirGPU; everything else, and anything AirGPU can’t serve at that moment, goes to cloud model providers.

    Combine efficient infrastructure with cloud-scale capability.

    Effective Cost Routing

    Route by Real Cost. Not Advertised Price.

    Air Router considers token accounting, cache state, model capabilities, and context requirements when evaluating model choices.

    Candidate models · one requestHypothetical values
    Hypothetical comparison of three fictional models for one request. Model B is selected for the lowest estimated effective cost.
    MetricModel AModel BSelectedModel C
    Advertised rateLowMediumHigh
    Cache stateColdWarmCold
    Context fitYesYesYes
    Effective costMediumLowestHigh

    Model B Selected.Lowest estimated effective cost for this request.

    Token-Adjusted Pricing

    Price each candidate on the tokens it would really process.

    Warm-Cache Economics

    Count reusable cached context in the comparison.

    Context-Aware Candidate Ranking

    Rank only models that fit the request’s context.

    The best route is the one that makes economic sense for the actual request.

    Agent Reliability

    Recover from Model Mistakes. Keep Agents Moving.

    Repair eligible malformed tool calls, detect empty responses, and avoid repeatedly selecting unreliable models during a session.

    1. Step 1Agent Request
    2. Step 2Model Response
    3. Step 3Response Validation
    4. Step 4Automatic Recovery
    5. Step 5Agent Continues
    tool_use · edit_filevalid
    1{"name": "edit_file", 2 "input": {"path": "src/auth/session.ts", 3 "line": 42, 4 "find": "validate(token)", 5 "replace": "validate(token, ctx)" 6+ }}
    1. Malformed Tool Call Detected
    2. Repair Applied
    3. Valid Tool Call Delivered

    Simulated example. Repairs apply only to eligible malformed calls.

    Tool-Call Repair

    Fix eligible malformed tool calls before the agent sees them.

    Empty-Response Detection

    Catch empty model responses instead of passing them on.

    Session-Aware Model Reliability

    Avoid reselecting models that keep failing in a session.

    Fewer avoidable failures. More productive agent execution.

    Intelligent Tier Optimization

    Compress Context. Keep Routing Decisions Safe.

    Air Router can use compressed context estimates when evaluating model tiers, with safeguards against inappropriate downgrades.

    1. Stage 1

      Original Request

      Large context

      140K tokens
    2. Stage 2

      Context Optimization

      Smaller eligible payload

      60K tokens
    3. Stage 3

      Guarded Tier Selection

      Suitable model tier

      Size alone suggests Fast Balancedkept
    • Original task complexity
    • Tier boundary protection
    • Session model constraints
    • Failure-aware escalation

    Smaller prompts shouldn’t mean weaker reasoning.

    Built for AI Coding Agents

    More Than Model Routing.

    Traditional gateways connect applications to models. Air Router goes further by optimizing how coding agents use those models.

    Capabilities of a generic basic model gateway compared with Air Router
    CapabilityConventional Model GatewayAir Router
    Model RoutingYesYes
    Provider FallbackYesYes
    Agent-Step RoutingVariesYes
    Task Complexity AnalysisVariesYes
    Cache-Aware Cost DecisionsVariesYes
    Agent Loop ProtectionVariesYes
    Context DeduplicationVariesYes
    Safe Tier EscalationVariesYes
    AirGPU + Cloud RoutingVariesYes

    Compared with a generic basic gateway. Capabilities of specific products vary.

    Developer Compatibility

    Keep Your Coding Tool. Upgrade Your Routing.

    Connect compatible coding tools through familiar API formats without rebuilding your workflow.

    AIR ROUTEROne endpoint for your tools
    • Claude Code
    • Codex CLI
    • Cursor
    • AirCode
    • GitHub Copilot CLI
    • Cline
    • Aider
    • Roo Code
    • OpenCode
    Guided setup: the AirLLM setup script or AirCode installer configures it Compatible endpoint: add the base URL and key in the tool’s settings
    Anthropic Messages/v1/messages
    OpenAI Chat Completions/v1/chat/completions
    OpenAI Responses/v1/responses

    Setup steps and supported features vary by tool and version.

    View Integration Guides

    Your AI Agents Can Work Smarter.

    Intelligent model selection. Efficient context. Cache-aware routing. Built for the next generation of AI coding agents.

    One intelligent routing layer for your AI development workflow.