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.

696 projects

code-oracle

wahyuzero

Verifies code changes with AST checks and Laya-based residual-drift evaluation

1·GitHub repo

seems-laya

ericmjl

Runs natural-language judgments in the Seems programming language using the local Laya decision model

1·GitHub repo

laya-mlx-zh

ZLHAOOO

Provides Chinese fine-tuned Laya weights, training data, and evaluations for Apple Silicon MLX

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

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

laya

robit-man

Provides a FastAPI service and web interface for testing Laya decisions and latency

0·GitHub repo

XERON

PIXELZX0

Fine-tunes Laya decision models for multilingual classification, scoring, routing, and browser actions

0·GitHub repo

Laya-vs-Jev

abcdmku

A side-by-side test bench compares the local Laya model with the hosted Jev API

0·GitHub repo

layad

a1re1

A local HTTP daemon that keeps a Python Laya decision model resident for repeated inference

0·GitHub repo

Nekomimi-Waifu-Seeker

CooLguNxDD

Uses Laya to guess anime and other fictional characters through typed decisions

0·GitHub repo

laya-router

MiguelCarrascoB

A FastAPI router uses Laya typed decisions to route prompts by complexity

0·GitHub repo

laya-blackjack

adambloebaum

Trains and evaluates a Laya-based blackjack policy with a simulator and probability dashboard

0·GitHub repo

laya-mcp

EbiPenMan

Serves a persistent local Laya model through an MCP Streamable HTTP server

0·GitHub repo

laya-server

phaser

A Jev-compatible HTTP server serves local Laya typed decisions on Apple silicon

0·GitHub repo

local-laya

binbandit

Runs Laya-MLX locally with an HTTP API and a TypeScript client

0·GitHub repo

laya-deploy

Pidbid

Deploys Laya as a local judgment backend for omp with an HTTP bridge, MCP tools, and installation scripts

0·GitHub repo

laya-test

byteling

CLI and Flask demos show typed decisions from the Laya model

0·GitHub repo

laya-server

SUSTYuxiao

A local inference wrapper and HTTP server for Laya with native and Jev-compatible prediction endpoints

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