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.

361 projects

laya-local-serve

yyong-brs

Runs Laya locally with Python, TypeScript, and integrations for serving and decision workflows

0·GitHub repo

jev-laya-form-builder

slamer59

Builds forms by letting hosted Jev or local Laya choose suitable input components

0·GitHub repo

photo-decision-studio

nsdkoo

Compares local Laya and DeepSeek on photo classification using image descriptions

0·GitHub repo

triage-incident

mumit

A synthetic network-incident benchmark evaluates Laya alongside Jev, Kev and other models

0·GitHub repo

decide.js

asertyui1

Provides a typed SDK and CLI for routing decisions across Jev, Laya, local models, and offline heuristics

0·GitHub repo

RayCodes_Mica_4B

47thtechcorner

Compares Mica and Laya decision models in a real-time Pac-Man evasion game

0·GitHub repo

laya-studio

ewrogers

Provides a local web workspace and Jev-compatible API for trying Laya decisions

0·GitHub repo

Laya-Playground

Johnell-Empuerto

A website for testing Laya's typed decisions with editable state and questions

0·GitHub repo
M

laya-demo

medhurgham

Provides a static interactive front end for Laya inference hosted on the model authors' Space

0·HF Space
D

laya-snake

deepondas

Runs the Laya decision model as it plays Snake in a live 3D game

0·HF Space
L

laya-scam-detector

LiChace

Detects Chinese and English scam messages with a fine-tuned Laya model in the browser

0·HF Space

laya-browser-guard

pateti-hub

A privacy-first browser extension analyzes website security using optional local Laya ONNX decisions

0·GitHub repo

Laya_try

kameusagiyahoo

Tests Laya in browsers and on iPhone, including ONNX inference and a runnable Google ADK workflow

0·GitHub repo

test-laya

tom-scott-dev

Runs a 2D town game where NPC behavior is driven by local Laya decisions

0·GitHub repo

laya-studio

eformat

Provides a local web workbench for exploring Laya checkpoints, decisions, and routing

0·GitHub repo

laya-system-one-client

kyawzawwin88

Chrome extension for sending Laya decision requests and viewing typed responses

0·GitHub repo

laya-voice-browser

mo-tunn

Controls Chromium by voice using a local Laya model and Playwright

0·GitHub repo

laya-coreml-hello-world

tuk-solita

A local web page demonstrates Laya choice, score, and yes/no predictions using a Core ML model

0·GitHub repo

Jev_vs_Laya_decision_games

minanayernia

Game-theory experiments compare Jev and Laya across six games with analysis and a browser app

0·GitHub repo

linkedin-bullshit-o-meter

PhunkyBob

A browser extension that classifies LinkedIn posts using Jev or a local Laya server

0·GitHub repo

laya-webgpu

game-design-projects

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

0·GitHub repo
S

Simul

Demo

A civilisation simulator where people and governments decide with Laya in the browser

0·Demo

chatbot-ai-company-python

special-snowflake

Ports a knowledge-base chatbot to Python and replaces its Jev model with Laya decision routing

0·GitHub repo

laya-tetris

Hiohk

A browser-based Tetris game uses Laya to choose and explain piece placements

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