Gemma 4 E2B-it WebGPU W4

A text-only, browser-oriented distribution derived from Google DeepMind's official QAT W4A16 checkpoint:

Base model: google/gemma-4-E2B-it-qat-w4a16-ct

This distribution is designed for the Gemma 4 JavaScript runtimes in:

Runtime / source code: https://github.com/NZM0/gemma4-js

Important: This is not a standard Transformers checkpoint. AutoModel.from_pretrained() is not expected to load this distribution.

Base model

  • Base model: google/gemma-4-E2B-it-qat-w4a16-ct
  • Original authors: Google DeepMind
  • Base-model license: Apache License 2.0
  • Architecture: Gemma 4 E2B-it
  • Source checkpoint format: QAT W4A16 / Compressed Tensors

The original checkpoint is published by Google DeepMind on Hugging Face.

Modifications from the original checkpoint

This repository contains a derivative distribution of the original checkpoint. The following changes were made:

  • Removed Vision-specific model weights.
  • Removed Audio-specific model weights.
  • Removed the duplicate lm_head.weight that is not used by this runtime.
  • Preserved the original QAT W4A16 language-model weights used by the runtime.
  • Preserved the tied language-model embedding used as the LM head.
  • Quantized model.language_model.embed_tokens_per_layer.weight (the per-layer embedding / PLE tensor) from BF16 to signed symmetric W4.
  • PLE integer range: [-7, 7].
  • PLE quantization group size: 32.
  • PLE scale format: BF16.
  • No PLE zero point is stored.
  • Packed W4 values use low-nibble-first two's-complement nibble encoding.
  • Split the quantized PLE into 64 independently loadable shards.
  • Repacked the model into a browser-oriented distribution format.

No additional training or fine-tuning was performed.

Distribution layout

core.safetensors
ple-w4/
β”œβ”€β”€ manifest.json
β”œβ”€β”€ ple-00000-of-00064.bin
β”œβ”€β”€ ple-00001-of-00064.bin
β”œβ”€β”€ ...
└── ple-00063-of-00064.bin

Approximate model-data size:

Component Approximate size
CORE 1.73 GiB
PLE W4 1.23 GiB
Total 2.96 GiB

PLE quantization

The source PLE tensor has shape:

[262144, 8960]

and is stored as BF16 in the original checkpoint.

This distribution stores it as:

signed symmetric W4
integer range: [-7, 7]
group size: 32
scale dtype: BF16
zero point: none

The original PLE occupies approximately 4.38 GiB. The W4 representation, including BF16 scales, occupies approximately 1.23 GiB.

Usage

This distribution is intended for the accompanying Gemma 4 JavaScript runtimes.

The project currently includes:

  • TensorFlow.js WebGL reference using the original QAT checkpoint.
  • TensorFlow.js WebGL reference using this compact CORE + W4 PLE format.
  • Custom WebGPU/WGSL runtime using this compact format.
  • Dense BF16 TensorFlow.js Node.js reference implementation.

The Custom WebGPU runtime supports both local-file loading and remote loading from a Hugging Face repository.

For remote loading, use this repository's resolve URL as the model base URL:

https://huggingface.co/NZM0/gemma-4-E2B-it-webgpu-w4/resolve/main

See the runtime repository for complete usage instructions.

Scope

This is a text-only distribution.

Vision and Audio components present in the original multimodal Gemma 4 checkpoint are intentionally not included.

Compatibility

This repository is a custom browser-oriented model-data format.

It is not intended to be loaded directly with standard Transformers, vLLM, or Compressed Tensors APIs.

License and attribution

The base checkpoint google/gemma-4-E2B-it-qat-w4a16-ct is published under the Apache License 2.0.

This derivative distribution is provided under the Apache License 2.0. See LICENSE for the complete license text.

The modifications made to the original checkpoint are documented in Modifications from the original checkpoint above.

Gemma is a trademark of Google LLC. Use of the Gemma name here is solely to identify the upstream model from which this distribution was derived.

This project is not affiliated with or endorsed by Google or Google DeepMind.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for NZM0/gemma-4-E2B-it-webgpu-w4