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

D

laya-onnx

desplega

Exports three Laya decision checkpoints to ONNX for use from Node or Bun

2·HF model

jeffrey

thomasbrueggemann

A coding-agent CLI uses Jev or Laya to choose tools while a configurable LLM executes them

2·GitHub repo

laya-sdk

ryuzcorp

Provides a TypeScript SDK for running cached Laya decision models locally in browsers and Node

2·GitHub repo

laya-portable

MatteoGauthier

Exports Laya to ONNX and provides JavaScript runtimes for Node.js and browser inference

2·GitHub repo

chatassistant-laya

HarrisXiu

Analyzes pasted chat messages locally with Laya and can generate optional reply suggestions

2·GitHub repo

laya-search

giaphutran12

Searches YC companies using local Laya inference or the TypeSafe Jev API

2·GitHub repo

pi-pignon

siiick

A Pi coding-agent extension routes prompts by difficulty using local Laya or hosted Jev

2·GitHub repo

openpave-jev

cnrai

Provides typed-decision commands for PAVE and Claude with local Laya and hosted Jev providers

2·GitHub repo

design-os-generative-ui

jangtrinh

Builds a generative UI engine using local Laya-MLX decisions and a TypeSafe JEV cascade router

2·GitHub repo

Routapse

pooyaphoenix

Routes prompts to models or specialist agents using Laya or Jev classification

2·GitHub repo
S

laya-multilingual-onnx-int8

Sharjeelbaig

Provides an INT8 ONNX quantization of Laya multilingual for CPU inference in JavaScript and TypeScript

1·HF model
A

daylens-laya-onnx

aaronalexS

Provides an ONNX conversion of Laya for local activity labeling in the Daylens desktop app

1·HF model
D

laya-onnx

duration465

Exports Laya’s multilingual checkpoint to ONNX for use with the @receptron/laya Node.js package

1·HF model
J

laya-ra2-v33

jayzou3773

Fine-tunes Laya to score candidate actions in Red Alert 2 matches

1·HF model

laya-jev

KonghaYao

Runs local Laya inference and exposes Jev-compatible HTTP endpoints

1·GitHub repo

decision-model-playground

tedliou

A local web playground comparing Laya and Jev for recommending articles

1·GitHub repo

laya-mcp

andragon3110

Provides MCP tools for coding-agent judgments using local decision models, including Laya

1·GitHub repo

omp-laya

KiidxAtlas

Adds local Laya decision policies and verification controls to Oh My Pi

1·GitHub repo

laya-jev-arena

dante01yoon

Compares local Laya and hosted Jev models in games and measurement tools

1·GitHub repo

stuntdouble

ReallyArtificial

Proxies Jev requests to local decision models and compares their answers on recorded traffic

1·GitHub repo

decision-infra

hufaei

Routes typed-decision requests to hosted Jev or local Reflex, SemIf, and Laya models

1·GitHub repo

system-one-playground

minkhant1996

Provides a local web playground for Laya and other System One decision models

1·GitHub repo

building-with-laya-skill

MIt9

An agent skill teaches developers to build typed-decision programs with Laya and laya-cli

1·GitHub repo

agent-decision-firewall

chinna250801

Gates AI agent actions with a local Laya decision model and fail-closed rules

1·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