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.

696 projects

laya-cli

MIt9

A CLI runs Laya typed decisions with batch, routing, and resident-daemon modes

2·GitHub repo

laya-as-judge

rbrus

Uses Laya-MLX to evaluate models and agents with typed-decision judgments

2·GitHub repo

laya-vs-jev

zaferayan

Benchmarks multilingual Laya against hosted Jev across 900 cases, three tasks, and six languages

2·GitHub repo

Decis

chaitin

Serves open decision models through a self-hosted TypeSafe System One API

2·GitHub repo

mac-attack

dockndevai

A macOS app uses Laya decisions to direct harmless effects in a camera-based screensaver game

2·GitHub repo

laya-cuda

Alexw1111

Provides a lightweight CUDA inference library for Laya

2·GitHub repo

laya-demo

almodover

A local web app analyzes text and ebooks across 82 dimensions using Laya

2·GitHub repo

SnakeGame_Laya

Okbatti

Uses a fine-tuned Laya model to choose moves in a Snake game

2·GitHub repo

oh-my-laya

leo1394

Installs local Laya tools for classification, scoring, and routing in coding agents

2·GitHub repo

laya-cpu-benchmark

taiheqi718-art

Measures steady-state CPU latency for the multilingual Laya model

2·GitHub repo

laya-ternary-lite

xixi3548942758-design

Quantizes Laya to ternary weights for smaller, lower-memory inference

2·GitHub repo

gutcheck

janmejai2002

Runs calibrated Jev- and Laya-style decisions on local NPUs or GPUs with agent tool leasing

2·GitHub repo

decidealot

psyb0t

Serves local Laya and Von decision models through TypeSafe-compatible HTTP and MCP APIs

2·GitHub repo

laya-thalamus

lcbkmm

Middleware uses Laya for agent tool routing with confidence-based LLM fallback and evaluation

2·GitHub repo
W

laya-ara

Wouze

Fine-tunes multilingual Laya for Arabic intent classification, inference, and ranking

153·HF model
T

laya-onnx

tozp

Hosts ONNX-converted English Laya model weights in FP32, FP16, and INT8 formats

146·HF model
C

laya-banking77-v1

Cahol

Fine-tunes Laya for classifying customer messages into the 77 BANKING77 banking intents

1·HF model
A

laya-typed-decisions

akshatbindal

Fine-tunes Laya on the typed-decisions benchmark and compares results with Jev

1·HF model
M

laya-mlx

millat

Converts Laya to a native MLX FP16 checkpoint for inference on Apple silicon

1·HF model
H

laya-issue-triage

harikarthikmanyam

Fine-tunes Laya to classify GitHub issue types and assess whether more information is needed

1·HF model
0

laya-System1

0xSojalSec

Provides multilingual Laya checkpoints for typed decisions over text and JSON states

1·HF model
M

laya-onnx

mariojcr

Exports Laya checkpoints to ONNX for inference with ONNX Runtime

1·HF model
F

laya-kannaka-evidence-gate

flaukowski

Fine-tunes Laya to assess whether memory excerpts contain evidence needed to answer a question

1·HF model
J

laya-agentguard

Jojoarumugam

A Laya fine-tune classifies tool calls for destructive risk and third-party content for prompt injection

1·HF model

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