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.
1713 projects
laya-tetris-finetuning
hama-jp
Fine-tunes Laya for real-time Tetris placement decisions and documents the experiments
laya
robit-man
Provides a FastAPI service and web interface for testing Laya decisions and latency
XERON
PIXELZX0
Fine-tunes Laya decision models for multilingual classification, scoring, routing, and browser actions
Laya-vs-Jev
abcdmku
A side-by-side test bench compares the local Laya model with the hosted Jev API
layad
a1re1
A local HTTP daemon that keeps a Python Laya decision model resident for repeated inference
Nekomimi-Waifu-Seeker
CooLguNxDD
Uses Laya to guess anime and other fictional characters through typed decisions
laya-router
MiguelCarrascoB
A FastAPI router uses Laya typed decisions to route prompts by complexity
laya-blackjack
adambloebaum
Trains and evaluates a Laya-based blackjack policy with a simulator and probability dashboard
laya-mcp
EbiPenMan
Serves a persistent local Laya model through an MCP Streamable HTTP server
laya-server
phaser
A Jev-compatible HTTP server serves local Laya typed decisions on Apple silicon
local-laya
binbandit
Runs Laya-MLX locally with an HTTP API and a TypeScript client
laya-deploy
Pidbid
Deploys Laya as a local judgment backend for omp with an HTTP bridge, MCP tools, and installation scripts
laya-test
byteling
CLI and Flask demos show typed decisions from the Laya model
laya-server
SUSTYuxiao
A local inference wrapper and HTTP server for Laya with native and Jev-compatible prediction endpoints
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
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