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

N

decisionlint

nolindnaidoo

Lints Jev and Luna decision-model questions in CI, editors, and an MCP server

305·npm package
I

pi-laya-guardrails

izolight

A Pi extension sends prompts and tool calls to a local Laya guardrail server

282·npm package
N

@scruple/provider-laya

nalexpear

A local Laya decision provider for the Scruple framework

252·npm package
J

opencode-jev-compaction

jlegends

Two OpenCode plugins prune stale tool calls and optionally refine decisions with local Laya

250·npm package
G

@gobing-ai/ts-laya-mlx

GitHub Actions

A TypeScript package connects applications to a local Laya decision backend through MLX

239·npm package
I

pi-laya-model-router

izolight

Routes Pi sessions to mapped models using task classifications from a local Laya server

145·npm package
D

modsure

davespace

Moderates user-written content against site rules using Jev or a loaded Laya client

129·npm package
L

reflex-hooks-oss

lia210350

A Node provider runs the Laya decision model locally through ONNX for reflex-hooks

116·npm package
K

@banh/laya

kevin-banh

Adds native Laya inference support to Bánh

70·npm package
J

janderscience-skills

janderson1719

Provides a corporate agentic workforce of specialized skills with a Jev/Laya decision engine

0·npm package

chakravyuha-oss

kspviswa

A browser maze game uses a locally hosted Laya model to choose each move

0·GitHub repo

Laya-vs-Jev

abcdmku

A side-by-side test bench compares the local Laya model with the hosted Jev API

0·GitHub repo

local-laya

binbandit

Runs Laya-MLX locally with an HTTP API and a TypeScript client

0·GitHub repo

system-one

lukeramsden

A TypeScript client provides typed-decision APIs for Jev, Cloudflare AI Gateway, and Laya

0·GitHub repo

laya-bot-det

koteitan

Classifies Nostr authors as bots with Laya running in the browser

0·GitHub repo

laya-demo

tjpajala

Benchmarks Laya and Open-Jev on JevBench and PubMedQA with a Dockerized comparison interface

0·GitHub repo

dsh-laya-router

ricardochen1996

Routes agent requests using a local Laya-MLX typed-decision model

0·GitHub repo

sag-laya-integration

DATN-SPRING2027

Integrates a local Laya router into the SAG application for question classification

0·GitHub repo

laya-mcp-npm

PerryLink

Launches a Python MCP server that exposes Laya typed decisions to Node.js clients

0·GitHub repo

laya-claude-plugin

noorforeverone

Provides a Claude Code plugin with local Laya decision tools and an MCP server

0·GitHub repo

laya-demo-web

sriramkasyap

Provides a browser playground for sending decision requests to a self-hosted Laya API

0·GitHub repo

opencode-memory

pedroteste00000008-stack

Adds long-term memory to OpenCode using Laya decisions, embeddings, reranking, and a local vector store

0·GitHub repo

omp-marketplace

F0Rextasy

Lists a local System-1 judge plugin for the oh-my-pi marketplace

0·GitHub repo

IOCArena

hc-nolan

Compares Jev, Von, and Laya decision models on VirusTotal data

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