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.

770 projects

leanroute

kdandu001-arch

Provides a Laya-powered decision SDK and gateway for blocking attacks and routing LLM requests

0·GitHub repo

system-one-model-finetuning

omkarghugarkar007

Provides a measured recipe for fine-tuning System One models such as Laya and Jev

0·GitHub repo

jev-context-rot

casperkwok

Reproduces an experiment comparing context sensitivity in Jev, Laya and Decider models

0·GitHub repo

laya

airen3339

A Python package and model router for multilingual typed decisions in a single forward pass

0·GitHub repo

laya

wenli03

Provides multilingual typed-decision checkpoints and a router for single-pass inference

0·GitHub repo

Laya

jersonboydmilan

Provides a multilingual typed-decision engine with checkpoint routing and Python interfaces

0·GitHub repo

laya

Shawny-W

Provides multilingual typed-decision scripts using Laya checkpoints and automatic language routing

0·GitHub repo

laya

HydriaOne

Serves Laya routing predictions in Docker and includes an offline scenario inspector

0·GitHub repo

Laya

samyakb32-sys

Routes requests to prompt-configured task sub-agents using the Laya model on CPU

0·GitHub repo

LayaService

wj1313677

Serves the Laya decision model through a local REST API using MLX on Apple Silicon

0·GitHub repo

LayaOnAWS

goodbyedavid

Deploys a Laya inference server on Amazon ECS with GPU capacity in an AWS account

0·GitHub repo

LayaVoiceCommand

stefanus-ai-tech

Recognizes Indonesian voice commands by transcribing audio and classifying commands with Laya

0·GitHub repo

classifier-laya

josecruset

A local browser interface for testing Laya-MLX typed-decision models on Apple Silicon

0·GitHub repo

jev-vs-laya

Cognition-Forge

Compares Jev and Laya variants across typed-decision tasks

0·GitHub repo

laya-murdle

reycardo

Parses Murdle puzzles with Laya and solves their clues using a constraint solver

0·GitHub repo

layagrep

marksomething

Searches files and stdin by asking Laya whether each line matches a natural-language description

0·GitHub repo

laya_demo

bigcoke1

Demonstrates Laya typed decisions in an inbox triage workflow

0·GitHub repo

try-laya

lin52025iq

Provides a Laya-first agent runtime with browser and Android control integrations

0·GitHub repo

laya-scraper

qxZap

Uses Laya to find publication pages and extract publication details with a browser-capable crawler

0·GitHub repo

LAYA_DEMO

davidL-zhan

Matches exam questions to knowledge points with local Laya yes-or-no predictions

0·GitHub repo

laya-api

agk4444

Serves Laya typed-decision models through a CPU-based HTTP API

0·GitHub repo

laya-integration

SanjaySathish

Routes Claude Code tasks to Claude tiers using a locally served Laya decision model

0·GitHub repo

laya-testing

hypen-code

Demonstrates CPU-based Laya classification in an interactive terminal program

0·GitHub repo

laya-mcp

frankdavid888

Packages Laya as an MCP server for AI assistants to make typed decisions

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