Litert.js, Google's high performance Web AI Inference

ilreb2 pts0 comments

LiteRT.js, Google's high performance Web AI Inference

- Google Developers Blog

Search

LiteRT.js, Google's high performance Web AI Inference

JULY 9, 2026

Ping Yu

Software Engineer

Marko Ristić

Software Engineer

Matthew Soulanille

Software Engineer

Chintan Parikh

Product Manager

Share

Facebook

Twitter

LinkedIn

Mail

We are excited to announce LiteRT.js, a JavaScript binding of LiteRT for running AI directly inside the web browser. By bringing the trusted on-device inference library LiteRT to the web, web developers can now run ML and AI models with maximum performance entirely locally. This means enhanced user privacy, zero server costs, and ultra-low latency for real-time experiences. For developers with existing .tflite models, LiteRT.js makes deployment to mobile and desktop web browsers smoother than ever, serving as a powerful evolution from TensorFlow.js for executing .tflite models.<br>While prior web AI solutions like TensorFlow.js relied on less performant JavaScript-based kernels, we are now making our native, cross-platform runtime with all its optimizations directly available to web developers through WebAssembly. LiteRT.js unlocks impressive performance by running your .tflite models directly in the browser leveraging the state-of-the-art hardware acceleration of LiteRT, including XNNPACK for CPU, ML Drift for GPU, and the upcoming WebNN for NPUs.<br>Our initial release provides all the tools needed to get started, including the new LiteRT.js npm package and a collection of demos showcasing real-world implementation.

Sorry, your browser doesn't support playback for this video

Vector search right in the browser, powered by LiteRT.js and EmbeddingGemma. Try it here.

How LiteRT.js benefits web developers<br>With LiteRT.js, web developers can integrate models into their apps written in JavaScript or TypeScript to handle complex tasks like text generation, object detection, and audio processing entirely client-side. As LiteRT.js shares a unified cross-platform stack with LiteRT, your web applications automatically benefit from the latest performance upgrades, quantization improvements, and hardware optimizations developed for Android, iOS, and desktop.<br>By leveraging LiteRT's lowering flow and runtime, you get simple conversion of models from a variety of Python ML frameworks and native hardware acceleration across all major accelerators (CPU / GPU / NPU). To help you unlock these AI capabilities easily, here are the main highlights of LiteRT.js:<br>1.PyTorch conversion & tailored quantization

With LiteRT Torch, PyTorch models can be converted in a single step, making them instantly ready to leverage advanced browser-based hardware acceleration. Get started today by following the LiteRT Torch guide.<br>For further optimization, AI Edge Quantizer allows you to configure tailored quantization schemes across different model layers. This achieves substantial size reductions and performance gains while preserving overall model quality. Explore the quantization colab to see this in action.<br>2.Native hardware acceleration across CPU, GPU, and NPU

LiteRT.js enables high-performance AI inference for a diverse variety of hardware backends.

CPU : utilizes XNNPACK , Google's highly optimized library for on-device CPU acceleration, providing robust multi-thread support and a relaxed SIMD build for enhanced performance.<br>GPU : powered by ML Drift , Google's leading solution for on-device GPU acceleration. LiteRT.js leverages WebGPU to enable state-of-the-art GPU acceleration on the web.<br>NPU : harnesses the emerging WebNN API (currently experimental in Chrome and Edge) to target dedicated NPUs for power-efficient, ultra low-latency inference.

Ready to accelerate your web applications? Dive into the LiteRT.js documentation to get started.

LiteRT.js Architecture Overview

Performance and real-world impact<br>To demonstrate the real-world impact of the unified runtime and hardware-accelerated backends, we evaluated LiteRT.js against existing web solutions. Across classical computer vision and audio processing models, LiteRT.js delivers significant speedups—outperforming other web runtimes by up to 3x across both CPU and GPU inference.

Note: Performance benchmarks conducted on a 2024 Apple MacBook Pro with M4 Apple Silicon in a controlled browser environment. Individual user performance may vary based on local GPU capabilities, thermal throttling, and browser driver optimization.

To ground these claims in real-world efficiency, we benchmarked popular AI models using LiteRT.js across three distinct web execution backends: CPU (via XNNPACK) , WebGPU , and WebNN (via Apple CoreML). For demanding real-time applications like object tracking, audio transcription, or image manipulation, leveraging the GPU or NPU via WebGPU or WebNN delivers 5-60x speedup compared to standard CPU execution, ensuring lower latency without compromising performance.

Note: Performance benchmarks conducted on a 2024 Apple MacBook Pro with...

litert performance models inference browser hardware

Related Articles