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.
770 projects
laya-mcp-server
carl0s
An MCP server and REST endpoint expose Laya for structured text and JSON decisions
jev-n-laya
jcezardasilva
Compares Jev, Laya, Von, and Gemma on typed-decision tasks
laya-lk-bench
mithilyr
Stress-tests Laya decision-model performance on Sinhala and Tamil offensive-language data
laya-code-router
SupremeDreamZ
Routes Claude Code and Codex turns using a local Laya model
laya-vs-jev
alilibx
Benchmarks open-weight Laya models against TypeSafe Jev on labelled datasets
laya-cuda-bench
bhushankinge
Benchmarks Laya inference throughput, latency and cost across NVIDIA GPUs and serving backends
laya-mlx-voxel
yuxino
Builds voxel reliefs by using Laya-MLX to choose extrusion depths from image pixel statistics
reflex-guard
NISH1001
Implements multi-label guardrails that score context against categories using Laya decision models
laya-cn-study
Adkid-Zephyr
Collects Chinese-first post-training experiments, datasets, and evaluations for Laya
-Semantic-Firewall-laya
manas95826
Authorizes AI-agent tool calls using retrieved security context and Laya decisions
laya-rlcd-expedition
HambaliMarcel
Runs local Laya decision inference in a web page for work and sales scenarios
TetrisGame_Laya
RehmanaliMomin
Plays Tetris by using a fine-tuned Laya model to choose piece rotations and drop columns
laya-local-http-server
ratheesh-aot
Serves the Laya typed-decision model through a local HTTP API using MLX or PyTorch
laya-code-review-action
Mcbeer
Reviews pull-request diffs against configurable rules using Laya's typed-decision model
laya-vs-jev-traffic
ameeetgaikwad
Compares local Laya and cloud Jev in a real-time traffic-control simulation
jev-laya-classification-bench
bhushankinge
Benchmarks Jev, Laya, and Qwen on classification of federal IT solicitations
von-laya-jev-paint-compare
zhangyunting123
Creates side-by-side paintings from typed decisions by VON, Laya, and Jev
laya-coreml-vs-jev-benchmark
sallout
Compares Laya and Jev on zero-shot intent classification benchmarks
laya-v2-agent-routing
mdad-elec
Fine-tunes a Laya System-One router to select the price tier for each agent turn
testes-laya-modelos-jev-like
diegoamrg4123
Tests typed-decision models and includes a Linux Snake demo using Laya
100-days-of-jev-and-laya
kashyaprparmar
Collects 100 practical projects using Jev and local Laya for typed decisions
laya-fine-tune-bn-eco-voice
nafi-ullah
Fine-tunes multilingual Laya for typed decisions in a Bangla e-commerce voice agent
news-signal
harveybc
Classifies financial news locally with Laya and emits auditable typed results
lx
iheeb1
Prunes shell output using RTK rewrites and Laya classifications
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