Instructions to use dari-ai/router-slm-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use dari-ai/router-slm-v2 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.6-35B-A3B") model = PeftModel.from_pretrained(base_model, "dari-ai/router-slm-v2") - Notebooks
- Google Colab
- Kaggle
Dari Router SLM v2
LoRA adapter for a model-routing policy with leases. Given anonymized candidate models, evaluation scores, projected costs, and a coding-agent conversation, the policy picks one candidate and a commitment length: {"action":"B","turns":10}. The caller holds that selection for the committed turns before consulting the policy again.
This is not a general-purpose chat model. It requires the Dari selector prompt, anonymized candidates, and constrained decoding over the exact action × lease-length completion set; unconstrained generate() is not a supported interface.
Breaking change from dari-ai/router-slm: v1 emits bare {"action":"B"} every turn. v2 adds the lease commitment (menu: 5, 10, or 30 turns) and expects cost projections at those horizons in its input. Neither direction is drop-in compatible.
Load
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
BASE_MODEL = "Qwen/Qwen3.6-35B-A3B"
BASE_REVISION = "995ad96eacd98c81ed38be0c5b274b04031597b0"
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL, revision=BASE_REVISION)
base_model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL, revision=BASE_REVISION, device_map="auto", dtype=torch.bfloat16
)
model = PeftModel.from_pretrained(base_model, "dari-ai/router-slm-v2", revision="v40")
model.eval()
Versions
Pin the tag, not main. v40 (the final training checkpoint) is the recommended default.
v40 adapter sha256: e6a2ab867c18d2789bbbdf978ee699d2630d2cbe4f6563d137eaacb3e4dd2be2
Benchmark
Terminal-Bench 2.1 (89 tasks, not seen in training), routing a mini-SWE agent among 8 candidates, single attempt per task:
| config | solved | cost/solve |
|---|---|---|
| router-slm-v2 v40 | 71/89 (79.8%) | $0.91 |
| hand-tuned production config | 71/89 (79.8%) | $1.07 |
| openrouter auto (beta) | 59/89 (66.3%) | $0.73 |
Provenance
Rank-32 LoRA on Qwen/Qwen3.6-35B-A3B, trained with episodic GRPO on live SWE-bench coding-agent trajectories (reward: task success minus small cost and thinking-length penalties). Inference adapter only — no optimizer state or trajectory data.
Adapter weights are Apache-2.0. Comply with the pinned Qwen base model's terms. The surrounding router remains responsible for candidate eligibility, lease bookkeeping, and rejection of invalid policy output.
- Downloads last month
- 49
Model tree for dari-ai/router-slm-v2
Base model
Qwen/Qwen3.6-35B-A3B