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.

1713 projects

laya-mlx-mailwatcher

apecia-org

Classifies email locally on macOS using an MLX build of the Laya model

1·GitHub repo

laya-npu

rahmanef63

Runs Laya typed-decision models on Intel hardware and other configured endpoints

1·GitHub repo
O

Laya-Arabic-Demo

oddadmix

Demonstrates an Arabic Laya decision model for safety labels, custom categories, yes/no questions and lane choices

1·HF Space

laya-ad

x6nux

Fine-tunes and quantizes Laya for Chinese advertising classification

1·GitHub repo

laya-deploy-guide

JUTZUGC

Provides a Chinese-language guide for installing and deploying the Laya decision model

1·GitHub repo

SimpleCalm-shared-skills

SimpleCalmAI

Guides users through fine-tuning and evaluating Laya with a practice dataset and Kaggle walkthrough

1·GitHub repo

system-one-aiops-demo

blacksoxx

Demonstrates Laya-based Kubernetes alert triage with typed decisions and calibrated probabilities

1·GitHub repo

jetson-browser-assistant

zibochen6

Uses local Laya and Qwen models to operate a browser and edit a whiteboard on Jetson

1·GitHub repo
S

laya-api

saleejkuruniyan

Provides a hosted and self-hosted API for Laya decision and routing inference

1·HF Space

pi-laya-server

sklearnin

Serves Laya prompt classifications to a pi extension for routing prompts by effort and security level

1·GitHub repo
N

decisionlint

nolindnaidoo

Lints Jev and Luna decision-model questions in CI, editors, and an MCP server

305·npm package
J

opencode-jev-compaction

jlegends

Two OpenCode plugins prune stale tool calls and optionally refine decisions with local Laya

250·npm package
G

@gobing-ai/ts-laya-mlx

GitHub Actions

A TypeScript package connects applications to a local Laya decision backend through MLX

239·npm package
C

laya-coding-curriculum-78k

callensxavier

A coding curriculum dataset for training Laya-LoRA and other structured-decision models

0·HF dataset
S

laya-jd-resume-ranking-enja

sky9262

Synthetic English and Japanese job–résumé ranking data with soft labels for fine-tuning Laya

0·HF dataset
A

laya-trading-decisions

Anay2010

Provides labeled trading decisions for training Laya decision models in Unsloth Studio

0·HF dataset
J

riidolaya-statehint-laya-reference-v0.1-development

JooYoon

Reports development measurements using a frozen pretrained Laya checkpoint

0·HF dataset

laya-doom

shantanugoel

A Doom game experiment uses a frozen Laya encoder and a trained decision head

0·GitHub repo

laya-rs

codesoda

A planned Rust runtime for local Laya decisions with Metal acceleration and a Jev-compatible HTTP API

0·GitHub repo

laya-playground

marcosnovaesq

Runs Laya locally behind a TypeSafe-compatible API and provides a web UI for testing requests

0·GitHub repo

laya-api

logixism

Authenticated local REST API that serves Laya or Cloudflare Clef decision models

0·GitHub repo

laya-jev-ultrafast

leisc

A browser agent that uses Laya for typed action and element selection, with Jev as an optional backend

0·GitHub repo

openjev

gillmoreno

Demonstrates local Laya email-triage and simulated trading-tick decisions

0·GitHub repo

anima3

hulryung-uo

Uses a System One decision brain with Qwen log-probabilities and Laya triage for a game client

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