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.
1712 projects
laya-ocr-guard
okrath
Adds fast Laya triage to a dual-gate code impact and regression guard
laya-thalamus
lcbkmm
Middleware uses Laya for agent tool routing with confidence-based LLM fallback and evaluation
laya-fa-support
hugging-apps
Routes Persian customer-support messages to departments with calibrated probabilities
laya-workbench
uu889
Installs and serves local Laya with a bilingual web workbench and remote decision API options
duckdb-jev-spatial
mraad
Adds DuckDB Jev-style SQL functions backed by a local Laya model for spatial examples
laya-v
henilchopada
Applies Laya typed decisions to images, documents, and other visual inputs
open-jev-laya-bench
pngwn
Shared benchmark of Laya 421M vs System One 4B and Bespoke Nimble 9B on accuracy and calibration
laya-cybersec
TextCortex
A multilingual Laya fine-tune detects prompt injection and data exfiltration, with an included ONNX build
laya-issue-triage
harikarthikmanyam
Fine-tunes Laya to classify GitHub issue types and assess whether more information is needed
laya-burmese-sib200
aungthuhein-dev
Fine-tunes Laya for calibrated seven-way Burmese topic classification on the SIB-200 dataset
laya-multilingual-FP8
Weidows
Provides an FP8 per-row quantization of the multilingual Laya checkpoint with multilingual evaluation results
laya-System1
0xSojalSec
Provides multilingual Laya checkpoints for typed decisions over text and JSON states
laya-onnx
mariojcr
Exports Laya checkpoints to ONNX for inference with ONNX Runtime
laya-kannaka-evidence-gate
flaukowski
Fine-tunes Laya to assess whether memory excerpts contain evidence needed to answer a question
laya-turkish-mmlu
AhmetSemih
A multilingual Laya checkpoint fine-tuned on Turkish MMLU questions
laya-ko
2nugu
Fine-tunes Laya for Korean and evaluates it on classification, relation extraction, inference, and similarity tasks
laya-rlcd-training
InfinimindCreations
Trains Laya on labeled data for typed decisions and evaluates results against a held-out set
laya-typed-decisions
Ankit1106
Fine-tunes Laya on typed-decision examples and reports held-out evaluation metrics
recmeets-laya-words
somniusx
A Greek- and English-language Laya fine-tune identifies likely speech-recognition word errors
laya-triage-banking77
Gjusev
A Laya checkpoint fine-tuned for hierarchical BANKING77 support-ticket triage
laya-home-fine-tune-en
nohaah
Fine-tunes Laya to map English smart-home commands to device actions for an offline assistant
laya-arabic
oddadmix
Fine-tunes Laya for Arabic typed decisions, including dialect-aware safety and intent classification
nlp-serving
saugataroyarghya
A BentoML playground serving and comparing focused NLP models, including Laya
sokudan
hiroki-abe-58
Builds a Japanese typed-decision model and benchmarks it against Laya
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