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

laya-multilingual-qnn

asopitech

Runs Laya's multilingual decision model on Qualcomm Hexagon NPU through ONNX Runtime QNN

0·GitHub repo

laya-post-flagger

MishraAnkit10

Classifies LinkedIn posts with a local Laya server and Chrome extension

0·GitHub repo

laya-cli-gate

uzuw

A head-only Laya fine-tune classifies terminal commands for safety review and tool routing

0·GitHub repo

gmail-laya-classifier

stefanus-ai-tech

Classifies Gmail messages with Laya

0·GitHub repo

laya-claude-router

Harryagarwal

Routes requests between Laya decisions and Claude

0·GitHub repo

jev-v-laya

rnunley

A held-out MMLU-Pro benchmark compares answer routing with local Laya and hosted Jev

0·GitHub repo

obsidian-classify

adra2n

Classifies Obsidian notes and assesses their long-term value with a local Laya model

0·GitHub repo

laya-mlx-windows-cuda

oboroge0

Documents running the MLX Laya model on Windows with an NVIDIA GPU

0·GitHub repo

jev-systemone-local

katya4oyu

Plans a local Jev-compatible System One server with MLX, Core ML, and ONNX Laya backends

0·GitHub repo

browser-agent-laya-fast

samdem-ai

Uses Laya and NuExtract to power a browser agent for automated tasks

0·GitHub repo

laya-decision-engine-tutorial

manishhnnegi

A hands-on notebook tutorial for Laya’s multilingual typed-decision model

0·GitHub repo

jev-kev-laya-selfhost

suarify

Provides a Dockerized, self-hosted HTTP API for Laya typed decisions with agent-skill documentation

0·GitHub repo

SEO-Agent-using-LAYA

07anishu12

Audits websites and uses Laya MLX inference to classify and prioritize SEO issues

0·GitHub repo

synapse

Hduc

Tạo hệ thống ra quyết định và tự động hóa bằng Laya, kết hợp quy tắc, phê duyệt và phân giải giao diện động

0·GitHub repo

laya-zeroshot-agent-guard-eval

Zephyr4772

An evaluation measures zero-shot Laya checkpoints as guards between agent steps

0·GitHub repo

decision-guard

ashp15205

Adds input scanning, thresholding, and confidence calibration for Jev and Laya decision models

0·GitHub repo

Smart-Support-Ticket-Router-Using-Laya

affan1311

Routes support tickets with Laya and uses Gemini to draft replies, with a benchmark against a Gemini-only pipeline

0·GitHub repo

Smart-Support-Ticket-Classifier-Using-Laya

affanhyder-diggit

Routes support tickets with Laya and benchmarks the results against a Gemini-only pipeline

0·GitHub repo

privatemode-decisions-benchmark

edgelesssys

A benchmark compares speed, accuracy, and cost for Jev, Laya, and Privatemode decisions

0·GitHub repo

MacJev-322M-4K-Laya

lawrence3699

Provides a fine-tuned Laya-derived decision model for local Mac agents

0·GitHub repo

jev-equivalent-research

hjl1045

Evaluates Jev, Laya, and a GPT-5.6 Luna baseline on synthetic auto-claims classification

0·GitHub repo

Autonomous-Decision-Intelligence-Platform-ADIP-

Ayyankhan101

Blueprints a local Laya-based decision platform using the laya-mlx runtime

0·GitHub repo

MacJev-322M-4K-Laya-GGUF

lawrence3699

Runs a quantized Laya-derived decision model through llama.cpp and a Python decision head

0·GitHub repo

Sureband

TejaPriyan

Applies split conformal prediction to provide coverage guarantees for outputs from models such as Laya

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