Router vs one checkpoint
The README quickstart is Router().predict. Loading one checkpoint skips the language choice and the routing object. This page is that distinction, not a new API.
What Router does
- Non-Latin script, including Han, goes to
laya-multilingual. Short Latin text that looks English stays onlaya. The README’s Khmer note is the reason: the English checkpoint scored 0.000 accuracy at 0.952 confidence, so confidence does not catch the wrong checkpoint. typed-decisionsis not in that automatic choice. Passmodel="typed-decisions", or set automatic task detection. The 0.766 row is that fine-tuned checkpoint, not the base you get by installing the package.- The
routingkey (model, repo, reason) is on the Router response. The Docker doc says a localLAYA_MODEL_PATHanswer comes from the Agent and has no Routerroutingmetadata.
Try both tickets in the workbench. The English sample stays on the English route. The 中文工单 sample is Han text. The yellow bar is still the demo heuristic, which only copies that routing rule.
Pin it, or pay the reload
model="english", "multilingual", or "typed-decisions" forces the checkpoint. Production code in the README uses Router(preload=True). The lazy default keeps max_loaded=2. max_loaded=1 rebuilds on every switch: the README’s median is 7.4 s on CPU and 10.3 s on a T4.
After preload, one multilingual question is 32.8 ms on that T4 and 193–464 ms on CPU. Those are published latencies, not a promise for your machine. Hardware notes are on Get started.
Score questions on the multilingual checkpoint have a position bias (#131). For an English rubric, pin model="english". Details are on Chinese routing and calibration.