laya-mcp (PerryLink): a warm sidecar that fixes Laya's silent truncation and constant noul
MCP server plus HTTP sidecar: token-budget preflight that reports what would be cut, a persisted calibration store, structured errors, and a noul fix (P(true) 0.5 → 1.0).
Documents a 7.4 s median CPU reload on every language switch in upstream Laya and keeps one Router warm instead.
# laya-mcp [Laya](https://github.com/NandhaKishorM/laya) is a fast, non-autoregressive "System 1" decision model: it answers typed questions — `noul` (yes/no), `choice`, `score` — over a piece of state and returns probabilities, in a single forward pass. It is genuinely good, and it is a research artifact. This is the part that makes it survive contact with a server. [English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md) ```bash pip install 'laya-mcp[mcp]' laya-mcp serve # loads the model once, keeps it warm on 127.0.0.1:8787 laya-mcp install # registers it with whichever agent harness you have ``` > **Status: 0.2.1, work in progress.** The core is implemented and its pure logic > is covered by 85 checks, but it has not yet been exercised end-to-end against a > live harness in CI. Interfaces may move before 1.0. --- ## The problem this solves Laya truncates things silently, and the omissions are the kind you only notice after acting on a wrong answer. **It cuts the state, from the end, and says nothing.** `build_sequence` gives the state whatever room is left after the options and slices it `st[:room]`. A long document loses its tail — which for a contract, a log or an email thread is often where the answer was — and the model then answers about the surviving prefix at full confidence. Nothing in the response marks it. **It shortens options until labels are indistinguishable.** Options share a fixed `head_max_len` budget (192 tokens on the English checkpoint, 256 on the others). Past a point every label gets ~4 tokens. This is the documented cause of the Banking77 collapse (0.425 against Jev's 0.870), and again, nothing reports it. **Its validation is one check.** An unkno