Google's Gemma 4 E4B Doubles Mobile AI Speed to 49 Tokens per Second
Google's LiteRT community ships Gemma 4 E4B in a mobile-ready format with speculative decoding support across Android, iOS, desktop, web, and Raspberry Pi.
Takeaways
- Google's litert-community released Gemma 4 E4B in
.litertlmformat for the LiteRT-LM on-device runtime. - Runs on Android, iOS, Windows, macOS, Linux, Web/WASM, and Raspberry Pi from one Apache 2.0 file.
- New speculative decoding boosts S26 Ultra GPU decode from 21.9 to 49.4 tok/s on code tasks.
- Hits 91 tok/s decode on an RTX 4090 and 44 tok/s in a WebGPU browser tab.
- 3.66 GB file with memory-mapped embeddings; supports 32k context (128k on the Web build).
- Install via
pip install -U litert-lmor try through the AI Edge Gallery app.
Google’s on-device runtime team has published a new Gemma 4 E4B build for LiteRT-LM, its orchestration layer for local generative AI. The release adds speculative decoding on mobile and desktop CPUs and GPUs, increasing reported output speed from about 22 to as much as 49 tokens per second on a Samsung S26 Ultra GPU.
The model repository provides ready-to-run .litertlm artifacts for Android, iOS, desktop, web, and Raspberry Pi. It lists an Apache-2.0 license and requires no access approval. Developers gain a common runtime layer for local inference without routing prompts through a hosted model API.
A 3.66 GB package with lazy-loaded media
LiteRT-LM sits above LiteRT, Google’s cross-platform inference runtime. LiteRT supplies CPU acceleration through XNNPack and GPU acceleration through ML Drift, while LiteRT-LM handles generative AI concerns such as prompt templates, KV-cache allocation, multimodal loading, and function calling.
The primary model file is 3.66 GB. Google attributes 2.24 GB to decoder weights and 0.67 GB to embedding parameters, with vision and audio components loaded when needed. The runtime keeps the main weights resident while memory-mapping the embeddings, allowing the operating system to page those parameters instead of loading the entire table into working memory.
Disk size and peak memory remain separate constraints. Actual memory use depends on the backend, context length, KV cache, operating system, and whether mapped pages remain resident.
Run it from the command line
Running the following commands installs the Python package and downloads the model from Hugging Face when the CLI starts:
pip install -U litert-lm
litert-lm run \
--from-huggingface-repo=litert-community/gemma-4-E4B-it-litert-lm \
--prompt="Write me a poem"
The initial download requires several gigabytes of storage and network transfer. Production apps will need a distribution strategy, such as an on-demand download with progress reporting, integrity checks, and device compatibility checks.
Draft, verify, accelerate
Speculative decoding pairs the target model with a smaller, faster draft model. The draft proposes several tokens, and the target evaluates them together, accepting valid predictions and resuming generation after a mismatch. Higher acceptance rates reduce the number of sequential target-model passes.
Predictable tasks such as code completion, rewriting, and summarization usually produce higher acceptance rates than open-ended generation. The target model still governs the resulting token distribution; the optimization changes how candidate tokens are evaluated.
| Backend | Task | Speculative decoding | Decode rate | Speedup |
|---|---|---|---|---|
| GPU | Baseline | No | 21.9 tok/s | 1.00× |
| GPU | Code snippet | Yes | 49.4 tok/s | 2.26× |
| GPU | Tone rewrite | Yes | 47.5 tok/s | 2.17× |
| GPU | Summarization | Yes | 46.0 tok/s | 2.10× |
| GPU | Free-form generation | Yes | 36.7 tok/s | 1.68× |
| CPU | Baseline | No | 17.0 tok/s | 1.00× |
| CPU | Tone rewrite | Yes | 29.5 tok/s | 1.74× |
These vendor-reported results show that the gain varies by prompt rather than applying uniformly. The repository also instructs anyone who downloaded the model before May 5, 2026, to fetch the updated artifact before enabling speculative decoding.
From phones to a Raspberry Pi
Google measured each platform with 1,024 prompt tokens, 256 generated tokens, and a 2,048-token context. Prefill rate measures how quickly the runtime processes the input prompt, while decode rate measures generated tokens per second. Time to first token includes the delay before output begins.
| Platform | Backend | Prefill | Decode | TTFT | Notes |
|---|---|---|---|---|---|
| Samsung S26 Ultra | Android GPU | 1,293 tok/s | 22.1 tok/s | 0.8 s | About 710 MB reported CPU memory |
| iPhone 17 Pro | iOS GPU | 1,189 tok/s | 25.1 tok/s | 0.9 s | Mobile GPU path |
| RTX 4090 system | Linux GPU | 7,260 tok/s | 91.2 tok/s | Not listed | Discrete desktop GPU |
| Apple M4 Max | macOS GPU | 2,560 tok/s | 101.1 tok/s | Not listed | Native macOS build |
| Intel Lunar Lake | Windows GPU | 1,202 tok/s | 25.1 tok/s | Not listed | 7.1 GB reported GPU memory |
| Apple M4 Max | WebGPU | 1,590 tok/s | 44.0 tok/s | Not listed | Web-optimized artifact |
| Raspberry Pi 5, 16 GB | CPU | 51 tok/s | 3.2 tok/s | Not listed | IoT deployment |
The two Android tables report slightly different baseline decode rates, 21.9 and 22.1 tokens per second, and should be treated as separate benchmark runs. The memory figures also measure different pools: the Android figure covers CPU memory, while the Windows figure covers GPU memory. They do not provide a direct platform-to-platform memory comparison.
The standard build supports context lengths up to 32,000 tokens. Google lists a specialized web artifact with support for up to 128,000 tokens because browsers impose different memory and packaging constraints. Both limits exceed the 2,048-token context used for these tests. Longer contexts expand the KV cache and can reduce throughput or exceed available memory.
Local inference shifts the engineering costs
On the tested phone GPU, structured prompts reached 46 to 49 tokens per second with speculative decoding, compared with roughly 22 tokens per second at baseline. That range can support interactive summarization, rewriting, code suggestions, and tool selection without a network round trip.
- Privacy and offline use: Prompts and outputs can remain within the app’s local execution path, subject to its telemetry, storage, and operating-system integrations.
- Distribution: The 3.66 GB artifact may be too large for an application bundle, making post-install downloads and cache management necessary.
- Cost: Local execution removes per-request inference charges while shifting compute, battery, storage, and support costs to the device and application team.
- Sustained performance: Short benchmark runs do not establish behavior under thermal throttling, low battery, background contention, or repeated long-context requests.
- Function calling: LiteRT-LM can orchestrate tool calls, but applications still need schema validation, permission checks, timeouts, and safe error handling.
- Quality: The published throughput results do not measure task accuracy, hallucination rates, or safety behavior. Teams should evaluate those properties against their own prompts.
Managed Android or direct deployment
| Integration path | Best fit | Developer responsibility |
|---|---|---|
| Android AI Core | Production apps on supported Android devices using Gemini Nano | Work within AI Core’s supported devices, APIs, and model availability |
| LiteRT-LM | Cross-platform apps, custom Gemma builds, web deployments, and devices outside AI Core coverage | Distribute the model and validate memory, performance, compatibility, and updates |
Google recommends Android AI Core for supported production Android applications. LiteRT-LM gives teams direct control over the model artifact and extends the same orchestration approach to iOS, desktop, web, and IoT targets.
Try the build
- The Edge Gallery app provides a packaged mobile interface. The linked store listing covers Android, and the release also lists iOS support.
- The hosted browser demo runs the web build through WebGPU.
- The SDK documentation covers Kotlin, Swift, C++, Python, JavaScript, and Flutter integrations.
The repository displayed nearly 900,000 downloads at publication, although that count reflects artifact requests rather than unique applications or production deployments. The measurable change in this release is narrower and useful: speculative decoding more than doubled reported mobile GPU throughput on several structured tasks while preserving a local, cross-platform deployment path.