receptron/laya

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

What it solves

Laya is a "System 1" decision model designed for fast, single-pass classification and scoring. Unlike traditional LLMs that generate text, Laya focuses on providing calibrated probabilities for specific types of questions: picking a choice, assigning a score on a rubric, or determining the probability of a yes/no statement.

How it works

The project provides a Node.js/TypeScript wrapper for the Laya model, allowing it to run locally via ONNX Runtime. This removes the dependency on PyTorch and Python at runtime. The model processes a state (such as a ticket or email) and a set of typed questions in a single forward pass, returning calibrated probabilities for each answer.

Who it’s for

Developers using Node.js or TypeScript who need to integrate fast, calibrated decision-making capabilities into their applications without the need for a full text-generation LLM.

Highlights

  • Single-pass decisions: Returns answers to multiple questions in one forward pass.
  • Calibrated probabilities: Provides precise probability distributions for choices, scores, and yes/no statements.
  • ONNX Runtime integration: Runs in Node.js/TypeScript without requiring Python or PyTorch.
  • High performance: A single call with three questions can take approximately 140ms on Apple-silicon CPUs.
  • Customizable: Supports loading local ONNX bundles or specific Hugging Face checkpoints.

Related

  • Project
  • Project
  • Project
  • Project