3. Automatic model detection and switch #4

Open
opened 2026-06-15 02:48:58 +03:00 by doru · 0 comments
Owner

Parent

  • #1 Epic: Model Switching via Sidecar

What to build

Router parses the model field from incoming chat completion requests, queries Sidecar for the active model, and triggers a switch if the active profile mismatches the requested model.

  • Router proxy endpoint — extracts model from chat completion JSON body, maps it to profile_id, queries Sidecar GET /models/status. If active_profile matches → route to Main PC. If mismatch or no active → POST to Sidecar /models/switch with profile_id, queue request, wait for readiness, then route.

Acceptance criteria

  • Router extracts model field from chat completion request body
  • Router queries Sidecar status before each request (stateless routing)
  • Matching active model → routes directly to Main PC
  • Mismatching model → triggers switch, queues request, waits for ready, then routes
  • No active model → triggers switch (cold start)
  • Tests: active model match routes to Main PC, mismatch triggers switch + queue, no active model triggers cold start

Blocked by

  • #3 (Sidecar model switch + Router request queue)

User stories covered

5, 16

## Parent - #1 Epic: Model Switching via Sidecar ## What to build Router parses the `model` field from incoming chat completion requests, queries Sidecar for the active model, and triggers a switch if the active profile mismatches the requested model. - **Router** proxy endpoint — extracts `model` from chat completion JSON body, maps it to profile_id, queries Sidecar `GET /models/status`. If `active_profile` matches → route to Main PC. If mismatch or no active → POST to Sidecar `/models/switch` with profile_id, queue request, wait for readiness, then route. ## Acceptance criteria - [ ] Router extracts `model` field from chat completion request body - [ ] Router queries Sidecar status before each request (stateless routing) - [ ] Matching active model → routes directly to Main PC - [ ] Mismatching model → triggers switch, queues request, waits for ready, then routes - [ ] No active model → triggers switch (cold start) - [ ] Tests: active model match routes to Main PC, mismatch triggers switch + queue, no active model triggers cold start ## Blocked by - #3 (Sidecar model switch + Router request queue) ## User stories covered 5, 16
doru added the
type:afk
triage:ready
labels 2026-06-15 02:48:58 +03:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: doru/intelligence-router#4
No description provided.