Laya: multilingual non-autoregressive System 1 decision engine
Laya is a multilingual, non-autoregressive System 1 decision engine that gives typed decisions over 100+ languages in a single forward pass.
Verified
Core facts
Read by a script from the official API, not rewritten by a model.
- Repository
- https://github.com/NandhaKishorM/laya
- License
- Apache-2.0
- Languages
- Python
- Maintainer
- NandhaKishorM
- Verified
What it is
Laya is a multilingual, non-autoregressive System 1 decision engine. It gives typed decisions over 100+ languages in a single forward pass. It is trained with reinforcement learning against strictly proper scoring rules (RLCD). Laya is developed by Convai Innovations and licensed under Apache 2.0.
Main features
Laya ships three checkpoints.
A Router picks between these three checkpoints per request.
Laya evaluates typed questions, namely choice, score and noul, over states such as text, email, ticket or JSON document.
Laya does not generate text.
The choice type outputs the top label, probabilities per option and confidence.
The score type outputs the expected level on an ordinal rubric, the distribution and confidence.
Getting started
Installation requires Python 3.10 or newer.
The Laya package offers optional extras, including an HTTP server and an MCP server.
Installing the package also installs a laya command for quick local testing.
On the command line, the lang option with a real language code picks the checkpoint and skips detection.
The device is selected automatically in the order CUDA, MPS, XPU, CPU.
python -m pip install layafrom laya import Router
router = Router() # downloads a checkpoint on first use; Router(preload=True) loads all three up front
state = "Hi, we were billed twice for March. Please refund the duplicate today or we will cancel our plan."
questions = {
"department": {"type": "choice", "instructions": "Which department should handle this?",
"criteria": {"billing": "invoices, payments, refunds",
"technical": "bugs, outages, system errors",
"other": "everything else"}},
"urgency": {"type": "score", "instructions": "How urgent is this?",
"criteria": ["not urgent", "soon", "blocking"]},
"churn_risk": {"type": "noul", "instructions": "Does the user threaten to cancel or leave?"},
}
result = router.predict(state, questions)
print(result["answers"]["department"]["choice"]) # billing
print(result["answers"]["churn_risk"]["noul"]) # probability the answer is yes
print(result["routing"]["model"]) # englishWho it is for
The project documentation recommends the built-in Router as the entry point. The project states in its Honest limits that the base checkpoints are near chance on typed-decisions zero-shot. The project reports that on the typed-decisions benchmark of 2,000 decisions across four workflows, the fine-tuned laya-typed-decisions checkpoint scores 0.766 accuracy, against 0.362 for the base English checkpoint on the same decisions.
Routing alone does not download a checkpoint. By default, the Router keeps up to two checkpoints resident. laya.serve exposes the Router over HTTP.
With the maximum length set to 8192, laya-multilingual reads up to 8,192 tokens. Unset hooks are a no-op. laya.evals scores a labelled dataset and gates a build on it.
laya.evals does not import torch. The MCP server is an optional extra, and the core package has no mcp dependency. Schema-driven decisions describe the shape with a JSON schema or a pydantic model.
The GPU fast path falls back to the stock forward on CPU or MPS, or when tilelang is not installed. Laya fine-tuning provides two training options. One of them, the Kaggle fine-tuning notebook, runs on Kaggle's free 2xT4 GPUs (DDP).
The other is a standalone training script for Apple Silicon MacBooks, using PyTorch MPS with CPU fallback.
Sources
This page is written from the official sources below. Open them to check the original text.
- GitHub READMEhttps://github.com/NandhaKishorM/layaFetched
Verified ·
This page is written by AI from the official sources above and checked automatically. This site has not tested it. Found a mistake? Tell us.