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

sky-team-ai-laya

wardraq

Implements a multiplayer Sky Team game with an optional Laya-powered AI player

0·GitHub repo

system-one-mcp

es11225599

Exposes typed decisions from System One backends, including Laya, through MCP tools

0·GitHub repo

codex-laya-go-decision

Ling0727-ai

Adds Codex tools for managing a local Laya inference server and making structured decisions

0·GitHub repo

davinci-laya-zcode

Ydjin1984

Integrates a local Laya decision engine into ZCode with risk gates, context ranking, and MCP tools

0·GitHub repo

laya-ai-local-llm

RohaizadMaznan

Routes chat requests with Laya before a local Ollama model generates replies

0·GitHub repo

laya-vega-benchmark

shadowmkj

Benchmarks Laya and Vega playing Chrome Dino under real-time latency constraints

0·GitHub repo

Quantlabs_G-L

rmrodriguezgit

Simulates Polymarket BTC up/down trading using GANs, Q-learning, and Laya MLX audits

0·GitHub repo

laya-triage

CodeCave0000

Adds local Laya-based message triage to the OpenClaw agent plugin

0·GitHub repo

mesa_de_credito_laya

AndrewMak

Orchestrates credit decisions using deterministic rules, a local Laya classifier, an LLM, and human review

0·GitHub repo

laya-heart

sykyyds3739

A local-first couple-chat copilot uses Laya for message questions and Gemma to draft replies

0·GitHub repo

laya-flow-builder

myrest

A visual decision-tree editor and HTTP API run multilingual Laya ONNX models

0·GitHub repo
E

@es11225599/systemone-mcp

es1259

Provides an MCP server for evaluating typed decisions through System One backends, including Laya

0·npm package

WAya

ACKB

A WhatsApp appointment agent uses Laya for intent classification and topic extraction

0·GitHub repo
T

@try-works/extension-laya

try-working

Implements choose, test, and score decisions using a pinned multilingual Laya checkpoint

0·npm package

system1-bridge

johnlam1968

Adds a Laya-backed System 1 provider and decision tool to dsh bundles

0·GitHub repo

layaprototype

Joscart

Provides a Spanish-language business credit approval prototype using the Laya Router

0·GitHub repo

CharacterStage

Kagenou-Eta

Adds character sprites to SillyTavern chats and uses Laya to select their expressions

0·GitHub repo

JevLayaDecisionModelTest

hiren-patel-slalom

Provides a local browser playground for interactive Laya decision predictions

0·GitHub repo

Laya_UI

AscendesShady

A local Electron app for using Laya decision checkpoints through Ollama

0·GitHub repo

dsh-laya-mcp-skill-router

royalallen

Routes tools and agent skills using Laya decisions and local embedding-based recall

0·GitHub repo
G

testing-agent

g4rcez

Runs plain-language browser tests using agent-browser and local Laya or Jev decisions

0·npm package
G

agent-tester

g4rcez

Creates and runs YAML or JSON browser tests with agent-browser and Jev or Laya decisions

0·npm package

pocketpacts

victorchimakanu

Reviews conversations for commitments and follow-ups using the local Laya model through QVAC SDK

0·GitHub repo

kestrel-mail

albendsouza

Sorts Gmail with an on-device Laya model fine-tuned for email

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