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

Helpdesk-Laya-Router

stefanus-ai-tech

Classifies helpdesk tickets with Laya and produces Excel routing and evaluation reports

0·GitHub repo

laya-post-flagger

MishraAnkit10

Classifies LinkedIn posts with a local Laya server and Chrome extension

0·GitHub repo

laya-system-one

italoalmeida0

Provides a local JavaScript Laya decision engine with WebGPU and WASM acceleration

0·GitHub repo

laya-sponsor-skip

Samuel-Ku

Skips YouTube sponsor reads using a local typed-decision model and a Chrome extension

0·GitHub repo

jev-systemone-local

katya4oyu

Plans a local Jev-compatible System One server with MLX, Core ML, and ONNX Laya backends

0·GitHub repo

laya-vs-dgpl-arena

vk-alto-none

Stages AI decision models in a game arena, including local Laya and hosted Jev

0·GitHub repo

simplotel-guest-concierge

Itachi-1824

A hotel guest assistant combines retrieval, Laya classification, and validated availability

0·GitHub repo

usejev

ali-master

Serves Laya through native ONNX inference on Bun with a TypeSafe-compatible API and bilingual playground

0·GitHub repo

ai-second-brain-lab

dante01yoon

Combines an Obsidian knowledge workflow, coding-assistant hooks, local Laya classification, and a 3D Markdown viewer

0·GitHub repo

decision-lab

Amine-LG

Provides a visual playground to build decisions and compare Jev, OpenJEV, and local Laya

0·GitHub repo

fly-brain-agent

shenjie002

Drives a browser-based fruit-fly simulation with Laya decisions and spiking-neuron dynamics

0·GitHub repo

laya

HydriaOne

Serves Laya routing predictions in Docker and includes an offline scenario inspector

0·GitHub repo

layaAgent

vishalmysore

Runs a browser-based agent that uses Laya for routine decisions and WebLLM when needed

0·GitHub repo

classifier-laya

josecruset

A local browser interface for testing Laya-MLX typed-decision models on Apple Silicon

0·GitHub repo

try-laya

lin52025iq

Provides a Laya-first agent runtime with browser and Android control integrations

0·GitHub repo

laya-scraper

qxZap

Uses Laya to find publication pages and extract publication details with a browser-capable crawler

0·GitHub repo

LAYA_DEMO

davidL-zhan

Matches exam questions to knowledge points with local Laya yes-or-no predictions

0·GitHub repo

laya-rex

luiz0ar

A browser dashboard uses Laya decisions to control the T-Rex Runner game

0·GitHub repo

laya-browser

Benny93

Uses a local Laya model to resolve plain-English selectors in browser automation

0·GitHub repo

zabbix-laya

j3udiel

A local web lab evaluates fictional Zabbix alerts with Laya and lets users download test results

0·GitHub repo

jev-laya-tetris

HarryReidx

Benchmarks TypeSafe Jev against local Laya in a competitive Tetris duel

0·GitHub repo

laya-mlx-voxel

yuxino

Builds voxel reliefs by using Laya-MLX to choose extrusion depths from image pixel statistics

0·GitHub repo

laya-rlcd-expedition

HambaliMarcel

Runs local Laya decision inference in a web page for work and sales scenarios

0·GitHub repo

dino-jump

ozbillwang

A browser runner game uses Laya scores to evaluate jump, duck, and run actions

0·GitHub repo

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