Laya for Python
The reference implementation of Laya is the `laya` package on PyPI, maintained by Convai Innovations under Apache 2.0. It ships three checkpoints, a Router that picks one per request by script and language, a CLI, an HTTP server and an optional MCP server.
1712 projects
laya
nishanth-kj
Provides a multilingual typed-decision model and Python package with optional serving and integration extras
laya-thai
team-od
A Thai-language fine-tune of Laya for typed decisions
Ariadne-Laya-TD
GoatHerder
A lightweight adapter that specializes a frozen Laya model for typed decisions
layazh-zh
NovaAI6868
A Chinese typed-decision model aligned with Laya's architecture and training recipe
laya-triage-en
elnachto
A Laya fine-tune that classifies GitHub issues for automated triage
laya-triage-multilingual
elnachto
A multilingual Laya fine-tune for classifying GitHub issues
layazh-zh
ZichenAI
Fine-tunes a Chinese decision model using Laya's architecture and training recipe
laya
Infin8-AI
Hosts multilingual, English, and typed-decisions checkpoints for the Laya decision model
Laya-GUT-Finetune
Qalarc
Provides a fine-tuned Laya checkpoint for local monitor-alert severity and urgency decisions
laya-plays-google-snake
BoogieKn
Provides an imitation-trained Laya checkpoint that scores moves in the Google Snake game
laya-typed-decisions-turkish-mmlu-10k
canbingol
A Laya checkpoint fine-tuned on 10,000 Turkish MMLU typed-decision examples
swarm-laya
Aditharavind
Fine-tunes Laya to make per-robot decisions in simulated swarm-robotics scenarios
LayaVoxprompt
MainzelMennchen
Fine-tunes multilingual Laya to classify dictation as an assistant prompt or ordinary text
laya-browser-agent
knpatil
Fine-tunes a ModernBERT-based Laya model for autonomous browser control
caldec-v1-laya
kgrozdanovski
A fine-tuned Laya encoder returns calibrated probabilities for closed assistant decisions
laya-typed-decisions
yashchouhann
Fine-tunes Laya on a typed-decisions benchmark and reports comparative results
laya-android
ByunByun
Fine-tunes Laya for selecting and grounding Android GUI actions from accessibility trees
laya-browser
wuyuanpei
Fine-tunes Laya as a browser-agent decision head compatible with jev-ultrafast
laya-fullft-typed-decisions
jjshin
Fine-tunes Laya with pure PyTorch RLCD for typed decisions and jailbreak detection
laya-typed-decisions
huangxn
A fine-tuned Laya model evaluated on the Typed-Decisions benchmark
laya-ra2-v33
jayzou3773
Fine-tunes Laya to score candidate actions in Red Alert 2 matches
laya-web-agent
abedinia
Selects browser-agent actions and page targets with a fine-tuned Laya decision model
laya-jev
KonghaYao
Runs local Laya inference and exposes Jev-compatible HTTP endpoints
decision-model-playground
tedliou
A local web playground comparing Laya and Jev for recommending articles
Install
Python 3.10 or newer, per the core README:
python -m pip install laya
Optional extras: laya[serve] (HTTP server), laya[mcp] (MCP server), laya[langchain], laya[onnx] (ONNX Runtime) and laya[fast] (TileLang GPU fast path).
First decision
from laya import Router
router = Router() # downloads a checkpoint on first use
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["routing"]["model"]) # english
The package also installs a laya command, for example laya "My payment failed twice" --preset triage.
Checkpoints
| checkpoint | encoder | params | context |
|---|---|---|---|
laya |
ModernBERT-large | 421M | 512 |
laya-multilingual |
mmBERT-base | 322M | 1024 (up to 8,192) |
laya-typed-decisions |
ModernBERT-large | 421M | 1024 |
The README reports 32.8 ms for one question with laya-multilingual on a Tesla T4, and 193 to 464 ms per request on CPU with checkpoints preloaded.
Other Python projects
laya-mlx and laya-coreml for Apple Silicon, laya-openvino for Intel CPUs, edgejev for INT8 ONNX on CPU, and laya-mcp for agent tools.
Caveats
The README is direct about limits: the base checkpoints score near chance on its typed-decisions benchmark (0.362 and 0.352), and the 0.766 figure comes from the fine-tuned checkpoint. Temperatures should be refit on your own data before you trust the probabilities. The English checkpoint collapses on non-Latin scripts, which is why the Router exists.
More ways to use Laya