Skip to content

feat(platform): model router core — class config (fast|strong) over the LLM seam #105

Description

@Jaybhade

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

  • router.complete({ class: 'fast' }) resolves to the cheap model; 'strong'
    to the strong model; both fall back to fake with no key.
  • Hermetic test asserts class→model resolution via the fake provider.

🔗 Sequencing

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

module: platformCross-cutting / repo-wide.priority: P1Important. Needed for the phase, but not blocking the loop.scope: backendExpress API / server-side.size: M2–4 days.status: in-reviewPR open, awaiting mergetype: featureNew capability.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions