WebLLM runs language models inside a WebGPU-capable browser, putting model loading and recovery on the application developer. Use it if keeping inference on the user's device is a requirement and you can support a defined set of devices. Skip it if your feature must work across an uncontrolled phone fleet without a fallback. Our source checkout built successfully and passed all 466 recorded tests. The useful deployment question is what happens after installation, when a browser downloads a model, allocates GPU memory and handles an interrupted request.
What people use web-llm for
Developers report using WebLLM for browser chat, retrieval-assisted answers, accessibility extensions and combat-log analysis. These examples put a local language model beside an existing application: a search interface, a student accessibility feature or a game-analysis tool. Each account identifies a concrete use and the developer's experience with it. The examples also show why choosing an inference engine involves more than comparing package installation commands.
| Who built it | What they used WebLLM for | What happened |
|---|---|---|
| The author of the Transformers.js comparison | Llama 3.2 chat and summaries of pasted Wikipedia articles | Reports combining WebLLM generation with Transformers.js semantic-search embeddings. Browser application account. |
| MarJone, developer of AssisT | Local AI in an accessibility extension for neurodivergent students | Reports interrupted longer inference and attempted keep-alive workarounds. AssisT extension report. |
| Gilder Miller, building Holocron | Analysis in a browser combat-log analyzer | Reports resolving production initialization failure by permitting WASM compilation in the deployment policy. Holocron deployment account. |
| Christian Liebel on web.dev | A chatbot answering questions about a to-do list | Presents model loading, caching and streamed replies in a tutorial. To-do chatbot tutorial. |
The comparison author combines Transformers.js embeddings with WebLLM generation. The embedding model finds relevant text; the language model consumes those retrieved chunks and writes the response. This gives developers a concrete integration pattern when semantic search already exists in an application. The two engines have separate jobs, so choosing WebLLM for generation does not require moving the embedding task into it. Retrieval-and-generation account.
The research pack also records custom-model and vision experiments. In issue #202, hrishioa reports compiling and running OpenHermes 2.5 and Dolphin 2.2.1 at q4f32 after resolving compiler-version problems. In issue #572, flatsiedatsie describes a public Phi 3.5 vision demo and reports that guarding access to missing adapter information allowed inference to work. These accounts give model integrators specific configurations and errors to investigate. Custom-model discussion, vision-demo discussion.
What happened when we ran it
Our October 11, 2026 source run installed in 13 seconds, built in 21 seconds and passed 466 of 466 Jest tests in 26 seconds at commit fb3a7fc. We measured 426 dependencies and 152 MB on disk. The configured sandbox had 3 CPUs, 8 GB RAM and image label lab-node:22. These results describe the source checkout and its repository checks, with the individual outcomes preserved below.
| October source-harness observation | Recorded result |
|---|---|
| Dependency installation | Succeeded in 13 seconds |
| Dependencies and disk footprint | 426 dependencies, 152 MB on disk |
| Build | Succeeded in 21 seconds |
| Jest tests | 466 passed, 0 failed of 466, in 26 seconds |
| npm audit | 0 known vulnerabilities: 0 critical, high, moderate or low |
| Checkout | 326 files, about 40,300 source lines, 13.2 MB |
| Repository signals | 5 CI workflow files, a tests directory, no Dockerfile detected |
The November 16 package check used commit e56c954a1875 and recipe quickstart-lib in a fresh, unprivileged lab-node:22 container configured with 2 CPUs and 4 GB RAM, no published ports and no secrets. Cloning took 2 seconds. Installing @mlc-ai/web-llm 0.2.88 took 8.7 seconds, leaving 27.2 MB in node_modules and 10 packages besides WebLLM.
The four-line README TypeScript task exited 0 without output in 0.4 seconds. The task was the Package Manager block, run unedited with tsx, and contained only unused imports. Those imports can be eliminated by tsx, so the recorded outcome is completion of that task. Teardown recorded success. The table keeps the package observations separate from the October source build and its Jest results.
| November package-check question | Answer | Verdict | Why |
|---|---|---|---|
| Did the checkout step complete? | Cloning took 2 seconds. | Completed | The quickstart-lib clone step recorded that duration. |
| Which package was installed, and how long did it take? | @mlc-ai/web-llm 0.2.88 installed in 8.7 seconds. | Installed | The installation record names the package and version. |
| How much disk space did node_modules occupy? | 27.2 MB after installation. | Recorded footprint | The installed-size step measured node_modules. |
| How many other packages were installed? | 10 packages besides @mlc-ai/web-llm. | Recorded dependency count | The dependency-count step excludes WebLLM itself. |
| What happened when the README task ran? | The four-line TypeScript task exited 0 without output in 0.4 seconds. | Task completed | The block contains unused imports that tsx can eliminate. |
| Did teardown complete? | Teardown recorded ok. | Completed | The teardown record reports success. |
Where people get stuck: cache, memory and deployment policy
Issue #322 records successful retries after the 0.2.26 update and cache clearing, while the mobile reports describe model-specific crashes and memory errors. The visible symptom matters: a stalled progress bar, a lost GPU device and blocked WASM compilation lead to different investigations. Keep the package revision, selected model and browser error together when comparing your failure with one of these reports.
| Symptom and source | What the reporter or maintainer found | Resolution shown in the record |
|---|---|---|
| Extension stalls while loading, issue #322 | Reports included failures loading cached weights, followed by further failures after an early update. | neubig reported four or five successful attempts after 0.2.26 and cache clearing. |
| Pixel 7 cannot load the original Llama 2 demo, issue #209 | Buffer limits, crashes and storage-allocation errors affected the tested model. | Reduced-context variants were added; beaufortfrancois reported success with a RedPajama 3B variant. |
| Pixel 6a crashes loading Gemma 2 2B or Phi 3 Mini, issue #524 | The reporter used a 1K context and available 16-bit WebGPU; Tiny Llama ran. | The supplied synthesis records the issue as open. |
| Phi 3.5 vision downloads but fails during initialization, issue #727 | Reports include a missing cached vision parameter on 0.2.80. | A maintainer acknowledged a vision-specific problem and ongoing work. |
| Works in development, fails on Vercel, Holocron deployment account | The WASM fetch succeeded, but production policy blocked compilation. | The author reports adding 'wasm-unsafe-eval' to script-src. |
The cache thread contains a useful sequence: a maintainer announced an update, the original reporter closed the issue, and another developer reported continued failures on 0.2.24. Further updates followed before the original reporter described four or five successful attempts. That sequence makes the reporter's retries more informative than the closed label alone. Match the error and version before treating a historical resolution as your next action. Cache-loading discussion.
Other supplied reports add distinct failure modes. Issue #356 describes Llama 2 gibberish alongside VK_ERROR_OUT_OF_DEVICE_MEMORY and a maintainer adding a 1024-context variant. Issue #202 describes Mistral OpenOrca continuing with empty output after its end marker; the contributor interrupted generation when output became empty. The same thread records custom compilation problems and success after pinning compatible revisions. These are reported workarounds for particular failures. ChromeOS memory report, custom-model discussion.
Browser storage makes offline use possible, with preparation
Christian Liebel's tutorial says WebLLM reads downloaded model files from the Cache API rather than requesting them again over the network. The research synthesis also records zeritonius confirming local, offline operation in issue #19 after preparing model artifacts. Serving the application and preparing its model assets are separate setup steps, so an offline requirement needs an asset inventory alongside the application code. Cache explanation, local deployment discussion.
The tutorial states that browser cache storage is isolated per origin. Two websites using the same model therefore download separate copies in its example. For an application interface, show initialization progress and explain the model download before asking the user to wait. Give a return visit an explicit ready state or useful error as well. The cache-loading thread shows why completing a network transfer and completing initialization deserve separate states in the interface.
Extensions need recovery when background work disappears
MarJone reports that AssisT can lose longer inference jobs when its service worker is killed, leaving the caller without an error or partial result. The report describes keep-alive alarms, offscreen documents and chunked streaming as attempted workarounds, each with costs. The developer connects this failure to accessibility features used by neurodivergent students, where an unanswered request interrupts the task the extension was meant to help complete. AssisT lifecycle report.
Preserving the input and offering a deliberate retry are application-design recommendations drawn from that report. A text-simplification interface needs to distinguish completed output from interrupted work so the student can continue. Phone standby creates a related state mismatch in issue #524: a maintainer explains that frontend state can survive after the worker terminates, and links PR #533 to internal reloading when expected and loaded model states disagree. Standby recovery discussion.
Local inference changes privacy work
The official documentation describes inference inside the browser with WebGPU acceleration and no server-side model processing. That locates the inference step, while the deployment accounts identify separate decisions about model hosting, workers and browser policy. An application making a privacy promise still needs to account for prompt handling, analytics and artifact delivery in its own code. Local model execution is one part of that data flow. WebLLM documentation.
Our October source run recorded zero known npm audit vulnerabilities across its installed dependency tree. Holocron's account addresses a different concern: its production policy blocked WASM compilation, and its error-path logs had been removed from the production build. The author reports changing the compilation directive and exposing production errors and fallback transitions. That account gives developers a specific deployment diagnosis and a reason to keep actionable error reporting in the hosted application. Production diagnosis.
WebLLM vs Transformers.js, wllama and Chrome's Prompt API
The supplied application author uses Transformers.js and WebLLM together, while the Pixel 6a reporter describes different outcomes across WebLLM and wllama. These accounts support choosing by task and intended device. They also provide concrete next steps: separate retrieval from generation, try the required model on the intended phone, or investigate a browser-managed model when shared downloads matter to the application.
| Alternative | What the supplied account says | When to investigate it |
|---|---|---|
| Transformers.js | The author uses its embedding model for semantic search and WebLLM for the LLM consuming retrieved chunks. Application comparison. | When the application needs retrieval alongside generation. |
| wllama | The Pixel 6a reporter ran a 1.63 GB Q4 GGUF Gemma 2 2B model; Phi 3 Mini also ran but was described as crawling. Device comparison. | When the required model fails to load through WebLLM on the intended device. |
| Chrome Prompt API | The January 2025 tutorial describes a central model downloaded into Chrome. Dated browser-model comparison. | When a browser-managed model fits the product's model-selection needs. |
The AssisT developer describes cloud API costs, latency and student-data privacy requirements as reasons to prefer local inference. Those requirements can make browser execution useful even when it adds lifecycle work. For applications serving an uncontrolled device fleet, the mobile and worker reports support budgeting another execution path. The practical choice depends on which requirement the product can control: its supported hardware, model selection, network use or background execution. AssisT architectural constraints.
What the other reviews get wrong
The official basic-usage documentation says the chat-completion model parameter is ignored. Model selection happens when creating or reloading the engine, which qualifies the homepage's broad OpenAI API compatibility wording. An existing client that switches models through each completion request therefore needs an integration change. The inspected material here is official documentation and fork READMEs; the specific corrections concern their compatibility language. Documented model selection.
Fork README wording about using any open-source model also exceeds the supplied support description. The README limits built-in support to a subset and points developers toward custom MLC compilation. The research synthesis records Qwen3.5 configuration paths described as placeholders and model recompilation following TVM refactors. Package code, model weights and the WASM library belong together in an upgrade decision. Model-support description, Qwen3.5 compatibility discussion.
A fork's description of a persistent background extension also conflicts with its service-worker lifecycle warning and the AssisT interruption report. Function-calling wording differs too: the fork labels it work in progress, while the official homepage lists it among available functionalities. These are specific source discrepancies, so read the feature documentation for the intended integration rather than choosing between broad labels. Service-worker warning, fork wording, official feature list.
Questions people ask
WebLLM Chat provides a ready-made browser interface, and developers can integrate the package into a WebGPU-compatible browser application. The official getting-started guide describes package-manager and CDN installation. The questions below cover browser access, local assets, mobile failures and deployment troubleshooting. Their answers separate documented setup steps from the outcomes individual reporters described, so readers can choose the relevant next step. Getting-started guide.
How can I access an LLM directly in my web browser?
Use WebLLM Chat for the ready-made interface, or integrate the package into your application. The official guide requires a WebGPU-compatible browser. Its basic-usage documentation describes creating an engine and asynchronously loading a model before making chat-completion requests. That loading step is part of application startup, so expose progress rather than treating package installation as the end of setup. Browser access guide, engine lifecycle.
How do I install WebLLM and run it locally?
Install the package with npm install @mlc-ai/web-llm, then import the library and initialize an engine with a supported model. The supplied README also gives Yarn, pnpm and CDN routes. Issue #19 records a local-server problem when using an ordinary local IP instead of 127.0.0.1, so retain the exact development URL when investigating a WebGPU setup failure. Package installation guide, local deployment issue.
Can WebLLM work completely offline without contacting Hugging Face?
Issue #19 records a user confirming offline operation after preparing local model artifacts. Liebel's tutorial separately explains that WebLLM reads previously downloaded model files from browser cache. These accounts describe preparing assets by hosting the required files yourself or reusing files already downloaded by an origin. Include the model library and application assets in that preparation, alongside the model files. Offline deployment discussion, browser cache explanation.
How do I host WebLLM models myself instead of relying on the project's storage locations?
Issue #19 describes downloading model metadata and shards, serving them locally and changing the configured model location. Its historical discussion uses cacheUrl. Use that thread to understand which assets must move, then use the configuration documented for your selected package and matching artifacts. The practical requirement is that the application can locate every file needed for model loading. Self-hosted artifact discussion.
Why does WebLLM fail on my phone when it works on desktop?
The supplied phone reports describe model-specific buffer and memory failures. Issue #209 records a Pixel 7 success with RedPajama-INCITE-Chat-3B-v1-q4f32_1-1k alongside Llama 2 crashes. Issue #524 records Pixel 6a crashes with Gemma 2 2B and Phi 3 Mini despite available 16-bit WebGPU. Keep the model, context, precision, browser and device together when comparing those outcomes with your application. Pixel 7 report, Pixel 6a report.
Can smaller buffers or models make WebLLM work on more Android devices?
Reduced-context variants helped in the reported Pixel 7 case. Maintainers added models intended to fit a 128 MB buffer limit, and beaufortfrancois reported that the RedPajama 3B variant worked. The same thread contains Llama 2 crashes and allocation errors, which makes the exact model variant part of the useful result. Start a device assessment with the configuration that the reporter actually named. Reduced-context model discussion.
Can WebLLM detect that my device has insufficient GPU memory before inference fails?
Issue #209 records work to catch out-of-memory errors in createBuffer() in npm 0.2.36. The discussion also distinguishes individual buffer limits from total allocatable memory. Handle loading and inference errors even after browser capability checks succeed, and retain their details for troubleshooting. The report's allocation failure and lost-device error show why a WebGPU feature check and a completed model request answer different questions. Memory and error-catching discussion.
How do I recover WebLLM after my phone goes into standby?
A maintainer in #524 links PR #533 to internal reloading when frontend and backend model states disagree. The explanation describes a terminated worker alongside frontend state that still expects a loaded model. Preserve the user's input and make interrupted requests recoverable in the interface. Include standby in the application checks for the chosen model and device, so recovery behavior is part of the supported configuration. Worker-state explanation.
Why does WebLLM stall or crash while loading models from cache?
Issue #322 records cached-weight loading failures and continued reports after an early update. After the 0.2.26 update and cache clearing, neubig reported four or five successful attempts. Capture the actual error and package revision before choosing a troubleshooting step. The thread's sequence is useful because it separates an announced fix from later retries by the person who reported the problem. Cache-loading history.
How do I enable useful WebLLM debug logs in my own application?
Collect browser console or remote-debugging output with the exact failing model and package revision. Issue #209 shows a reporter supplying a storage-allocation failure and a lost-device error, which gave maintainers concrete details to discuss. Keep those errors alongside the visible loading or inference symptom. Holocron's deployment account also shows why error reporting needs to survive the production build. Browser error example, production logging account.
Why does WebLLM work in development but fail silently on Vercel?
Holocron's author traced that behavior to a production policy that allowed the WASM download but blocked compilation. The account reports adding 'wasm-unsafe-eval' to script-src and restoring production error-path logs. Inspect the hosted worker's error and deployed policy before applying the same change: the useful evidence is the compilation failure, while a successful network response only records that the file arrived. Vercel deployment diagnosis.
Why do WebLLM vision models fail after downloading successfully?
The supplied threads describe different errors: missing adapter information in #572 and a missing cached vision parameter in #727. Reporters in #572 described success after guarding adapter access; a maintainer later announced a fix in 0.2.70, followed by mixed reports. Identify the error and package version before choosing a workaround, because successful downloads appear in accounts with different initialization failures. Adapter-information discussion, vision-parameter error.
What we have not tested yet
Runtime module loading was not verified by the November README task: its unused TypeScript imports can be eliminated by tsx. Our first-party evidence covers repository checks, package installation and task completion, without a measured browser conversation. First-download duration, cached initialization, prefill, decoding speed, peak GPU memory, answer quality and offline inference remain outside those runs. The October source commit is fb3a7fc; the November package record names e56c954a1875 and package 0.2.88. Neither the image label nor the newer package task supplies an actual runtime or operating-system version, and the October results are not a test of package 0.2.88.
Mobile compatibility, standby recovery, extension background survival, self-hosted artifacts, vision inference and function calling across models lack our hands-on assessment. The linked worker-recovery work lacks a publication-and-user-confirmation sequence in the supplied extract. Closed vision threads retain unresolved or mixed reports, and the January 2025 Prompt API account supplies historical comparison evidence rather than current availability. The supplied debugging material provides no supported logLevel configuration or INFO/DEBUG recipe to reproduce.
The sampled applications establish specific reported uses rather than adoption or production reliability. Application network traffic, browser storage security and model licenses are outside our audit. There is no matched workload here comparing WebLLM with the alternatives or research runtimes in the pack. Rendered layout, resolved links, related links and recommendation modules also fall outside this text review. For a deployment decision, the next useful result is a completed request on the least capable supported device, followed by another after standby and another with networking disabled after asset preparation.


