# Laya

> A multilingual, non-autoregressive decision model that returns calibrated typed answers (choice, score, yes/no) over text in a single forward pass.

Laya is an open-source decision engine from Convai Innovations (GitHub owner NandhaKishorM), released under Apache 2.0. Given a state (text, email, ticket or JSON) and typed questions, it returns typed answers with calibrated probabilities in one forward pass across 100+ languages. It never generates text, so there is nothing to parse. The README lists release v0.4.6.

## What It Is

Laya is a System 1 decision model for classification, routing, scoring and guardrail-style tasks. You define questions of three types: `choice` (pick one label), `score` (ordinal level) and `noul` (probability that a statement is true). The model answers all questions in a single forward pass, which the project reports at about 33 ms for one question on a T4 GPU. It is trained with reinforcement learning against strictly proper scoring rules (RLCD) so reported probabilities are meant to be honest.

## Checkpoints and Routing

Three checkpoints are provided: an English ModernBERT-large model, a multilingual mmBERT-base model (context 1,024, extendable to 8,192 tokens with `max_len=8192`), and a typed-decisions checkpoint fine-tuned for four workflows. A built-in `Router` detects script and language and dispatches each request to the right checkpoint, returning routing metadata explaining its choice. Direct single-model loading is also supported.

## Ways to Use It

Install with `pip install laya` (Python 3.10+). Optional extras add an HTTP server compatible with the TypeSafe Jev `/v1/systemone` protocol, an MCP server, LangChain/LangGraph nodes, LlamaIndex and CrewAI routing, ONNX Runtime and a TileLang GPU fast path. A command-line tool, built-in presets (routing, guardrails, moderation, ticket and email triage), schema-driven `decide`, batch prediction, confidence gating and an evaluation harness are included, as is a fine-tuning notebook for Kaggle GPUs.

## Documented Limits

The project states that base checkpoints are near chance on the typed-decisions benchmark zero-shot (0.362 for English) while the fine-tuned checkpoint scores 0.766, and that shipped checkpoints are over-confident until temperatures are refit on your own data. It also notes weaker results on questions with many options (over about 20) and on ordinal score questions. Benchmark comparisons against Jev use third-party published figures for Jev.

## Features
- Typed decisions: choice, score and noul (yes/no) questions
- Single forward pass answering all questions
- 100+ language support via multilingual checkpoint
- Router that auto-selects checkpoint by script and language
- Calibrated probabilities trained with RLCD
- HTTP server compatible with Jev /v1/systemone
- MCP server exposing decision tools
- Schema-driven decisions via JSON schema or pydantic
- Batch prediction and long-document windowing
- Built-in presets for routing, guardrails, moderation, triage
- Confidence gating with min_confidence abstention
- Fine-tuning notebooks and evaluation harness
- Command-line interface
- Optional TileLang GPU fast path and ONNX Runtime

## Integrations
Hugging Face Transformers, LangChain, LangGraph, LlamaIndex, CrewAI, ONNX Runtime, MCP, Docker, Google Colab, Kaggle, TileLang

## Platforms
WINDOWS, MACOS, LINUX, WEB, API, VSC_EXTENSION, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Version
0.4.6

## Links
- Website: https://huggingface.co/convaiinnovations/laya
- Documentation: https://nandhakishorm.github.io/laya/
- Repository: https://github.com/NandhaKishorM/laya
- EveryDev.ai: https://www.everydev.ai/tools/laya
