# ModelRouter

Official NVIDIA/NIM-first model routing and sanitized ModelDecision evidence.

Status: implemented
Version: latest
Review: source-backed

## Official-route-first model boundary

ModelRouter selects configured official model routes and records ModelDecision evidence with hashes, status, route, schema version, provider labels, and redacted payload summaries.

| Decision type | Expected provider posture | Stored evidence |
| --- | --- | --- |
| Lead/deal score | Frugal NVIDIA/Nemotron route when configured | Score, confidence, rationale summary, source refs |
| Copy safety | Safety route with schema validation | Risk category, approval recommendation, fail-closed status |
| Deliverable QA | Showcase or quality route | QA summary, gaps, release recommendation |
| Classification | Low-cost structured route | Class label, confidence, source hash |
| Fallback | Explicit fallback-only provider | Fallback label and non-official proof status |

## Fail-closed behavior

- Missing official route cannot be represented as official NVIDIA proof.
- Invalid JSON or schema mismatch produces a failed ModelDecision.
- Unsafe draft/copy classifications block Gmail execution.
- Hidden reasoning, raw model context, API keys, and private values are not persisted in public proof surfaces.
- ModelDecision records link back to runs, drafts, approvals, artifacts, or ledger rows when available.


Source paths:
- `lib/autonomous_agency/ai/model_router.ex`
- `lib/autonomous_agency/ai/model_decision.ex`
