innerloop-dev commited on
Commit
31153ca
·
verified ·
1 Parent(s): acb0b4b

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +133 -0
README.md ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: gemma
3
+ license_name: gemma-terms-of-use
4
+ license_link: https://ai.google.dev/gemma/terms
5
+ base_model: google/gemma-3-4b-it
6
+ pipeline_tag: text-generation
7
+ library_name: gguf
8
+ language:
9
+ - en
10
+ tags:
11
+ - gemma3
12
+ - gguf
13
+ - text-only
14
+ - ollama
15
+ - breadcrumb
16
+ ---
17
+
18
+ Google's Gemma 3 4B, as Ollama builds it, with the picture-reading part taken out.
19
+ The text weights are the same bytes. It writes text. It cannot look at an image.
20
+
21
+ ## What it is
22
+
23
+ This is Ollama's own `gemma3:4b` — the Q4_K_M build of `google/gemma-3-4b-it` — with the
24
+ vision tower and the multimodal projection removed and nothing else changed.
25
+
26
+ - Source file: the model layer of `gemma3:4b`,
27
+ sha256 `aeda25e63ebd698fab8638ffb778e68bed908b960d39d0becc650fa981609d25`,
28
+ 3,338,792,448 bytes.
29
+ - What came out: 439 tensors whose names begin `v.` (the SigLIP vision tower) or `mm.`
30
+ (the multimodal input projection), and 9 metadata keys — `gemma3.mm.tokens_per_image`
31
+ and the eight `gemma3.vision.*` keys.
32
+ - What stayed: all 444 text tensors, byte for byte. Same names, same ggml quantization
33
+ types, same shapes, same bytes. Nothing was requantized, converted, retrained or
34
+ fine-tuned. The tokenizer is untouched, all 262,145 entries, so token numbers do not
35
+ move and the model writes the same words.
36
+ - What was added: one metadata key, `general.description`, carrying the notice that this
37
+ file is a modified Gemma file.
38
+ - Result: 2,498,332,864 bytes,
39
+ sha256 `199388f8f8cbec06b80bd63b0b1a774103e00c993c107bf1d480e58047420532`.
40
+
41
+ The template and the sampling parameters are the ones Ollama ships with `gemma3:4b`,
42
+ unchanged: stop `<end_of_turn>`, temperature 1, top_k 64, top_p 0.95.
43
+
44
+ ## Why
45
+
46
+ [Breadcrumb](https://innerloop.works), by Innerloop, uses this model to give screens, chapters and meetings short names. It only
47
+ ever sends it text. The vision tower was 840 MB of weights that were read off disk,
48
+ paged in and held in memory for work that never happened.
49
+
50
+ Measured on the same machine, one model resident at a time, with `footprint` against the
51
+ running `llama-server`:
52
+
53
+ | | on disk | held while answering |
54
+ |---|---|---|
55
+ | `gemma3:4b` | 3.3 GB | 4.28 GB |
56
+ | this model | 2.5 GB | 2.73 GB |
57
+
58
+ That is about 1.6 GB less memory while it is working, and 0.8 GB less disk. On an 8 GB
59
+ Mac that is the difference between naming a screen and swapping.
60
+
61
+ The names it writes are the same names. On 300 pinned items from a real store — 150
62
+ screen moments, 75 chapters, 75 meetings — this file and `gemma3:4b` wrote 300 identical
63
+ titles out of 300, at the same settings, and both were stable across a second pass.
64
+
65
+ ## It cannot see
66
+
67
+ This is a text-only model. There is no vision tower in the file and no projector layer in
68
+ the manifest. `ollama show` reports one capability, `completion`, where `gemma3:4b`
69
+ reports `completion` and `vision`. If you send it an image it has nothing to look at.
70
+ If you need Gemma 3 to read pictures, use `gemma3:4b` instead.
71
+
72
+ ## Gemma notice
73
+
74
+ Gemma is provided under and subject to the Gemma Terms of Use found at
75
+ ai.google.dev/gemma/terms
76
+
77
+ This distribution contains a modified Gemma file. The full Gemma Terms of Use, as last
78
+ modified April 1, 2026, travel with the model: the LICENSE file in this repository is that complete copy, and NOTICE carries the modification notice.
79
+
80
+ Use of this model is subject to Google's Gemma Prohibited Use Policy at
81
+ ai.google.dev/gemma/prohibited_use_policy. That policy is part of the Gemma Terms and
82
+ applies to you whether you got this model from us or from anywhere else. If you pass this
83
+ model on, or anything you build from it, you pass these terms on with it and you tell the
84
+ people you pass it to that the Gemma use restrictions apply.
85
+
86
+ Google claims no rights in what you generate with it.
87
+
88
+ Everything in this distribution that is not Gemma is © Innerloop, [innerloop.works](https://innerloop.works).
89
+
90
+ ## How to verify it yourself
91
+
92
+ You do not have to take our word that only the vision parts came out. The check needs
93
+ nothing but a GGUF reader.
94
+
95
+ 1. Get Ollama's `gemma3:4b` and find its model layer in your blob store. It should hash
96
+ to `aeda25e63ebd698fab8638ffb778e68bed908b960d39d0becc650fa981609d25`.
97
+ 2. Get this model and find its model layer. It should hash to
98
+ `199388f8f8cbec06b80bd63b0b1a774103e00c993c107bf1d480e58047420532` and be
99
+ 2,498,332,864 bytes.
100
+ 3. Open both with a GGUF reader and list the tensors. The original has 883 tensors and
101
+ this one has 444 tensors. Every one of the 439 missing tensors has a name beginning
102
+ `v.` or `mm.`. Nothing else is missing.
103
+ 4. The 444 that remain are `token_embd.weight`, `output_norm.weight`, and thirteen
104
+ tensors for each of the 34 blocks: `attn_q.weight`, `attn_k.weight`, `attn_v.weight`,
105
+ `attn_output.weight`, `attn_q_norm.weight`, `attn_k_norm.weight`, `attn_norm.weight`,
106
+ `post_attention_norm.weight`, `ffn_gate.weight`, `ffn_up.weight`, `ffn_down.weight`,
107
+ `ffn_norm.weight`, `post_ffw_norm.weight`. By quantization: 205 Q4_K, 34 Q6_K,
108
+ 205 F32, the same counts as in the original's text half.
109
+ 5. For each of those 444, compare the ggml type, the shape, the byte count and the
110
+ sha256 of the tensor's own bytes against the same tensor in the original. All 444
111
+ match. Any single mismatch means the weights were touched, and they were not.
112
+ 6. The metadata: 27 keys here against 35 in the original. The 9 that are gone are the
113
+ vision keys listed above. One key is new, `general.description`, which says the file
114
+ was modified. `general.architecture` is still `gemma3`, and the tokenizer keys are
115
+ identical.
116
+
117
+ The script that does the surgery lives in a private repository, so the recipe is written
118
+ out above rather than linked. It is short enough to re-implement: copy every tensor whose
119
+ name does not start with `v.` or `mm.`, copy every metadata key that does not start with
120
+ `gemma3.vision.` or `gemma3.mm.`, add `general.description`, write the file. Then hash
121
+ what you wrote. If you get `199388f8…` you have reproduced it exactly.
122
+
123
+ ## What we did not do
124
+
125
+ No fine-tuning. No requantization. No distillation. No change to the tokenizer, the chat
126
+ template or the sampling defaults. No system prompt. This is the same model, minus a part
127
+ it was not being asked to use.
128
+
129
+
130
+ ## Get it
131
+
132
+ - Ollama: `ollama run innerloop/gemma3-4b-text` (the same file, published at https://ollama.com/innerloop/gemma3-4b-text)
133
+ - This repository: the GGUF is `gemma-3-4b-it-text-Q4_K_M.gguf`, 2,498,332,864 bytes, sha256 `199388f8f8cbec06b80bd63b0b1a774103e00c993c107bf1d480e58047420532`.