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
laya-setup
LeonardoBrum0907
Runs Laya locally as a perception layer for the Ultron system
n8n-nodes-ollaya
cogniwork-fr
An n8n node that routes workflow items using typed decisions from Ollaya or TypeSafe AI
sentrygate
mnjkshrm
A local Node.js guard that uses Laya to detect prompt injections and redact PII
@alisio/plugin-laya
gustavogutierrez
An Alisio plugin that runs local Laya models for select, boolean and ordinal decisions
sudoku-laya-ai
KrisnaSantosa15
A browser-based Sudoku game uses Laya to recommend number placements
snake-laya-ai
KrisnaSantosa15
A browser-based Snake game uses Laya to choose safe directions in real time
HeXA-laya-demo
queso-gato1355
A local dashboard demonstrates Laya decisions for an autonomous delivery robot scenario
@reflex-control/provider-local
GitHub Actions
Routes inference requests to local servers backed by RDM or Laya checkpoints
@blackbelt-technology/pi-dashboard-system-one-plugin
robertcsakany
Adds dashboard controls and managed local servers for System 1 decision models, including Laya
trace-sec
vk.amogh
Security checks for coding agents with SecureBERT and a fine-tuned Laya ONNX router
pybullet-yolo-laya-sorter
cf2018
Uses Laya to direct a simulated robot arm sorting colored cups
system1-prompt-lab
msmidhunms
Evaluates and compares Laya and other System 1 classifiers with datasets and prompt optimization
sintonia
Chere3
Filters YouTube recommendations using time-based profiles and Jev or Laya classification
laya-superfast
LazyHuman
Serves Laya decisions through an MCP bridge and browser automation relay
laya-vs-jev
jupiutrera
Compares Laya and Jev confidence calibration on typed decisions using a pixel-art visualization
laya-jev-full-example
sharath-mohan
Provides a TypeScript example integrating Laya and Jev
pi-laya-auto-classifier
finngreig
Adds a Laya-powered local classification gate for tool calls in the Pi coding agent
tetromino
tomayac
A browser tetromino game uses the Decisions API with selectable Laya and open-jev backends
jev-websearch-eval
anweat
An offline web-search evidence evaluation compares hosted Jev with local Laya and a rule baseline
pi-knowledge-triage-compactor
sebastianosrt
Compacts Pi agent knowledge and retrieves archived sessions using a local Laya classifier
laya-demo
foxnukem
Runs a Tower Bloxx browser agent that uses Laya to decide when to drop blocks
pi-laya-firewall
r1cc4rd0m4zz4
Adds local Laya-powered policy checks and taint tracking to the Pi Coding Agent
laya-vs-reranker-benchmark
gowthxm07
Benchmarks Laya relevance filtering against cross-encoder reranking in RAG workflows
legal-ia-meetings
anzaja72
Creates meeting minutes for Colombian lawyers and uses Laya to suggest speaker roles from transcripts
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