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.
696 projects
laya-mario
gavinHuang
A Mario-style platformer uses Laya-MLX typed decisions to select actions on each game tick
laya-mlx-test
VansonLeung
Experiments with Laya-powered Tetris gameplay and sentence-level grammar screening
laya-assist-proxy
dwyschka
A local Home Assistant bridge that classifies voice commands with Laya and routes uncertain requests to an LLM
laya-plays-Pokemon
masmoriya
A local model agent plays Pokémon using Laya decisions and Qwen vision
laya-car-snake
KarimHFahmy
Uses Laya to choose safe moves in a car-and-trailer grid game
laya-warehouse-safety
senthilr-nv
Simulates warehouse robot decisions using Laya, with a browser replay and deterministic collision-safety layer
laya_comp_use
InterestingBrainPoops
A Windows screen agent uses Laya to choose UI actions from text-described controls
laya-rlcd-benchmark
mourad-ghafiri
Evaluates the multilingual Laya model on adversarial decision-making scenarios
Laya-GuardRails-Harness
morre95
A Python harness evaluates coding-agent actions with Laya typed decisions and policy rules
jev-arena
Samge0
Compares Jev, NanoJev, and Laya decisions in Tetris and 1024 with recorded gameplay replays
classify-goblin
Sharkelot
A local typed-decision service offers Laya alongside rules, DistilBERT, and Qwen backends
computer-use-testing
yoaugust
Tests Jev, Laya, and CUA for computer-use tasks and plans further reinforcement-learning fine-tuning
calibrated-decisions-iot-demo
javierdv7
An interactive smart-home demo compares local Laya inference with Jev using shared rules
laya
bitofant
Packages a self-hosted Laya model with Docker lifecycle management and an NVIDIA GPU inference endpoint
laya
DarkWanderer
Runs experiments with the open-source Laya System-1 decision model
laya
inematds
A Portuguese triage application wraps Laya with a local interface, API, CLI, and reproducible evaluation
laya_examples
jayanthbagare
Python examples demonstrate the Laya model
laya-jev
kiuckhuang
Adds a local Laya decision endpoint and conformance tests to a Jev browser-agent fork
jev-laya
wuzhiping
Probes the multilingual Laya model on Apple Silicon and records machine-readable inference results
snake-laya
Cognition-Forge
Lets users play Snake against Laya using PyTorch or MLX model runtimes
layaApi
patelkrish-27
A REST server exposes Laya typed-decision inference with low-VRAM checkpoint management
laya2typesafeapi
yunhai-dev
Serves the multilingual Laya decision model through a self-hosted TypeSafe-compatible API
laya-mlx-fine-tuning
canwhite
Provides MLX fine-tuning support for the Laya model
laya-mlx-wzq
smile-magic
A browser-based Gomoku game runs Laya-MLX locally to choose moves on Apple Silicon
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