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

inhabitants

Uses Laya to choose targets in a Space Invaders game and compares it with a rule baseline

1·GitHub repo

jev-laya-benchmark

EnesDemir143

Benchmarks TypeSafe Jev and Laya-MLX on structured issue classification

1·GitHub repo

laya-learning-demo

Daryl9441

A runnable tutorial teaches Laya decision primitives, routing, fine-tuning, and comparison with Jev

1·GitHub repo

laya-omni-agent

yashrastogi069-dev

An autonomous agent combines local Laya or Jev routing with cloud reasoning and browser, OS, and data tools

1·GitHub repo

tetris_for_laya

fchange

Provides a terminal Tetris environment where a local Laya model chooses each action

1·GitHub repo

laya-mcp-mimo-desktop

miniongk

Bridges Laya typed decisions into MiMo Desktop through a local stdio MCP server

1·GitHub repo

laya-mlx-per-turn-classifier

M37Labs

Demonstrates per-turn customer message classification with Laya on Apple Silicon

1·GitHub repo

decision-infra

hufaei

Routes typed-decision requests to hosted Jev or local Reflex, SemIf, and Laya models

1·GitHub repo

macos-use

ArdaOzd

Controls native macOS apps and Chrome using spoken or typed commands with local Laya or hosted Jev decisions

1·GitHub repo

system-one-playground

minkhant1996

Provides a local web playground for Laya and other System One decision models

1·GitHub repo

second-thought

KNambiarDJsc

Measures decision calibration, prioritizes human review, and builds fine-tuning datasets

1·GitHub repo

hd5-antigravity-jev

alpaslan-exe

A workshop teaching developers to build projects with Antigravity and locally run Laya decisions

1·GitHub repo

laya-cuda

adamjen

Benchmarks Laya typed-decision checkpoints with a CUDA backend on NVIDIA GPUs

1·GitHub repo

laya-exp

changtimwu

Experiments comparing an MLX Laya port with Jev and a TypeSafe-compatible Laya client

1·GitHub repo

laya-main

bill9924

Maps patent texts to OpenAlex concepts using TF-IDF retrieval and a Laya decision model

1·GitHub repo

laya-lab

Alevsk

Runs Laya locally with reproducible scenarios that explore its capabilities on Apple Silicon

1·GitHub repo

laya-rn-executorch

ksanjiv05

Exports and runs Laya decision models offline in a React Native app using ExecuTorch

1·GitHub repo

laya-computer-use

koushikvarma37-jpg

Runs a local Windows voice assistant that uses Laya to choose intents and actions

1·GitHub repo

laya-inference-engine

aaditagrawal

Provides a GPU inference engine and performance modes for Laya on NVIDIA Blackwell

1·GitHub repo

laya-adk-toolkit

Ashfaqbs

Google ADK tools expose Laya's typed-decision engine for classification, scoring, and detection

1·GitHub repo

decision-making

tzt-company

A local demo runs Laya for multilingual text decisions and Git commit risk checks

1·GitHub repo

laya-ko-decision-onnx

2nugu

Fine-tunes Laya for Korean decisions and provides PyTorch training and ONNX export scripts

1·GitHub repo

Tern

AmRitJain0442

A model router uses local Laya-MLX inference to select between configurable provider tiers

1·GitHub repo

agent-decision-firewall

chinna250801

Gates AI agent actions with a local Laya decision model and fail-closed rules

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