Intelligence Phase 3: Live Ingestors, Deprecation Trends, Tenant Availability

2026-03-19

model-intelligence-enginedeprecation-detectormodel-auto-selectormodel-router

What We Built

Added LiteLLM and Portkey as live data ingestors to the Model Intelligence Engine, bringing the total data source count to 6 (static catalog, provider probes, OpenRouter, LiteLLM, Portkey, benchmarks). These sources cross-validate pricing, capability, and context window data — giving BrainstormRouter the most accurate live model catalog in the industry.

Enhanced the deprecation detector with quality trend analysis: it now compares the current 7-day performance window against the previous 7-day window, detecting quality degradation before models go fully offline. On critical alert transitions, the system emits events via the platform event bus.

Introduced tenant model availability tracking: when a provider returns 401/403 for a specific tenant (e.g. missing BYOK key), the auto-selector learns to skip that model for that tenant, eliminating wasted retries. Entries expire after 1 hour for automatic re-testing.

Why It Matters

Multi-source intelligence means BrainstormRouter catches pricing changes, new model launches, and deprecations faster than any single-source system. Quality trend detection gives customers early warning before a model degrades — they can migrate proactively instead of reactively. Tenant-specific availability tracking eliminates the most common source of 401 cascade failures in BYOK deployments.

How It Works

The LiteLLM ingestor fetches the comprehensive model_prices_and_context_window.json (2000+ models), parsing pricing, capabilities (vision, tools, JSON mode, prompt caching), and context windows. The Portkey ingestor fetches pricing from Portkey's gateway repo, stripping tier suffixes (-lte-128k, -gt-128k) for canonical model mapping.

The deprecation detector's new quality trend analysis uses getWindowStatsForRange() to compare validity means across consecutive 7-day windows. A >10% decline triggers a watch signal; >20% triggers a warning. Combined with probe miss signals, this creates a multi-signal deprecation prediction system.

Successor recommendations are now capability-weighted: capabilityOverlap 0.6 + priceProximity 0.4, preferring successors that match the deprecated model's tools, vision, and JSON mode support.

The Numbers

  • 6 live data sources feeding the intelligence store (up from 4)
  • LiteLLM covers 2000+ model variants across all major providers
  • Quality trend detection window: 14 days (current 7d vs previous 7d)
  • Tenant availability TTL: 1 hour (auto-retry cadence)
  • Ingestor intervals: LiteLLM 6h, Portkey 6h, OpenRouter 15min, Benchmarks 24h

Competitive Edge

No other AI gateway combines 6 live data sources for model intelligence with quality trend detection and per-tenant availability tracking. Portkey has static pricing; OpenRouter has live data but no trend analysis; neither tracks per-tenant auth failures. BrainstormRouter's intelligence engine is the only system that predicts deprecation before the provider announces it.

Lockstep Checklist

> _You MUST check these boxes [x] and verify the corresponding files are updated BEFORE committing this log._

  • [x] API Routes: src/api/routes/intelligence.ts updated (deprecation response includes auto_migrate_at).
  • [x] TS SDK: packages/sdk-ts/src/resources/intelligence.ts updated with autoMigrateAt and auto_migrate_at fields.
  • [x] Python SDK: packages/sdk-py — returns Dict[str, Any], no code change needed.
  • [x] MCP Schemas: Not applicable (no new MCP tools).
  • [ ] Master Record: docs/architecture/master-capability-record.md reflects this capability.