receptron/laya

Run Laya, the open-source Jev-compatible System-1 decision model, from Node.js / TypeScript via ONNX Runtime

What it solves

Laya provides a specialized "System 1" decision model that performs classification and scoring tasks without generating free-form text. It is designed for scenarios where you need reliable, calibrated probabilities for specific outcomes—such as routing support tickets, scoring urgency, or detecting churn risk—rather than conversational responses.

How it works

It runs the Laya model locally using ONNX Runtime within a Node.js or TypeScript environment. Instead of a standard LLM generation loop, it processes a given input state (like a JSON object or email body) and a set of typed questions in a single forward pass. It returns structured answers with associated confidence scores, ensuring the output is mathematically consistent with the reference Python implementation.

Who it’s for

Developers building automated decision-making systems or classification pipelines in TypeScript/Node.js who want to avoid the overhead of running Python or PyTorch in production.

Highlights

  • Single-Pass Inference: Processes multiple classification or scoring questions simultaneously in one model pass.
  • Calibrated Probabilities: Provides explicit confidence metrics for every answer, including yes/no (noul), categorical choices, and rubric scores.
  • Zero-Python Runtime: Uses ONNX Runtime to execute the model, eliminating the need for Python dependencies in the production environment.
  • Type-Safe API: Offers a native TypeScript interface that maps directly to the model's decision-making outputs.
  • Optimized Performance: Designed for speed, with a single-batch request typically taking around 140ms on Apple Silicon.

Related

  • Project
  • Dispatch
  • Project
  • Project
  • Dispatch