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

N

laya

nishanth-kj

Provides a multilingual typed-decision model and Python package with optional serving and integration extras

1·HF model
T

laya-thai

team-od

A Thai-language fine-tune of Laya for typed decisions

1·HF model
G

Ariadne-Laya-TD

GoatHerder

A lightweight adapter that specializes a frozen Laya model for typed decisions

1·HF model
N

layazh-zh

NovaAI6868

A Chinese typed-decision model aligned with Laya's architecture and training recipe

1·HF model
E

laya-triage-en

elnachto

A Laya fine-tune that classifies GitHub issues for automated triage

1·HF model
E

laya-triage-multilingual

elnachto

A multilingual Laya fine-tune for classifying GitHub issues

1·HF model
Z

layazh-zh

ZichenAI

Fine-tunes a Chinese decision model using Laya's architecture and training recipe

1·HF model
I

laya

Infin8-AI

Hosts multilingual, English, and typed-decisions checkpoints for the Laya decision model

1·HF model
Q

Laya-GUT-Finetune

Qalarc

Provides a fine-tuned Laya checkpoint for local monitor-alert severity and urgency decisions

1·HF model
B

laya-plays-google-snake

BoogieKn

Provides an imitation-trained Laya checkpoint that scores moves in the Google Snake game

1·HF model
C

laya-typed-decisions-turkish-mmlu-10k

canbingol

A Laya checkpoint fine-tuned on 10,000 Turkish MMLU typed-decision examples

1·HF model
A

swarm-laya

Aditharavind

Fine-tunes Laya to make per-robot decisions in simulated swarm-robotics scenarios

1·HF model
M

LayaVoxprompt

MainzelMennchen

Fine-tunes multilingual Laya to classify dictation as an assistant prompt or ordinary text

1·HF model
K

laya-browser-agent

knpatil

Fine-tunes a ModernBERT-based Laya model for autonomous browser control

1·HF model
K

caldec-v1-laya

kgrozdanovski

A fine-tuned Laya encoder returns calibrated probabilities for closed assistant decisions

1·HF model
Y

laya-typed-decisions

yashchouhann

Fine-tunes Laya on a typed-decisions benchmark and reports comparative results

1·HF model
B

laya-android

ByunByun

Fine-tunes Laya for selecting and grounding Android GUI actions from accessibility trees

1·HF model
W

laya-browser

wuyuanpei

Fine-tunes Laya as a browser-agent decision head compatible with jev-ultrafast

1·HF model
J

laya-fullft-typed-decisions

jjshin

Fine-tunes Laya with pure PyTorch RLCD for typed decisions and jailbreak detection

1·HF model
H

laya-typed-decisions

huangxn

A fine-tuned Laya model evaluated on the Typed-Decisions benchmark

1·HF model
J

laya-ra2-v33

jayzou3773

Fine-tunes Laya to score candidate actions in Red Alert 2 matches

1·HF model
A

laya-web-agent

abedinia

Selects browser-agent actions and page targets with a fine-tuned Laya decision model

1·HF model

laya-jev

KonghaYao

Runs local Laya inference and exposes Jev-compatible HTTP endpoints

1·GitHub repo

decision-model-playground

tedliou

A local web playground comparing Laya and Jev for recommending articles

1·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