This is an early release preview. You may encounter bugs.
WebLLM logo
Unclaimed

Tool inference

WebLLM

In-browser LLM inference engine running open models client-side on WebGPU with an OpenAI-compatible API

A 80/100 GitHub score ? This grade is derived from GitHub signals, not user votes. Open for the full breakdown.
Discussion

01 / Summary

About WebLLM.

WebLLM is an LLM inference engine that runs open models entirely inside a web browser, with no server, using WebGPU for hardware acceleration. Its interface follows the OpenAI chat completions API, so the same calls (streaming, JSON mode, seeding, and preliminary function calling) work against local open-source models, and inference stays on the user's device.

It is a companion project to MLC LLM and reuses its model artifacts and compilation flow. Built-in model families include Llama, Phi, Gemma, Mistral, and Qwen, and custom models compiled to the MLC format can be added. JSON-mode structured generation runs in the WebAssembly part of the model library, and optional Subresource Integrity hashes verify downloaded config, WASM, and tokenizer files before loading.

WebLLM ships as an npm package or through a CDN, and its engine can run in a dedicated Web Worker or a Service Worker to keep heavy computation off the UI thread and manage model lifecycle. It also supports building Chrome extensions, and WebLLM Chat is a full chat application built on it. Downloaded weights are cached in the browser through the Cache API, IndexedDB, the Origin Private File System, or an experimental cross-origin storage extension.

  • In-browser inference: models run client-side with WebGPU acceleration and no server
  • OpenAI-compatible API: chat completions with streaming, JSON mode, seeding, logit-level control, and preliminary function calling
  • Structured JSON generation: JSON mode with custom schemas implemented in WebAssembly
  • Built-in models: Llama, Phi, Gemma, Mistral, and Qwen families
  • Custom models: compile and deploy your own weights in the MLC format
  • Workers: run the engine in a Web Worker or Service Worker
  • Chrome extensions: examples for basic and advanced browser extensions
  • Cache backends: Cache API, IndexedDB, OPFS, or a cross-origin storage extension
  • Integrity verification: SRI hashes checked on model artifacts before loading

02 / Discussion CREDIBILITY-GATED

Discussion

Reading is open to everyone. Posting and voting need a verified identity or a GitHub grade of B or higher.

  • No discussions yet.

04 / Build

Build with WebLLM.

Browse the catalog for frameworks, tools, and harnesses, each scored on real GitHub credibility.

Get WebLLM →

Browse the catalog