Repository navigation
feat(chat): model router behind model "auto" (DIP 0035) - #356
Merged
Merged
Conversation
`model: "auto"` (or absent, or auto:fast|standard|high|max) now routes each request: classify the task, score every live model for it (size/family priors, house specialists, learned per-category quality, price, speed, health), pick single / cascade / critique / fuse by expected quality, cost and latency for the effort, run it with deterministic checks, escalation, fallbacks and hedged requests, learn from the outcome, and return a receipt. - lib/router: framework-free classify, registry, stats, planner, verify, engine; 20 tests - lib/chat/routed.ts: Infernet calls billed per user, live pool + price cache, router_stats in SQLite Cloud, JSON/SSE responses, streamed pass-through that still learns; 6 tests - /v1/chat/completions and resumable runs route; any router error falls back to the direct path; C0MPUTE_ROUTER=off disables - POST /api/v1/route explains a plan for free; /v1/models lists auto entries; /chat picker offers auto:fast/high/max Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| if (/^(js|javascript|mjs|cjs)$/i.test(lang)) { | ||
| try { | ||
| // Parses only; the code is never run. | ||
| new Function(code); |
ThreatCrush Security Scan17 finding(s) HIGH/CRITICAL: 1 | MEDIUM: 12 | LOW: 4
Snippets are redacted; ThreatCrush never prints matched credential material. |
Collaborator
Author
|
Also carries two test-only commits so CI can pass on current master. #355 raised
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copilot Fusion-style routing for c0mpute, built to fix Fusion's published weaknesses. Design:
dips/0035-model-router.md.model: "auto"(or absent, orauto:fast|standard|high|max) now:router_stats), Infernet price, measured speed, health (failing models benched).max_cost_usd/max_latency_ms.x-c0mpute-routeheader plus a fullx_c0mpute_routereceipt (every call, tokens, cost, verdict).POST /api/v1/routegives the plan for free.Streaming at fast/standard passes straight through on the planned model (no first-token penalty) and is verified afterwards to keep learning. High/max run the plan with SSE keepalives. Resumable /chat turns route too. Any router error falls back to the old direct path;
C0MPUTE_ROUTER=offdisables it.Tests (vienna, bun): router 20/20, glue 6/6. Web lib suite 147 pass. The 3 failures are environmental: two content-policy tests read
node/, which my rsync left out, and the music test is a time-format assertion in an untouched module.tscreports no errors in the touched files.🤖 Generated with Claude Code