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.29
Nandakishore08843b6255e
diff --git a/README.md b/README.mdindex 7bf1b7ab..0b157ce9 100644--- a/README.md+++ b/README.md@@ -94,6 +94,25 @@ The shipped checkpoints work zero-shot, but fine-tuning on decisions from your o**[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.29++* **`predict_long` no longer splits a state that fits.** The one-pass shortcut compared the state against the default window instead of the room the questions actually leave, so any state in the band between the two was scanned in two windows and answered with the max or the most confident window rather than the plain answer (#966). On `laya-multilingual` that band is roughly 761 to 989 state tokens, an ordinary email: an 878-token note returned noul 0.998 against `predict`'s 0.752, at twice the forward passes. It now matches `predict` exactly, and an explicit `window=` still scans.+* **A line of English acronyms no longer routes to the multilingual checkpoint.** `MON`, `DES`, `EST` and `LA` collide with French stopwords, so one line of ordinary abbreviations inside an English state made `analyse` name the whole state French (#1013). The all-caps guard is kept, because a customer shouting in Portuguese is still Portuguese, and the fix separates that case from a line of bare acronyms. A second cause is fixed with it: acronyms were voting in the whole-state verdict too, which no helper was filtering.+* **A `min_confidence` map key that cannot name a bucket is refused.** The validator checked only that a key was a string, so `{"choice:2-5": 0.9}` passed and then silently gated nothing: the lookup misses, falls back to `default`, then to 0.0 (#1002). A caller who mis-spells one key believed that bucket was gated at 0.9 while every answer in it abstained never.+* **Fine-tuning reports what it learned, on held-out data.** `laya-train --eval eval.csv` evaluates the base checkpoint before training and the fine-tune after, and writes `train_report.json` with accuracy, loss, ECE, Brier and signed deltas (#967, #887). Evaluation items are checked for overlap against both the training and calibration splits, and a set that overlaps is labelled `overlapping_eval` rather than reported as generalization. With no `--eval` and no calibration items, evaluation is skipped rather than reporting training fit.+* **A fine-tune that collapses to the class prior now says so.** On a few hundred rows the default epoch budget can finish at chance with a near-constant logit, and the run still looks successful (#968, #963).+* **`laya-evals evidence --checkpoint DIR`** reads the calibration evidence a fine-tune persists and reports it as `PRESENT`, `MISSING`, `INSUFFICIENT` or `UNKNOWN`, so zero calibration items stops reading as healthy (#964). It loads no weights and does not need torch.+* **The fine-tuning scripts now share one loop.** `notebooks/laya_finetune_typed_decisions_mps.py` and `research/scripts/finetune_single_device.py` call `laya.train` instead of carrying their own copies, which is what #851 and #885 were: the same temperature-clamp bug fixed twice in parallel (#965, #887).+* **The default loss stays `rlcd`, now on evidence.** A three-seed panel on typed-decisions says the single-seed soft-CE win does not replicate: paired `soft-ce − rlcd` accuracy is +0.0002 on average and changes sign between seeds, with soft-CE far noisier (std 0.0155 against 0.0016) (#1012, #887, #741).+* **Java.** `laya-java` gains language routing, the preset question sets, the embedding shortlist and the email cleaner, gated against fixtures recorded from the Python package, plus a JDK matrix lane because `\p{L}` follows the JDK's own Unicode version (#938). Three defects on `main` are fixed with it, including a release workflow that could publish a jar named after a branch, and a release test floor that counted skipped tests.+* **Thirty-one documentation corrections**, each landing a gate that fails if the page drifts again (#972 to #1011, from @aashish254). The largest class: `confidence` was documented as one entropy formula across every question type, when it is `1 - H/log(k)` for `choice` and `score` and equals `answer_confidence` for `noul`. Others name parameters a tool actually takes, correct key counts, and stop calling the shipped `answer_confidence` calibrated when the loader itself warns that it is not.+* **Portability.** Six repo reads in `tests/` left the codec to the runner, which is cp1252 on the Windows lane, so a UTF-8 page killed the whole suite at the read rather than failing one assertion. A gate now refuses an unpinned repo read (#1001).+* **`laya[onnx]` no longer caps NumPy for everyone.** The cap that torch below 2.3 needs is scoped by marker to macOS on Intel, instead of making the extra unresolvable next to anything requiring `numpy>=2` (#947).++44 pull requests from 8 contributors.++---+## What's new in 0.3.28* **`laya.backends` was missing from every published wheel.** The package was never added to setuptools' explicit list, so the wheels for 0.3.25, 0.3.26 and 0.3.27 shipped without it (#940). The documented backend selection API was therefore unavailable to anyone who installed with pip: `Agent(backend="eager")` raised `ModuleNotFoundError` and `agent.set_backend("eager")` raised `ImportError`, while the compile guide described both. The default path was unaffected, which is why this went unnoticed; it also only ever worked from a source checkout, which every contributor here uses. A packaging check now keeps the declared list aligned with every importable `laya` source package, so the next one fails at build time instead of at install time.diff --git a/laya/__init__.py b/laya/__init__.pyindex ba200d91..a391b85d 100644--- a/laya/__init__.py+++ b/laya/__init__.py@@ -35,7 +35,7 @@ from .presets import (from .router import DEFAULT_MODELS, RouteDecision, Routerfrom .structured import DecisionResult, decide, decide_batch-__version__ = "0.3.28"+__version__ = "0.3.29"# 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/nix/package.nix b/nix/package.nixindex a0cb3836..2ca76a97 100644--- a/nix/package.nix+++ b/nix/package.nix@@ -12,7 +12,7 @@ let# side, where tests/test_packaging.py compares all three declarations (this one,# pyproject.toml and laya.__version__) and fails CI when they diverge. Nothing# did, which is how this sat at 0.3.4 while the package reached 0.3.20.- version = "0.3.28";+ version = "0.3.29";src = ../.;format = "setuptools";propagatedBuildInputs = with python3Packages; [diff --git a/pyproject.toml b/pyproject.tomlindex 9b9a265d..01441018 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"[project]name = "laya"-version = "0.3.28"+version = "0.3.29"description = "Fast, non-autoregressive System 1 decision engine with calibrated probabilities"readme = "README.md"requires-python = ">=3.10"