Gemma3-1B-IT — Google Tensor NPU (AOT, 4096 context)
[!NOTE] Quantized, repackaged variants of
google/gemma-3-1b-itprecompiled (AOT) for the Google Tensor Edge TPU NPU across Pixel generations. Packaged as.litertlmbundles for LiteRT-LM. G3/G4 = int4 per-channel + Hadamard · G5/G6 = int8. (This repo was previously namedGemma3-1B-IT-Tensor-G4-NPU.)
[!IMPORTANT] Community build — not an official Google release. Built and maintained by @xThr45hx; not affiliated with or endorsed by Google.
Variants
| SoC | Pixel | Quant | File | Status |
|---|---|---|---|---|
| Tensor G4 | Pixel 9 / 9 Pro / 9 Pro XL / 9 Pro Fold | int4 + Hadamard | Gemma3-1B-IT_int4hadamard_aot_ekv4096_G4.litertlm |
✅ VERIFIED on device |
| Tensor G3 | Pixel 8 / 8 Pro / 8a | int4 + Hadamard | Gemma3-1B-IT_int4hadamard_aot_ekv4096_G3.litertlm |
🟡 Same program as the verified G4 build; replies word-for-word identically to the G4 build on G4 hardware — awaiting a Pixel 8 report |
| Tensor G6 | Pixel 11 series | int8 | Gemma3-1B-IT_int8_aot_ekv4096_G6.litertlm |
✅ VERIFIED on device (retail Pixel 11 Pro XL, kodiak): coherent output, runs on the NPU |
| Tensor G5 | Pixel 10 series | int8 | Gemma3-1B-IT_int8_aot_ekv4096_G5.litertlm |
⚠️ UNVERIFIED on hardware — compiled 100% to the NPU (buenos_b0, 1295/1295 + 1226/1226 ops, 0 CPU ops); awaiting a Pixel 10 report |
[!NOTE] Why int8 on G5/G6? On a retail Tensor G6 (
santafe_a0) every int4 variant we compiled with the Tensor SDK v2.1 runs on the NPU but produces word salad. That covers int4 + Hadamard, plain per-channel int4, mixed int8-head + int4-body, blockwise-64 int4, and several compiler-option combinations (8 builds in total). The same graph quantized to int8 is coherent on the NPU. The int4 path on G6 is not yet working with the current compiler, and that is not a quant-recipe problem we could fix on our side. G5 uses the same int8 recipe as G6. Google's own G5/G6 Gemma 3 1B bundles are also int8.The earlier int4 G5/G6 bundles in this repo have been removed. The G6 one failed warmup on a retail Pixel 11 (it was built with the older beta SDK, whose G6 firmware ABI didn't match retail silicon; SDK v2.1 fixed that). The G5 one was never confirmed on hardware.
[!WARNING] Tensor G5 is not yet confirmed on a Pixel 10. It is built from the same int8 model as the verified G6 bundle and compiles fully to the NPU. If you have a Pixel 10, please test it and comment on this repo (Community tab) with: device, whether it loads on the NPU, tokens/s, and a sample multi-sentence reply. That's what moves it to ✅.
[!WARNING] Tensor G3 is not yet confirmed on a Pixel 8. Strong evidence it works: the G3 and G4 compiles are the same program. They differ in only 19 bytes (a device-type tag and its hash), and the G3 bundle runs on a Pixel 9 (G4) and gives word-for-word identical replies to the G4 build. If you have a Pixel 8 / 8 Pro / 8a, please test it and comment on this repo (Community tab) with: device, whether it loads on the NPU, tokens/s, and a sample multi-sentence reply. That's what moves it to ✅.
Cross-generation DGC compatibility (tested on a Pixel 9 Pro XL / Tensor G4)
- G3 ↔ G4: the G3 and G4 builds compile to the same program. They differ only in a device-type
field (
03vs04) in the embedded compiler options, plus its 8-byte hash. The G3 bundle loads and gives word-for-word identical replies to the G4 build on G4 hardware, so the G4 runtime does not enforce the tag. - G5 → G4: in an earlier test, a G5-compiled Gemma4-E2B loaded on G4 and its prefill executed on the G4 NPU, but decode did not. G5 compiles use dual-cluster optimizations that G4 hardware lacks, so newer-generation DGCs are only partly forward-loadable.
- Takeaway: use the build for your chip. G3 and G4 share a program; G5 and G6 need their own compiles.
All variants: 26-layer Gemma 3 1B-IT, 4096 context (embedded KV cache), prefill 128, embedded
tokenizer + chat template, .litertlm v1, built from Google's QAT checkpoint
google/gemma-3-1b-it-qat-int4-unquantized.
Sizes: G3/G4 int4 ≈ 875 MB · G5 int8 ≈ 1.65 GB · G6 int8 ≈ 2.11 GB.
- G3/G4: to our knowledge, the first publicly available int4 AOT Tensor-NPU build of Gemma 3 1B, at about half the size of the int8 Tensor-NPU Gemma 3 1B bundles: 875 MB vs Google's 1,678 MB G5 int8 build (0.52×).
- G6: 4096 context, against the 1280 of Google's own G6 bundle (3.2× the context), at about the same size (~2.1 GB vs 2.04 GB).
⚠️ How to run it
These are precompiled DarwiNN DGCs. They need a GoogleTensor dispatch runtime that matches your chip's generation.
👉 G3/G4: use Box. It ships the correct runtimes/dispatch libs.
Download the APK, put the .litertlm for your SoC on the phone, load it with the NPU backend.
| Surface | Support |
|---|---|
| Box (github.com/jegly/Box) | ✅ recommended for G3/G4 |
LiteRT-LM CLI (--backend=npu) |
✅ with a compatible dispatch runtime |
| Stock Google AI Edge Gallery | ❌ on G3/G4 (its bundled dispatch runtime is the newer-generation one). On G5/G6, import with the settings below |
| Use the file for your SoC only | a DGC compiled for one Tensor generation won't run on another |
| llama.cpp / GGUF, Web, iOS, desktop, non-Pixel | ❌ .litertlm DGCs are Pixel-NPU-only |
Edge Gallery import settings
Use Import Model with: max tokens 4096, accelerator NPU only, image/audio/thinking/speculative decoding off.
Performance (Pixel 9 Pro XL, Tensor G4)
Measured 2026-09-10 on the G4 bundle:
| prefill | decode | prefill tok/s | decode tok/s |
|---|---|---|---|
| 128 | 64 | 608.83 | 15.93 |
| 512 | 128 | 659.22 | 16.17 |
| 1024 | 64 | 663.99 | 15.89 |
Prefill scales, decode is pinned (~16 tok/s, dispatch-bound): fastest option on the phone for prefill-heavy work (RAG, long context, summarization, classification).
The exact AOT recipe (reproducible)
Full step-by-step for both paths in AOT_RECIPE.md. The int4 path has an
executable version with guardrails in recipe/gemma3_int4hr_recipe.py.
Shared:
- Source: QAT weights
google/gemma-3-1b-it-qat-int4-unquantized(not plain-it). - Export:
litert_torchexport_hf:split_cache=True,cache_length=4096,prefill_lengths=[128],externalize_embedder=True. Use the floatprefill_decode(model.tflite), not the default int8 copy that export_hf also writes.
G3/G4 (int4 + Hadamard):
- Quantize:
ai_edge_quantizerdynamic_wi4c_hr_afp32(int4 per-channel + Hadamard rotation), applied once. - Rank-2 FC surgery:
recipe/fc_rank2_surgery.py(seeRANK2_FC_SURGERY.md). - Compile: large-model-support only, no sharding flag.
ai_edge_litert 2.2.0+ Google Tensor beta compiler (BuildID87ea807a…).
G5/G6 (int8):
- Quantize:
ai_edge_quantizerdynamic_wi8_afp32on the floatmodel.tflite. - No rank-2 surgery.
- Compile: large-model-support only. Tensor SDK v2.1:
ai-edge-litert 2.3.0+ai-edge-litert-sdk-google-tensor 2.3.0(compiler BuildIDf4df3004…). In our tests the nightly packages INTERNAL'd on this graph and the stable 2.3.0 packages compiled it.
Reproducibility check: a from-scratch G4 rebuild with this recipe produces a compiled prefill_decode that is
bit-identical to the published G4 build (md5 f1102df2…), and gives word-for-word identical replies
on device.
Quantization notes
- G3/G4: Hadamard rotation is the coherence fix. Plain per-channel int4 is fluent-but-wrong; the same int4 + Hadamard is correct. Also what lets the 4096-context graph compile.
- G6: int4 is not yet coherent with the current compiler. All 8 int4 variants we tried word-salad on retail silicon. int8 is coherent.
- int4 per-tensor compiles but word-salads (one scale over the 262k-vocab head).
- Blockwise int4 compiles but is incoherent on the NPU AOT path.
- Per-quant support is compiler-build-dependent: retest against your own compiler instead of trusting a table.
Files
| File | Purpose |
|---|---|
Gemma3-1B-IT_int4hadamard_aot_ekv4096_G4.litertlm |
Tensor G4, int4: ✅ verified |
Gemma3-1B-IT_int4hadamard_aot_ekv4096_G3.litertlm |
Tensor G3, int4: 🟡 same program as G4, awaiting Pixel 8 report |
Gemma3-1B-IT_int8_aot_ekv4096_G6.litertlm |
Tensor G6, int8: ✅ verified (Pixel 11 Pro XL) |
Gemma3-1B-IT_int8_aot_ekv4096_G5.litertlm |
Tensor G5, int8: ⚠️ unverified on hardware (buenos_b0) |
AOT_RECIPE.md |
exact reproducible AOT recipe (int4 G3/G4 + int8 G5/G6) |
recipe/gemma3_int4hr_recipe.py |
executable int4 recipe with toolchain/input guardrails |
recipe/fc_rank2_surgery.py |
rank-3 → rank-2 FC surgery (G3/G4) |
RANK2_FC_SURGERY.md |
why the surgery is needed |
MANIFEST.md |
sizes + SHA-256 |
docs/ |
Edge Gallery import screenshots |
License & attribution
Base model Gemma 3 1B-IT © Google, under the Gemma Terms of Use. These quantized/repackaged derivatives inherit the Gemma license. Runtime: LiteRT-LM / LiteRT (Apache-2.0). Quantization, rank-2 FC surgery, int4 + Hadamard and int8 AOT compiles, and Tensor NPU packaging by @xThr45hx. Not affiliated with or endorsed by Google.