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

G

testing-agent

g4rcez

Runs plain-language browser tests using agent-browser and local Laya or Jev decisions

0·npm package
G

agent-tester

g4rcez

Creates and runs YAML or JSON browser tests with agent-browser and Jev or Laya decisions

0·npm package
A

laya-guard-trial

Ayaannnnnnn

Lets users test Laya-based shell-command judgments for an agent safety hook

0·HF Space

Freelancer-Protection-Client-Scanner

MuhammadAsad29

Scans Upwork job posts with Laya to identify risks and display safety indicators

0·GitHub repo

laya-burn

lileeei

Runs and fine-tunes the Laya decision model natively in Rust using the Burn tensor framework

0·GitHub repo

petsona-catalogue-ai

jeromtom

Classifies pet products using evidence-backed typed decision models, including Laya

0·GitHub repo

home-router

cloudeeo

Routes home-assistant requests locally using Laya before running commands, search, or chat

0·GitHub repo

NapQuest

adkbbx

Runs a 2D woodland sandbox game with local Laya AI

0·GitHub repo

laya-weights

SemanticaBook

Hosts quantized ONNX weights for in-browser inference with the multilingual Laya model

0·GitHub repo

laya-gomoku-k3

TechyLX

Runs Laya on a SpacemiT K3 board to power a browser-based Gomoku game

0·GitHub repo

laya-localserver

smellship

Deploys the Laya decision model locally and connects it to UI automation workflows

0·GitHub repo

laya-notes

itsdula

Tags local Markdown notes by running the Laya ONNX model on the user's computer

0·GitHub repo

browser-agents

hiszpan400

Routes browser automation tasks to pluggable agents, including a Laya agent

0·GitHub repo

next-draw

enabled528

Compares lottery-number candidates with a local Laya model in a deployable web application

0·GitHub repo

spot-snake

Gitguy268

A browser-based snake game with an optional AI player powered by Laya through WebGPU

0·GitHub repo
J

laya-service-desk-demo

JuanRetamales

Demonstrates a Laya model adapted to classify and triage Spanish technical-support incidents

0·HF Space

layaForWeb

realizer-1966

Runs a quantized Laya decision model in the browser with ONNX Runtime Web

0·GitHub repo

laya-workflows-ko

realizer-1966

Runs Korean workflow demos in the browser using the multilingual Laya decision model

0·GitHub repo

laya-web-ko

realizer-1966

Runs a quantized Laya decision model in the browser with ONNX Runtime Web

0·GitHub repo

laya-rag-judge-ko

realizer-1966

Runs browser-based RAG claim verification and evaluation with the Laya typed-decision model

0·GitHub repo

layaAgent-ko

realizer-1966

Runs a browser-based agent using Laya for routine decisions and WebLLM when needed

0·GitHub repo

layaForMemory-ko

realizer-1966

Uses Laya typed decisions in a browser-based layer that invalidates stale agent memories

0·GitHub repo

laya-browser-grounding

Who-Code

A study and demo using Laya-MLX to ground browser automation actions on page elements

0·GitHub repo

nothing-to-lose

p3bri4n

Simulates a zombie invasion where Laya drives zombie decisions and a local LLM guides survivors

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