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
IIT-Guwahati-Arjun-Verma-Hackathon
who-else-but-arjun
Analyzes financial news and portfolio activity using task-specific models and decision models including Laya
dk-tech-lead-scanner
pthaodotcom
Scans Facebook group posts and uses Laya for classification, Qwen for comments, and Chrome automation for posting
laya-interp
bruce249
Deploys Ollaya serving Laya on an Azure CPU VM with an SSH-tunneled Streamlit interface
laya-laravel-playground
EarthlingOllie
Provides a Laravel playground for trying the laya-php SDK with a local Laya model server
decision.js
Jacqkues
Runs d1, d3-lite and Laya decision models in the browser with WebGPU
ducktape-laya
adrian729
Embeds local Laya GGUF inference through C++, Rust, Node.js and experimental browser bindings
Decision
l0d0v1c
Runs a French decision oracle locally in the browser using a quantized ONNX Laya model
sky-team-ai-laya
wardraq
Implements a multiplayer Sky Team game with an optional Laya-powered AI player
orphusbot
kelvincushman
Provides self-hosted task bots that use Laya for routing and checking risky actions
landing-car
fl0wo
Compares typed-decision models by using their flight-control decisions to land a simulated car
laya-browser-agent
Sreenuraj
Automates web tasks locally using Laya MLX and Playwright tools
risk-detection-with-laya
aatifahmad123
Analyzes banking-call transcripts with Laya-based structured fraud-risk decisions
laya-dealership-lead-triage
Rafash-Wiz
Classifies dealership leads with Laya and routes them to sales actions
arcade-decision-agent
fuleinist
Uses local Laya decisions to play browser arcade games, with Jev and OpenAI models supervising
laya-vega-benchmark
shadowmkj
Benchmarks Laya and Vega playing Chrome Dino under real-time latency constraints
laya-heart
sykyyds3739
A local-first couple-chat copilot uses Laya for message questions and Gemma to draft replies
laya-flow-builder
myrest
A visual decision-tree editor and HTTP API run multilingual Laya ONNX models
laya-bangla-playground
algolyzer
Runs Bangla and Banglish Laya decisions locally in a browser
laya-pokesurvivor
garykhfung
Uses a local Laya checkpoint to control a browser-based PokéSurvivor game on Apple Silicon
laya-agent
manishsharma004
Uses Laya to choose actions for a browser-control agent
LayaMed
csbl-usp
Teaches how to build a live clinical-probability demo using a fine-tuned Laya model
Laya-Trader
johnpg82
Adds browser-based Laya trade signals and personalized entry and exit suggestions to TradingView charts
CharacterStage
Kagenou-Eta
Adds character sprites to SillyTavern chats and uses Laya to select their expressions
JevLayaDecisionModelTest
hiren-patel-slalom
Provides a local browser playground for interactive Laya decision predictions
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