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

gavinHuang

A Mario-style platformer uses Laya-MLX typed decisions to select actions on each game tick

0·GitHub repo

laya-mlx-test

VansonLeung

Experiments with Laya-powered Tetris gameplay and sentence-level grammar screening

0·GitHub repo

laya-assist-proxy

dwyschka

A local Home Assistant bridge that classifies voice commands with Laya and routes uncertain requests to an LLM

0·GitHub repo

laya-plays-Pokemon

masmoriya

A local model agent plays Pokémon using Laya decisions and Qwen vision

0·GitHub repo

laya-car-snake

KarimHFahmy

Uses Laya to choose safe moves in a car-and-trailer grid game

0·GitHub repo

laya-warehouse-safety

senthilr-nv

Simulates warehouse robot decisions using Laya, with a browser replay and deterministic collision-safety layer

0·GitHub repo

laya_comp_use

InterestingBrainPoops

A Windows screen agent uses Laya to choose UI actions from text-described controls

0·GitHub repo

laya-rlcd-benchmark

mourad-ghafiri

Evaluates the multilingual Laya model on adversarial decision-making scenarios

0·GitHub repo

Laya-GuardRails-Harness

morre95

A Python harness evaluates coding-agent actions with Laya typed decisions and policy rules

0·GitHub repo

jev-arena

Samge0

Compares Jev, NanoJev, and Laya decisions in Tetris and 1024 with recorded gameplay replays

0·GitHub repo

classify-goblin

Sharkelot

A local typed-decision service offers Laya alongside rules, DistilBERT, and Qwen backends

0·GitHub repo

computer-use-testing

yoaugust

Tests Jev, Laya, and CUA for computer-use tasks and plans further reinforcement-learning fine-tuning

0·GitHub repo

calibrated-decisions-iot-demo

javierdv7

An interactive smart-home demo compares local Laya inference with Jev using shared rules

0·GitHub repo

laya

bitofant

Packages a self-hosted Laya model with Docker lifecycle management and an NVIDIA GPU inference endpoint

0·GitHub repo

laya

DarkWanderer

Runs experiments with the open-source Laya System-1 decision model

0·GitHub repo

laya

inematds

A Portuguese triage application wraps Laya with a local interface, API, CLI, and reproducible evaluation

0·GitHub repo

laya_examples

jayanthbagare

Python examples demonstrate the Laya model

0·GitHub repo

laya-jev

kiuckhuang

Adds a local Laya decision endpoint and conformance tests to a Jev browser-agent fork

0·GitHub repo

jev-laya

wuzhiping

Probes the multilingual Laya model on Apple Silicon and records machine-readable inference results

0·GitHub repo

snake-laya

Cognition-Forge

Lets users play Snake against Laya using PyTorch or MLX model runtimes

0·GitHub repo

layaApi

patelkrish-27

A REST server exposes Laya typed-decision inference with low-VRAM checkpoint management

0·GitHub repo

laya2typesafeapi

yunhai-dev

Serves the multilingual Laya decision model through a self-hosted TypeSafe-compatible API

0·GitHub repo

laya-mlx-fine-tuning

canwhite

Provides MLX fine-tuning support for the Laya model

0·GitHub repo

laya-mlx-wzq

smile-magic

A browser-based Gomoku game runs Laya-MLX locally to choose moves on Apple Silicon

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