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-vs-jev-traffic

ameeetgaikwad

Compares local Laya and cloud Jev in a real-time traffic-control simulation

0·GitHub repo

von-laya-jev-paint-compare

zhangyunting123

Creates side-by-side paintings from typed decisions by VON, Laya, and Jev

0·GitHub repo

nlaut

benkya

Runs natural-language browser tests with deterministic, vision-model, and Laya-based judgments

0·GitHub repo

jev-course-demo

clchrf

Evaluates university AI course plans in the browser using quantized Laya ONNX inference

0·GitHub repo

cut

harshpreet931

Uses Laya to label and cut unnecessary lines from posts in a browser or local app

0·GitHub repo

xcrystal

dgu0323

Scores cryptocurrency relevance and market signals in X posts with a local Laya server

0·GitHub repo

wizden-moonlander

WizdenOrg

A lunar lander game compares Laya and Jev as typed-decision flight controllers

0·GitHub repo

Laya_local

RickyFer22

A Pong game and experiment using Laya for real-time decisions alongside physics-based prediction

0·GitHub repo

laya-tetris

nickyqqq

A playable Tetris experiment showing Laya's candidate probabilities and decisions in a live dashboard

0·GitHub repo

laya-playground

dharm1287

Provides a FastAPI playground for Laya survey predictions and a Snake game

0·GitHub repo

TrucoLaya

guillermojmontenegro-hub

Runs an Argentine Truco card game with AI players controlled by Laya

0·GitHub repo

laya-ui

bharath-ui1027

Provides a multilingual Laya decision engine with UI components and optional serving integrations

0·GitHub repo

laya-playground

shwetankg07

Three browser games measure Laya’s decisions against exact ground truth

0·GitHub repo

laya-voice-browser

AkshayKulkarni1904

Controls Chromium-based browsers by voice using local Laya decisions on Windows

0·GitHub repo

jev-voice-browser-agent

adnankhan46

Implements a voice-controlled browser agent using Jev or Laya

0·GitHub repo

ChenneyZhuang

ChenneyZhuang

Showcases a fine-tuned Laya browser model and local browser-agent tooling

0·GitHub repo

reflex-engine

chenshuai9101

A Python toolkit collects, calibrates, and automates routine decisions using local Laya

0·GitHub repo
D

dsh-browser-laya

drscrewdriver

A reserved npm package name for a planned browser-action backend using a local Laya sidecar

0·npm package
E

jev-arena

eliot5566

Lets users create text-driven fighting bots piloted by Jev, Laya, or other models

0·npm package
M

laya-web-demo

mizchi

Runs Laya typed decisions in browser games using ONNX Runtime Web and WebGPU

0·HF Space
S

laya-demo

siloh12

Runs a browser demo that calls a Gradio Space to make typed decisions with Laya

0·HF Space
W

laya-demo

wuyouxiaobai

Provides a landing page and deployable Gradio demo for Laya typed decisions

0·HF Space
T

laya-webgpu

ti3x-m

Runs Laya typed-decision checkpoints in the browser using WebGPU or WASM

0·HF Space
T

laya-json-render

ti3x-m

Runs Laya typed decisions locally in the browser to drive validated JSON-render interfaces

0·HF Space

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