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
docs(guide): fix misattached clauses, duplicated paragraph and tense
Ash0fedfda4feb0
diff --git a/docs/cli-mcp.md b/docs/cli-mcp.mdindex f1c2f6d5..b09d5588 100644--- a/docs/cli-mcp.md+++ b/docs/cli-mcp.md@@ -158,7 +158,7 @@ Laya does not open a network port.| `laya_decide` | Answers a JSON-schema-shaped decision in one forward pass and returns the decided values with per-field confidence, instead of an answer map to parse. Schema properties may be enum choices, booleans, or integers with a minimum and maximum; free strings, arrays, and nested objects are rejected by path. | `state`, `schema`, optional `model` |The three batch and schema tools exist because the same operations are available on the SDK and-`laya-serve`: reaching for many requests, or for a caller that already knows the answer shape,+`laya-serve`: handling many requests, or serving a caller that already knows the answer shape,does not require dropping to Python. For the schema-driven form in more depth, see[Schema-driven decisions](structured.md).diff --git a/docs/crewai.md b/docs/crewai.mdindex da66f11f..0fdbb7c1 100644--- a/docs/crewai.md+++ b/docs/crewai.md@@ -159,7 +159,7 @@ to their own agent; both repeats gave the same count.| Tasks on their own agent | 2/59 | 7/59 | 16/59 || Median ms per task | 146 | 190 | 265 |-Before this, the same run could not be asked at all: `LayaCrewRouter.__init__() got an unexpected+Before this, the same run could not be made at all: `LayaCrewRouter.__init__() got an unexpectedkeyword argument 'max_len'`.Absolute accuracy is not the claim here -- the checkpoint is not a MASSIVE classifier and 59 similardiff --git a/docs/evals.md b/docs/evals.mdindex 7a5ada2c..fd5ab7de 100644--- a/docs/evals.md+++ b/docs/evals.md@@ -90,7 +90,7 @@ short name like `english`, since there is no Router on this path (defaultwhose `model` field names a different one fails with a clear error rather than being silentlyanswered by the wrong model; `--device` does not apply. `--batch-size` uses the agent's batchAPI when it has one and falls back to one call per state otherwise; `--sort-by-length` is forwarded-to that batch API, which the per-state fallback has no group to reorder. Pass `--calibration PATH`+to that batch API; the per-state fallback has no group to reorder. Pass `--calibration PATH`to load a fitted calibration map onto `ONNXAgent`, so calibration gates such as `--max-ece`evaluate against calibrated probabilities. The report's `config` block records the `onnx` pathand `calibration` path (when set).diff --git a/docs/hooks/errors.md b/docs/hooks/errors.mdindex 4782077c..b23f5e1b 100644--- a/docs/hooks/errors.md+++ b/docs/hooks/errors.md@@ -146,7 +146,7 @@ One honest caveat: Python cannot interrupt a thread, so a timed-out hook keeps rbackground. The timeout bounds how long the request waits, not how long the hook lives. Use it tokeep a served request responsive, not to reclaim the work. For a hook that can hang, also give theunderlying call its own timeout (a socket or HTTP timeout). Because the thread cannot be-reclaimed, a hook that hangs on every call grows threads one per call; give a hook that can hang+reclaimed, a hook that hangs on every call grows one thread per call; give a hook that can hangits own bound rather than relying on `hooks_timeout` to stop it.For an async hook, the coroutine runs on the event loop; a timeout on the calling side stilldiff --git a/docs/hooks/lifecycle.md b/docs/hooks/lifecycle.mdindex a4a11287..293ca650 100644--- a/docs/hooks/lifecycle.md+++ b/docs/hooks/lifecycle.md@@ -142,7 +142,7 @@ Key points:- Every start hook of a checkpoint's requests runs before any of their end hooks, because theyshare forward passes. A cache that fills in `on_predict_end` therefore cannot serve a duplicatestate within the same checkpoint group; it can across calls.-- For the same reason the requests end in reverse of the order they started, so a hook that sets+- For the same reason the requests end in the reverse of the order they started, so a hook that setssomething in start and resets it in end (a `contextvars` value, an OpenTelemetry`context.attach` / `detach`) unwinds to the value it found.- A start hook that replaces `ctx.states`, `ctx.questions` or the token budget changes its owndiff --git a/docs/hooks/patterns.md b/docs/hooks/patterns.mdindex d04074c7..77a0700f 100644--- a/docs/hooks/patterns.md+++ b/docs/hooks/patterns.md@@ -281,7 +281,7 @@ or quietly makes the call worse:* A start hook's `ctx.head_max_len` *replaces* the budget for the call. What is in force before itis the caller's own per-call value, or the checkpoint default in `ctx.agent.cfg` -- so compare- against that, and writing a plain number can lower the budget a caller already set.+ against that: writing a plain number can lower the budget a caller already set.* One call answers every question it carries, so size on the widest of them rather than onwhichever happens to come first.* Once the options no longer fit the head, `laya/common.py` gives each of themdiff --git a/docs/security.md b/docs/security.mdindex 43003f96..157bcb41 100644--- a/docs/security.md+++ b/docs/security.md@@ -173,9 +173,6 @@ docker compose -f compose.yaml -f compose.http.yaml up laya-serveThere is no `_FILE` variant of this variable: that indirection exists for secrets, and a digest mapis not one.-An unset or empty variable means no verification, so this is safe to leave out of environments that-do not need it. Malformed JSON raises rather than silently skipping the check.-**Name each checkpoint when a process loads more than one.** The variable takes two shapes, and thevalue types say which:diff --git a/docs/use-cases.md b/docs/use-cases.mdindex fe5c5a76..3757bcb8 100644--- a/docs/use-cases.md+++ b/docs/use-cases.md@@ -90,8 +90,8 @@ def route_request(user_prompt: str):Conversational voice agents (WebRTC, telephony) operate under strict turn-taking constraints: delays indetecting when a user speaks or interrupts create unnatural conversational dead air. Waiting for a full-generative model to produce its first token introduces avoidable lag when the caller simply acknowledged or-interrupted.+generative model to produce its first token introduces avoidable lag when the caller simply acknowledges or+interrupts.Laya can be placed directly after Speech-to-Text (STT) transcription to classify conversational flow anduser intent in a single forward pass: triggering quick filler audio or halting audio playback immediately