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.
752 projects
jev-zen
loongWoong
Reconstructs and validates Laya inference locally using NumPy and a browser-based interface
Jev-agent
To3akaRin
Suggests clipboard entries based on the focused field using local Laya inference or the Jev API
before-you-send
roisol144
Checks message tone, formality and fight risk while users type, using Laya decisions
screenquest
DanielTea
Controls a game on Apple Silicon with screenshot perception, Laya decisions, and vision-language planning
semantic-browser
koriym
Navigates hypermedia applications by selecting server-declared links using Laya-MLX
jev-eval-ja
unirt
Benchmarks Jev and Laya on Japanese business-style decision tasks
job-classifier-search
NoNFake
Ranks Danish job listings against a candidate profile using the Laya decision model
mandate-1
siva-sub
Explores Laya fine-tunes for finance research while a separate DeepSeek path powers the live reference
laya
iaeluk
Runs a local Laya-powered Snake game with a CUDA server and browser version
laya
harisathees
Tests Laya predictions, multilingual behavior, CPU performance, and interactive runs through a local web console
laya
pgarvie
Provides multilingual typed-decision models and a router for single-pass inference
laya
ai-2-m
Provides a multilingual, non-autoregressive model for typed decisions in a single forward pass
product_search_bench
Wanke15
Compares BM25, Jev, Qwen, and Laya for product search and reranking
LayaBOT
tomikan1208-code
Uses Laya decisions to control a Minecraft combat bot through Mineflayer
LayaMCP
GeneGulanesJr
Exposes Laya decision tools to MCP clients through an HTTP server
LayaWatch
BLANCO-11
Runs Laya in-process and provides a self-hosted console for traces, metrics, access control, and model management
laya-example
mkassaf
Demonstrates how to run the Laya typed-decision model with a minimal example
laya-ANE
vipuldivyanshu92
Ports Laya inference to Core ML for Apple devices, with a SwiftUI iPhone demonstration app
laya-ROCm
don-milsey-miller
Provides an AMD ROCm runtime and benchmarks for running the Laya decision model
layaagent
rotsl
Routes tasks through Laya classification and deterministic mediation to local or API-based coding agents
layad
rcwsr
Keeps the Laya decision model resident and serves it over HTTP with MLX or PyTorch
laya-vk
sulistta
Ports the Laya decision runtime to a Vulkan/IREE encoder backend for AMD and Qualcomm GPUs
rest-laya
wdonega
Serves the Laya model over REST with optional Jev-compatible endpoints for non-Python clients
ondevice-system1
Ahtsham0715
Develops smaller on-device typed-decision models derived from Laya, with training code and evaluations
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