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.

752 projects

jev-zen

loongWoong

Reconstructs and validates Laya inference locally using NumPy and a browser-based interface

0·GitHub repo

Jev-agent

To3akaRin

Suggests clipboard entries based on the focused field using local Laya inference or the Jev API

0·GitHub repo

before-you-send

roisol144

Checks message tone, formality and fight risk while users type, using Laya decisions

0·GitHub repo

screenquest

DanielTea

Controls a game on Apple Silicon with screenshot perception, Laya decisions, and vision-language planning

0·GitHub repo

semantic-browser

koriym

Navigates hypermedia applications by selecting server-declared links using Laya-MLX

0·GitHub repo

jev-eval-ja

unirt

Benchmarks Jev and Laya on Japanese business-style decision tasks

0·GitHub repo

job-classifier-search

NoNFake

Ranks Danish job listings against a candidate profile using the Laya decision model

0·GitHub repo

mandate-1

siva-sub

Explores Laya fine-tunes for finance research while a separate DeepSeek path powers the live reference

0·GitHub repo

laya

iaeluk

Runs a local Laya-powered Snake game with a CUDA server and browser version

0·GitHub repo

laya

harisathees

Tests Laya predictions, multilingual behavior, CPU performance, and interactive runs through a local web console

0·GitHub repo

laya

pgarvie

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

0·GitHub repo

laya

ai-2-m

Provides a multilingual, non-autoregressive model for typed decisions in a single forward pass

0·GitHub repo

product_search_bench

Wanke15

Compares BM25, Jev, Qwen, and Laya for product search and reranking

0·GitHub repo

LayaBOT

tomikan1208-code

Uses Laya decisions to control a Minecraft combat bot through Mineflayer

0·GitHub repo

LayaMCP

GeneGulanesJr

Exposes Laya decision tools to MCP clients through an HTTP server

0·GitHub repo

LayaWatch

BLANCO-11

Runs Laya in-process and provides a self-hosted console for traces, metrics, access control, and model management

0·GitHub repo

laya-example

mkassaf

Demonstrates how to run the Laya typed-decision model with a minimal example

0·GitHub repo

laya-ANE

vipuldivyanshu92

Ports Laya inference to Core ML for Apple devices, with a SwiftUI iPhone demonstration app

0·GitHub repo

laya-ROCm

don-milsey-miller

Provides an AMD ROCm runtime and benchmarks for running the Laya decision model

0·GitHub repo

layaagent

rotsl

Routes tasks through Laya classification and deterministic mediation to local or API-based coding agents

0·GitHub repo

layad

rcwsr

Keeps the Laya decision model resident and serves it over HTTP with MLX or PyTorch

0·GitHub repo

laya-vk

sulistta

Ports the Laya decision runtime to a Vulkan/IREE encoder backend for AMD and Qualcomm GPUs

0·GitHub repo

rest-laya

wdonega

Serves the Laya model over REST with optional Jev-compatible endpoints for non-Python clients

0·GitHub repo

ondevice-system1

Ahtsham0715

Develops smaller on-device typed-decision models derived from Laya, with training code and evaluations

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