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.

141 projects

laya-dino

JakkNaj

A fine-tuned Laya model plays Chrome Dino using a Python backend and TypeScript frontend

0·GitHub repo

laya-review

x007007007

Provides local-first code review using Laya decision rules through ONNX Runtime

0·GitHub repo

laya-serve

ouijan

Serves Laya decisions over HTTP with a typed TypeScript client

0·GitHub repo

agentify-laya

hongyaok

Serves local Laya classifications through an OpenAI-shaped HTTP API and usage dashboard

0·GitHub repo

TestLaya

sandeep-m-patil

Tests Laya's decision-making model on problem-solving tasks

0·GitHub repo

laya-quiz

Aryamanironman

Uses Laya to adapt trivia categories and difficulty to each player's performance

0·GitHub repo

laya-todo

firede

Classifies to-do items locally with Laya and compares its predictions with an optional Kev backend

0·GitHub repo

keemsisi-laya-js

keemsisi

Provides JavaScript clients and a Node server adapter for Laya typed decisions

0·GitHub repo

keemsisi-tetris-laya

keemsisi

Lets players control Tetris with decisions from the Laya model

0·GitHub repo

laya-answer-router

ramb5144

A Chrome side panel and MCP bridge use local Laya to route page questions to OpenAI models

0·GitHub repo

laya-or-jev-pong

bananadonn

Compares local Laya and hosted Jev decision APIs by having them control paddles in Pong

0·GitHub repo

jev-frontend-lab

dante01yoon

Six frontend demos compare Jev and local Laya decision pipelines with optional LLM refinement

0·GitHub repo

opencode-system-1-router

jonasneustock

An OpenCode plugin routes tasks to cloud models with Jev or local Laya and routes subagents independently

0·GitHub repo

jev-demo

nadeem4

A demo site compares Jev and Laya playing games and includes benchmarks and agent experiments

0·GitHub repo

dsh-decision-engine

LiuRJ99

A JavaScript decision runtime for DeepSeek Harness with Laya as its first provider

0·GitHub repo

laya-s-dungeon

ValchanOficial

A tactical auto-battler that uses Laya through ONNX Runtime to choose actions each turn

0·GitHub repo

system-one-poc

tonysprite

Integrates Laya-based typed decisions into DeepSeek Harness tool approvals and selection

0·GitHub repo

laya_demo

Cokefish9527

Deploys Laya ONNX weights locally on CPU and serves decisions through an HTTP API

0·GitHub repo

LAYA-RLCD

shyamsridhar123

Teaches RLCD and trains Laya pilots through a tactical game, lessons, and benchmarks

0·GitHub repo

laya-node

roryyu

Provides a Node.js SDK for local Laya typed decisions using Transformers.js and ONNX

0·GitHub repo

layaaimodel.com

anderson188

Provides static community documentation for the Laya System-1 decision model

0·GitHub repo

dsh-laya

RestCode72

Adds Laya typed-decision tools and a service to DeepSeek Harness

0·GitHub repo

laya-chrome

korbinjoe

Uses local Laya to perform constrained browser tasks in Chrome

0·GitHub repo

laya-js

johnhenry

Runs Laya typed decisions in JavaScript across MLX, WebGPU and CPU backends

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