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-mac-serve

chrisns

Serves Laya from a macOS menu bar app through an OpenAI-compatible HTTP endpoint

1·GitHub repo

localjev-mlx

rimusz

A self-hosted System One judgment service for Apple Silicon using laya-mlx

1·GitHub repo

rimworld-autopilot

Georgy-hook

A local RimWorld colony autopilot uses Laya to choose and issue in-game orders

1·GitHub repo

chinese-workflow-decision-bench

Adkid-Zephyr

Benchmarks Jev and Laya on synthetic Feishu message classification scenarios

1·GitHub repo

decide

gopaljigaur

Provides a Python client that chains Laya with hosted and other decision-model backends

1·GitHub repo

system-one

asynq-io

Offers a provider-neutral SDK for typed decisions through hosted and local backends

1·GitHub repo

doom-war

rythmn1111

Compares local MLX Laya and hosted Jev as decision-makers in a Doom deathmatch

1·GitHub repo

laya

ganeshdipdumbare

Serves Laya typed-decision predictions over HTTP in a self-hosted Docker deployment

1·GitHub repo

laya

DilwoarH

Wraps the Laya Router agent in a Flask API for typed-decision predictions

1·GitHub repo

LayaStudio

biplovgautam

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

1·GitHub repo

SmartMom

clydechen0228

Uses Laya for edge classification and training within a smart-factory operations platform

1·GitHub repo

laya_dashboard

ghozifadilah

A REST API and web studio serve Laya decisions and manage workflows

1·GitHub repo

laya-cn

yangshun2005

Provides a Chinese translation of Laya documentation for its multilingual typed-decision engine

1·GitHub repo

laya-micro

osamabinIaggin

Prunes and quantizes Laya for low-memory single-board computer deployment

1·GitHub repo

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

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