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-classifier-finetuning

sallout

Fine-tunes Laya for custom text classifiers and optionally exports models to Core ML

0·GitHub repo

laya-document-classifier

AshutoshKY

A local web app uses Laya for zero-shot classification of documents and uploaded files

0·GitHub repo

jev-vs-laya-dino

RodolfoBonis

A Chrome Dino game demo compares Jev and Laya on gameplay, latency, cost, and performance

0·GitHub repo

laya-stock-analysis-agent

sandeepj15

A stock analysis pipeline uses Laya to screen setups before Gemini synthesizes trade alerts

0·GitHub repo

laya-system1-snake

Kamandlou

A terminal Snake game uses Laya MLX to choose moves from structured game-state features

0·GitHub repo

jev-laya-case-study

Takuakira

A controlled case study compares Jev and Laya decision responses as repair costs change

0·GitHub repo

Jev-Laya-Use-Cases-

majidansari786

Examples demonstrate Laya for classification, routing, scoring, and structured workflow decisions

0·GitHub repo

finetuning-laya-for-browser-agents

kp-algomaster

Code, datasets, and evaluations fine-tune Laya for structured browser automation decisions

0·GitHub repo

frontdoor

debojitroy

Screens messages with Laya inference, specialization experiments, and reproducible evaluations

0·GitHub repo

local-ai-tetris

jaredjlg2

Runs local Tetris games with Laya and other AI models making inspectable decisions

0·GitHub repo

CatalogMesh

debojitroy

Maps supplier catalog products to marketplace categories using Laya inference

0·GitHub repo

hekla-spjall

Hekla-dev

A Chrome side panel pairs on-device Gemma text generation with local Laya decisions

0·GitHub repo

Decision-Models-Are-Not-Calculators

AnthusAI

A preregistered study compares Jev, Kev, and Laya on fair-die predictions

0·GitHub repo

jev-decision-layer

qualixar

A decision layer routes coding-agent tasks through Jev with optional local Laya

0·GitHub repo

flickering-sign

tienef

An autonomous-agent experiment combines Laya decisions with an LLM and simulated brain systems

0·GitHub repo

local-software-factory

champion19007

Runs a local coding assistant that uses Laya for task triage and Qwen for code generation

0·GitHub repo

Reai

ReKara12

Provides a local voice assistant for anticipatory operating-system navigation and control

0·GitHub repo

doomgemma

dexmac221

Compares Laya with fine-tuned Gemma models in FreeDoom accuracy, calibration, latency, and gameplay tests

0·GitHub repo

laya-mlx

HuSuuuu

Runs the Laya typed-decision model locally on Apple silicon using MLX

0·GitHub repo

open-laya

skorotkiewicz

Provides a local HTTP API and MCP tools for Laya decisions

0·GitHub repo

laya-packet-analyser

esterhuizen

Analyzes network traffic and uses a local Laya model to triage alerts and classify conversations

0·GitHub repo

laya-e2-multitype

13974737898-lgtm

Studies Laya decision quality through reproducible benchmarks, comparisons, and fine-tuning experiments

0·GitHub repo
J

maclaya

jannisleifeld

Serves local Laya models on Apple Silicon through a Jev-compatible API with a dashboard and playground

0·npm package
A

laya-trader

antonellof

Paper-trades crypto and S&P 500 stocks using Laya’s market outlook decisions

0·HF Space

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