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

laya

NandhaKishorM

Runs multilingual typed-decision models and provides routing, serving, and integration options

23.9k·GitHub repo

laya-mlx

mizorewww

Runs Laya typed-decision models locally on Apple Silicon using MLX

6.3k·GitHub repo
C

laya

convaiinnovations

A multilingual-ready System 1 model that returns calibrated typed decisions over text in one pass

3.5k·HF model

laya-coreml

mizorewww

Runs Laya typed-decision models locally on Apple Silicon using Core ML and the Neural Engine

1.4k·GitHub repo

openJev-verdict-2.0

Heman10x-NGU

Develops and benchmarks a non-autoregressive typed-decision model against Jev and Laya

285·GitHub repo
C

laya-multilingual

convaiinnovations

A multilingual System 1 model that returns calibrated typed decisions over text in one pass

257·HF model
C

laya-demo

convaiinnovations

A Gradio demo for Laya typed decisions, multilingual routing, moderation, and RAG filtering

195·HF Space

laya-ultrafast

ipenywis

Runs a browser automation agent using local Laya decisions through MLX

181·GitHub repo

laya-playground

wdobry

A local website combines Laya model demos, games, a benchmark, and an agent skill

157·GitHub repo
C

laya-typed-decisions

convaiinnovations

A Laya model fine-tuned for agent traces, customer service, invoices, and security incidents

102·HF model

laya-vs-jev

virajbhartiya

A side-by-side T-Rex game compares local Laya and hosted Jev decision models

100·GitHub repo
A

laya-mlx

aac6fef

An MLX FP16 conversion of Laya for native inference on Apple silicon

90·HF model

jevals

openlayer-ai

Agent evaluation and guardrail tools run with local Laya, Kev, or hosted Jev

85·GitHub repo

system1-agents

ThinkFlowLab

Prebuilt agents use Jev, Laya, or Cua-S1 for browser, computer, robotics, and game tasks

64·GitHub repo

laya-vision

r33drichards

Adds calibrated image-and-text decisions to Laya using a compact vision-language backbone

52·GitHub repo

laya-pilot

anthonyli

Generates and replays Excel browser tests using Playwright and local Laya decisions

43·GitHub repo

laya-vs-jev-arena

PromptEngineer48

Pits locally run Laya against Jev in Snake and fighting games

30·GitHub repo

arbiter

0xBakeer

Serves Laya and other typed-decision models locally with a Jev-compatible API

29·GitHub repo

laya-jev-GraphRAG

bodepudimuneendra-netizen

Builds graph-based retrieval pipelines with swappable local Laya and cloud Jev decisions

29·GitHub repo

stuntd

bladedevoff

Learns typed decision heads on a frozen Laya encoder and serves them through Jev- and OpenAI-compatible APIs

27·GitHub repo

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

21·GitHub repo
C

laya-browser

cklxx

Fine-tunes Laya as a browser-agent decision head for web navigation

13·HF model
M

laya-onnx

Mattepiu

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

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