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
whenmatches (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
| Path | Typical model | Use when |
|---|---|---|
| Cheap SLM | owned/slm-support | Classify, refund triage, short CX turns |
| Cheap classify | owned/slm-apiheal | Schema / intent classify for API healers |
| General owned | owned/general-llm | Default reasoning, multi-step agents |
| Provider hard path | External provider | Capability 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/strongHeaders that drive rules
| Header | Maps to |
|---|---|
X-Inferix-Intent | routing.rules[].when.intent |
X-Inferix-Agent | routing.rules[].when.agent |
X-Inferix-Tenant | routing.rules[].when.tenant |
X-Inferix-Trace-Id | joins 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.decidespan attributes (matched rule, fallback used) - Product deep dive: RouteIQ
DriftWatch signals and FineForge promote / rollback.
Drift & retrain →