Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.
Python calibrationclassificationdecision-modelhuggingfacejevmodernbertmultilingualnlppythonpytorchroutingtyped-decisionszero-shot
release: 0.3.16, installation, quickstart and documentation first
Nandakishor1a099d978519
diff --git a/README.md b/README.mdindex d9d7ff72..31b1ad2a 100644--- a/README.md+++ b/README.md@@ -29,13 +29,39 @@ python -m pip install layaPython 3.10 or newer. Optional extras: `laya[serve]` (HTTP server), `laya[mcp]` (MCP server), `laya[langchain]` (LangChain and LangGraph), `laya[onnx]` (ONNX Runtime), `laya[fast]` (TileLang GPU fast path). Step-by-step setup for each platform, CPU-only or GPU PyTorch builds, and troubleshooting are in [Installation details](#installation-details).+## Quickstart++```python+from laya import Router++router = Router() # downloads a checkpoint on first use; Router(preload=True) loads all three up front++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["answers"]["churn_risk"]["noul"]) # probability the answer is yes+print(result["routing"]["model"]) # english+```++Text in any of 100+ languages works the same way: the `Router` sends it to `laya-multilingual` automatically. From the command line, `laya "My payment failed twice" --preset triage` answers a ready-made question set. More in the [full quickstart](#quickstart-route-mode-recommended) and the [docs](https://nandhakishorm.github.io/laya/).+## Documentation**[nandhakishorm.github.io/laya](https://nandhakishorm.github.io/laya/)**: guides for [prediction hooks](https://nandhakishorm.github.io/laya/hooks/), [schema-driven decisions](https://nandhakishorm.github.io/laya/structured/), [Docker](https://nandhakishorm.github.io/laya/docker/) and [LangChain and LangGraph](https://nandhakishorm.github.io/laya/langchain/), plus a full [API reference](https://nandhakishorm.github.io/laya/reference/).-## What's new in 0.3.15+## What's new in 0.3.16-* **Installation and documentation first.** This README now opens with how to install Laya and where the docs are.+* **Installation, quickstart and documentation first.** This README now opens with how to install Laya, a runnable example, and where the docs are.* **Documentation site** at [nandhakishorm.github.io/laya](https://nandhakishorm.github.io/laya/), with an API reference generated from the docstrings.The code is unchanged from the last runtime release, whose fixes are:diff --git a/laya/__init__.py b/laya/__init__.pyindex 51c6bcb0..758bd2c5 100644--- a/laya/__init__.py+++ b/laya/__init__.py@@ -14,7 +14,7 @@ from .presets import (from .router import DEFAULT_MODELS, RouteDecision, Routerfrom .structured import DecisionResult, decide-__version__ = "0.3.15"+__version__ = "0.3.16"# Routing, language detection and email cleaning are pure Python. The torch-backed names are# resolved lazily so that `import laya` -- and therefore `from laya import Router` ordiff --git a/pyproject.toml b/pyproject.tomlindex 8d95af03..4ed05199 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"[project]name = "laya"-version = "0.3.15"+version = "0.3.16"description = "Fast, non-autoregressive System 1 decision engine with calibrated probabilities"readme = "README.md"requires-python = ">=3.10"