mirror of
https://github.com/zenlm/zen-router.git
synced 2026-10-30 14:57:44 +00:00
- training/catalog.yaml: routable universe (24 models) = 3 local zen + zen cloud tiers + Anthropic/OpenAI/Gemini/Grok/DeepSeek/Kimi, priced from the gateway live config (hanzoai/ai/conf/models.yaml). Route head auto-sizes 7 -> 24. - training/extract_local_sessions.py: build eval rows from ~/.claude + ~/.codex session logs; real model ids mapped 1:1 to catalog ids (no generic tiers). - sft.py: configurable dtype (fp32 stable on MPS), record backbone base in router_config.json. - eval_routing.py: device-aware, single-forward latency + pred distributions. - config.local.yaml: reduced MPS run off on-disk zen-nano-0.6b. - docs/config.md: drop-in router_policy.yaml (zero-code cost routing) + route-to-anything (one catalog row). - README Measured: M4 Max, 5455 rows (94.6% opus imbalance), task_acc 0.824 / route_acc 0.961 / top3 0.999, single-forward 137ms, with full caveats.
21 lines
587 B
YAML
21 lines
587 B
YAML
# Local MPS run of the SFT: same shape as config.yaml, reduced for a brief
|
|
# Apple-Silicon fine-tune off the on-disk zen-nano-0.6b weights (no HF download).
|
|
base_model: /Users/a/work/zen/models/zen-nano-0.6b
|
|
output_dir: out/zen-router
|
|
|
|
tasks: [code, reasoning, math, creative, vision, long_context, cheap_chat, general]
|
|
|
|
heads:
|
|
task: {type: classification, classes: 8}
|
|
route: {type: classification, classes_from: catalog}
|
|
features: {type: projection, dim: 256}
|
|
|
|
catalog: training/catalog.yaml
|
|
|
|
sft:
|
|
lr: 2.0e-5
|
|
epochs: 1
|
|
batch_size: 16
|
|
max_seq_len: 512
|
|
pooled: last_token
|