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.
362 projects
laya-snake-benchmark
IYIcode
Benchmarks Laya on Snake gameplay with recorded results and browser-based reruns
omnifast-browser
abdulaaly
Runs a browser agent with pluggable Jev and Laya decision engines
laya
csr9497
A browser interface for designing and evaluating semantic decisions with the Laya library
layaForMemory
vishalmysore
A browser-based agent memory layer that uses Laya to assess whether stored facts remain valid
layastudio
Lu-cong-1
Provides a local visual workbench for testing, evaluating, and serving Laya decision models
jobs-laya
adilsonmenechini
Collects job listings and classifies their fit to a professional profile using Laya
laya-webgpu
TakedaShinken
Runs Laya typed-decision models in browsers with WebGPU and ONNX Runtime Web
laya-btc-decision-console
avtandilkasparov-debug
Measures Laya decision latency and compares paper-trading strategies in a local dashboard
kev-and-laya-experiment
HendrikPetertje
Provides web experiments for testing choice and scoring decisions with Laya or a compatible backend
phobos
watanabe3tipapa
Introduces the Laya decision model with a browser playground and UI design guide
laya
mpjivdc
Provides a multilingual, non-autoregressive model for typed text decisions with Python and TypeScript interfaces
laya-browser
vikrambalaaj
Uses Laya with Playwright to select browser elements for goal-directed actions
laya-react
dungdq4
Implements a React demo of Laya's typed decision patterns for routing, filtering, and moderation
laya_playground
git-Ktu
Provides a local web playground and API server for testing Laya classifications, scores, and yes-or-no decisions
laya-cycle-dashboard
gchat137
Displays replayable simulation results from Laya decision-model game runs
laya-how-to
machinelearning2014
Teaches Laya's Python API and documents its typed-decision features
gatekeeper
weeklyvillain
A word game and interactive explainer uses Laya multilingual as its AI guard
laya-benchmark
LokenSI
Benchmarks local decision models and Jev against Laya on English and Norwegian tasks
laya-playground
lowaa
Provides evaluation scripts and a local web playground for a running Laya server
LAIA
HackathonYeti
A multilingual desktop app transcribes consultations locally and uses Laya for health decision support
Tone-Checker
AkmalDV
A local Laya-powered backend and dashboard evaluate custom conversation cases
desert-ant-video-pipeline
Shubin123
Processes video on-device with optional Laya failover for clip selection
LAYA
Waqar-ahmedkhan
Offers four browser games powered by local CPU inference with the Laya decision model
visual-laya
ring-experimental
Uses fine-tuned Laya to judge player-written dialogue in a Korean visual novel
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