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

mcp-laya

dockndevai

Provides an MCP server exposing Laya typed-decision tools to agents

0·GitHub repo

laya-server

roilanrodriguez55

Runs the real Laya server locally or in Docker and provides Bruno API tests

0·GitHub repo

Laya-Finetune

zamax14

Fine-tunes and evaluates multilingual Laya for support-ticket classification

0·GitHub repo

laya-plus

KotalaKishanReddy

Extends Laya's effective context with longer inputs and retrieve-then-decide processing

0·GitHub repo

laya-rex

luiz0ar

A browser dashboard uses Laya decisions to control the T-Rex Runner game

0·GitHub repo

laya-games

BM-Popcorn

Demonstrates Laya-driven turn-based games and fine-tunes the model on engine-labeled positions

0·GitHub repo

laya-top

bsisduck

Monitors local processes with explainable tags and optional Laya inference

0·GitHub repo

laya-universal

abusuraihsakhri

Provides cross-platform inference utilities for Laya checkpoints using ONNX Runtime and MLX

0·GitHub repo

laya-finetuning

sothi-em

Fine-tunes Laya for key-value match detection using the KVP-10K dataset

0·GitHub repo

laya-ecosystem

MiguelFAraujo

Provides utilities for supervision, context compaction, search, and UI decisions using Laya and Jev

0·GitHub repo

laya_bio

maris205

Adapts the Laya encoder into a shared candidate-scoring model for biological sequence tasks

0·GitHub repo

laya-server

zachary-walters

Serves Laya classification, scoring, and detection endpoints with Apple Silicon acceleration

0·GitHub repo

hey-laya

touhidsiddiqueeraj-bit

Runs an offline voice assistant that uses Laya for on-device decisions

0·GitHub repo

zabbix-laya

j3udiel

A local web lab evaluates fictional Zabbix alerts with Laya and lets users download test results

0·GitHub repo

laya-studio

jiaheng6

Provides a Windows desktop client for installing, running, testing, and serving Laya models

0·GitHub repo

laya_demo

itsvrushabh

Demonstrates and benchmarks Laya’s typed decision engine across interactive use cases

0·GitHub repo

laya-deploy

iintothewind

Deploys and benchmarks Laya Serve on Windows with Docker and a temporary public tunnel

0·GitHub repo

laya-studio

felix-homelab

Wraps Laya in a web panel for schema authoring, evaluation, automation, and calibration monitoring

0·GitHub repo

Laya_wrapper

ugelucero

Wraps Laya checkpoints in a command-line tool and FastAPI service for request routing

0·GitHub repo

everything-laya

its-negy-lmsy

Provides an MCP server and Python toolkit for self-hosted Laya

0·GitHub repo

local-laya

maurostorch

Runs Laya as a Dockerized HTTP service with a web interface

0·GitHub repo

laya-lab

Parswanadh

Coordinates long-context decision-engine research for the open Laya model

0·GitHub repo

laya-indic-bench

jay123anta

Evaluates Laya decision models on Hindi and Assamese

0·GitHub repo

laya-call-router

riefer02

Demonstrates fine-tuned Laya decisions in an inspectable dealership call-routing workflow

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