madewithlaya

Catalog / Tools & apps

0050GitHub

@receptron/laya: run Laya from Node.js and TypeScript via ONNX Runtime

npm package that runs Laya with ONNX Runtime, no Python or PyTorch at runtime. Same request shape as TypeSafe's system_one API; output matches Python to four decimals.

~1.7 GB fp32 ONNX weights, budget ~2 GB RAM.

Open source ↗ github.comcostfree, localtime-
receptron/layaREADME ↗
# @receptron/laya

Run **[Laya](https://huggingface.co/convaiinnovations/laya)** — the open-source, Jev-compatible
_System 1 decision model_ by Convai Innovations — from Node.js / TypeScript.

Laya does not generate text. You hand it a state (a ticket, an email, a JSON object) and typed
questions, and it returns every answer with calibrated probabilities in **one forward pass**:

- `choice` — pick one option, with a probability per option
- `score` — an expected level on an ordered rubric, with the distribution
- `noul` — a calibrated P(true) for a yes/no statement

This package runs the model with [ONNX Runtime](https://onnxruntime.ai/); PyTorch and Python are
not needed at runtime. The request/response shape is the same as the Python reference
implementation (`RLAgent.system_one`) and as TypeSafe Jev's `system_one` API, and the output
matches the Python implementation to four decimal places.

## Install

```sh
npm install @receptron/laya
```

Node.js 20 or newer. The ONNX weights (about 1.7 GB, fp32) are downloaded from Hugging Face on first
use and cached under `~/.cache/receptron-laya` (override with `LAYA_CACHE`). Budget roughly 2 GB of
RAM for the loaded model plus a few hundred MB per batch of questions.

## Usage

```ts
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" },
    },
    urgency: {
      type: "score",
      instructions: "How urgent is this ticket?",
      criteria: ["not ur

Also filed under Tools & apps

  1. 0005

    laya-mlx plays Snake at 60 decisions per second

    介绍比Jev快50倍,在你设备上跑的laya-mlx! 只在你的设备上占用最高1G内存 Laya是一个开源的类似于Jev的,基于文本输出概率的分类系统 我将其移植到MLX,并且做了一些性能优化! 视频中就是这个模型在我的本地M3Max上玩贪吃蛇 这个模型能够以每秒决策60次的速度玩贪吃蛇! https://t.co/31KGUiNunb

    @mizorewww · Tools & apps · free, local · 60 decisions/s

  2. 0112

    Laya on Axera AX650 and AX8850 edge NPUs, under 70 ms

    AXERA-TECH's conversion of all three Laya checkpoints for its edge AI chips, reported at latency under 70 ms per decision on AX650/AX8850.

    AXERA-TECH · Tools & apps · free, on-device · < 70 ms on AX650 / AX8850

  3. 0099

    laya-mcp (PerryLink): a warm sidecar that fixes Laya's silent truncation and constant noul

    MCP server plus HTTP sidecar: token-budget preflight that reports what would be cut, a persisted calibration store, structured errors, and a noul fix (P(true) 0.5 → 1.0).

    @PerryLink · Tools & apps · free, local

  4. 0097

    Gomoku against Laya-MLX: you play black, the model picks white's move from six candidates

    Local 15x15 Gomoku on Apple Silicon. Rules in Python, board in the browser, every AI move one real Laya choice over up to six candidates, probabilities shown. No Gomoku training.

    smile-magic · Tools & apps · free, local