Laya
lastmod 2026-11-17created 2026-11-171 edits
Laya is an open-source decision model and Python library created by Nandakishor M of Convai Innovations. Given a text and a list of questions, it does not generate text; instead it returns choices, scores, and yes/no probabilities in a single forward pass, making it a non-autoregressive "System 1" engine. Rather than handing classification to an LLM, it makes fast judgments with a small encoder and is aimed at using the probabilities to decide whether to process something automatically or send it to human review.
About
- There are three question types:
choice, which picks one of a fixed set of options;score, which assigns a graded score; andnoul, which gives a yes/no probability. Writing a description (criteria) for each option is enough for zero-shot decisions without labeled data - The default checkpoints are ModernBERT-family encoders (roughly 150M–421M parameters):
layafor English,laya-multilingualfor more than 100 languages (mmBERT-base, up to 8,192 tokens), andlaya-typed-decisions, fine-tuned for business decisions - A
Routerdetects the script and language of the input and picks a checkpoint. On a T4 GPU, a single decision takes about 33 ms, and batching handles 103–332 questions per second - Probabilities are trained with reinforcement learning (RLCD) using a strictly proper scoring rule as the reward. Out of the box the model tends to be overconfident, so calibrating the temperature on your own data is recommended
- With
vegaml=True, it runs on top of a 0.8B reader model (vega-U) and returns, for each answer, a conformal prediction set, whether it abstains, whether the input is out of distribution, and auto/review routing. This mode also accepts images, audio, video, and documents of up to 73,728 tokens -
fit, which trains a small logistic head per question from a labeled CSV, leaves the model weights untouched and finishes in seconds. In the repository's example, 40 rows raised department classification accuracy from 0.600 to 0.900 - The fine-tuned
laya-typed-decisionsreaches 0.766 accuracy on 2,000 items of the typed-decisions benchmark, compared with 0.362 for the default English checkpoint - With more than 20 options, accuracy drops because a fixed token budget has to be shared among them (0.425 on Banking77's 77 labels)
- From the CLI, presets such as triage, email, guard, moderation, and router can be used directly, as in
laya "My payment failed twice" --preset triage. It also provides an HTTP server (laya-serve) speaking the same/v1/systemoneprotocol as Jev, an MCP server, integrations with LangChain, LlamaIndex, and CrewAI, and a TypeScript package (laya-ts) -
pip install laya, Python 3.10 or later. Apache-2.0 license
See also
- Jev - TypeSafe AI's System One decision model
- ModernBERT
- Classification
- LLM