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.
753 projects
laya-tictactoe
Kasa-Harendra
A terminal Tic-Tac-Toe demo runs the Laya model locally through Core ML on Apple Silicon
laya-mcp
WayneCommand
Wraps the Laya decision model in an MCP server and REST API for agent integrations
laya-mcp
YerikZ
Exposes Laya decision presets as MCP tools for coding agents
laya-onnx
Geoking2104
Runs Laya decision models with ONNX Runtime and provides export, inference, and benchmark tools
laya-test
jafs
Provides a web playground for testing Laya typed decisions on text or JSON
laya-agent
ahmadfreijeh
A support-action agent combines a Python Laya prediction service with a Node.js customer-facing server
werewolf-laya
CallSohail
Runs a Werewolf game in which bots use Laya to score suspicions, choose intentions, and vote
laya-railway
nomideusz
Deploys Laya on Railway behind a Jev-compatible HTTP API
laya-studio
song-chaoyang
Provides a web interface for Laya inference, language detection, email tools, and shortlist demos
laya-agent
adhishthite
Benchmarks ConvAI Laya against TypeSafe Jev with and without live web grounding
laya-fastapi
remominor
Serves Laya typed decisions through a local FastAPI and ONNX Runtime deployment
laya-genui
KevinBermudezC
Routes generative UI components and detects urgency with the Laya decision model
laya-example
lim6112j
Demonstrates typed-question routing with Laya checkpoints and startup optimizations
laya-dino
JakkNaj
A fine-tuned Laya model plays Chrome Dino using a Python backend and TypeScript frontend
laya-serve
ouijan
Serves Laya decisions over HTTP with a typed TypeScript client
laya-duum
Hadlock
Uses the Laya Core ML decision model to play the Duum game from semantic state
laya-api
yrodrigez
A FastAPI service loads the Laya model and serves typed-decision predictions
laya-demo
clonekim
Provides a local server and browser interface for classifying text with Laya
laya-server
r2d-ai
Serves Laya's multilingual checkpoint through CUDA-backed REST and MCP interfaces
laya-service
xiaobai1017
Exposes Laya through a FastAPI service with a Jev-compatible System One API
oido-laya
Djancyp
Wraps the Laya decision model in a Dockerized HTTP API for typed predictions
laya-memory
ganeshdipdumbare
A local Laya classifier selects relevant durable memories for coding agents across sessions
agentify-laya
hongyaok
Serves local Laya classifications through an OpenAI-shaped HTTP API and usage dashboard
laya-snapdragon
piffie
Runs Laya typed decisions on Snapdragon X NPUs through ONNX Runtime and Qualcomm QNN
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