Skip to content
System One

@receptron/laya

Node.js and TypeScript package that runs the Laya decision model through ONNX Runtime, so JavaScript projects can call it without Python.

receptron/laya on GitHub

Stars
374
Forks
31
Language
TypeScript
License
MIT
Last push
21 Sep 2026

Read from GitHub on . Counts change daily.

Reported by the author

3-question call
~140 msa call with three questions takes about 140 ms on an Apple-silicon CPU once the model is warmgithub.com
Model size
~1.7 GBThe ONNX weights (about 1.7 GB, fp32) are downloaded from Hugging Face on first usegithub.com

@receptron/laya runs Laya, Convai Innovations’ open-source, Jev-compatible decision model, from Node.js and TypeScript without needing Python or PyTorch installed. Laya doesn’t generate text: it takes a state, such as a support ticket or a JSON object, plus typed questions, and returns an answer for each with calibrated probabilities in one forward pass. The three question types match Jev’s: choice picks one option with a probability per option, score gives an expected level on an ordered rubric, and noul returns a calibrated probability that a yes-or-no statement is true.

The package runs the model through ONNX Runtime, and the maintainers say its output matches the Python reference implementation to four decimal places. The ONNX weights, about 1.7 GB in fp32, download from Hugging Face on first use and are cached locally, with a budget of roughly 2 GB of RAM for the loaded model. A call with three questions takes about 140 milliseconds on an Apple-silicon CPU once the model is warm. The repository also includes a script to export a newer or unpublished Hugging Face checkpoint into the same five-file ONNX bundle the package expects.

How it uses Jev

const t0 = performance.now();
const result = await laya.systemOne(state, {
  department: {
    type: "choice",
    instructions: "Which team should handle this ticket?",
    criteria: { billing: "payments, refunds, invoices", support: "product help and bugs", sales: "new purchases and upgrades" },
  },
  urgency: {
    type: "score",
    instructions: "How urgent is this ticket?",
    criteria: ["not urgent", "somewhat urgent", "urgent", "critical"],
  },
  churn_risk: { type: "noul", instructions: "Is the customer likely to cancel or dispute?" },
});
console.log(`${(performance.now() - t0).toFixed(0)} ms`);

View in examples/basic.ts

Open on GitHub

More like this

Keep browsing