feat(router): v3+gate as the default wide-deep routing (0.22.0) - #81
Merged
Conversation
… (0.22.0)
Brings NadirClaw's bundled router up to the getnadir.dev routing:
- new `v3` checkpoint (wide_deep_v3.pt, clean retrain) — the default variant
- Neyman-Pearson complex gate (complex_gate_v1.pt) decides complex-vs-rest
at high recall (τ=0.12); below the gate the v3 head splits medium/simple
("head split"), which beats the legacy companion LR (less under-routing)
- gate ON by default for v3, OFF for asym/symmetric (legacy argmax intact)
Env knobs (all optional): NADIR_COMPLEX_GATE=0 disables the gate,
NADIR_GATE_THRESHOLD tunes τ, NADIR_MS_SPLIT=companion reverts the split.
Measured on RouterArena (n=2479): miss-complex 8.2%, ~41% cost reduction.
Bumps __version__ 0.21.1 → 0.22.0. Tests + MODEL_CARD updated. Not released.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Ports the v3+gate routing from getnadir.dev into NadirClaw's bundled wide-deep classifier, and makes it the default.
What changed
v3checkpoint (wide_deep_v3.pt, the clean retrain) is now the default variant. Unlikeasym(which suppresses the simple class) it keeps a realP(simple), so it can drive the below-gate split.complex_gate_v1.pt, ~12 KB) decides complex-vs-rest at high recall (τ=0.12).P(simple)vsP(medium), which beats the legacy companion LR (it under-fills Medium, causing avoidable under-routing).v3, OFF forasym/symmetric(their legacy argmax behaviour is untouched).Config (all optional env)
NADIR_COMPLEX_GATE=0— disable the gate (fall back to plain 3-class decode)NADIR_GATE_THRESHOLD=<τ>— tune the gate threshold (default 0.12)NADIR_MS_SPLIT=companion— revert to the legacy below-gate LR splitMeasured (RouterArena, n=2,479, cheapest-correct labels)
miss-complex 8.2%, ~41% cost reduction vs always-premium. Mirrors the getnadir.dev production config.
Notes
__version__0.21.1 → 0.22.0.models/*.ptpackage-data glob.binary; v3+gate is the default only within the wide-deep classifier when selected.🤖 Generated with Claude Code