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

A

laya-multilingual-mlx

aac6fef

Converts the multilingual Laya decision model to MLX for Apple silicon

12·HF model

edgejev

yzfly

Exports, quantizes, and serves Laya and other Jev-style models for offline CPU inference

11·GitHub repo

laya-browser-agent

ChenneyZhuang

Runs Laya locally to provide typed decisions for browser agents

10·GitHub repo

ComfyUI-Laya

jtydhr88

Routes ComfyUI workflows using typed decisions from the Laya model

10·GitHub repo

laya-openvino

rupeshs

Adds an OpenVINO inference backend and serving support for Laya checkpoints

10·GitHub repo
A

laya-multilingual-coreml-ane

aac6fef

Packages the multilingual Laya decision model as a Core ML bundle for Apple devices

471·HF model

laya-jev-lab

yibie

Compares Jev and Laya decision models and evaluates a local-first inference cascade

9·GitHub repo

laya-apple

tc3oliver

Runs Laya locally on Apple Silicon with MLX GPU and Apple Neural Engine support

8·GitHub repo
A

laya-coreml

aac6fef

Packages the Laya decision model as a Core ML bundle for Apple devices

128·HF model

laya

he-jev

A Hugging Face repository provides Laya multilingual and typed-decision model checkpoints

6·GitHub repo

laya_router

glukicov

A Python model router compares local Laya decisions with a GPT-5 nano routing model

6·GitHub repo

jevbench

dhruvmehra

A reproducible benchmark compares JEV, Laya, and other classifiers across datasets and metrics

6·GitHub repo

laya-ultrafast

xuancuongdoo

A Python browser agent uses local Laya decisions to select actions from indexed page elements

6·GitHub repo
S

laya-mind2web-browser-agent

ShaunSpark

Fine-tunes Laya on Mind2Web for browser automation decisions

110·HF model
A

laya-typed-decisions-mlx

aac6fef

Runs Laya typed-decision inference natively on Apple silicon with MLX

5·HF model

laya-mcp

NVentimiglia

An MCP server exposes Laya decision capabilities as tools for agent workflows

5·GitHub repo

vgi-laya

lmangani

Runs local Laya inference in DuckDB to filter, classify, and score rows

5·GitHub repo

laya-jev-compatible-server

exfly

Serves Laya through a TypeSafe Jev-compatible HTTP API

5·GitHub repo

laya-plays-smb3

cv

Demonstrates Laya controlling Super Mario Bros. 3 with recorded, replay-verified decisions

5·GitHub repo

omp-laya-judge

F0Rextasy

Adds a local Laya-powered decision judge and MCP server for oh-my-pi

5·GitHub repo

headroom

llm-learner

A local-first Codex plugin estimates prompt load using Laya scoring

5·GitHub repo

laya-fast

DJLougen

Runs Laya typed decisions on Apple Silicon with MLX and optional Core ML execution

5·GitHub repo

deqio

ILuce

Serves multiple typed-decision models, including Laya, through a local API and browser UI

5·GitHub repo

reflexbench

brida-ai

Benchmarks Laya and other typed-decision engines across quality, calibration, robustness, and latency

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