Operate

Routing policies

RouteIQ picks the model for every call before invoke. Policies encode cheap SLM paths, general owned models, and hard provider fallbacks — plus cache and budgets so cost stays bounded.

Decision order

For each call RouteIQ evaluates:

  • Match first rule whose when matches (intent, agent, tenant, labels)
  • Else use routing.default
  • On failure or capability miss, walk fallback / rule fallback chain
  • Apply response cache if the rule allows it
  • Enforce tenant / agent budget before spend

Every decision is a TraceForge span and a LensAI label on model_id / route.

Capability matrix

PathTypical modelUse when
Cheap SLMowned/slm-supportClassify, refund triage, short CX turns
Cheap classifyowned/slm-apihealSchema / intent classify for API healers
General ownedowned/general-llmDefault reasoning, multi-step agents
Provider hard pathExternal providerCapability gap, outage, or explicit escalate

Policy example

routing:
  default: owned/general-llm
  fallback: owned/general-llm

  cache:
    enabled: true
    ttl_seconds: 300
    key: [model, messages_hash, tenant_id]

  budgets:
    - tenant: acme
      daily_usd: 200
      on_exceed: cheap_only   # force cheap SLM until reset
    - agent: gtm-outbound
      daily_usd: 50
      on_exceed: reject

  rules:
    - name: support-cheap
      when:
        intent: support
      model: owned/slm-support
      fallback: owned/general-llm
      cache: true

    - name: apiheal-classify
      when:
        agent: api-healer
      model: owned/slm-apiheal
      fallback: owned/general-llm

    - name: voice-low-latency
      when:
        agent: voice-appointments
      model: owned/slm-support
      fallback: owned/general-llm
      timeout_ms: 800

    - name: tenant-acme-strong
      when:
        tenant: acme
        intent: escalate
      model: owned/general-llm
      fallback:
        - provider/strong

Headers that drive rules

HeaderMaps to
X-Inferix-Intentrouting.rules[].when.intent
X-Inferix-Agentrouting.rules[].when.agent
X-Inferix-Tenantrouting.rules[].when.tenant
X-Inferix-Trace-Idjoins LensAI + TraceForge

Cache and quality

Cache only idempotent, non-personalized turns. Disable cache on refund, payment, and voice turns where stale replies hurt trust. LensAI exposes cache hit rate so you can tune TTL.

What to watch

  • LensAI: cost by model_id, route distribution, budget rejects
  • TraceForge: routeiq.decide span attributes (matched rule, fallback used)
  • Product deep dive: RouteIQ

DriftWatch signals and FineForge promote / rollback.

Drift & retrain →