Use Laya from Node.js

You can run Laya inside a Node.js process with ONNX Runtime, or keep the model in a separate server and call it over HTTP. Both routes use the same state-plus-typed-questions request shape as the Python package and the Jev API.

378 projects

playwright-system1-triage

kint4

Classifies Playwright failures and benchmarks calibrated CI decisions using local Laya and the Jev API

0·GitHub repo

petsona-catalogue-ai

jeromtom

Classifies pet products using evidence-backed typed decision models, including Laya

0·GitHub repo

runlaya

Khip01

Serves Laya ONNX models through an API for choice, score, and yes-or-no predictions

0·GitHub repo

laya-test

ALYREZA

Classifies SMS messages for spam, phishing, credentials requests, category, and risk using local Laya inference

0·GitHub repo

home-router

cloudeeo

Routes home-assistant requests locally using Laya before running commands, search, or chat

0·GitHub repo

NapQuest

adkbbx

Runs a 2D woodland sandbox game with local Laya AI

0·GitHub repo

question-triage-laya

Thaw-Zin-Myo-Aung

Classifies student questions with Laya and routes them to the appropriate learning-assistant workflow

0·GitHub repo
G

alvaress

GitHub Actions

Installs an OpenCode agent harness that makes local decisions with Laya and validates code changes

0·npm package
E

semanticabook

eduardorrs

Converts PDFs to EPUB and Markdown, using optional local Laya classification to recover document structure

0·npm package

trend-agent-webapp

Lucas-0911

Scores media trends with Jev or local Laya-MLX and feeds the results into an analysis workflow

0·GitHub repo

laya-gpt

stevenke1981

Uses a local Laya model to select reasoning effort for GPT and resume prematurely ended turns

0·GitHub repo
S

@opentask/taskin-difficulty-estimator

sidartaveloso

Estimates task difficulty with Jev and Laya, then benchmarks their scores against human ratings

0·npm package

Router-LM-Studio

BouchezMarc

Routes prompts to locally hosted LM Studio models based on intent classified by Laya

0·GitHub repo

laya-notes

itsdula

Tags local Markdown notes by running the Laya ONNX model on the user's computer

0·GitHub repo

layaForWeb

realizer-1966

Runs a quantized Laya decision model in the browser with ONNX Runtime Web

0·GitHub repo
R

systemone-judge

ridlo543

Provides an MCP server, CLI runner, and TypeScript SDK for Laya, Jev, and OpenAI-compatible models

0·npm package

nothing-to-lose

p3bri4n

Simulates a zombie invasion where Laya drives zombie decisions and a local LLM guides survivors

0·GitHub repo

analog

nkurunziza-saddy

Streams Solana payments at a rate determined by AI judges using hosted Laya or Jev

0·GitHub repo

In-process: @receptron/laya

@receptron/laya runs the model with ONNX Runtime, so neither Python nor PyTorch is needed at runtime. It requires Node.js 20 or newer.

npm install @receptron/laya
import { Laya } from "@receptron/laya";

const laya = await Laya.load();

const result = await laya.systemOne(
  { subject: "Refund not received", body: "I cancelled two weeks ago and still have no refund..." },
  {
    department: {
      type: "choice",
      instructions: "Which team should handle this ticket?",
      criteria: { billing: "payments, refunds, invoices", support: "product help and bugs", sales: "new purchases" },
    },
    churn_risk: { type: "noul", instructions: "Is the customer likely to cancel or dispute?" },
  },
);

result.answers.department.choice; // "billing"
await laya.close();

Per its README, the fp32 ONNX weights are about 1.7 GB and download on first use. Budget roughly 2 GB of RAM. A three-question call takes about 140 ms on an Apple Silicon CPU once warm, and the output matches the Python implementation to four decimal places. The package is MIT-licensed; the weights are Apache 2.0.

Over HTTP: laya-studio

laya-studio is a zero-dependency TypeScript client for a running Laya server (Node.js 18.17+):

npm install laya-studio
pip install "laya[serve]"
laya-serve                          # binds 0.0.0.0:8000

Other JavaScript projects

  • @r4ai/laya-web: ONNX Runtime Web runtime for browsers and Node.js.
  • kevala: a Rust engine compiled to WebAssembly with WebGPU kernels, installable from npm.
  • gg-friggin-ez: a profanity and toxicity screener that defaults to Jev and can point at a local Laya endpoint.

Caveats

The English checkpoint's options must fit a 192-token budget and the state is cut at 512 tokens. The receptron README recommends fewer than about 20 options per choice question.

More ways to use Laya