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

dev

phix

Hardens and rebrands Laya as a local typed-decision engine with server and MCP support

0·GitHub repo

Sent1nel

srinath1505

A guardrail SDK and API routes policy decisions through hosted Jev or self-hosted Laya

0·GitHub repo

S1-chess

Talles64

Fine-tunes Laya to choose chess moves from legal options in a single forward pass

0·GitHub repo

nlaut

benkya

Runs natural-language browser tests with deterministic, vision-model, and Laya-based judgments

0·GitHub repo

korean-decision-benchmark

jkf87

Benchmarks SemIf, Decider, Laya, and Jev on Korean hate-speech classification

0·GitHub repo

synthetic-ehr-decision-evals

MadCodeTX

Benchmarks decision models on synthetic EHR administrative-routing tasks

0·GitHub repo

rlcd_x_1b-4b_instruct

mrgonzales-dev

Tests RLCD models including Laya and explores their use with 2B–4B models

0·GitHub repo

gyra

Gowtham-R-2002

Fine-tunes Laya for fast coding-agent decisions and evaluates it against labeled tests

0·GitHub repo

cut

harshpreet931

Uses Laya to label and cut unnecessary lines from posts in a browser or local app

0·GitHub repo

xcrystal

dgu0323

Scores cryptocurrency relevance and market signals in X posts with a local Laya server

0·GitHub repo

jev-vs-llms

ivanviragine

Compares Jev, Laya, other open models, and chat LLMs on loaded questions in two languages

0·GitHub repo

handoff

kingd2925-beep

A local router learns from chat history to direct requests to cheaper or stronger models

0·GitHub repo

ai-experiments

nadeem4

A collection of documented AI experiments reports protocols and results for model evaluations

0·GitHub repo

laya

Daboolu

A Chinese-focused Laya fork provides local Python inference, language routing and a command-line interface

0·GitHub repo

laya-mario

xujialiang

An experimental controller uses Laya to choose actions in the original Super Mario Bros

0·GitHub repo

Laya_local

RickyFer22

A Pong game and experiment using Laya for real-time decisions alongside physics-based prediction

0·GitHub repo

laya-idjvsuen

muhfalihr

Fine-tuned Laya models for classification and decisions across Indonesian, Javanese, Sundanese, and English

0·GitHub repo

laya-tetris

nickyqqq

A playable Tetris experiment showing Laya's candidate probabilities and decisions in a live dashboard

0·GitHub repo

laya-service

manul-audio

Wraps Laya predictions in a FastAPI service for Paperclip agent decisions

0·GitHub repo

laya-playground

dharm1287

Provides a FastAPI playground for Laya survey predictions and a Snake game

0·GitHub repo

TrucoLaya

guillermojmontenegro-hub

Runs an Argentine Truco card game with AI players controlled by Laya

0·GitHub repo

laya-ui

bharath-ui1027

Provides a multilingual Laya decision engine with UI components and optional serving integrations

0·GitHub repo

laya-image

muck-stump

Provides a container image for deploying Laya on AMD-accelerated OpenShift

0·GitHub repo

laya-docker

beremaran

A Docker image runs Laya as a GPU-backed, Jev-compatible HTTP server

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