Goal: a thin TS router (platform/model-router) where callers request a
class (fast | strong), not a vendor. Config maps class → { model, fallback[], max_budget }, resolved through the existing LLM factory
(apps/api/src/modules/memory/llm/index.ts). Per ADR-0002.
How to do it
- Define
ModelClass = 'fast' | 'strong' and a config map → provider+model+
fallback chain (fast → gpt-4o-mini/haiku; strong → sonnet, fallback opus).
router.complete({ class, ... }) resolves the class and delegates to the
current provider seam; with no API key every class resolves to the fake
provider (CI stays offline).
- Hot-swap model via config, no call-site change.
Acceptance criteria
🔗 Sequencing
Goal: a thin TS router (
platform/model-router) where callers request aclass (
fast|strong), not a vendor. Config maps class →{ model, fallback[], max_budget }, resolved through the existing LLM factory(
apps/api/src/modules/memory/llm/index.ts). Per ADR-0002.How to do it
ModelClass = 'fast' | 'strong'and a config map → provider+model+fallback chain (
fast→ gpt-4o-mini/haiku;strong→ sonnet, fallback opus).router.complete({ class, ... })resolves the class and delegates to thecurrent provider seam; with no API key every class resolves to the fake
provider (CI stays offline).
Acceptance criteria
router.complete({ class: 'fast' })resolves to the cheap model;'strong'to the strong model; both fall back to fake with no key.
🔗 Sequencing