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

3·GitHub repo

laya-thalamus

lcbkmm

Middleware uses Laya for agent tool routing with confidence-based LLM fallback and evaluation

3·GitHub repo
H

laya-fa-support

hugging-apps

Routes Persian customer-support messages to departments with calibrated probabilities

3·HF Space

laya-workbench

uu889

Installs and serves local Laya with a bilingual web workbench and remote decision API options

3·GitHub repo

duckdb-jev-spatial

mraad

Adds DuckDB Jev-style SQL functions backed by a local Laya model for spatial examples

3·GitHub repo
H

laya-v

henilchopada

Applies Laya typed decisions to images, documents, and other visual inputs

108·HF model
P

open-jev-laya-bench

pngwn

Shared benchmark of Laya 421M vs System One 4B and Bespoke Nimble 9B on accuracy and calibration

2·HF dataset
T

laya-cybersec

TextCortex

A multilingual Laya fine-tune detects prompt injection and data exfiltration, with an included ONNX build

59·HF model
H

laya-issue-triage

harikarthikmanyam

Fine-tunes Laya to classify GitHub issue types and assess whether more information is needed

12·HF model
A

laya-burmese-sib200

aungthuhein-dev

Fine-tunes Laya for calibrated seven-way Burmese topic classification on the SIB-200 dataset

7·HF model
W

laya-multilingual-FP8

Weidows

Provides an FP8 per-row quantization of the multilingual Laya checkpoint with multilingual evaluation results

2·HF model
0

laya-System1

0xSojalSec

Provides multilingual Laya checkpoints for typed decisions over text and JSON states

2·HF model
M

laya-onnx

mariojcr

Exports Laya checkpoints to ONNX for inference with ONNX Runtime

2·HF model
F

laya-kannaka-evidence-gate

flaukowski

Fine-tunes Laya to assess whether memory excerpts contain evidence needed to answer a question

2·HF model
A

laya-turkish-mmlu

AhmetSemih

A multilingual Laya checkpoint fine-tuned on Turkish MMLU questions

2·HF model
2

laya-ko

2nugu

Fine-tunes Laya for Korean and evaluates it on classification, relation extraction, inference, and similarity tasks

2·HF model
I

laya-rlcd-training

InfinimindCreations

Trains Laya on labeled data for typed decisions and evaluates results against a held-out set

2·HF model
A

laya-typed-decisions

Ankit1106

Fine-tunes Laya on typed-decision examples and reports held-out evaluation metrics

2·HF model
S

recmeets-laya-words

somniusx

A Greek- and English-language Laya fine-tune identifies likely speech-recognition word errors

2·HF model
G

laya-triage-banking77

Gjusev

A Laya checkpoint fine-tuned for hierarchical BANKING77 support-ticket triage

2·HF model
N

laya-home-fine-tune-en

nohaah

Fine-tunes Laya to map English smart-home commands to device actions for an offline assistant

2·HF model
O

laya-arabic

oddadmix

Fine-tunes Laya for Arabic typed decisions, including dialect-aware safety and intent classification

2·HF model

nlp-serving

saugataroyarghya

A BentoML playground serving and comparing focused NLP models, including Laya

2·GitHub repo

sokudan

hiroki-abe-58

Builds a Japanese typed-decision model and benchmarks it against Laya

2·GitHub repo

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