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-multimodal

TalalAhmed311

Trains a multimodal typed-decision model that answers image and text questions in one pass

0·GitHub repo

Laya-Navigator

Vann4799

Adapts Laya decisions to workflow-state classification and next-action prediction

0·GitHub repo

laya-mlx-mcp

Blackphi6

Exposes Laya-MLX typed decisions through an MCP server for Apple Silicon

0·GitHub repo

codex_laya_dev

sirogarasu

Provides a Codex devcontainer and GPU API sidecar for running the Laya model

0·GitHub repo

codex-laya-mcp

AetherZZ2

Exposes local Laya typed-decision tools to Codex through MCP on Apple Silicon

0·GitHub repo

laya-multilingual-playground

pumpkinfadly

Provides a web playground and API for testing multilingual Laya typed decisions

0·GitHub repo

laya-decision-engine

vampirethoran

Serves local Laya typed decisions over HTTP with multilingual routing and inference metrics

0·GitHub repo

laya-ai-poc

distractdiverge

Prototypes offline Todoist task categorization with a currently stubbed Laya integration

0·GitHub repo

jev-laya-explore

NachiketKandari

Evaluates the local Laya decision model alongside TypeSafe's hosted Jev

0·GitHub repo

laya-local-lab

torresnicolas0

Reproduces local evaluations of three Laya variants across support, guardrails, RAG, and model selection

0·GitHub repo

laya-mlx-benchmarks

jayluxferro

Benchmarks Laya typed-decision models running through the MLX inference port

0·GitHub repo

cam-laya-mcp

vdqvinh2004

Adds optional local Laya-MLX decision tools for coding agents

0·GitHub repo

laya-medical-finetune

Priyanshu-5257

Provides RLCD fine-tuning recipes and evaluations for Laya on medical decision tasks

0·GitHub repo

laya-multilingual-dml

minicom365

Runs and benchmarks Laya Multilingual on AMD hardware using DirectML

0·GitHub repo

laya-coding-router

0xSarnavo

Fine-tunes Laya to route coding-agent prompts to skills, tools, MCP servers, and models

0·GitHub repo

laya-tri-commentaires

APRESIA

A local Python script sorts YouTube comments into categories using the Laya model

0·GitHub repo

laya-powered-interviewer

BhavyaFattania

Evaluates technical interview answers with similarity metrics, decision-engine scoring and structured feedback

0·GitHub repo

laya-snake-lab

shaunthebuilder

Combines a Snake game with Laya-powered autoplay, training, and live decision probabilities

0·GitHub repo

Jev-vs-Laya

aarush-dhingra

Compares Jev and Laya as chess decision-makers in a local browser arena

0·GitHub repo

laya-kev-docker

AndiMajore

Deploys Laya and Kev decision servers in configurable CUDA-enabled Docker containers

0·GitHub repo

laya-fit-check

JhouCode

A Python kit reproduces Laya's published benchmark and compares it with free baselines on custom data

0·GitHub repo

laya-escalation-classifier

Sathish-30

Detects support-chat escalation with Laya and provides batch evaluation and a web demo

0·GitHub repo

Helpdesk-Laya-Router

stefanus-ai-tech

Classifies helpdesk tickets with Laya and produces Excel routing and evaluation reports

0·GitHub repo

laya-chatgpt-flow

Boom-Vitt

Uses local Laya decisions to operate Google Flow in a Thai video-production 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