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.
768 projects
laya-plays-doom
greencat667
Uses Laya as a single-pass decision model for an autonomous Doom-playing agent
jev-vs-laya
janagarajsn
A Flask app benchmarks Jev and local Laya on synthetic customer-support tickets
laya-agent-skill
HunterXing
Provides agent integrations for typed decisions through Laya-compatible APIs
laya-issue-triage
manyamkarthik
A fine-tuned Laya model triages GitHub issues using a CPU-ready GitHub Action
laya-jev-eval
yuvrajrox
Evaluates Laya against Jev on email intent and explores text generation with Laya’s backbone
laya-open-eval
lgy1027
Packages local Laya inference and evaluation with an optional HTTP adapter
laya-mcp-server
ocha-no-taiko
Wraps the laya-mlx typed-decision model in an MCP server for tools such as Claude Code
laya-vs-llms
Ujjwal3115
Benchmarks Laya against hosted language models on developer commit triage and CI safety decisions
laya-flappy-bird
GadhiyaRaj
A Flappy Bird-style game uses Laya to choose real-time flap or coast actions
laya-zh-eval
lzero07
Evaluates Laya checkpoints on Chinese skill-routing requests
agent-firewall-laya
wmsing
Serves Laya semantic scores through a local HTTP sidecar for agent-firewall
laya-session-guard
Mr-Neutr0n
A fine-tuning experiment trains and evaluates Laya for coding-session security decisions
laya-whitebox-attack
YashDThapliyal
Evaluates generalization and white-box attacks against a fine-tuned Laya agent monitor
laya-codex-router
mcmcmcmmmc
Routes Codex model calls and thinking effort locally using Laya
laya-support-ticket-triage
IshaanLabs
A local Laya system triages customer-support tickets and benchmarks results in an interactive dashboard
Laya-System-1-Model
JayanGupta
Showcases Laya for text classification, urgency scoring, and ticket triage with Hugging Face Transformers
laya-or-jev-pong
bananadonn
Compares local Laya and hosted Jev decision APIs by having them control paddles in Pong
llm-jev-laya-bench
PerryLink
Measures the cost, latency, and failure boundaries of judgment layers
salt
rtuszik
Scores messages from coding-agent transcripts with an on-device Laya model and produces reports
jev-laya-local-daemon
ThreeLightStudio
Provides a localhost API for typed decisions using local Laya or hosted Jev
switchyard
mayur2109
A local decision service exposes Laya's typed answers to agents and automation systems
laya-gtx1650-benchmark
PredictiveManish
Measures Laya inference latency on a laptop with a GTX 1650 GPU
laya-mlx-jev-compat
matt-starburst
Serves a local MLX Laya model through a Jev-compatible HTTP endpoint
laya-vs-llm-benchmark
Shray15
Benchmarks Laya against a local LLM for selecting MCP tools
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