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

omnia-news

Omniaeye

Filters source content with OMNIA Laya and records evidence-backed feed decisions

1·GitHub repo

layaMOE

vishalmysore

Routes Laya requests to domain-specific expert heads, with a browser demo using ONNX Runtime Web

1·GitHub repo

laya-local-guard

Kamandlou

Classifies content for safety risks locally with Laya-MLX and detects PII and secrets

1·GitHub repo

laya-system1-snake

Kamandlou

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

1·GitHub repo

laya-eval

yliuai

Fine-tunes Laya to play Snake on a Mac and measures base vs fine-tuned decision accuracy

1·GitHub repo

omnia-laya

Omniaeye

Integrates Laya inference with validated outputs, durable decision records, replay and evaluation tools

1·GitHub repo

laya-pi

trinacria-tech

Runs Laya decision APIs and demos on a Raspberry Pi 4 using ONNX Runtime or PyTorch

1·GitHub repo

chong-laya

cloudwallker

Provides a local interface for inspecting Laya shopping decisions, probabilities, latency, and raw responses

1·GitHub repo

general-decision-with-laya

chenking2020

Provides a multilingual decision platform using locally loaded Laya weights for typed answers and confidence gating

1·GitHub repo

omnia-mcp

Omniaeye

Exposes Jev and local Laya typed decisions to agents through the Model Context Protocol

1·GitHub repo

docweave

pareshbhangale

Converts PDFs to Markdown and uses Jev or Laya alongside local models for layout routing and table auditing

1·GitHub repo

laya-finetune

lucianfialho

Fine-tunes Laya using Jev distillation and pilot datasets

1·GitHub repo

laya-triage

elnachto

A GitHub Action uses local Laya decisions to label issues and pull requests and flag spam

1·GitHub repo

laya-agent

inboxxobni

Runs Laya typed decisions locally on Apple Silicon and provides an HTTP server and agent integrations

1·GitHub repo

laya-jev-tester

Collanteslu

Tests Laya or Jev-compatible endpoints through a browser-based interface for typed decisions

1·GitHub repo
A

laya-zerogpu

afen0768

Runs Laya checkpoints on ZeroGPU for typed decisions over text or JSON

1·HF Space

Laya_test_bench

francismdpro

Provides command-line and web tools for experimenting with Laya's typed decision questions

1·GitHub repo

jev_laya_studies

professortavares

Explores structured text decisions, explainability, and comparisons involving Jev and Laya

1·GitHub repo

laya-decision-gateway

harshad-jadav

Serves Laya model decisions through a documented API gateway

1·GitHub repo

system-one-web-ai

Josuesp1620

An interactive web guide measuring Laya on Spanish customer-service messages and explaining its implementation

1·GitHub repo

snake-game-laya-ai-example

larchanka

Provides terminal games that use the Laya model for real-time decisions

1·GitHub repo

Civic-Signal-Laya

satiricalguru

Routes multilingual public-service requests with Laya and presents decisions for human review

1·GitHub repo

laya-router

vuongvm812

Sets up local Laya classification and Jev Router proxies for coding clients

1·GitHub repo

laya-persian-benchmark

alipyth

Benchmarks Laya's Persian support-triage decisions across eight language-specific message families

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