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
| license: apache-2.0 | |
| base_model: Qwen/Qwen3-Embedding-0.6B | |
| tags: | |
| - router | |
| - model-routing | |
| - embeddings | |
| - mlx | |
| # coding-router β routing model | |
| The routing model for [coding-router](https://github.com/experientiallabs/coding-router): | |
| one local endpoint that optimizes coding requests between big and small models, so you get | |
| more usage at the same cost. Given a coding task (or a whole agent conversation), it picks | |
| the model and reasoning effort with the best measured cost/quality trade-off. Routing runs | |
| fully locally β this encoder runs in-process on your machine. | |
| ## Files | |
| | path | what | | |
| |---|---| | |
| | `router.json` | model list, decision-rule parameters, provenance | | |
| | `router.npz` | the evidence bank: task embeddings plus measured outcome and cost per model | | |
| | `encoder-fp16/` | the tuned Qwen3-Embedding-0.6B, fp16 safetensors β CUDA / CPU via sentence-transformers | | |
| | `encoder-mlx-4bit/` | the same tuned encoder, 4-bit MLX for Apple Silicon | | |
| Both encoder directories are the same model in two precisions. The server downloads only | |
| the one it needs: MLX on Apple Silicon, torch elsewhere. | |
| ## What the router is | |
| Qwen3-Embedding-0.6B, fine-tuned (LoRA on the attention projections) to route coding work. | |
| At inference: embed the request, compare it against a bank of tasks with measured outcomes | |
| for every model, and pick the cheapest model predicted to solve it. If nothing in the bank | |
| is similar to the request, the router does not guess β it escalates to the strongest model. | |
| <!-- Benchmarks section format set by Kion (2026-08-03): the shipped artifact's live-measured | |
| per-source results, with a savings column. Plain model names, no protocol jargon. --> | |
| ## Benchmarks | |
| Live-measured on held-out tasks the router never saw during fitting, against always using | |
| opus-5 (high), the strongest single model: | |
| | task type | router quality | opus-5 quality | cheaper | saved | | |
| |---|---|---|---|---| | |
| | short interactive requests | 1.000 | 1.000 | **6.0Γ** | **83%** | | |
| | competitive programming (LiveCodeBench) | 0.961 | 0.997 | **6.0Γ** | **83%** | | |
| | long-horizon software tasks (DeepSWE) | 0.908 | 0.926 | **3.8Γ** | **74%** | | |
| Quality differences are within statistical noise on every task type; the saving is the win. | |
| ## Scope | |
| The router was validated on repo-issue-style tasks (a paragraph or more of real problem | |
| description). Very short one-line prompts often have no close match in the evidence bank; | |
| the router then escalates to the strongest model rather than guess β safe, but no saving. | |
| Check `off_distribution` on the decision if you want to know when that happened. | |
| ## Use | |
| You never fetch this by hand β `uv run python -m router.serve` in | |
| [coding-router](https://github.com/experientiallabs/coding-router) downloads it on first | |
| run, then runs offline. New router versions overwrite this repo in place; old versions | |
| stay in the repo's git history. | |
| This model contains only benchmark-task embeddings and measured outcomes β no user data | |
| of any kind. | |