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
leanroute
kdandu001-arch
Provides a Laya-powered decision SDK and gateway for blocking attacks and routing LLM requests
system-one-model-finetuning
omkarghugarkar007
Provides a measured recipe for fine-tuning System One models such as Laya and Jev
jev-context-rot
casperkwok
Reproduces an experiment comparing context sensitivity in Jev, Laya and Decider models
laya
airen3339
A Python package and model router for multilingual typed decisions in a single forward pass
laya
wenli03
Provides multilingual typed-decision checkpoints and a router for single-pass inference
Laya
jersonboydmilan
Provides a multilingual typed-decision engine with checkpoint routing and Python interfaces
laya
Shawny-W
Provides multilingual typed-decision scripts using Laya checkpoints and automatic language routing
laya
HydriaOne
Serves Laya routing predictions in Docker and includes an offline scenario inspector
Laya
samyakb32-sys
Routes requests to prompt-configured task sub-agents using the Laya model on CPU
LayaService
wj1313677
Serves the Laya decision model through a local REST API using MLX on Apple Silicon
LayaOnAWS
goodbyedavid
Deploys a Laya inference server on Amazon ECS with GPU capacity in an AWS account
LayaVoiceCommand
stefanus-ai-tech
Recognizes Indonesian voice commands by transcribing audio and classifying commands with Laya
classifier-laya
josecruset
A local browser interface for testing Laya-MLX typed-decision models on Apple Silicon
jev-vs-laya
Cognition-Forge
Compares Jev and Laya variants across typed-decision tasks
laya-murdle
reycardo
Parses Murdle puzzles with Laya and solves their clues using a constraint solver
layagrep
marksomething
Searches files and stdin by asking Laya whether each line matches a natural-language description
laya_demo
bigcoke1
Demonstrates Laya typed decisions in an inbox triage workflow
try-laya
lin52025iq
Provides a Laya-first agent runtime with browser and Android control integrations
laya-scraper
qxZap
Uses Laya to find publication pages and extract publication details with a browser-capable crawler
LAYA_DEMO
davidL-zhan
Matches exam questions to knowledge points with local Laya yes-or-no predictions
laya-api
agk4444
Serves Laya typed-decision models through a CPU-based HTTP API
laya-integration
SanjaySathish
Routes Claude Code tasks to Claude tiers using a locally served Laya decision model
laya-testing
hypen-code
Demonstrates CPU-based Laya classification in an interactive terminal program
laya-mcp
frankdavid888
Packages Laya as an MCP server for AI assistants to make typed decisions
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