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

reckon

Quietcatalpa

Organizes and reviews Windows files offline using rules and the local Laya decision model

1·GitHub repo

god-llm-decisions

surajvs2710-stack

A decision engine fuses Laya and Jev predictions with confidence weighting and auditable logs

1·GitHub repo

verdict

Manavarya09

Provides calibrated zero-shot and fine-tuned typed decision models as an alternative to Jev

1·GitHub repo

laya-console

biyyl234

Provides a local web console and REST API for Laya inference and intent classification

1·GitHub repo

RayCodes_LayaAI

47thtechcorner

A browser-based Pong game uses Laya to control an AI opponent's paddle

1·GitHub repo

laya-reader

msudars

Ranks new arXiv papers against a reader profile using the local Laya model

1·GitHub repo

laya-sentiment-analyzer

SwatiK425

A local command-line sentiment analyzer using Laya's typed choices and calibrated probabilities

1·GitHub repo

laya-decision-api

bmw8080

An HTTP service wraps local Laya with OpenAPI documentation and Java, TypeScript, and Python SDKs

1·GitHub repo

laya-vs-dijkstra

antonellof

Compares Laya MLX pathfinding decisions with Dijkstra on seeded weighted mazes

1·GitHub repo

katai

Shiawaseu

A browser automation agent uses fine-tuned Laya models to select actions and target elements

1·GitHub repo

code-oracle

wahyuzero

Verifies code changes with AST checks and Laya-based residual-drift evaluation

1·GitHub repo

Laya-Finetune

zamax14

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

1·GitHub repo

laya-browser

Benny93

Uses a local Laya model to resolve plain-English selectors in browser automation

1·GitHub repo

cbjev

tomek7667

Implements a Jev-compatible decision model and benchmarks it directly against Laya

1·GitHub repo

seems-laya

ericmjl

Runs natural-language judgments in the Seems programming language using the local Laya decision model

1·GitHub repo

apm-laya-triage

danielmeppiel

Benchmarks local Laya issue classification against labels in the Microsoft APM corpus

1·GitHub repo

laya-voice-browser

AkshayKulkarni1904

Controls Chromium-based browsers by voice using local Laya decisions on Windows

1·GitHub repo

omarchy-agent

pranav6266

Runs an offline Linux voice assistant that uses Laya to route user requests

1·GitHub repo

ghosthand

ameerhmz

A local macOS voice and computer-use agent uses Laya for typed decisions

1·GitHub repo

jev-search

AnthonyDavidAdams

A Python library and CLI run decision-driven search with Jev or a local Laya backend

1·GitHub repo
B

laya-calibration-lab

BunsDev

Fits and evaluates probability calibration for Laya typed-decision models

1·HF Space

laya-ignite

sirgio03

Bootstraps specialized, calibrated Laya decision heads from zero-shot criteria

1·GitHub repo

laya-clipper

jinlh060109-cyber

Creates vertical video clips using Whisper transcription, Laya scoring and ffmpeg editing

1·GitHub repo

pi-laya-skill-router

ericmjl

Routes pi coding-agent requests to relevant skills using a local Laya model

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