+2
Daily
19,379
stars
1,412
forks
137
watchers
441
prs
449
issues
8
releases
README
WebLLM High-Performance In-Browser LLM Inference Engine. Documentation | Blogpost | Paper | Examples Overview WebLLM is a high-performance in-browser LLM inference engine that brings language model inference directly onto web browsers with hardware acceleration. Everything runs inside the browser with no server support and is accelerated with WebGPU. WebLLM is fully compatible with OpenAI API. That is, you can use the same OpenAI API on any open source models locally, with functionalities including streaming, JSON-mode, function-calling (WIP), etc. We can bring a lot of fun opportunities to build AI assistants for everyone and enable privacy while enjoying GPU acceleration. You can use WebLLM as a base npm package and build your own web application on top of it by following the examples below. This project is a companion project of MLC LLM, which enables universal deployment of LLM across hardware environments. Check out WebLLM Chat to try it out! Key Features - In-Browser Inference: WebLLM is a high-performance, in-browser language model inference engine that leverages WebGPU for hardware acceleration, enabling powerful LLM operations directly within web browsers without server-side processing. - Full OpenAI API Compatibility: Seamlessly integrate your app with WebLLM using OpenAI API with functionalities such as streaming, JSON-mode, logit-level control, seeding, and more. - Structured JSON Generation: WebLLM supports state-of-the-art JSON mode structured generation, implemented in the WebAssembly portion of the model library for optimal performance. Check WebLLM JSON Playground on HuggingFace to try generating JSON output with custom JSON schema. - Extensive Model Support: WebLLM natively supports a range of models including Llama 3, Phi 3, Gemma, Mistral, Qwen(通义千问), and many others, making it versatile for various AI tasks. For the complete supported model list, check MLC Models. - Custom Model Integration: Easily integrate and deploy custom models in MLC format, allowing you to adapt WebLLM to specific needs and scenarios, enhancing flexibility in model deployment. - Plug-and-Play Integration: Easily integrate WebLLM into your projects using package managers like NPM and Yarn, or directly via CDN, complete with comprehensive examples and a modular design for connecting with UI components. - Streaming & Real-Time Interactions: Supports streaming chat completions, allowing real-time output generation which enhances interactive applications like chatbots and virtual assistants. - Web Worker & Service Worker Support: Optimize UI performance and manage the lifecycle of models efficiently by offloading computations to separate worker threads or service workers. - Chrome Extension Support: Extend the functionality of web browsers through custom Chrome extensions using WebLLM, with examples available for building both basic and advanced extensions. Built-in Models Check the complete list of available models on MLC
Top issues
#553Use subgroup operations when possible23 comments · 2024-08-20#524Gemma 2 2B crashes on mobile phone16 comments · 2024-08-04#810[Model Request] Gemma 412 comments · 2026-04-03#609WebLLM always processes on Intel UHD Graphics, not on NVIDIA T120011 comments · 2024-10-10#519Phi 3 Mini output near random (Phi-3-mini-4k-instruct-q4f16_1-MLC)11 comments · 2024-07-28#319GPU Device Error: Uncaught (in promise) TypeError: lib$1.exports.detectGPUDevice is not a function10 comments · 2024-02-28#675Model Request: Gemma 38 comments · 2025-03-12#680I downloaded the model on huggingface locally, can I load the local model?7 comments · 2025-04-03
Latest release
v0.2.88 v0.2.88 2026-11-10Fix prompt echo in streaming text completions Fix selected-token logprobs and logprobs for buffered UTF-8 output Fix decode rates for completions that finish during prefill Fix TypeScript type checking for installed packages Upgrade @mlc-ai/web-runtime to 0.28.0-dev2 Full Changelog: https://github.com/mlc-ai/web-llm/compare/v0.2.87...v0.2.88