Route or classify
Pick from named options, such as billing, technical support or sales.
Laya turns a piece of text into structured decisions in one model pass: choose a label, score a rubric, or estimate yes/no probability.
Instead of asking a large language model to write an answer and then parsing it, you define the decision you need. Laya returns typed outputs and probability distributions.
Pick from named options, such as billing, technical support or sales.
Estimate an ordered level, such as urgency from routine to blocking.
Score a proposition, such as “does this message explicitly request a refund?”
Laya is most useful when the next step is a bounded decision, not an open-ended explanation.
Label a case, estimate urgency, flag churn signals, then send uncertain cases to a person.
Choose a workflow path or whether a request should use a smaller model or a stronger one.
Score a prompt or post against a defined policy, with review gates for risky decisions.
The useful abstraction is a state, a question schema and a checkpoint. The model scores possible outputs directly; it does not compose a free-form response token by token.
Choose among named options; return the selected label and a distribution. Use for intent, category or destination.
Return an expected level on an ordinal rubric, plus a distribution. Use for urgency, severity or frustration.
Return a probability from 0 to 1 that a proposition is true. Use for a defined yes/no signal such as “contains a refund request”.
decide() when you want one structured object.The built-in Router uses script and language heuristics to choose between the English and multilingual checkpoint. You can provide your own language guess or force a model.
Language and script detection
English, multilingual, or explicit override
Single request or compatible batch
lang_guess and test ambiguous cases.Repository-reported benchmark results show the multilingual checkpoint outperforming the English model across the sampled non-English tasks. They do not establish performance on your workflow.
| Reported measure | English | Multilingual / routed |
|---|---|---|
| MASSIVE, 13 other languages | 0.306 | 0.451 |
| XNLI, 14 other languages | 0.521 | 0.731 |
| Languages above 3× random | 23 / 51 | 45 / 51 |
Both target fast, typed decisions inside software and agent workflows. Jev is TypeSafe AI’s hosted model; Laya is an open-weight implementation you can run and specialise yourself.
| Dimension | Laya | Jev · TypeSafe AI |
|---|---|---|
| Access | Open weights / self-hosted; Apache 2.0 repository licence | Hosted API; weights are not offered in the Laya comparison |
| Decision interface | choice, score, noul; Python SDK and Jev-compatible HTTP wire protocol | choice, score, noul via TypeSafe API |
| Adaptation | Can fine-tune a checkpoint on domain decisions | Use the hosted model; no model-weight fine-tuning path described by Laya |
| Where it can lead | High-cardinality choice is a weak spot in the cited comparison: Banking77 0.425 | Banking77 reported at 0.870 (72 vs 77 labels) |
Load a checkpoint with Router or laya.load(). Run in-process and batch compatible states to use accelerator capacity efficiently.
Good for: prototypes, offline jobs, an existing Python service.
Optional extras add a FastAPI server, MCP server, LangChain / LangGraph integrations and ONNX support.
Good for: shared internal service, agent tool boundary or deployment independent of the app.
The hard part isn’t calling predict(). It’s defining the label space, validating edge cases and setting a safe fallback.
Use Python 3.10+ and install laya. First model use downloads weights from Hugging Face.
Start with one workflow and a small, mutually exclusive label set. Write examples for ambiguous and negated language.
Keep the existing workflow in charge. Log output, distributions, routing and errors against labelled examples.
Measure per-class precision/recall, language and subgroup slices, calibration and abstention. Fit temperatures on held-out data.
Choose thresholds from your risk tolerance and validation set. Escalate low-confidence or high-impact cases.
Preload chosen checkpoints, batch where useful, add hooks for redaction/audit, then watch drift and error samples.
model="multilingual" explicitly and set max_len=8192; its reported accuracy varies beyond roughly 4,000 input tokens.Facts, benchmark values, examples and implementation notes in this deck are based on the project’s current README and linked documentation.
Prepared 27 September 2026 · Author-reported metrics are labelled as such. Recheck upstream docs before implementation.