Instructions to use experiential-labs/coding-router with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use experiential-labs/coding-router with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir coding-router experiential-labs/coding-router
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
v1.1 live-cell rebuild: README.md
Browse files
README.md
CHANGED
|
@@ -8,12 +8,23 @@ tags:
|
|
| 8 |
- mlx
|
| 9 |
---
|
| 10 |
|
| 11 |
-
# coding-router — trained default artifact (v1)
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
This release replaces the kNN-over-base-embeddings artifact with a **trained** router
|
| 19 |
(EXP-012 winning recipe `reward_lcb_b0.2`), shipped in two encoder formats plus one
|
|
@@ -24,7 +35,7 @@ head/calibration payload.
|
|
| 24 |
| path | what |
|
| 25 |
|---|---|
|
| 26 |
| `router.json` | arm list + per-arm request kwargs, decision-rule params (`T`, `lam`, `sim_floor`), provenance (`kind: "trained"`) |
|
| 27 |
-
| `router.npz` | `emb` — 110-task DeepSWE evidence bank in the tuned space; `graded` —
|
| 28 |
| `encoder-fp16/` | merged (LoRA→base) Qwen3-Embedding-0.6B, fp16 safetensors — loads via sentence-transformers / transformers on CUDA or CPU |
|
| 29 |
| `encoder-mlx-4bit/` | the same merged encoder, 4-bit MLX (group size 64) for Apple Silicon — loads via `mlx_embeddings` |
|
| 30 |
|
|
@@ -47,35 +58,51 @@ Final-mint policy: one training run with the sweep's exact code and seed; (check
|
|
| 47 |
own selection discipline); the shipped bank is the full 110-task evidence. The artifact
|
| 48 |
was never selected or early-stopped on the holdout numbers reported below.
|
| 49 |
|
| 50 |
-
## Honest numbers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
|
|
|
|
| 53 |
|
| 54 |
| policy | graded | cost/split | read |
|
| 55 |
|---|---|---|---|
|
| 56 |
| always-best-train arm (deployable baseline) | 0.9336 | $126.28 | what you could actually deploy without hindsight |
|
| 57 |
-
|
|
| 58 |
-
|
|
| 59 |
-
|
| 60 |
-
Minted-artifact re-evaluation (this exact shipped artifact's encoder + single global
|
| 61 |
-
(step=50, lam=0.01) instead of per-seed selection, same 6 splits, sweep eval code):
|
| 62 |
-
graded **0.9353 at $50.21/split** — slightly below the per-seed-selected sweep mean
|
| 63 |
-
(that gap is the per-seed selection's optimism, deliberately not shipped), cheaper,
|
| 64 |
-
and still above the always-best-train baseline on both axes. The shipped checkpoint
|
| 65 |
-
and `lam` were selected on inner train-side splits only; the holdout numbers above
|
| 66 |
-
were computed after the artifact was frozen.
|
| 67 |
|
| 68 |
Quality-BEATING routing on this data is dead (held-out oracle analysis, EXP-018): the
|
| 69 |
-
honest framing is parity-quality at a
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
## Backend agreement (fp16 vs MLX 4-bit)
|
| 74 |
|
| 75 |
-
Over 20 probe texts (DeepSWE issues, LCB tasks, short interactive prompts)
|
| 76 |
-
per-arm |ΔP(solve)| = **0.
|
| 77 |
-
|
| 78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
## Scope warning
|
| 81 |
|
|
|
|
| 8 |
- mlx
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# coding-router — trained default artifact (v1.1, live-cell rebuild)
|
| 12 |
+
|
| 13 |
+
**Changelog v1.1 (2026-08-01):** the bank's published DeepSWE cells were replaced with
|
| 14 |
+
the EXP-015 LIVE matrix (1,130 fresh trials, dense 10 arms × 113 tasks) after the June
|
| 15 |
+
matrix was shown to be quality-stale live (e.g. `luna_max` 0.946 published → 0.687
|
| 16 |
+
live, effort ladders inverted) — a router voting over stale cells never escalates.
|
| 17 |
+
Roster 41 → 10 live arms; per-arm `med_cost` and fallback (`opus5_high`, live f2p
|
| 18 |
+
0.951) from live cells; `lam` re-selected (0.005) on inner train-side splits under the
|
| 19 |
+
same protocol; tuned encoder, bank embeddings, `T`, and `sim_floor` unchanged. Paired
|
| 20 |
+
server fix: client system prompts are now excluded from the routing embedding
|
| 21 |
+
(constant preamble bytes homogenized every request toward one arm).
|
| 22 |
+
|
| 23 |
+
The default routing artifact for [coding-router](https://github.com/experientiallabs/coding-router):
|
| 24 |
+
optimizes coding requests between big and small models — more usage at the same cost.
|
| 25 |
+
Given a coding task (or a whole agent conversation), it picks the model+effort arm with
|
| 26 |
+
the best measured cost/quality trade-off. Routing runs fully locally: the encoder below
|
| 27 |
+
runs in-process.
|
| 28 |
|
| 29 |
This release replaces the kNN-over-base-embeddings artifact with a **trained** router
|
| 30 |
(EXP-012 winning recipe `reward_lcb_b0.2`), shipped in two encoder formats plus one
|
|
|
|
| 35 |
| path | what |
|
| 36 |
|---|---|
|
| 37 |
| `router.json` | arm list + per-arm request kwargs, decision-rule params (`T`, `lam`, `sim_floor`), provenance (`kind: "trained"`) |
|
| 38 |
+
| `router.npz` | `emb` — 110-task DeepSWE evidence bank in the tuned space; `graded` — 10×110 LIVE outcome matrix (EXP-015; the calibration side of the vote); `med_cost` — per-arm median live $/task |
|
| 39 |
| `encoder-fp16/` | merged (LoRA→base) Qwen3-Embedding-0.6B, fp16 safetensors — loads via sentence-transformers / transformers on CUDA or CPU |
|
| 40 |
| `encoder-mlx-4bit/` | the same merged encoder, 4-bit MLX (group size 64) for Apple Silicon — loads via `mlx_embeddings` |
|
| 41 |
|
|
|
|
| 58 |
own selection discipline); the shipped bank is the full 110-task evidence. The artifact
|
| 59 |
was never selected or early-stopped on the holdout numbers reported below.
|
| 60 |
|
| 61 |
+
## Honest numbers
|
| 62 |
+
|
| 63 |
+
**This shipped artifact, LIVE cells (EXP-015), 6-seed repo-split holdout:** routed
|
| 64 |
+
graded **0.9276 at $98.47/split** vs always-`opus5_high` (the strongest live arm)
|
| 65 |
+
0.9509/$139.69 — graded delta **−0.023, repo-clustered 95% CI [−0.066, +0.025]**
|
| 66 |
+
(contains zero: statistical parity at n=110), cost ratio **1.42× [1.25, 1.65]**.
|
| 67 |
+
`lam` was selected on inner train-side splits only; holdouts were scored afterwards.
|
| 68 |
|
| 69 |
+
The encoder recipe's original certification (EXP-012, June-matrix cells, 41 arms) for
|
| 70 |
+
context — these numbers describe the RECIPE on the old cells, not this artifact:
|
| 71 |
|
| 72 |
| policy | graded | cost/split | read |
|
| 73 |
|---|---|---|---|
|
| 74 |
| always-best-train arm (deployable baseline) | 0.9336 | $126.28 | what you could actually deploy without hindsight |
|
| 75 |
+
| recipe, per-seed selection (sweep) | 0.9484 | $60.17 | +0.015 graded, 2.1× cheaper |
|
| 76 |
+
| single-(step,λ) mint, same splits | 0.9353 | $50.21 | per-seed selection's optimism removed |
|
| 77 |
+
| hindsight-best static arm (opus-5@high) | 0.9635 | $135.73 | parity, NOT better |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
Quality-BEATING routing on this data is dead (held-out oracle analysis, EXP-018): the
|
| 80 |
+
honest framing is parity-quality at a cost saving vs the strongest deployable policy.
|
| 81 |
+
Live cells make the cost claim current; models keep drifting monthly, so the bank is
|
| 82 |
+
expected to be refreshed from live re-benchmarks (the EXP-014/015 harness) rather than
|
| 83 |
+
treated as frozen.
|
| 84 |
+
|
| 85 |
+
## Difficulty ladder (through the real serve path, MLX)
|
| 86 |
+
|
| 87 |
+
7 rungs trivial → distributed-systems-hard, each run with and without a 12,000-char
|
| 88 |
+
opencode-scale system preamble: decisions identical 7/7 (system messages are excluded
|
| 89 |
+
from the routing embedding), 4 distinct arms across the ladder (`luna_high` on
|
| 90 |
+
easy/medium, `sol_xhigh`/`terra_high` on hard in-bank tasks, `opus5_high`), trivial
|
| 91 |
+
one-liners abstain to `opus5_high` by design (logged as `off_distribution`). Table in
|
| 92 |
+
`provenance/ladder.json`.
|
| 93 |
|
| 94 |
## Backend agreement (fp16 vs MLX 4-bit)
|
| 95 |
|
| 96 |
+
Over 20 probe texts (DeepSWE issues, LCB tasks, short interactive prompts) against
|
| 97 |
+
the live-cell bank: max per-arm |ΔP(solve)| = **0.0340**; decisions and abstentions
|
| 98 |
+
agreed on **18/20** probes (`provenance/agreement_live.json`). **The two
|
| 99 |
+
disagreements are utility-ranking flips near the decision boundary** — adjacent
|
| 100 |
+
tiers whose utility margin is smaller than the 4-bit quantization noise
|
| 101 |
+
(luna_medium↔luna_high at |ΔP|=0.0005, and luna_high↔opus5_high on one probe):
|
| 102 |
+
with only 10 live arms the utility gaps are tighter than under the old 41-arm bank
|
| 103 |
+
(which agreed 20/20). Treat backend choice as part of the artifact's identity; both
|
| 104 |
+
flips escalate to an equal-or-stronger arm on MLX, never a weaker one. Cross-backend
|
| 105 |
+
embedding cosine runs 0.91–0.97.
|
| 106 |
|
| 107 |
## Scope warning
|
| 108 |
|