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.

1713 projects

snake

ufuayk

Runs a browser-based Snake game whose moves are selected by the laya-mlx model

1·GitHub repo

Unitree_Low-Level_Balance

DeRuiChen258

Combines Unitree G1 balance control, skill scheduling, and structured LayA decisions in MuJoCo

1·GitHub repo

DevPulse

CarlosGaubert

Aggregates technology news and uses Laya to classify relevance, topics, and impact

1·GitHub repo

LayaResolve

jasgigli

Routes and triages problems with the Laya decision model family

1·GitHub repo

laya-mlx-http

noahwaldner

Serves laya-mlx decisions over HTTP and provides a Vercel AI SDK adapter

1·GitHub repo

laya-vs-llms-benchmark

stuaninauts

Compares Laya with machine-learning and language models on financial complaint triage

1·GitHub repo

floorcall

yashraz23

Provides a fine-tuned and calibrated Laya decision layer for voice-agent tasks

1·GitHub repo

dsh-router-laya-deploy

kaijin1448

Deploys and patches a local Laya decision service and its OpenCode integration on Windows

1·GitHub repo

laya-agent

clarois

Uses local Laya decisions to choose and execute actions in Ragnarok Offline

1·GitHub repo

laya-android

Byun11

Fine-tunes Laya into a typed-decision policy for Android GUI action selection

1·GitHub repo

life-decision-system

NankoMi

Provides an agent skill for life decisions with an integrated Laya scoring and fine-tuning pipeline

1·GitHub repo

goal-classification-bench

fuljorge

Benchmarks Laya and Strands Decider for customer-goal classification in Brazilian Portuguese

1·GitHub repo

reverie

r3c0nc1l3r

Runs browser tests from Markdown specifications using local Laya or hosted Jev decisions

1·GitHub repo

oficina-guardrails

rynalde

Screens assistant inputs with rules and Laya decisions to block, review, or allow text

1·GitHub repo

laya-ort

Fruank4

Runs Laya typed decisions on Linux x86_64 using ONNX Runtime

1·GitHub repo

neo4j-laya-exploration

Satyaprakash27

Routes LangGraph agents using Laya decisions informed by Neo4j episodic memory

1·GitHub repo

laya-mlx-jev-endpoint

rezhajulio

Serves laya-mlx through a FastAPI endpoint compatible with the JEV decision API

1·GitHub repo

miniLaya

yesterdayfuture

Fine-tunes a BERT-based typed-decision model and compares its outputs with Jev and Laya

1·GitHub repo

decision-datagen

SunixLiu

Generates typed-decision training datasets from policy documents for Jev-style models

1·GitHub repo

llm-decision-api

OpenAurora

Provides a Qwen-powered semantic decision API and compares its results with Laya and Jev

1·GitHub repo

OpsOne

prannesshkva

Automates cloud operations and cost remediation using LangGraph, FastAPI, and Laya decisions

1·GitHub repo

vega-laya-chess

harishkotra

Plays and benchmarks chess matches between local Vega and Laya decision models

1·GitHub repo

dsh-laya-mcp

Alexander390370

Connects the local Laya decision model to DeepSeek Harness through an MCP server

1·GitHub repo

mail-triage

patrikcze

Sorts local inbox email into personal, review, and junk categories using Laya 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