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
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-as-judge
rbrus
Uses Laya-MLX to evaluate models and agents with typed-decision judgments
laya-ultrafast
xuancuongdoo
A Python browser agent uses local Laya decisions to select actions from indexed page elements
laya-multilingual-demo
abhishekbhakat
Demonstrates multilingual Laya typed decisions and probabilities through a Gradio interface
laya-typed-decisions-mlx
aac6fef
Runs Laya typed-decision inference natively on Apple silicon with MLX
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
laya-fast
DJLougen
Runs Laya typed decisions on Apple Silicon with MLX and optional Core ML execution
reflexbench
brida-ai
Benchmarks Laya and other typed-decision engines across quality, calibration, robustness, and latency
laya-multilingual-coreml
aac6fef
Exports multilingual Laya as a portable Core ML bundle for Apple devices
laya-tr
hayriyigit
A Turkish fine-tune of Laya answers typed choice, yes/no, and score questions about text
laya-hebrew
RoeiG
A Hebrew–English decision model using Laya’s typed-decision architecture for calibrated classification
laya-blackjack
adambloebaum
Adapts Laya for blackjack action preferences and probability prediction in simulated play
laymbda
HQarroum
Runs the Laya decision model as a CPU-only AWS Lambda function with SnapStart
vgi-laya
lmangani
Runs local Laya inference in DuckDB to filter, classify, and score rows
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-decision-brain
kevinbadi
Provides a web lab for Laya decisions on survey data and a Snake game
deqio
ILuce
Serves multiple typed-decision models, including Laya, through a local API and browser UI
laya-plays-google-snake
Makankn
Controls the real Google Snake game using Laya decisions and visual tracking
clinguard-laya-rag
saberfazliahmadi
Demonstrates a calibrated Laya decision layer for on-premises healthcare retrieval-augmented generation
Laya
AXERA-TECH
Packages Laya checkpoints for deployment on AXERA AX650 and AX8850 NPUs
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