Gemma 4 E4B Instruct — GGUF (iPhone-optimized, text path)
GGUF quantizations of
google/gemma-4-E4B-it
, built and optimized for on-device inference on iPhone, iPad, and Apple Silicon Macs via
llama.cpp
or apps that wrap it (e.g.
Haplo
).
Gemma 4 is Google's 2026 successor to Gemma 3, using the
Mix-of-Modality
(MoM) pattern from Gemma 3n: a single set of weights with conditional execution paths that yield different effective parameter counts.
E4B
has ~4B active parameters during a forward pass and ~7B total parameters on disk. The base model is multimodal (
any-to-any
— text/vision/audio);
this drop ships only the text path
for now, since llama.cpp does not yet expose Gemma 4's vision/audio towers via standard chat APIs.
Available quantizations
File
Size
Bits/weight
Recommended use
Gemma-4-E4B-it-Q4_K_M.gguf
5.0 GB
5.66
Default — best size/quality tradeoff for iPhone Pro & iPad
Gemma-4-E4B-it-Q5_K_M.gguf
5.4 GB
6.12
Slightly better quality, ~8% bigger; good for iPad / Mac
Q8_0 was skipped to keep download sizes practical — for near-FP16 quality, run the upstream model directly on a Mac.
Pick
Q4_K_M
for general use. ~5GB is the largest single-file model that fits comfortably on a 256GB iPhone with other apps installed.
Performance on Apple Silicon
Approximate decode throughput at single-batch greedy decode, 2048-token context, text-only path. Measured with
llama-cli
.
Device
RAM
Q4_K_M tok/s
Notes
iPhone 15 Pro
8 GB
~14 tok/s
5GB is the largest model practically usable here
iPhone 16 Pro
8 GB
~17 tok/s
Recommended phone target
iPad Pro M4
16 GB
~32 tok/s
Snappy; consider Q5_K_M for better quality
MacBook Pro M3
16 GB
~58 tok/s
Effectively instant
Reference numbers — Gemma 4's MoM architecture has slightly higher per-token cost than a comparable 4B dense model because the conditional execution graph has more branches.
How to use
1. Haplo (iPhone / iPad / Mac)
The model appears automatically in Haplo's model browser on
Kuzco-1.2.0+
builds (older builds use the wrong chat template — see "Chat template" below). The download URL for Q4_K_M is:
The full template (in
chat_template.jinja
from the upstream model) also defines
<|channel>...<channel|>
for thinking/reasoning streams,
<|tool>...<tool|>
for tool declarations, and
<|tool_call>...<tool_call|>
/
<|tool_response>...<tool_response|>
for function calling. The basic chat path above is sufficient for most use cases.
The chat template is preserved in the GGUF metadata, so
llama.cpp
's
--chat-template
flag is not required.
If you are wrapping
llama.cpp
in your own app, make sure your prompt formatter has a dedicated path for Gemma 4 — Gemma 3's template will produce garbage tokens.
Sampling defaults
For chat / general output:
temperature=0.7
,
top_p=0.95
(Google's recommendation for Gemma 4 base chat).
For deterministic / structured output:
temperature=0.0
,
top_p=1.0
.
The GGUF stores the upstream defaults — most clients (llama.cpp, Haplo, Ollama) will use them automatically.
Quantization recipe
Built with
llama.cpp
at commit
f9cd456
(May 7, 2026).
Downloaded
google/gemma-4-E4B-it
safetensors checkpoint via
huggingface-cli
.
Patched
tokenizer_config.json
— converted
extra_special_tokens
from list-of-strings (
['<|video|>']
) to dict (
{'video_token': '<|video|>'}
) to satisfy
transformers
4.57.6's tokenizer loader.
Converted to GGUF FP16 via
convert_hf_to_gguf.py --outtype f16
. Only the text tower is emitted — vision and audio towers are not preserved in this drop.
Quantized to each target type via
llama-quantize
:
No imatrix calibration was used — the weights come from the upstream BF16 directly.
What's missing vs upstream
Vision tower
— not in this drop. Gemma 4 E4B can natively process images via
<|image|>
tokens; that path requires an
mmproj
companion file similar to SmolVLM, which is not yet wired into Haplo.
Audio tower
— not in this drop. Same reason.
Q8_0
— skipped to keep downloads under 6GB.
If you need these, run the upstream model on a Mac via
transformers
directly.
Governed by
Google's Gemma Terms of Use
(linked above as the "license_link"). The Gemma license permits commercial use, modification, and redistribution, subject to the Use Restrictions in the Gemma Prohibited Use Policy. Read the full terms at
https://ai.google.dev/gemma/docs/gemma_4_license
before using these weights in production.
Gemma 4 by Google. Used and redistributed under the Gemma Terms of Use.
Acknowledgements
Google for the original Gemma 4 weights and the open release.
The
llama.cpp
team for the Gemma 4 converter and inference register that landed May 7, 2026 — without that, this drop would not exist.
Gemma-4-E4B-it-GGUF huggingface.co is an AI model on huggingface.co that provides Gemma-4-E4B-it-GGUF's model effect (), which can be used instantly with this jc-builds Gemma-4-E4B-it-GGUF model. huggingface.co supports a free trial of the Gemma-4-E4B-it-GGUF model, and also provides paid use of the Gemma-4-E4B-it-GGUF. Support call Gemma-4-E4B-it-GGUF model through api, including Node.js, Python, http.
Gemma-4-E4B-it-GGUF huggingface.co is an online trial and call api platform, which integrates Gemma-4-E4B-it-GGUF's modeling effects, including api services, and provides a free online trial of Gemma-4-E4B-it-GGUF, you can try Gemma-4-E4B-it-GGUF online for free by clicking the link below.
jc-builds Gemma-4-E4B-it-GGUF online free url in huggingface.co:
Gemma-4-E4B-it-GGUF is an open source model from GitHub that offers a free installation service, and any user can find Gemma-4-E4B-it-GGUF on GitHub to install. At the same time, huggingface.co provides the effect of Gemma-4-E4B-it-GGUF install, users can directly use Gemma-4-E4B-it-GGUF installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Gemma-4-E4B-it-GGUF install url in huggingface.co: