Run Laya in the browser

Laya is small enough to run in a browser tab with no server and no API key. The input never leaves the page. The trade-off is a download of several hundred megabytes on the first visit and much slower inference than a native runtime.

171 projects

laya-ultrafast

ipenywis

Runs a browser automation agent using local Laya decisions through MLX

181·GitHub repo

laya-playground

wdobry

A local website combines Laya model demos, games, a benchmark, and an agent skill

157·GitHub repo

laya-pilot

anthonyli

Generates and replays Excel browser tests using Playwright and local Laya decisions

43·GitHub repo

laya-vs-jev-arena

PromptEngineer48

Pits locally run Laya against Jev in Snake and fighting games

30·GitHub repo

layaForWeb

vishalmysore

Runs a quantized ONNX version of the Laya decision model entirely in the browser

18·GitHub repo
C

laya-browser

cklxx

Fine-tunes Laya as a browser-agent decision head for web navigation

13·HF model

open-jev-laya

killkli

Runs Laya multilingual ONNX inference in browser-based decision demos

11·GitHub repo

zlaya

dip-proto

Runs Laya inference locally in Zig, including native and WebAssembly targets

9·GitHub repo

kevala

bvolpato

A Rust WebAssembly engine runs Laya and other decision models locally in browsers

7·GitHub repo

layaForWorkflows

vishalmysore

Runs browser-based Laya decisions to automate branching workflows

6·GitHub repo
S

laya-mind2web-browser-agent

ShaunSpark

Fine-tunes Laya on Mind2Web for browser automation decisions

110·HF model

deqio

ILuce

Serves multiple typed-decision models, including Laya, through a local API and browser UI

5·GitHub repo
M

laya-multilingual-onnx

mizchi

Exports multilingual Laya to ONNX for native and browser WebGPU inference

4·HF model

laya-mlx-voice-browser

aryanbhujade

Uses a local Laya-MLX model to turn spoken commands into browser actions on Mac

4·GitHub repo

laya-pong

aovestdipaperino

Demonstrates Laya-driven paddle decisions in a browser Pong game

3·GitHub repo

laya-web

r4ai

Runs Laya typed-decision models in browsers and Node.js using ONNX Runtime Web

3·GitHub repo

zero-shot-ie-bench

umstek

Compares Laya and other zero-shot systems across information-extraction and classification tasks

3·GitHub repo
I

laya-onnx

inferenceprince

Exports Laya to ONNX for inference with ONNX Runtime on CPUs, GPUs, and browsers

98·HF model

laya-onnx

gqgs

Exports the Laya model to quantized ONNX for browser inference

2·GitHub repo

laya-sdk

ryuzcorp

Provides a TypeScript SDK for running cached Laya decision models locally in browsers and Node

2·GitHub repo

laya-portable

MatteoGauthier

Exports Laya to ONNX and provides JavaScript runtimes for Node.js and browser inference

2·GitHub repo

laya-needle

50bbx

Finds semantically relevant webpage passages with a locally running Laya model

2·GitHub repo
K

open-jev-laya-multilingual-onnx

killkli

A browser-ready ONNX export of Laya multilingual for typed decisions

189·HF model
A

laya-typed-decisions-web-q8

alfred361

Provides a quantized web build of Laya typed-decision models

1·HF model

Libraries

kevala is a zero-dependency Rust engine compiled to WebAssembly, with WebGPU kernels. It works from any page:

<script type="module">
  import { Kevala } from "https://cdn.jsdelivr.net/npm/kevala@latest/js/src/index.js";
  const kevala = await Kevala.load({ model: "laya", onProgress: console.log });
</script>

or pnpm add kevala. According to its README, the Laya int8 pack is 479 MB and is kept in browser storage after the first visit.

@r4ai/laya-web runs ONNX Runtime Web with WebGPU and a WebAssembly SIMD fallback, and is designed to run in a Web Worker:

npm install @r4ai/laya-web onnxruntime-web

Demos you can open

  • layaForWeb: the English checkpoint as quantized ONNX (default build about 440 MB), with a live demo.
  • open-jev-laya: multilingual Laya on Transformers.js (fp16 ONNX about 647 MB) with Gomoku, Big Two and a 3D maze.
  • layaAsRagJudge: checks RAG claims against retrieved evidence entirely in the tab.

Speed and support

The layaForWeb README reports that a three-question call on the default WASM backend took about 2 to 5 seconds on a 2-core machine. In that project, WebGPU works only with the int4 build, because ONNX Runtime's WebGPU MatMulNBits kernel supports 2- and 4-bit weights. open-jev-laya tries WebGPU and falls back to WebAssembly.

Caveats

Quantized browser builds do not match PyTorch exactly. layaForWeb reports 97.9% top-answer agreement for all three of its quantized builds, with the largest probability gaps in int4. For a real-time loop, laya-pong keeps the model native. Its README gives the reason: the checkpoint wants about 2.4 GB resident in f32, and wasm32 has a 4 GB address space and no Metal.

More ways to use Laya