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_filter
plitenh
Collects and annotates Laya-powered news decisions for corpus building and regression training
system-one-api
jrmmendes
Exposes Laya for probabilistic text classification through a REST API
laya-demo
tjpajala
Benchmarks Laya and Open-Jev on JevBench and PubMedQA with a Dockerized comparison interface
laya-setup
rexleimo
Installs and manages a local Laya decision service across Windows, Linux, and macOS
laya-dev
AVMG20
A local HTTP server exposes Laya through a Jev-compatible API and includes a browser playground
laya-hermes
pavlealeksic
Adds Laya decision tools, routing hints, and output filtering to the Hermes Agent
laya-local
vit-cerny
Runs a browser agent using local Laya decisions or TypeSafe's hosted Jev backend
claude-laya
jverhoeks
Scores local Claude Code session transcripts with Laya
laya_demo
jingyuan9527
Runs Laya locally as a persistent HTTP service with automatic device selection
laya-ft
Alexander-Ollman
A reproducible study benchmarks Jev against fine-tuned Laya on workflows and chat moderation
laya-mcp
devthinker-ai
Serves Laya typed decisions over MCP and HTTP on Apple Silicon using MLX
laya-email
sreekar2403
Tags Gmail messages locally with five Laya-powered classifications in one pass
laya-api
benwyrosdick
Provides a hosted API for Laya typed decisions with account management, API keys, and a playground
laya-api
mlnima
Serves Laya Multilingual through a local Python HTTP API and MCP service
laya-linux
scottvannucci-sys
Provides local Linux inference and serving for Laya typed-decision models
laya-doom
cohenom
Displays Laya's live tactical votes alongside heuristic-driven Doom combat
laya-crystalball
InteractiveNinja
Wraps Laya typed-choice inference in a FastAPI service with calibrated confidence and option probabilities
laya-chess
buzzo123
Provides chess games against a computer that selects moves using Laya
Laya-test
LouisMoretti
Runs Laya locally for message classification and benchmarks its server and prediction performance
laya-mcp
jerepaira
Exposes local Laya typed decisions as tools for MCP clients
laya-mlx
MohammadAsadi-7
Runs Laya typed-decision models natively on Apple Silicon using MLX
lunar-laya
mraad
Runs Laya typed decisions on Apple MLX to guide a lunar-landing simulation
laya-api
marcosoliveeira1
Wraps the Laya decision-model library in a FastAPI service with Docker deployment support
laya-server
nvkudva
Serves the Laya decision model locally through a Jev-compatible HTTP API
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