Local decision-model SDK and MCP tool server · Active versioned project with documented release 0.3.21, multiple runtime surfaces, examples, tests, and research harnesses; repository dates in 2026 remain externally unreconciled.

NandhaKishorM/laya

Apache-2.0 multilingual decision-model toolkit that provides Python and TypeScript SDKs, local CLI and HTTP serving, ONNX runtimes, framework integrations, evaluation harnesses, and an optional MCP server for fast typed choice, ordinal-score, and yes/no decisions; no native Claude Code plugin, hook, skill, or Claude-specific installation path is evidenced.

machine learningnatural language processingclassificationdecision routingmultilingual inferenceguardrailscontent moderationsupport automationmodel routingevaluation
Routing score
80.0
Readiness
Usable for evaluation and carefully validated deployments, but shipped calibration, multilingual task quality, option-order sensitivity, and workload-specific accuracy require local testing before automated actions.
License
Apache-2.0
Maintenance
active
Components
20
Revision
0

Selection

Select when

  • You need local fixed-label decisions rather than free-form generation.
  • You can validate and calibrate predictions on representative held-out data.
  • You need choice, ordinal, or yes/no outputs with probability distributions.
  • You need multilingual routing across English and non-English traffic.
  • You need batch inference or local ONNX deployment.
  • You want an MCP-accessible decision service for an agent host.
  • You need schema-shaped decisions limited to enums, booleans, and bounded integers.
  • You need hooks for redaction, caching, auditing, metrics, or routing overrides.
  • You want self-hosted HTTP compatibility with the documented Jev wire format.
  • You need first-party evaluation and robustness diagnostics.

Boundaries

Avoid when

  • You require a turnkey native Claude Code plugin, skill, hook, or marketplace install.
  • You need free-form generation, explanation, or arbitrary structured values.
  • You cannot benchmark accuracy and calibration on your own workload.
  • Your decision is safety-critical or high-impact without human review and independent validation.
  • You need reliable zero-shot behavior for every claimed language or domain.
  • You have insufficient memory, disk, startup time, or compute for the model checkpoints.
  • You need very high-cardinality choices without shortlisting or careful option-budget analysis.
  • You require confidence values that are trustworthy without calibration.
  • You need guaranteed invariance to option order, labels, prompt wording, or document position.
  • You require a supplied Claude Code compatibility matrix or Claude-specific security guidance.

Strengths

Capabilities

Returns typed choice, ordinal-score, and yes/no decisions without autoregressive text generation.Routes English and non-English inputs among three documented checkpoints using script and language heuristics.Supports more than 100 languages through the multilingual checkpoint according to first-party documentation.Exposes prediction, routed prediction, batched prediction, long-document scanning, and schema-driven decision APIs.Provides opt-in abstention through answer-confidence thresholds while retaining raw answers and distributions.Runs as a Python SDK, local command-line application, FastAPI service, NixOS service, or optional MCP server.Publishes direct TypeScript inference through split ONNX models for Node.js and browsers.Provides a separate TypeScript HTTP client for the self-hosted Python service.Integrates with LangChain, LangGraph, LlamaIndex, and CrewAI through optional extras.Supports PyTorch, ONNX Runtime, CPU, CUDA, MPS, XPU, and an optional TileLang GPU fast path.Batches compatible states and can sort by length to reduce padding on supported runtimes.Scans long documents in overlapping windows and reports the deciding window when attribution remains valid.Allows prediction hooks to redact, cache, audit, observe, override routing, skip inference, or rewrite results.Offers built-in schemas for triage, email, guardrails, moderation, and model routing.Supports fine-tuning, calibration-temperature fitting, checkpoint export, and regression evaluation workflows.Provides per-language, calibration, presentation-bias, and metamorphic robustness research harnesses.Can preload, attach, evict, and cap resident checkpoints to control memory and reload behavior.Supports optional bearer authentication and per-checkpoint revision or SHA-256 configuration for serving.Exposes Jev-compatible single and batch HTTP decision endpoints.Includes runnable examples and archived diagnostic datasets with offline audits.

Risk profile

Risks and limitations

  • Uncertainty: only selected first-party files were supplied, so package code, MCP implementation, manifests, dependency locks, CI, security controls, and most tests were not directly inspected.
  • Uncertainty: repository metadata and benchmark records are dated in 2026 relative to this analysis context, so recency, adoption, release state, and reported dependency versions cannot be independently reconciled.
  • Uncertainty: no supplied first-party file names Claude Code or demonstrates its MCP configuration, so Claude compatibility is inferred only from the generic MCP extra and tools.
  • Repository-reported latency, throughput, accuracy, parity, and fine-tuning gains were not independently reproduced.
  • The documentation says both shipped base checkpoints are over-confident, while the multilingual checkpoint has no fitted temperatures.
  • The English checkpoint performs poorly on unsupported scripts while remaining confident, making correct pre-inference routing important.
  • Short Latin-script inputs can lack enough language signal for reliable automatic routing.
  • Document position materially affects long-context accuracy, and long-window aggregation probabilities are not calibrated for whole documents.
  • Choice and score outputs exhibit option-position sensitivity, including a documented multilingual score first-slot bias.
  • Supplied Chinese diagnostics are small and synthetic but show severe failures for some workflows, including confidently constant yes/no behavior.
  • The independent harness could not reproduce most committed multilingual per-language accuracies despite matching files and the English path.
  • High option counts can truncate or collapse option representations, and changing token budgets can also reduce accuracy.
  • Reduced precision, batching shapes, fast kernels, and thresholds can change probabilities or occasionally flip decisions.
  • Model loading can require hundreds of megabytes to more than a gigabyte, and cold builds or compilation can take seconds.
  • The HTTP service binds to all interfaces by default, bearer authentication is optional, and TLS or CORS is delegated to a proxy.
  • No independent security audit, privacy assessment, telemetry statement, or Claude Code compatibility matrix was supplied.

The supplied documentation describes optional bearer authentication for prediction endpoints, configurable checkpoint revisions and SHA-256 maps, request validation and option-count guards, a hardened DynamicUser NixOS service, and hook timeouts or error policy. It also states that the server binds to 0.0.0.0 by default, leaves TLS and CORS to a proxy, and keeps /health public. Hooks can rewrite inputs or outputs, skip inference, and forward data externally, so hook code is trusted. The MCP implementation and its authentication or authorization controls were not supplied. No independent audit or complete threat model was provided.

Component inventory

20 documented components

unclassified

Repository classification

Standalone decision-model library and services; supplied files document no Claude Code plugin, skill, hook, command, or installation path.

README.md
module

Laya Python SDK

Loads checkpoints and makes typed choice, score, and yes/no decisions over text or structured state.

README.md
module

Router

Detects language/script, selects a checkpoint, manages loaded models, and supports routed prediction batches.

README.md
workflow

Structured decisions

Projects JSON Schema or Pydantic object properties into typed Laya questions and schema-shaped results.

docs/structured.md
command

laya CLI

Routes or predicts local decisions interactively, from one input, custom questions, presets, stdin, or batch files.

README.md
command

laya-evals

Validates labelled JSONL, evaluates checkpoints, slices metrics, and fails on configured quality regressions.

research/evals/README.md
service

laya-serve

Self-hosted FastAPI inference service exposing Jev-compatible single and batch System One endpoints.

README.md
service endpoint

System One HTTP API

Accepts typed decision requests and returns model, answers, usage, and optional routing metadata.

sdk/typescript/README.md
MCP tool surface

MCP decision tools

Optional MCP extra exposes documented prediction, routed batch, and structured-decision tools.

README.md
extension API

Prediction hooks

Observes or modifies routing and inference for logging, redaction, caching, metrics, gating, and overrides.

docs/hooks/index.md
module

Built-in presets

Supplies ready-made schemas for triage, email, guardrails, moderation, and model routing.

README.md
integration module

LangChain and LangGraph integration

Provides router, guardrail, and structured-decision runnables with shared synchronous and asynchronous batching.

docs/langchain.md
module

ONNXAgent

Runs exported checkpoints through ONNX Runtime with prediction, batching, long-document, and structured-decision APIs.

README.md
acceleration module

TileLang fast path

Optionally replaces supported CUDA forward operations with fused TileLang kernels and CUDA graphs.

README.md
TypeScript module

laya-ts

Runs Laya inference directly in Node or browsers using split ONNX models, routing, hooks, batching, and structured decisions.

laya-ts/README.md
TypeScript SDK

laya-client

Dependency-free ESM/CommonJS client for a self-hosted laya-serve endpoint, with typed schemas and cancellation.

sdk/typescript/README.md
web application

Local web playground

Two-pane local GUI for editing requests, running predictions, inspecting distributions, and copying curl or Python.

examples/server.py
service module

NixOS laya-serve module

Runs a hardened systemd laya-serve unit with model caching, CUDA access, firewall, and credential options.

README.md
research command

Per-language evaluation harness

Measures MASSIVE intent accuracy, macro-F1, ECE, confidence, and per-case output for selected languages.

research/eval/laya_eval.py
research workflow

Metamorphic robustness harness

Measures option-order and label-renaming stability, probability drift, budget confounding, and selective-prediction signals.

research/eval/metamorphic.py

Technical profile

Requirements and configuration

License
Apache-2.0 repository license; one bundled contributed benchmark directory states a separate MIT license.
Languages
Python is the primary repository language, with TypeScript SDK and ONNX browser or Node support.
Models
Three documented checkpoints: 421M-parameter English, 322M-parameter multilingual, and 421M-parameter typed-decisions.
Decision Types
choice, score, and noul yes/no probability.
Context Windows
English is documented at 512 tokens, while multilingual and typed-decisions are documented at 1,024 tokens with multilingual runtime extension up to 8,192.
Interfaces
Python SDK, local CLI, FastAPI HTTP service, optional MCP server, TypeScript HTTP client, and direct TypeScript ONNX runtime.
Frameworks
LangChain, LangGraph, LlamaIndex, and CrewAI integrations are documented as optional extras.
Serving
Jev-compatible POST /v1/systemone and batch serving are documented, with optional bearer authentication.
Hardware
CPU, CUDA, MPS, XPU, ONNX Runtime, and optional TileLang CUDA acceleration are documented.
Model Source
First use can download checkpoints from Hugging Face, while local checkpoint directories and pinned revisions are supported.
Version Evidence
The README identifies release 0.3.21, but supplied metadata and documents use unreconciled 2026 dates.
Claude Relation
Inference: an MCP-capable Claude Code deployment could consume Laya's generic MCP tools, but no Claude-specific first-party setup is evidenced.

Classification

How it enters the stack

Tool SurfaceExternal Cli LibraryStandalone Application

Evidence: Laya runs as its own Python/TypeScript library, CLI, HTTP service, browser runtime, and optional MCP server. Inference: its generic MCP tools could be connected to Claude Code, but no Claude-specific plugin, skill, hook, or setup is documented; model downloads and runtime selection make setup medium.

Runs Alongside · medium setup effort · medium confidence · automated

Evidence and risk

Primary sources

first_party_fileREADME.mdhttps://github.com/NandhaKishorM/laya/blob/main/README.md
first_party_filelaya-ts/README.mdhttps://github.com/NandhaKishorM/laya/blob/main/laya-ts/README.md
first_party_fileexamples/README.mdhttps://github.com/NandhaKishorM/laya/blob/main/examples/README.md
first_party_fileresearch/README.mdhttps://github.com/NandhaKishorM/laya/blob/main/research/README.md

Routing context

Conflicts, complements, and synergies

No catalog relationships have been documented yet.