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

V

@molecule/api-ai-decisions

vialoh

Defines a provider interface for typed AI decisions, with Laya as a supported backend

0·npm package
B

@banh-dev/laya

banh-kevin

Native Laya ONNX inference package for the Banh workflow CLI

0·npm package

laya-js

desplega-ai

A TypeScript runtime and Hono server load ONNX Laya checkpoints and answer typed decision questions

0·GitHub repo

qa-triage-demo

lucad87

Uses a fine-tuned Laya decision model to triage Playwright failures and guide verified fixes or bug reports

0·GitHub repo

laya-linear-assigner

DamengRandom

Assigns unassigned Linear tickets to engineers using the local Laya decision model

0·GitHub repo

claude-laya

marcellbaan

Routes Claude Code turns among Haiku, Sonnet, and Opus using local Laya decisions

0·GitHub repo

test-laya

tom-scott-dev

Runs a 2D town game where NPC behavior is driven by local Laya decisions

0·GitHub repo

laya-test

supermy

Runs quantized Laya inference locally on Android and Termux using native ONNX Runtime

0·GitHub repo

laya-system-one-client

kyawzawwin88

Chrome extension for sending Laya decision requests and viewing typed responses

0·GitHub repo

laya-voice-browser

mo-tunn

Controls Chromium by voice using a local Laya model and Playwright

0·GitHub repo

citypulse

rohandesilvaa

An offline emergency dispatch game that uses Laya to triage calls

0·GitHub repo

linkedin-bullshit-o-meter

PhunkyBob

A browser extension that classifies LinkedIn posts using Jev or a local Laya server

0·GitHub repo

JevRouter-for-OpenCode

husnain381a

An OpenCode plugin that uses Laya or Jev to route prompts to downstream models

0·GitHub repo

pi-laya

avatsaev

Adds a typed-question Laya tool and configuration command to the pi agent

0·GitHub repo

laya-tetris

Hiohk

A browser-based Tetris game uses Laya to choose and explain piece placements

0·GitHub repo

hybrid-classification-poc

zeachco

Provides a Python classification server with a TypeScript client that downloads and runs Laya

0·GitHub repo

opencode-laya-plugin

PedroZia

Adds a local Laya decision tool to OpenCode for classifications, routing, scoring, and yes/no decisions

0·GitHub repo

sys1-eval

David-DL-Space

Compares Laya and Jev on typed decisions for LLM agent harnesses

0·GitHub repo

systemone-poc

joskr2

Connects Jev and Laya decision models to coding agents for preflight task routing

0·GitHub repo

dsh-auto-review-jev

xlennart

Adds Jev and self-hosted Laya decision API backends to a DeepSeek Harness approval plugin

0·GitHub repo

laya

getlexora-ai

Deploys the open-source Laya decision model as a CPU service with a playground and test set

0·GitHub repo

laya-calibration

BargLabs

Publishes a preregistered calibration experiment evaluating Laya as a judge of agent completion reports

0·GitHub repo

laya-api

polites-co-jp

Provides a signed relay API for Laya endpoints and a development chat client

0·GitHub repo

laya-auto-mode

tuncer-byte

Adds Laya-powered automatic model routing to the GitHub Copilot Chat model picker

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