AlexAtomic commited on
Commit
c69c8a2
·
verified ·
1 Parent(s): ecf0565

Atomic Chat self-quantized google/gemma-4-E4B-it ladder (imatrix, calibration_datav3)

Browse files
.gitattributes CHANGED
@@ -33,3 +33,17 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ gemma4-e4b-it-IQ3_M.gguf filter=lfs diff=lfs merge=lfs -text
37
+ gemma4-e4b-it-IQ4_XS.gguf filter=lfs diff=lfs merge=lfs -text
38
+ gemma4-e4b-it-Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
39
+ gemma4-e4b-it-Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
40
+ gemma4-e4b-it-Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
41
+ gemma4-e4b-it-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
42
+ gemma4-e4b-it-Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text
43
+ gemma4-e4b-it-Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
44
+ gemma4-e4b-it-Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
45
+ gemma4-e4b-it-Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
46
+ gemma4-e4b-it-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
47
+ gemma4-e4b-it-UD-Q4_K_XL.gguf filter=lfs diff=lfs merge=lfs -text
48
+ hero.png filter=lfs diff=lfs merge=lfs -text
49
+ mmproj-gemma4-e4b-it-f16.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ license_link: https://ai.google.dev/gemma/docs/gemma_4_license
4
+ thumbnail: https://huggingface.co/AlexAtomic/gemma4-e4b-it-GGUF/resolve/main/hero.png
5
+ base_model:
6
+ - google/gemma-4-E4B-it
7
+ base_model_relation: quantized
8
+ quantized_by: AlexAtomic
9
+ pipeline_tag: image-text-to-text
10
+ library_name: gguf
11
+ tags:
12
+ - atomic-chat
13
+ - gemma
14
+ - gemma4
15
+ - google
16
+ - gguf
17
+ - imatrix
18
+ - quantized
19
+ - llama.cpp
20
+ ---
21
+
22
+ <center>
23
+
24
+ <div style="display:flex; justify-content:center; align-items:center; gap:10px; flex-wrap:wrap;">
25
+ <a href="https://atomic.chat"><img src="https://huggingface.co/AlexAtomic/gemma4-e4b-it-GGUF/resolve/main/pill_atomic_v3.png" alt="Atomic Chat" width="186"></a>
26
+ <a href="https://discord.gg/8wGSsvmg4V"><img src="https://huggingface.co/AlexAtomic/gemma4-e4b-it-GGUF/resolve/main/pill_discord_v3.png" alt="Join Discord" width="184"></a>
27
+ <a href="https://github.com/AtomicBot-ai/Atomic-Chat"><img src="https://huggingface.co/AlexAtomic/gemma4-e4b-it-GGUF/resolve/main/pill_github_v3.png" alt="GitHub" width="141"></a>
28
+ </div>
29
+
30
+ <br/>
31
+
32
+ <img src="https://huggingface.co/AlexAtomic/gemma4-e4b-it-GGUF/resolve/main/hero.png" alt="Gemma 4 E4B" style="width:100%; max-width:100%; height:auto; margin-bottom:0.6em;"/>
33
+
34
+ <div style="display:flex; justify-content:center; gap:0.5em;">
35
+ <a href="https://huggingface.co/google/gemma-4-E4B-it"><strong>Base model: google/gemma-4-E4B-it</strong></a>
36
+ </div>
37
+ </center>
38
+
39
+ **Gemma 4 E4B**, self-quantized to GGUF by [Atomic Chat](https://atomic.chat). Built straight from Google's original weights with a per-tensor importance matrix. Runs fully offline.
40
+
41
+ ## Highlights
42
+
43
+ - **Natively multimodal** — handles text, image, and audio input and generates text output.
44
+ - **4.5B effective parameters (8B with embeddings)** — the "E" stands for "effective", using Per-Layer Embeddings (PLE) for on-device efficiency.
45
+ - **128K-token context window** built on a hybrid local/global attention mechanism.
46
+ - **Built-in thinking mode** — configurable step-by-step reasoning, triggered with the `<|think|>` token.
47
+ - **Native function calling** for structured tool use and agentic workflows.
48
+ - **Multilingual** — out-of-the-box support for 35+ languages, pre-trained on 140+ languages.
49
+
50
+ > [!NOTE]
51
+ > These GGUFs are **self-quantized from the original weights**, not a repack. The importance matrix keeps low-bit quants closer to the full-precision model.
52
+
53
+ > [!IMPORTANT]
54
+ > Always pass `--jinja` so the **Gemma 4 E4B chat template** is applied. Without it the model can emit malformed turns.
55
+
56
+ ## Model Overview
57
+
58
+ | Property | Value |
59
+ |---|---|
60
+ | Base model | `google/gemma-4-E4B-it` |
61
+ | Parameters | 4.5B effective (8B with embeddings); uses Per-Layer Embeddings (PLE) |
62
+ | Layers | 42 |
63
+ | Context length | 128K tokens |
64
+ | Vocabulary | 262K |
65
+ | Modalities | Text, Image, Audio |
66
+ | Architecture | Dense, hybrid local sliding-window (512) + global attention with p-RoPE |
67
+ | This repo | GGUF quants (imatrix) + vision mmproj |
68
+
69
+ > [!NOTE]
70
+ > Gemma 4 E4B is multimodal. This repo ships the **`mmproj-gemma4-e4b-it-f16.gguf`** vision projector. With `-hf` it is pulled automatically; otherwise pass `--mmproj`. Use `llama-mtmd-cli` or `llama-server` to feed images.
71
+
72
+ <img src="https://huggingface.co/AlexAtomic/gemma4-e4b-it-GGUF/resolve/main/benchmark.png" alt="Gemma 4 E4B benchmark scores" style="width:100%; max-width:760px;"/>
73
+
74
+ Scores are Google's published results for the base `google/gemma-4-E4B-it`. Quantization preserves the large majority of this; `Q4_K_M` and up sit within a point or two of full precision.
75
+
76
+
77
+ ## Choosing a quant
78
+
79
+ | Quant | Size | Notes |
80
+ |---|---|---|
81
+ | `Q2_K` | 4.4 GB | Smallest. Minimal RAM, clear quality drop. |
82
+ | `IQ3_M` | 4.7 GB | Beats Q3 at similar size thanks to imatrix. Best low-RAM pick. |
83
+ | `Q3_K_M` | 0.1 GB | Low quality but usable. |
84
+ | `Q3_K_L` | 5.0 GB | A step above Q3_K_M. |
85
+ | `IQ4_XS` | 5.1 GB | Excellent quality for size. Recommended low-bit. |
86
+ | `Q4_K_S` | 0.1 GB | Compact Q4, fast. |
87
+ | **`Q4_K_M`** | 5.3 GB | **Recommended default. Best balance of size, speed and quality.** |
88
+ | **`UD-Q4_K_XL`** | 6.2 GB | **Dynamic. Embeddings and output kept at Q8_0 for higher quality at a Q4 footprint.** |
89
+ | `Q5_K_S` | 5.7 GB | Higher quality. |
90
+ | `Q5_K_M` | 5.8 GB | Higher quality, low loss. |
91
+ | `Q6_K` | 6.2 GB | Near lossless. |
92
+ | `Q8_0` | 8.0 GB | Effectively lossless, reference quality. |
93
+
94
+ > [!TIP]
95
+ > Pick the largest file that fits your (V)RAM with room for context. `Q4_K_M` or `UD-Q4_K_XL` is the sweet spot for most setups; `Q6_K` or `Q8_0` for maximum fidelity.
96
+
97
+ ## Get started
98
+
99
+ Run Gemma 4 E4B locally with:
100
+
101
+ - **[Atomic Chat](https://atomic.chat):** the easiest path. Open the app, search `AlexAtomic/gemma4-e4b-it-GGUF`, pick a quant, hit **Use this model**.
102
+ - **llama.cpp:** `llama-server -hf AlexAtomic/gemma4-e4b-it-GGUF:Q4_K_M --jinja -c 8192`
103
+ - **Ollama:** `ollama run hf.co/AlexAtomic/gemma4-e4b-it-GGUF:Q4_K_M`
104
+ - **LM Studio / Jan:** search the repo id, download any quant.
105
+
106
+ ## Best practices
107
+
108
+ | Parameter | Value |
109
+ |---|---|
110
+ | temperature | 1.0 |
111
+ | top_p | 0.95 |
112
+ | top_k | 64 |
113
+
114
+ Google's standardized sampling configuration recommended across all use cases.
115
+
116
+ ## Run in llama.cpp
117
+
118
+ ```bash
119
+ git clone https://github.com/ggerganov/llama.cpp
120
+ cmake llama.cpp -B llama.cpp/build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON
121
+ cmake --build llama.cpp/build --config Release -j --target llama-cli llama-server
122
+ ```
123
+
124
+ ```bash
125
+ ./llama.cpp/build/bin/llama-server \
126
+ -hf AlexAtomic/gemma4-e4b-it-GGUF:UD-Q4_K_XL \
127
+ --jinja -ngl 99 -c 8192 -fa on
128
+ ```
129
+
130
+ ## How these were made
131
+
132
+ 1. Download `google/gemma-4-E4B-it` (original weights).
133
+ 2. Convert to f16 GGUF with [llama.cpp](https://github.com/ggerganov/llama.cpp).
134
+ 3. Build an importance matrix over `calibration_datav3` (100 chunks).
135
+ 4. Quantize the full ladder with `--imatrix`.
136
+ 5. `UD-Q4_K_XL` additionally pins the token-embedding and output tensors to `Q8_0`.
137
+
138
+ ## License
139
+
140
+ Original model by Google DeepMind, released under the Apache 2.0 license. Quantized by Atomic Chat.
141
+
benchmark.png ADDED
gemma4-e4b-it-IQ3_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5408286c230d253d831d208651d79c1d68dcae88d995721415f975825e67c078
3
+ size 4714696192
gemma4-e4b-it-IQ4_XS.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee912d0c765ac8480b8aa3904bc02b8e0564f93124988d5af7a3effa15382ac4
3
+ size 5070956032
gemma4-e4b-it-Q2_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12dd2286d2f05155cd14e1ac32e71f1b06065b8df1990f80b368ea95936d404a
3
+ size 4401321472
gemma4-e4b-it-Q3_K_L.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ecbeba83958494f61254434217e4ed5fbd5ae8eb4a195c65b59a58179845928
3
+ size 5021281792
gemma4-e4b-it-Q3_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c78bdf973f56cacec724525c009f0ee731f1503eba815fc03e0c69fdc99a2da
3
+ size 70886560
gemma4-e4b-it-Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf4b60853354d05a8fc21aa7bb9e1f292a7e74c328331d7229499913b9d77dbd
3
+ size 5335291392
gemma4-e4b-it-Q4_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c78bdf973f56cacec724525c009f0ee731f1503eba815fc03e0c69fdc99a2da
3
+ size 70886560
gemma4-e4b-it-Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e28ec8266d0aafea0d2bae333e17e2fd9e43ea0e012454ef81ddccf329314a6
3
+ size 5762913792
gemma4-e4b-it-Q5_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:838c9b56271b09afc67512ebb11d01b5fb9e8becccb5836d6e048db7d8fd243e
3
+ size 5685970432
gemma4-e4b-it-Q6_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ce1c3a87ca8e877f82da9d8af8bbc1726199a8f5e8482929ab2e79a20af509b
3
+ size 6217262592
gemma4-e4b-it-Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e68160d4c432e12b83ef42d9f82b450c394c308c7f828d37dac17e54ff02d94b
3
+ size 8031241728
gemma4-e4b-it-UD-Q4_K_XL.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43fb5fb7958bc169e49c9ccf570a253431752432a163f1e9a7efd8881f11c624
3
+ size 6180443648
hero.png ADDED

Git LFS Details

  • SHA256: 9c0e503f4be60479a64510afec10878d3c2787e834b1dc9f89d3b900a1e71001
  • Pointer size: 131 Bytes
  • Size of remote file: 186 kB
mmproj-gemma4-e4b-it-f16.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b26ce301094fdc470b658b48061fc1a7c2535769619865c4f5031927a6374a6
3
+ size 991552256
pill_atomic_v3.png ADDED
pill_discord_v3.png ADDED
pill_github_v3.png ADDED