Home / Insights / Web and SaaS Development
Web and SaaS Development
In-Browser AI with WebGPU and Built-In Browser Models: What Web Apps Can Run Locally
Browsers can now run some AI models on the user’s own device, either through built-in APIs or through WebGPU. This guide explains which workloads fit, which browsers and devices support them, and how to design a feature that still works when local AI is not available.
Key takeaways
- There are two practical routes to local AI in a web app: browser-provided APIs (such as Chrome’s Summarizer, Translator and Language Detector) and your own model running on WebGPU or WebAssembly.
- Local inference suits narrow, high-frequency tasks such as classification, translation, short summaries, embeddings, speech-to-text and image clean-up. Broad reasoning over company data still belongs on the server.
- Support is uneven. WebGPU reached all major browser engines during 2025, but not every platform, and Chrome’s built-in models are desktop-only with real hardware requirements.
- Design local AI as progressive enhancement: feature-detect, check availability, ask before large downloads and fall back to a server path that gives the same result.
- Budget for a wider test matrix, model licence checks and download size management. The saving on inference cost is real, but it is not free.
On this page
- What does running AI in the browser actually mean?
- Which workloads fit on the user’s device?
- Where does browser and device support stand in early 2026?
- How do you decide between local, server and hybrid?
- How should the feature be architected?
- What are the risks and hidden costs?
- Checklist for a local AI pilot
- Frequently asked questions
- Sources and methodology
For most of the last few years, adding AI to a web product meant calling a model over an API. Every request left the device, every token had a cost and every feature depended on a network round trip. That is still the right default for many features. However, two developments in 2025 changed what a browser can do on its own. WebGPU became available in all major browser engines, and Chrome shipped stable APIs that run a built-in model on the user’s device.
This article is for CTOs, product leads and technical architects who are deciding whether part of their web application’s AI should run locally. I will cover the two routes, which workloads fit, where support stands at the start of 2026, how to architect a feature so it degrades gracefully, and what it costs to test and maintain. The aim is to help you pick the narrow cases where local AI earns its place, not to replace your server-side models.
What does running AI in the browser actually mean?
There are two distinct approaches, and they have very different trade-offs. It helps to separate them before any design discussion.
Route 1: built-in browser AI APIs
The browser ships and manages the model. Your code calls a high-level JavaScript API, such as ‘summarise this text’ or ‘translate this into French’, and the browser runs it locally. According to Chrome’s built-in AI API overview, the Translator, Language Detector and Summarizer APIs are stable from Chrome 138, and the Prompt API is stable for Chrome extensions from the same version. The Writer, Rewriter and Proofreader APIs, and the Prompt API for ordinary web pages, were still in trial programmes at the time of writing.
You do not choose the model, you do not ship weights and you do not pay per call. In exchange, you accept whatever quality and behaviour the browser vendor provides, and the feature only works where that browser and its model are available.
Route 2: your own model on WebGPU or WebAssembly
You choose an open model, convert and usually quantise it, and run it in the page using a library. MDN describes WebGPU as the successor to WebGL, with first-class support for general-purpose GPU computation through compute shaders. It is available only in secure contexts and can be used inside web workers. Libraries such as Transformers.js run models through ONNX Runtime, defaulting to the CPU via WebAssembly and switching to the GPU with a WebGPU option. For language models specifically, the WebLLM paper describes an open-source engine that runs LLM inference entirely in the browser, exposes an OpenAI-style API and, in the authors’ evaluation, retains up to 80% of native performance on the same device.
This route gives you control over the model and works across more browsers, but you own the download size, the performance tuning and the quality.
Comparing the two
| Factor | Built-in browser APIs | Own model on WebGPU / WASM |
|---|---|---|
| Who supplies the model | Browser vendor | You, usually an open-weight model |
| Download to the user | Managed by the browser, shared across sites | Your model files, per origin, often tens to hundreds of megabytes |
| Control over quality | Low: task-level options only | High: choice of model, size, quantisation, fine-tuning |
| Browser reach | Narrow: specific browser, desktop, capable hardware | Wider: any browser with WebGPU, or WASM fallback on CPU |
| Engineering effort | Low | Medium to high |
| Best for | Summaries, translation, language detection, writing help | Specialised tasks: classification, embeddings, speech, vision |
Many products will end up with a third, hybrid route: a local path where it is available and cheap, and a server path for everyone else and for anything heavier.
Which workloads fit on the user’s device?
The question is not whether a browser can run a model. It can. The question is whether a model small enough to download and run on a typical customer’s laptop is good enough for the task.
Good candidates
- Classification and routing. Tagging a support message, detecting the language of user input or flagging likely spam before submission. Small models do this well and the result is easy to verify.
- Translation and short summaries. Translating user-generated content inline or summarising a long comment thread. Chrome’s built-in Translator and Summarizer APIs target exactly this.
- Embeddings for in-page search. Computing embeddings for a few hundred local items, such as a user’s own notes or a product catalogue page, so that search works offline and without sending the query anywhere.
- Speech-to-text and audio. Transformers.js lists automatic speech recognition among its supported tasks. Dictation that never leaves the device is attractive for sensitive notes.
- Vision clean-up. Background removal, image classification and object detection before upload. This reduces upload size and lets users see the result immediately.
Poor candidates
- Reasoning over company data. If the answer depends on records in your database, the data has to reach the model. Moving it to the client to keep inference local usually creates a bigger privacy problem than it solves.
- Long documents and long conversations. Small local models have limited context and degrade faster on long inputs.
- Anything where a wrong answer is costly. Clinical, legal or financial outputs need the strongest model you can justify plus review, not the smallest model that fits in a browser tab.
- Agentic workflows with tools. Tool calls usually hit your back end anyway, so local inference adds complexity without removing the server.
For example, a document-heavy SaaS product might run language detection and a short ‘what is this document’ summary locally, while extraction, validation and anything written back to the record stays on the server. That split keeps the local part low-risk and the expensive part auditable. Our article on choosing cloud, edge or on-device computer vision applies the same reasoning to vision models.
Where does browser and device support stand in early 2026?
Support is the main constraint, and it differs sharply between the two routes.
WebGPU
According to web.dev’s post WebGPU is now supported in major browsers (November 2025), the picture is:
| Browser | Status | Caveats |
|---|---|---|
| Chrome and Edge | Windows, macOS and ChromeOS since version 113 | Android from version 121 on Android 12+ with Qualcomm or ARM GPUs; Linux still in progress |
| Firefox | Windows from version 141 | macOS on Apple silicon from version 145; Linux, Intel Macs and Android in progress |
| Safari | Safari 26 | macOS, iOS, iPadOS and visionOS 26 |
MDN still marks WebGPU as limited availability, not Baseline, because coverage is incomplete across widely used platforms. In practice, a meaningful share of your users will be on a device or operating system version without WebGPU, and some with WebGPU will have integrated graphics that run a model slowly. WebAssembly on the CPU is the universal fallback, but it is much slower for larger models.
Chrome built-in AI
Chrome’s getting-started documentation lists the requirements for the built-in foundation model (Gemini Nano): Windows 10 or 11, macOS 13 or later, Linux, or ChromeOS on Chromebook Plus devices. The foundation-model APIs do not run on Android, iOS or other mobile devices. The profile volume needs at least 22 GB free, and the device needs either a GPU with more than 4 GB of VRAM or a CPU setup with 16 GB of RAM and at least four cores. The model downloads once over an unmetered connection, then works offline. Chrome states that no data is sent to Google or any third party when using the model.
The availability() method returns one of four states: unavailable, downloadable, downloading or available. If the model is not yet on the device, creating a session requires a user gesture. Your interface has to handle all four states.
What this means for planning
Assume local AI will be available to a minority of sessions at first, skewed towards desktop users on recent hardware. If your users are mostly on mobile, or on managed corporate laptops with locked-down browsers, the share may be small. Measure it before you build on it.
How do you decide between local, server and hybrid?
Local inference is often pitched on privacy and cost. Both benefits are real, but each comes with conditions.
| Criterion | Local in the browser | Server-side API or hosted model |
|---|---|---|
| Data leaving the device | None for inference itself | Every request, subject to your processor agreements |
| Marginal cost per request | Near zero to you; the user’s device does the work | Per token or per GPU hour |
| Latency | No network round trip, but slow on weak hardware and first run | Predictable, depends on network and provider |
| Output quality | Limited by small model size | Access to the strongest models |
| Consistency across users | Varies by device, browser and model version | Same model for everyone |
| Observability | Hard: outputs stay on the device unless you log them | Full logging and evaluation possible |
| First-use friction | Model download, possibly large | None |
Questions that settle most decisions
- Would the task be acceptable with a noticeably weaker model? If not, stop here.
- Is the input sensitive enough that keeping it on the device is a selling point or a compliance requirement?
- Is the task frequent enough that per-request server cost matters? A feature run on every keystroke is a different case from one run once a day.
- What share of your users have the browser and hardware to benefit?
- Can you live without central logging of inputs and outputs for this feature?
If you answer yes to the first and at least two of the next three, a hybrid design is usually worth prototyping. If cost is the main driver, compare against server-side options first. Our guide to self-hosted LLM costs shows how to size the server alternative properly.
How should the feature be architected?
The pattern that works is progressive enhancement: the feature exists for everyone, and local AI is an optimisation where it is available.
Core design rules
- One interface, two engines. Put local and server inference behind a single internal interface, such as
summarise(text, options). The UI never knows which engine answered. - Detect, then check availability. Feature-detect the API or
navigator.gpu. For built-in APIs, callavailability(). For your own model, check adapter limits and run a short warm-up to measure speed before committing. - Ask before big downloads. Tell users the size and purpose, offer ‘not now’, and never start a large download on a metered connection without consent.
- Run off the main thread. Put inference in a web worker. WebGPU is available in workers, and keeping the main thread free protects responsiveness.
- Cache deliberately. Store your own model files with the Cache API or origin private storage, version them and plan for eviction under storage pressure.
- Fall back by policy, not by accident. Define when to use the server: no support, slow warm-up, low-confidence output or user preference.
A rollout sequence
- Ship the server-side version first and capture a baseline for quality, latency and cost.
- Add anonymous capability telemetry to see how many sessions could run locally.
- Build the local engine behind a feature flag for internal users.
- Run the same evaluation set through both engines and compare outputs side by side.
- Enable local inference for a small share of eligible users and watch completion rates, error rates and support tickets.
- Widen gradually, keeping the server path as the default for anyone who is not eligible.
What are the risks and hidden costs?
Testing matrix
Server inference is tested once. Local inference has to be tested across browsers, operating systems, GPU vendors, memory sizes and model versions. Built-in models can also change when the browser updates, without any release on your side. Keep a fixed evaluation set and rerun it on a schedule against the browsers you support.
Quality drift and silent failure
Because outputs stay on the device, you may not notice when quality drops. Add lightweight, privacy-respecting signals, such as whether users accept, edit or discard a suggestion, so you can see problems without collecting the content.
Security
Local models are still language models. Prompt injection, unsafe output and leaking instructions remain possible, and a determined user can inspect or tamper with anything running in their own browser. Never treat a local model’s output as trusted input to a server action without validation. Our walkthrough of the OWASP Top 10 for LLM applications applies here too.
Licences and weights
If you ship your own model, its weights are downloaded to every user’s device. Check the licence allows redistribution in this way and that any usage restrictions are compatible with your product.
Download size and battery
Model files are large compared with typical web assets. They cost users bandwidth and storage, and GPU inference drains laptop and phone batteries. Prefer quantised variants, which Transformers.js supports through options such as fp16, q8 and q4, and load models only when the user reaches the feature.
Where the money goes
The inference saving is offset by extra engineering, a broader QA matrix and ongoing model maintenance. For a feature used occasionally by a small number of users, the server path is almost always cheaper overall. Local AI pays off for frequent, lightweight tasks at scale, or where keeping data on the device is a product requirement.
Checklist for a local AI pilot
- Pick one narrow, frequent task where a smaller model is acceptable.
- Ship or confirm the server-side baseline and record quality, latency and cost.
- Collect anonymous capability data: WebGPU presence, built-in API availability, device class.
- Choose the route: built-in API for summary, translation or language detection; own model for specialised tasks.
- Check model licence terms for client-side redistribution.
- Implement one internal interface with local and server engines and a clear fallback policy.
- Run inference in a web worker and handle all availability states in the UI.
- Ask before large downloads and cache model files with versioning.
- Build an evaluation set and compare both engines before any user sees local output.
- Roll out behind a feature flag and monitor acceptance, errors and support contacts.
PoliteTech’s website design and development team builds React and Next.js front ends and can help you prototype a local inference path alongside an existing server-side feature, with the fallback and testing approach described above.
Frequently asked questions
Can we run a ChatGPT-style assistant entirely in the browser?
Technically yes, using an engine such as WebLLM with a small open model on WebGPU. In practice the model has to be small enough to download and run on your users’ hardware, so quality, context length and speed will be well below a hosted frontier model. It suits narrow tasks better than a general assistant.
Does local AI mean we no longer need a data processing agreement with an AI provider?
For the local inference itself, no data goes to a model provider. But most products still have a server fallback, and any feature that logs inputs or sends results to your back end is still processing personal data. Treat local inference as reducing exposure, not removing your obligations.
Will Chrome’s built-in AI work for our mobile users?
Not at the time of writing. Chrome’s documentation states the foundation-model APIs do not run on Android or iOS, and they need capable desktop hardware. Mobile users need a server path or, for specific tasks, your own model on WebGPU where the device supports it.
How large are the model downloads?
It depends on the model and quantisation. Built-in browser models are managed by the browser and shared across sites. Your own models are downloaded per origin, and even small quantised models are large compared with normal web assets, so load them only when needed and ask users first.
Is local inference cheaper overall?
Per request, yes, because the user’s device does the work. Overall it depends on volume. Extra engineering, a wider test matrix and model maintenance cost money, so local inference tends to pay off for frequent, lightweight tasks or where keeping data on the device is a requirement.
Sources and methodology
Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.
- Chrome for Developers: Built-in AI APIs — accessed 9 November 2026. Status of the Translator, Language Detector, Summarizer, Prompt, Writer, Rewriter and Proofreader APIs and the Chrome 138 stable versions.
- Chrome for Developers: Get started with built-in AI — accessed 9 November 2026. Hardware and OS requirements, desktop-only support, availability() states, user activation for download and on-device privacy statement.
- MDN Web Docs: WebGPU API — accessed 9 November 2026. WebGPU as WebGL’s successor with compute shader support, secure-context requirement, worker availability and limited-availability status.
- web.dev: WebGPU is now supported in major browsers (November 2025) — accessed 9 November 2026. Per-browser and per-platform WebGPU support, including Linux and Android caveats.
- Hugging Face: Transformers.js documentation — accessed 9 November 2026. ONNX Runtime backend, WASM default and WebGPU device option, supported tasks and quantisation dtypes.
- arXiv: WebLLM, A High-Performance In-Browser LLM Inference Engine (Ruan et al., 2024) — accessed 9 November 2026. In-browser LLM inference on WebGPU, OpenAI-style API and up to 80% of native performance in the authors’ evaluation.
Related reading
Continue your research
Which AI features in your web app could run on the user’s device?
We can review your AI features, measure what share of your users could run them locally and prototype a hybrid path with a safe server fallback.
