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.
770 projects
laya-classifier-finetuning
sallout
Fine-tunes Laya for custom text classifiers and optionally exports models to Core ML
laya-document-classifier
AshutoshKY
A local web app uses Laya for zero-shot classification of documents and uploaded files
jev-vs-laya-dino
RodolfoBonis
A Chrome Dino game demo compares Jev and Laya on gameplay, latency, cost, and performance
laya-stock-analysis-agent
sandeepj15
A stock analysis pipeline uses Laya to screen setups before Gemini synthesizes trade alerts
laya-system1-snake
Kamandlou
A terminal Snake game uses Laya MLX to choose moves from structured game-state features
jev-laya-case-study
Takuakira
A controlled case study compares Jev and Laya decision responses as repair costs change
Jev-Laya-Use-Cases-
majidansari786
Examples demonstrate Laya for classification, routing, scoring, and structured workflow decisions
finetuning-laya-for-browser-agents
kp-algomaster
Code, datasets, and evaluations fine-tune Laya for structured browser automation decisions
frontdoor
debojitroy
Screens messages with Laya inference, specialization experiments, and reproducible evaluations
local-ai-tetris
jaredjlg2
Runs local Tetris games with Laya and other AI models making inspectable decisions
CatalogMesh
debojitroy
Maps supplier catalog products to marketplace categories using Laya inference
hekla-spjall
Hekla-dev
A Chrome side panel pairs on-device Gemma text generation with local Laya decisions
Decision-Models-Are-Not-Calculators
AnthusAI
A preregistered study compares Jev, Kev, and Laya on fair-die predictions
jev-decision-layer
qualixar
A decision layer routes coding-agent tasks through Jev with optional local Laya
flickering-sign
tienef
An autonomous-agent experiment combines Laya decisions with an LLM and simulated brain systems
local-software-factory
champion19007
Runs a local coding assistant that uses Laya for task triage and Qwen for code generation
Reai
ReKara12
Provides a local voice assistant for anticipatory operating-system navigation and control
doomgemma
dexmac221
Compares Laya with fine-tuned Gemma models in FreeDoom accuracy, calibration, latency, and gameplay tests
laya-mlx
HuSuuuu
Runs the Laya typed-decision model locally on Apple silicon using MLX
open-laya
skorotkiewicz
Provides a local HTTP API and MCP tools for Laya decisions
laya-packet-analyser
esterhuizen
Analyzes network traffic and uses a local Laya model to triage alerts and classify conversations
laya-e2-multitype
13974737898-lgtm
Studies Laya decision quality through reproducible benchmarks, comparisons, and fine-tuning experiments
maclaya
jannisleifeld
Serves local Laya models on Apple Silicon through a Jev-compatible API with a dashboard and playground
laya-trader
antonellof
Paper-trades crypto and S&P 500 stocks using Laya’s market outlook decisions
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