litert-community/gemma-4-E4B-it-litert-lm

Model

203

stars

30

commits

5

repos using this model

2

linked in READMEs

Aug 7, 2026

updated

litert-lm

README

litert-community/gemma-4-E4B-it-litert-lm

Main Model Card: google/gemma-4-E4B-it

This model card provides the Gemma 4 E4B model in a way that is ready for deployment on Android, iOS, Desktop, IoT and Web.

Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models. This particular Gemma 4 model is small so it is ideal for on-device use cases. By running this model on device, users can have private access to Generative AI technology without even requiring an internet connection.

These models are provided in the .litertlm format for use with the LiteRT-LM framework. LiteRT-LM is a specialized orchestration layer built directly on top of LiteRT, Google’s high-performance multi-platform runtime trusted by millions of Android and edge developers. LiteRT provides the foundational hardware acceleration via XNNPack for CPU and ML Drift for GPU. LiteRT-LM adds the specialized GenAI libraries and APIs, such as KV-cache management, prompt templating, and function calling. This integrated stack is the same technology powering the Google AI Edge Gallery showcase app.

The model file size is 3.66 GB, which includes a text decoder with 2.24 GB of weights and 0.67 GB of embedding parameters. LiteRT-LM framework always keeps main weights in memory, while the embedding parameters are memory mapped which enables significant working memory savings on some platforms as seen in the detailed data below. The vision and audio models are loaded as needed to further reduce memory consumption.

Try Gemma 4 E4B

Build with Gemma 4 E4B and LiteRT-LM

Ready to integrate this into your product? Get started here.

Gemma 4 E4B Performance on LiteRT-LM

All benchmarks were taken using 1024 prefill tokens and 256 decode tokens with a context length of 2048 tokens via LiteRT-LM. The model can support up to 32k context length. The inference on CPU is accelerated via the LiteRT XNNPACK delegate with 4 threads. Time-to-first-token does not include load time. Benchmarks were run with caches enabled and initialized. During the first run, the latency and memory usage may differ. Model size is the size of the file on disk.

CPU memory was measured using, rusage::ru_maxrss on Android, Linux and Raspberry Pi, task_vm_info::phys_footprint on iOS and MacBook and process_memory_counters::PrivateUsage on Windows.

Android

Note: On supported Android devices, Gemma 4 is available through Android AI Core as Gemini Nano, which is the recommended path for production applications.

Device                                     BackendPrefill (tokens/sec)Decode (tokens/sec)Time-to-first-token (sec)Model size (MB)CPU Memory (MB)
S26 UltraCPU19517.75.336543283
S26 UltraGPU1,29322.10.83654710

🚨 NEW: Android with Speculative Decoding 🚨

The numbers in this section include speculative decoding. Speculative decoding is an optimization that accelerates LLMs by using a small, fast "draft" model to quickly predict multiple upcoming tokens, while a larger “target” model then verifies those tokens in parallel. The effectiveness of speculative decoding is task dependent because the “draft” model can more easily predict the correct tokens of some tasks. The metrics in this section were collected from a variety of sample prompts and grouped into categories by task type. The baseline measurements are an average across all task types. The number of input and output tokens varied across prompts. Note that if you download this model before May 5, 2026, you should re-download the model if you want to use speculative decoding. Speculative decoding is available on CPU and GPU on Mobile and Desktop.

Device                                     BackendTask TypeSpeculative Decoding?Decode (tokens/sec)CPU Memory (MB)
S26 UltraCPUBaselineNo17.02800
S26 UltraCPUSummarize textYes27.53116
S26 UltraCPUCode snippetYes26.22946
S26 UltraCPURewrite toneYes29.52922
S26 UltraCPUFree formYes21.12962
S26 UltraGPUBaselineNo21.9837
S26 UltraGPUSummarize textYes46.01069
S26 UltraGPUCode snippetYes49.41021
S26 UltraGPURewrite toneYes47.5999
S26 UltraGPUFree formYes36.7991

iOS

Device                                     BackendPrefill (tokens/sec)Decode (tokens/sec)Time-to-first-token (sec)Model size (MB)CPU/GPU Memory (MB)
iPhone 17 ProCPU1599.76.53654961
iPhone 17 ProGPU1,18925.10.936543380

Linux

Device                                     BackendPrefill (tokens/sec)Decode (tokens/sec)Time-to-first-token (sec)Model size (MB)CPU Memory (MB)
Arm 2.3 & 2.8GHzCPU8217.512.636543139
NVIDIA GeForce RTX 4090GPU7,26091.20.236541119

macOS

Device                                     BackendPrefill (tokens/sec)Decode (tokens/sec)Time-to-first-token (sec)Model size (MB)CPU/GPU Memory (MB)
MacBook Pro M4 MaxCPU27727.03.73654890
MacBook Pro M4 MaxGPU2,560101.10.436543217

Windows

Device                                     BackendPrefill (tokens/sec)Decode (tokens/sec)Time-to-first-token (sec)Model size (MB)CPU Memory (MB)
Intel LunarLakeCPU17316.85.9836549372
Intel LunarLakeGPU120225.130.8936547147

Web

Device                                     BackendPrefill (tokens/sec)Decode (tokens/sec)Time-to-first-token (sec)Model size (MB)GPU Memory (MB)
Macbook Pro M4 MaxWebGPU1,590441.752969~3300
  • Web on LiteRT-LM uses a specially optimized model for Web because of its unique memory constraints. Currently the model is text-only.

IoT

Device                                     BackendPrefill (tokens/sec)Decode (tokens/sec)Time-to-first-token (sec)Model size (MB)CPU Memory (MB)
Raspberry Pi 5 16GBCPU513.220.536543069

Running Gemma 4 E4B on Web with MediaPipe

You can also run Gemma through MediaPipe LLM Inference Engine. However, this route is currently in maintenance mode. To add it to your existing MediaPipe flow, download the gemma-4-E4B-it-web.task model file and run with our sample web page, or follow the guide to add it to your own app.

Contributors

marissaw

23 commits

tylermullen

4 commits

mattkreileder

1 commits

Yoursmiling

1 commits

litert-community/gemma-4-E4B-it-litert-lm

Model

203

stars

30

commits

5

repos using this model

2

linked in READMEs

Aug 7, 2026

updated

litert-lm

README

litert-community/gemma-4-E4B-it-litert-lm

Main Model Card: google/gemma-4-E4B-it

This model card provides the Gemma 4 E4B model in a way that is ready for deployment on Android, iOS, Desktop, IoT and Web.

Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models. This particular Gemma 4 model is small so it is ideal for on-device use cases. By running this model on device, users can have private access to Generative AI technology without even requiring an internet connection.

These models are provided in the .litertlm format for use with the LiteRT-LM framework. LiteRT-LM is a specialized orchestration layer built directly on top of LiteRT, Google’s high-performance multi-platform runtime trusted by millions of Android and edge developers. LiteRT provides the foundational hardware acceleration via XNNPack for CPU and ML Drift for GPU. LiteRT-LM adds the specialized GenAI libraries and APIs, such as KV-cache management, prompt templating, and function calling. This integrated stack is the same technology powering the Google AI Edge Gallery showcase app.

The model file size is 3.66 GB, which includes a text decoder with 2.24 GB of weights and 0.67 GB of embedding parameters. LiteRT-LM framework always keeps main weights in memory, while the embedding parameters are memory mapped which enables significant working memory savings on some platforms as seen in the detailed data below. The vision and audio models are loaded as needed to further reduce memory consumption.

Try Gemma 4 E4B

Build with Gemma 4 E4B and LiteRT-LM

Ready to integrate this into your product? Get started here.

Gemma 4 E4B Performance on LiteRT-LM

All benchmarks were taken using 1024 prefill tokens and 256 decode tokens with a context length of 2048 tokens via LiteRT-LM. The model can support up to 32k context length. The inference on CPU is accelerated via the LiteRT XNNPACK delegate with 4 threads. Time-to-first-token does not include load time. Benchmarks were run with caches enabled and initialized. During the first run, the latency and memory usage may differ. Model size is the size of the file on disk.

CPU memory was measured using, rusage::ru_maxrss on Android, Linux and Raspberry Pi, task_vm_info::phys_footprint on iOS and MacBook and process_memory_counters::PrivateUsage on Windows.

Android

Note: On supported Android devices, Gemma 4 is available through Android AI Core as Gemini Nano, which is the recommended path for production applications.

Device                                     BackendPrefill (tokens/sec)Decode (tokens/sec)Time-to-first-token (sec)Model size (MB)CPU Memory (MB)
S26 UltraCPU19517.75.336543283
S26 UltraGPU1,29322.10.83654710

🚨 NEW: Android with Speculative Decoding 🚨

The numbers in this section include speculative decoding. Speculative decoding is an optimization that accelerates LLMs by using a small, fast "draft" model to quickly predict multiple upcoming tokens, while a larger “target” model then verifies those tokens in parallel. The effectiveness of speculative decoding is task dependent because the “draft” model can more easily predict the correct tokens of some tasks. The metrics in this section were collected from a variety of sample prompts and grouped into categories by task type. The baseline measurements are an average across all task types. The number of input and output tokens varied across prompts. Note that if you download this model before May 5, 2026, you should re-download the model if you want to use speculative decoding. Speculative decoding is available on CPU and GPU on Mobile and Desktop.

Device                                     BackendTask TypeSpeculative Decoding?Decode (tokens/sec)CPU Memory (MB)
S26 UltraCPUBaselineNo17.02800
S26 UltraCPUSummarize textYes27.53116
S26 UltraCPUCode snippetYes26.22946
S26 UltraCPURewrite toneYes29.52922
S26 UltraCPUFree formYes21.12962
S26 UltraGPUBaselineNo21.9837
S26 UltraGPUSummarize textYes46.01069
S26 UltraGPUCode snippetYes49.41021
S26 UltraGPURewrite toneYes47.5999
S26 UltraGPUFree formYes36.7991

iOS

Device                                     BackendPrefill (tokens/sec)Decode (tokens/sec)Time-to-first-token (sec)Model size (MB)CPU/GPU Memory (MB)
iPhone 17 ProCPU1599.76.53654961
iPhone 17 ProGPU1,18925.10.936543380

Linux

Device                                     BackendPrefill (tokens/sec)Decode (tokens/sec)Time-to-first-token (sec)Model size (MB)CPU Memory (MB)
Arm 2.3 & 2.8GHzCPU8217.512.636543139
NVIDIA GeForce RTX 4090GPU7,26091.20.236541119

macOS

Device                                     BackendPrefill (tokens/sec)Decode (tokens/sec)Time-to-first-token (sec)Model size (MB)CPU/GPU Memory (MB)
MacBook Pro M4 MaxCPU27727.03.73654890
MacBook Pro M4 MaxGPU2,560101.10.436543217

Windows

Device                                     BackendPrefill (tokens/sec)Decode (tokens/sec)Time-to-first-token (sec)Model size (MB)CPU Memory (MB)
Intel LunarLakeCPU17316.85.9836549372
Intel LunarLakeGPU120225.130.8936547147

Web

Device                                     BackendPrefill (tokens/sec)Decode (tokens/sec)Time-to-first-token (sec)Model size (MB)GPU Memory (MB)
Macbook Pro M4 MaxWebGPU1,590441.752969~3300
  • Web on LiteRT-LM uses a specially optimized model for Web because of its unique memory constraints. Currently the model is text-only.

IoT

Device                                     BackendPrefill (tokens/sec)Decode (tokens/sec)Time-to-first-token (sec)Model size (MB)CPU Memory (MB)
Raspberry Pi 5 16GBCPU513.220.536543069

Running Gemma 4 E4B on Web with MediaPipe

You can also run Gemma through MediaPipe LLM Inference Engine. However, this route is currently in maintenance mode. To add it to your existing MediaPipe flow, download the gemma-4-E4B-it-web.task model file and run with our sample web page, or follow the guide to add it to your own app.

Contributors

marissaw

23 commits

tylermullen

4 commits

mattkreileder

1 commits

Yoursmiling

1 commits