STOP WASTING PAID TOKENS. START POOLING ACCOUNTS TODAY. [ GET YOUR VAULT ]
← BACK TO BLOG

Task-Based Routing: How SpiderGate Maps Intent to Models

Eli Vostok
May 04, 2026 · 3 min read
Copied!
Task-Based Routing: How SpiderGate Maps Intent to Models

Task-Based Routing: How SpiderGate Maps Intent to Models

The most expensive mistake in LLM ops is using the same model for everything. A simple classification task doesn't need GPT-4o. A complex reasoning chain shouldn't run on a 7B parameter model. But without routing infrastructure, the default is to pick one model and use it everywhere.

The Alias System

SpiderGate introduces model aliases — logical names that resolve to physical providers based on rules you define:

| Alias | Resolves To | Use Case | |-------|------------|----------| | fast | GPT-4o-mini → Gemini Flash | Classification, extraction, simple Q&A | | smart | Claude Sonnet → GPT-4o | Reasoning, analysis, long-context | | code | Claude Sonnet → GPT-4o | Code generation, refactoring | | vision | GPT-4o → Gemini Pro | Image analysis, OCR | | embed | text-embedding-3-small | Vector embeddings |

Your agents call model: "fast" and the gateway handles the rest.

Fallback Chains

Every alias can define an ordered fallback chain. If the primary provider is down, rate-limited, or returning errors, SpiderGate automatically routes to the next provider:

aliases:
  smart:
    primary: anthropic/claude-sonnet-4-20250514
    fallbacks:
      - openai/gpt-4o
      - google/gemini-1.5-pro
    max_latency_ms: 30000
    retry_on: [429, 500, 502, 503]

The agent never sees the failover. The response comes back in the same format regardless of which provider served it.

Cost Optimization

The routing layer enables automatic cost optimization without sacrificing quality:

In practice, teams using task-based routing see 40-60% cost reduction compared to single-model deployments.

Configuration

Aliases are defined per-brand in the SpiderGate admin panel or via the API:

curl -X PUT https://gate.spideriq.ai/api/v1/admin/aliases/fast \
  -H "Authorization: Bearer sg_admin_xxx" \
  -d '{
    "primary": "openai/gpt-4o-mini",
    "fallbacks": ["google/gemini-2.0-flash"],
    "max_tokens": 4096,
    "temperature_override": null
  }'

Real-World Example

Consider an agency running three agent types:

  1. Lead qualifier — reads a business profile, scores it. Needs speed, not depth → fast

  2. Email writer — crafts personalized outreach. Needs creativity → smart

  3. Code deployer — generates and validates website components → code

Without routing, all three hit GPT-4o at $2.50/1M input tokens. With aliases:

Blended cost drops dramatically while each task gets the optimal model.

The Key Insight

Routing isn't about picking the cheapest model. It's about matching capability to intent. SpiderGate's alias system makes this declarative — you define what "fast" means for your team, and every agent benefits.

← BACK TO BLOG