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

0·GitHub repo

dk-tech-lead-scanner

pthaodotcom

Scans Facebook group posts and uses Laya for classification, Qwen for comments, and Chrome automation for posting

0·GitHub repo

laya-interp

bruce249

Deploys Ollaya serving Laya on an Azure CPU VM with an SSH-tunneled Streamlit interface

0·GitHub repo

laya-laravel-playground

EarthlingOllie

Provides a Laravel playground for trying the laya-php SDK with a local Laya model server

0·GitHub repo

decision.js

Jacqkues

Runs d1, d3-lite and Laya decision models in the browser with WebGPU

0·GitHub repo

ducktape-laya

adrian729

Embeds local Laya GGUF inference through C++, Rust, Node.js and experimental browser bindings

0·GitHub repo

Decision

l0d0v1c

Runs a French decision oracle locally in the browser using a quantized ONNX Laya model

0·GitHub repo

sky-team-ai-laya

wardraq

Implements a multiplayer Sky Team game with an optional Laya-powered AI player

0·GitHub repo

orphusbot

kelvincushman

Provides self-hosted task bots that use Laya for routing and checking risky actions

0·GitHub repo

landing-car

fl0wo

Compares typed-decision models by using their flight-control decisions to land a simulated car

0·GitHub repo

laya-browser-agent

Sreenuraj

Automates web tasks locally using Laya MLX and Playwright tools

0·GitHub repo

risk-detection-with-laya

aatifahmad123

Analyzes banking-call transcripts with Laya-based structured fraud-risk decisions

0·GitHub repo

laya-dealership-lead-triage

Rafash-Wiz

Classifies dealership leads with Laya and routes them to sales actions

0·GitHub repo

arcade-decision-agent

fuleinist

Uses local Laya decisions to play browser arcade games, with Jev and OpenAI models supervising

0·GitHub repo

laya-vega-benchmark

shadowmkj

Benchmarks Laya and Vega playing Chrome Dino under real-time latency constraints

0·GitHub repo

laya-heart

sykyyds3739

A local-first couple-chat copilot uses Laya for message questions and Gemma to draft replies

0·GitHub repo

laya-flow-builder

myrest

A visual decision-tree editor and HTTP API run multilingual Laya ONNX models

0·GitHub repo
A

laya-bangla-playground

algolyzer

Runs Bangla and Banglish Laya decisions locally in a browser

0·HF Space

laya-pokesurvivor

garykhfung

Uses a local Laya checkpoint to control a browser-based PokéSurvivor game on Apple Silicon

0·GitHub repo

laya-agent

manishsharma004

Uses Laya to choose actions for a browser-control agent

0·GitHub repo

LayaMed

csbl-usp

Teaches how to build a live clinical-probability demo using a fine-tuned Laya model

0·GitHub repo

Laya-Trader

johnpg82

Adds browser-based Laya trade signals and personalized entry and exit suggestions to TradingView charts

0·GitHub repo

CharacterStage

Kagenou-Eta

Adds character sprites to SillyTavern chats and uses Laya to select their expressions

0·GitHub repo

JevLayaDecisionModelTest

hiren-patel-slalom

Provides a local browser playground for interactive Laya decision predictions

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