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-flappy-bird
GadhiyaRaj
A Flappy Bird-style game uses Laya to choose real-time flap or coast actions
pol2-laya-studio
shentonyan
A local interactive playground visualizes and evaluates typed decisions from Laya models
e2e-ui-test-laya
spencerlepine
A local browser-use agent uses Laya through MLX to choose actions and verify task completion
Jev
Caho1
A research repository documents Laya fine-tuning, evaluation, local inference and browser automation experiments
jev-frontend-lab
dante01yoon
Six frontend demos compare Jev and local Laya decision pipelines with optional LLM refinement
crisis-triage
mazenDDr
Fine-tunes and evaluates Laya for multilingual disaster-message triage with uncertainty routing
laya-s-dungeon
ValchanOficial
A tactical auto-battler that uses Laya through ONNX Runtime to choose actions each turn
LayaGUIDemo
SaturnAura
Provides a Gradio interface for asking Laya choice, score, and yes-or-no questions about text
LayaBasedAssistant
userasg
Uses Laya to route requests and gate risky actions in a local voice-and-text assistant
pixel
adetbekov
Uses Laya to route robot-pet commands locally and Gemini for unknown requests
LAYA-RLCD
shyamsridhar123
Teaches RLCD and trains Laya pilots through a tactical game, lessons, and benchmarks
laya-triage
AlexLeow99
Provides an offline console for classifying and scoring text with the Laya decision model
layaaimodel.com
anderson188
Provides static community documentation for the Laya System-1 decision model
laya-dino
that-daniel
Controls Chrome's dinosaur game with Laya through a real-browser decision loop
laya-chrome
korbinjoe
Uses local Laya to perform constrained browser tasks in Chrome
laya-js
johnhenry
Runs Laya typed decisions in JavaScript across MLX, WebGPU and CPU backends
poc-laya
MayukhCars24
Measures Laya classification latency with a FastAPI backend, web console, and observability tools
chess-laya
Kpaul-create
Combines Minimax, Laya, and Gemini to play chess through parallel consensus
laya-retrieval
Sharjeelbaig
Selects evidence passages with Laya in an experimental two-stage retrieval system
laya-tetris-ai
Sharjeelbaig
Demonstrates Laya choosing Tetris placements from candidate board evaluations
laya-multilingual-playground
pumpkinfadly
Provides a web playground and API for testing multilingual Laya typed decisions
laya-decision-web
LeeeeeeM
Runs a local browser demo for Laya decisions in Snake and side-scrolling game scenarios
laya-tetris-ai
htpu
Uses local Laya decisions to choose Tetris moves through a Chrome extension or Playwright bot
Jev-vs-Laya
aarush-dhingra
Compares Jev and Laya as chess decision-makers in a local browser arena
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