talira

Run large language models in the browser on WebGPU, with an OpenAI-compatible API

open sourceApache-2.0free

WebLLM is an in-browser inference engine for large language models: the model runs entirely inside the web page, accelerated by WebGPU, with no server. Its MLCEngine follows the OpenAI chat completions API, with streaming, JSON mode and structured generation, logit-level control and seeding, so code written for OpenAI can run open models such as Llama, Phi, Gemma, Mistral and Qwen locally. It runs in web workers, service workers and Chrome extensions, loads custom models compiled in MLC format, and installs from npm as @mlc-ai/web-llm or from a CDN. It is the browser companion of MLC LLM and is Apache-2.0.

Problems it solves

  • run an LLM in the browser so user data never leaves the device
  • add a chatbot to my web app without paying for an inference API
  • use the OpenAI API shape against a local model in JavaScript
  • build a Chrome extension with an on-device language model
  • run a small model offline in a web page with WebGPU

Features

  • runs LLMs fully in the browser with WebGPU acceleration and no server
  • OpenAI-compatible chat completions API with streaming
  • JSON mode and structured generation in WebAssembly
  • prebuilt Llama, Phi, Gemma, Mistral and Qwen models, plus custom MLC-format models
  • web worker, service worker and Chrome extension support
  • install from npm or import from a CDN

Capabilities

Has an APIplan not known
Has official SDKsplan not known

Alternatives

The same job

These do what WebLLM does.

  1. KoboldCpp Run GGUF AI models locally with a KoboldAI UI. One file, zero install.

Compare WebLLM with the top 3