← All evidence
P-007 · Model Routing

Required task_type. Required schema_id. No exceptions.

Production Verified

Every model call carries a required task_type + schema_id; the dispatcher refuses ungoverned dispatches at the boundary. The schema is enforced by the request envelope — not optional metadata.

Source of truth

The local-lane dispatcher (LLMLocalDispatcher) and its request schema (LLMLocalRequest) live in the FastAPI service. Worker side (LLMLocalWorker) self-registers and processes from schema/task-specific queues.

Mechanism

The request schema is enforced at the Pydantic model layer: schema_id and task_type are required fields with no default. The dispatcher validates against the model registry and routes the job to the matching schema/task queue. Workers register themselves and process only from queues that match their declared model + task class.

Evidence
ONE ROUTER · A REQUIRED CONTRACT ON EVERY CALL

  every request:
    schema_id      ← which model schema  (required)
    task_type      ← which task class    (required, enum)
    caller         ← which service       (required — attribution)
    priority       ← 0–10                (default 5)
    timeout        ← seconds

  every response:
    assigned_model_id   ← which model actually ran the job
    queue_name          ← which schema/task lane it landed in
    queue_position      ← visible queue depth
    estimated_completion

  routing properties (built-in):
    ✓ model registry validation
    ✓ schema-locked enforcement
    ✓ Redis job queue routing by schema + task
    ✓ auto-tuning batch sizes from response-time metrics
    ✓ worker self-registration + health monitoring
    ✓ performance metrics per model × task combination
Reproduction
Source artifact
LLMLocalDispatcher class + LLMLocalRequest schema in the FastAPI service
Command
POST /llm_local/dispatch with a payload missing task_type or schema_id
Expected output
HTTP 422 / validation error — required field
Verification
re-POST with all required fields + a registered schema_id; expect a queued job with an assigned_model_id and queue_position
Caveats
This validates the local lane — schema-locked enforcement, required fields, registry validation, worker self-registration. The frontier lane uses the same contract pattern; frontier-share is tracked per call as a routing KPI inside each deployment.