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.
696 projects
laya-multilingual-mlx
aac6fef
Converts the multilingual Laya decision model to MLX for Apple silicon
edgejev
yzfly
Exports, quantizes, and serves Laya and other Jev-style models for offline CPU inference
laya-browser-agent
ChenneyZhuang
Runs Laya locally to provide typed decisions for browser agents
ComfyUI-Laya
jtydhr88
Routes ComfyUI workflows using typed decisions from the Laya model
laya-openvino
rupeshs
Adds an OpenVINO inference backend and serving support for Laya checkpoints
laya-multilingual-coreml-ane
aac6fef
Packages the multilingual Laya decision model as a Core ML bundle for Apple devices
laya-jev-lab
yibie
Compares Jev and Laya decision models and evaluates a local-first inference cascade
laya-apple
tc3oliver
Runs Laya locally on Apple Silicon with MLX GPU and Apple Neural Engine support
laya-coreml
aac6fef
Packages the Laya decision model as a Core ML bundle for Apple devices
laya
he-jev
A Hugging Face repository provides Laya multilingual and typed-decision model checkpoints
laya_router
glukicov
A Python model router compares local Laya decisions with a GPT-5 nano routing model
jevbench
dhruvmehra
A reproducible benchmark compares JEV, Laya, and other classifiers across datasets and metrics
laya-ultrafast
xuancuongdoo
A Python browser agent uses local Laya decisions to select actions from indexed page elements
laya-mind2web-browser-agent
ShaunSpark
Fine-tunes Laya on Mind2Web for browser automation decisions
laya-typed-decisions-mlx
aac6fef
Runs Laya typed-decision inference natively on Apple silicon with MLX
laya-mcp
NVentimiglia
An MCP server exposes Laya decision capabilities as tools for agent workflows
vgi-laya
lmangani
Runs local Laya inference in DuckDB to filter, classify, and score rows
laya-jev-compatible-server
exfly
Serves Laya through a TypeSafe Jev-compatible HTTP API
laya-plays-smb3
cv
Demonstrates Laya controlling Super Mario Bros. 3 with recorded, replay-verified decisions
omp-laya-judge
F0Rextasy
Adds a local Laya-powered decision judge and MCP server for oh-my-pi
headroom
llm-learner
A local-first Codex plugin estimates prompt load using Laya scoring
laya-fast
DJLougen
Runs Laya typed decisions on Apple Silicon with MLX and optional Core ML execution
deqio
ILuce
Serves multiple typed-decision models, including Laya, through a local API and browser UI
reflexbench
brida-ai
Benchmarks Laya and other typed-decision engines across quality, calibration, robustness, and latency
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