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

hermes-nerve

keeltrace

Adds typed decision oversight and tool gating to Hermes agents using Jev or self-hosted Laya

25·GitHub repo

laya-mps

afshinm

Runs Laya typed-decision inference locally on Apple Silicon using Metal Performance Shaders

22·GitHub repo

laya-guard

scs0209

Locally judges AI coding-agent tool calls with regex checks and the Laya model

21·GitHub repo

eikos

caiovicentino

Builds calibrated typed-decision models for finance and trading and evaluates them against Laya

19·GitHub repo

JevAny

SimpleJev

Training and evaluation infrastructure for System 1 decision models, with Laya as a benchmark baseline

19·GitHub repo
M

laya-onnx

Mattepiu

Exports a fine-tuned Laya decision model to ONNX for Python and Node.js inference

15·HF model
A

laya-multilingual-mlx

aac6fef

Converts the multilingual Laya decision model to MLX for Apple silicon

15·HF model
T

laya-fa-support

tarfandoon

Routes Persian customer-support messages to the appropriate department using a fine-tuned Laya model

14·HF model

llm-honing

HectorHHZ

Trains and evaluates small decision models through game-playing loops and shared decision-server integrations

13·GitHub repo

edgejev

yzfly

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

12·GitHub repo

ComfyUI-Laya

jtydhr88

Routes ComfyUI workflows using typed decisions from the Laya model

11·GitHub repo
S

laya-mind2web-browser-agent

ShaunSpark

Fine-tunes Laya on Mind2Web for browser automation decisions

143·HF model
A

laya-multilingual-coreml-ane

aac6fef

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

83·HF model
C

MacJev-322M-4K-Laya

chaoliangUNSW

Fine-tunes Laya for long-context local Mac agents and compares it with the base model

58·HF model

laya-jev-lab

yibie

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

10·GitHub repo

laya-browser-agent

ChenneyZhuang

Runs Laya locally to provide typed decisions for browser agents

10·GitHub repo

laya-openvino

rupeshs

Adds an OpenVINO inference backend and serving support for Laya checkpoints

10·GitHub repo

WechatVibe

tswawa

Analyzes WeChat conversations for intent, emotion, and participant profiles using Laya models

10·GitHub repo

LayaStudio

biplovgautam

Fine-tunes Laya decision models locally on Mac and evaluates results before deployment

9·GitHub repo
T

laya-vision-demo

thaitea

Demonstrates calibrated image-based yes/no, choice and rubric decisions with Laya Vision

9·HF Space

opendecider

manjunathshiva

Provides calibrated System 1 decision models and benchmarks them against Laya and other models

9·GitHub repo

laya-apple

tc3oliver

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

8·GitHub repo

laya-security-guardrail

shashvik

Runs local Laya typed decisions as cybersecurity inspection and guardrail checks

8·GitHub repo
A

laya-coreml

aac6fef

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

37·HF model

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