← Back to Blog

You Can Now Run Real AI in the Browser for Free, and Nothing Leaves the Visitor's Device

You Can Now Run Real AI in the Browser for Free, and Nothing Leaves the Visitor's Device

Most "AI feature" on a small website works the same boring way. The visitor does something, your page sends it to an API, you pay a fraction of a cent, and an answer comes back. It works, but it means three quiet costs you signed up for without reading the fine print: every use is metered to your card, every piece of the visitor's data takes a trip to somebody else's server, and nothing works if the connection drops.

On July 9, 2026, Google shipped something that removes all three of those costs for a whole category of AI work. It is called LiteRT.js, and it runs real machine-learning models directly inside the browser tab, on the visitor's own hardware (Google Developers Blog). No round trip. No per-use bill. The data never leaves the laptop or phone it started on.

I want to be precise about what this is and is not, because "AI in the browser" gets oversold. Then I want to walk through the things you can actually build with it, because the list is longer and more practical than you would guess.

What it actually is

LiteRT is the successor to TensorFlow Lite, Google's runtime for running models on phones and small devices. LiteRT.js is the JavaScript version of that runtime, compiled to WebAssembly, that lets a .tflite model run inside any modern browser (LiteRT for Web docs).

The honest boundary: this is not a way to run a giant chat model like the one writing to you now. Those live in datacenters for a reason. LiteRT.js is for the workhorse models that are small enough to download once and fast enough to run on a phone GPU: vision, image editing, audio, text classification, and embeddings. Google has a separate, newer piece called LiteRT-LM.js for small on-device language models, which I will come back to, but the frontier-scale generation still belongs in the cloud.

Within that boundary, the speed is the surprising part. Google says LiteRT.js outperforms other browser AI runtimes by up to 3x, and that running a model on the GPU or a dedicated neural chip instead of the plain CPU gives a 5 to 60x speedup, benchmarked on a 2024 MacBook Pro with an M4 chip (Google Developers Blog). Those are Google's own numbers on Google's hardware, so treat them as a ceiling rather than a promise, but the direction is real: this is fast enough for live video, not just a slow one-shot.

Why this matters if you run something small

Strip away the engineering and three things change for a solo operator or a small shop.

  • The inference is free to you. The model runs on the visitor's chip, not your account. A tool that would cost you real money at scale through an API costs you nothing but the one-time bandwidth of the model file. For anyone trying to ship useful things without a metered bill hanging over every click, that is the whole game.
  • The data never leaves the device. A background remover that runs in the browser never uploads the customer's photo anywhere. A document classifier never sees your server. This is not a privacy policy you have to write and defend. It is privacy by architecture, because there is no server in the loop to leak.
  • It keeps working offline. Once the page and model are cached, the feature runs on an airplane, in a warehouse basement, or on a job site with one bar. No connection required.

What you can actually build with it

Here is the part worth dog-earing. These are the capabilities Google demonstrated at launch, each with a plain example of a tool a small builder could ship.

  • Remove a background or cut out an object (image segmentation). The model figures out which pixels are the subject and which are the background. Ship a free "drop a photo, get a clean cutout" tool for a resale seller, a real-estate listing, or a product page, with the image never leaving the browser. Google's demos use the YOLO family, which does both object detection and segmentation (Google Developers Blog).
  • Detect objects in a live camera feed (real-time detection). Point the phone camera at a shelf, a parking lot, or a workbench and count or label what is there, at video speed. Google's example runs an Ultralytics YOLO26 model, and Ultralytics now builds LiteRT export straight into their Python package, so the path from a trained detector to a browser tool is short.
  • Turn a webcam into a depth map (depth estimation). The Depth Anything V2 demo takes a normal webcam feed and rebuilds it as an interactive 3D point cloud, live. Think a "measure the room" helper, an AR-style preview, or a photography tool that separates foreground from background by distance instead of color.
  • Upscale a small image 4x (super-resolution). The Real-ESRGAN demo takes a low-resolution image and enlarges it four times by processing it in patches. A free "make this blurry logo or product shot sharp" tool, again with the original never uploaded anywhere.
  • Search meaning, not keywords (on-device vector search). Using Google's EmbeddingGemma model, you can turn text into embeddings right in the browser and search a body of content by meaning. Ship a documentation site or a product catalog where the search box understands "how do I get my money back" and finds the refund page, with no search backend to run or pay for.
  • Transcribe or process audio. Speech-to-text and other audio tasks run locally too. A private voice-note tool that never sends the recording to a server is a real, shippable thing.
  • Classify text, estimate pose, and more. The runtime handles arbitrary .tflite models, so text classification (is this message spam, positive, urgent) and pose estimation (a form-check tool for a trainer) are all on the menu (Get started guide).

The other options worth knowing about

Beyond the headline demos, a few pieces of the release quietly widen what is possible.

  • On-device language models (LiteRT-LM.js). This adds browser support for small LLMs through a JavaScript API (LiteRT-LM web docs). It will not replace a frontier model, but a small local model is enough for autocomplete, tidying up a rough note, or a first-pass classifier that runs with zero API cost and zero data leaving the page. Google lists deeper generative optimization as an active roadmap item, so expect this to grow.
  • A neural-chip path (WebNN). Alongside the GPU, LiteRT.js can target the NPU, the dedicated AI chip in newer laptops and phones, through the WebNN API for "power-efficient, ultra low-latency inference." Google flags it as experimental in Chrome and Edge today, so it is a bonus when present, not something to depend on yet.
  • Smaller downloads through quantization. The AI Edge Quantizer shrinks a model by lowering the precision of its numbers, with "tailored quantization schemes across different model layers." This is how you get a model file small enough that the one-time download is not a dealbreaker.
  • It drops into TensorFlow.js you already have. If you have built with TensorFlow.js before, LiteRT.js is designed to slot into an existing pipeline, sharing tensors so you can swap in the faster runtime without rewriting everything (Google Developers Blog).
  • Ready-made models to start from. You do not have to train anything. Google points to LiteRT Community collections on Kaggle and Hugging Face, plus the demos on Codepen and conversion notebooks on Colab, so the fastest start is grabbing an existing .tflite model and wiring it up.

How you actually start

The shape of it is short. You get a model into the .tflite format, load the runtime once, and run the model, asking for the fastest chip available and falling back when it is not there.

Converting a model is a single step from PyTorch through a tool called LiteRT Torch, and JAX and TensorFlow are supported too (Get started guide). Or you skip conversion entirely and download a community model. Then, in the browser:

npm install @litertjs/core @litertjs/tfjs-interop
import { loadLiteRt, loadAndCompile } from '@litertjs/core';
import { runWithTfjsTensors } from '@litertjs/tfjs-interop';

// Load the WebAssembly runtime once, at startup.
await loadLiteRt('/wasm/');

// Compile the model. Ask for the GPU; fall back to CPU if it is not there.
let model;
try {
  model = await loadAndCompile('/models/segmenter.tflite', { accelerator: 'webgpu' });
} catch {
  model = await loadAndCompile('/models/segmenter.tflite', { accelerator: 'wasm' });
}

// Run it on the visitor's own hardware.
const output = runWithTfjsTensors(model, inputTensor);

That is the whole pattern, simplified. The accelerator string is 'webgpu', 'webnn', or 'wasm', and unsupported operations fall back to the CPU on their own. The exact function signatures live in Google's Get Started guide, which is where you should copy from rather than from my sketch above.

The honest caveats

Three things to check before you lean on this.

  • The GPU speed needs WebGPU, and coverage is good but not total. WebGPU is now supported in current Chrome, Edge, Firefox, and Safari (web.dev), covering the large majority of traffic (caniuse). But older phones, Linux setups, and some Apple silicon are still uneven. This is exactly why the WASM fallback matters: your feature still runs on the CPU when the GPU is missing, just slower.
  • The first load is a download. The runtime plus the model is real weight, sometimes several megabytes to tens of megabytes. Do not block your page's first paint on it. Load the model only when the visitor actually reaches for the feature, and let the browser cache it so the second visit is instant.
  • It is not a chatbot engine. If your idea needs frontier-scale reasoning or long generation, that stays in the cloud. LiteRT.js is for the specific, fast, well-defined models above. Matching the tool to the job is the whole skill here.

The through-line is simple. For a real and growing set of AI features, "send it to an API" is no longer the only option. You can hand the work to the visitor's own device, pay nothing per use, keep their data on their machine, and still have it run at video speed. For anyone building useful things on a small budget, that is a genuinely new floor.

If you are trying to launch a real web presence full of tools like this without a subscription stack bleeding you dry, that lean, build-it-yourself approach is the whole argument of my book The $97 Launch (search the title on Amazon Kindle). The short version lives on this blog, in the posts below.

Related reading

Fact-check notes and sources

  • Announcement and date: LiteRT.js was announced by Google on July 9, 2026 as "a JavaScript binding of LiteRT for running AI directly inside the web browser" (Google Developers Blog).
  • Performance claims: "outperforming other web runtimes by up to 3x" and a "5-60x speedup compared to standard CPU execution" for GPU/NPU, benchmarked on a 2024 Apple MacBook Pro with M4, per the announcement above. These are the vendor's own benchmarks; real-world results depend on the device and model.
  • Backends: CPU via XNNPACK with multi-thread support and a relaxed SIMD build; GPU via ML Drift on WebGPU; NPU via the WebNN API, which Google describes as experimental in Chrome and Edge (same source).
  • Demos and models: image segmentation and real-time detection via the Ultralytics YOLO family (with LiteRT export built into the Ultralytics package), depth estimation via Depth Anything V2, 4x upscaling via Real-ESRGAN, and in-browser vector search via EmbeddingGemma (same source).
  • Tooling and formats: models run in the .tflite format; PyTorch converts in a single step via LiteRT Torch, with JAX and TensorFlow also supported; the AI Edge Quantizer handles model shrinking; packages are @litertjs/core and @litertjs/tfjs-interop (Get started guide).
  • On-device LLMs: LiteRT-LM.js "adds browser support for LLMs via JavaScript API" (LiteRT-LM web docs).
  • WebGPU browser support: now shipping in Chrome, Edge, Firefox, and Safari, with remaining gaps on Linux, some Apple silicon, and older mobile GPUs (web.dev, caniuse).

This post is informational, not engineering or legal advice. Mentions of Google, LiteRT, TensorFlow, Ultralytics, and other third parties are nominative fair use. No affiliation is implied. Vendor performance figures are cited as published and were not independently benchmarked.

← Back to Blog

Accessibility Options

Text Size
High Contrast
Reduce Motion
Reading Guide
Link Highlighting
Accessibility Statement

J.A. Watte is committed to ensuring digital accessibility for people with disabilities. This site conforms to WCAG 2.1 and 2.2 Level AA guidelines.

Measures Taken

  • Semantic HTML with proper heading hierarchy
  • ARIA labels and roles for interactive components
  • Color contrast ratios meeting WCAG AA (4.5:1)
  • Full keyboard navigation support
  • Skip navigation link
  • Visible focus indicators (3:1 contrast)
  • 44px minimum touch/click targets
  • Dark/light theme with system preference detection
  • Responsive design for all devices
  • Reduced motion support (CSS + toggle)
  • Text size customization (14px–20px)
  • Print stylesheet

Feedback

Contact: jwatte.com/contact

Full Accessibility StatementPrivacy Policy

Last updated: April 2026