homerquan commited on
Commit
336c50f
·
verified ·
1 Parent(s): b0be8ba

Add standard Q4_K_M text model and Q8_0 vision/audio companion

Browse files
.gitattributes CHANGED
@@ -1,35 +1 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz 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
 
1
+ *.gguf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
GGUF_AUDIT.json ADDED
@@ -0,0 +1,360 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "passed": true,
3
+ "preserved_metadata_fields": [
4
+ "gemma-embedding2.block_count",
5
+ "gemma-embedding2.context_length",
6
+ "gemma-embedding2.embedding_length",
7
+ "gemma-embedding2.feed_forward_length",
8
+ "gemma-embedding2.attention.head_count",
9
+ "gemma-embedding2.attention.head_count_kv",
10
+ "gemma-embedding2.rope.freq_base",
11
+ "gemma-embedding2.rope.freq_base_swa",
12
+ "gemma-embedding2.attention.layer_norm_rms_epsilon",
13
+ "gemma-embedding2.attention.key_length",
14
+ "gemma-embedding2.attention.value_length",
15
+ "gemma-embedding2.attention.sliding_window",
16
+ "gemma-embedding2.attention.shared_kv_layers",
17
+ "gemma-embedding2.embedding_length_per_layer_input",
18
+ "gemma-embedding2.attention.sliding_window_pattern",
19
+ "gemma-embedding2.attention.key_length_swa",
20
+ "gemma-embedding2.attention.value_length_swa",
21
+ "gemma-embedding2.rope.dimension_count",
22
+ "gemma-embedding2.rope.dimension_count_swa",
23
+ "gemma-embedding2.embedding_length_out",
24
+ "gemma-embedding2.attention.causal",
25
+ "gemma-embedding2.pooling_type",
26
+ "tokenizer.ggml.model",
27
+ "tokenizer.ggml.tokens",
28
+ "tokenizer.ggml.scores",
29
+ "tokenizer.ggml.token_type",
30
+ "tokenizer.ggml.merges",
31
+ "tokenizer.ggml.bos_token_id",
32
+ "tokenizer.ggml.eos_token_id",
33
+ "tokenizer.ggml.unknown_token_id",
34
+ "tokenizer.ggml.padding_token_id",
35
+ "tokenizer.ggml.mask_token_id",
36
+ "tokenizer.ggml.add_bos_token",
37
+ "tokenizer.ggml.add_eos_token",
38
+ "tokenizer.ggml.add_sep_token",
39
+ "tokenizer.chat_template",
40
+ "tokenizer.ggml.add_space_prefix"
41
+ ],
42
+ "tokenizer_tokens": 262144,
43
+ "projection_tensor": {
44
+ "name": "output.weight",
45
+ "shape_ggml": [
46
+ 512,
47
+ 768
48
+ ]
49
+ },
50
+ "files": [
51
+ {
52
+ "path": "work/embeddinggemma-2-BF16.gguf",
53
+ "size_bytes": 557950176,
54
+ "sha256": "68bae29d62fb8c7d23e98d21fd4662753ddd636e6b62b8a70dfe059a9844f216",
55
+ "tensor_count": 413,
56
+ "tensor_types": {
57
+ "BF16": 219,
58
+ "F32": 194
59
+ },
60
+ "tensor_prefixes": {
61
+ "token_embd": 1,
62
+ "output": 1,
63
+ "blk": 408,
64
+ "output_norm": 1,
65
+ "per_layer_model_proj": 1,
66
+ "per_layer_proj_norm": 1
67
+ },
68
+ "metadata": {
69
+ "general.architecture": "gemma-embedding2",
70
+ "general.type": "model",
71
+ "general.name": "embeddinggemma-2",
72
+ "general.size_label": "271M",
73
+ "general.license": "apache-2.0",
74
+ "general.tags": [
75
+ "embedding",
76
+ "feature-extraction",
77
+ "sentence-transformers",
78
+ "multimodal-embedding",
79
+ "multimodal",
80
+ "vision",
81
+ "audio",
82
+ "video",
83
+ "image-feature-extraction",
84
+ "audio-feature-extraction",
85
+ "video-feature-extraction",
86
+ "sentence-similarity",
87
+ "feature-extraction"
88
+ ],
89
+ "general.languages": [
90
+ "multilingual"
91
+ ],
92
+ "gemma-embedding2.block_count": 24,
93
+ "gemma-embedding2.context_length": 262144,
94
+ "gemma-embedding2.embedding_length": 512,
95
+ "gemma-embedding2.feed_forward_length": 2048,
96
+ "gemma-embedding2.attention.head_count": 4,
97
+ "gemma-embedding2.attention.head_count_kv": [
98
+ 2,
99
+ 2,
100
+ 2,
101
+ 2,
102
+ 2,
103
+ 1,
104
+ 2,
105
+ 2,
106
+ 2,
107
+ 2,
108
+ 2,
109
+ 1,
110
+ 2,
111
+ 2,
112
+ 2,
113
+ 2,
114
+ 2,
115
+ 1,
116
+ 2,
117
+ 2,
118
+ 2,
119
+ 2,
120
+ 2,
121
+ 1
122
+ ],
123
+ "gemma-embedding2.rope.freq_base": 1000000.0,
124
+ "gemma-embedding2.rope.freq_base_swa": 10000.0,
125
+ "gemma-embedding2.attention.layer_norm_rms_epsilon": 9.999999974752427e-07,
126
+ "gemma-embedding2.attention.key_length": 512,
127
+ "gemma-embedding2.attention.value_length": 512,
128
+ "general.file_type": 32,
129
+ "gemma-embedding2.attention.sliding_window": 1024,
130
+ "gemma-embedding2.attention.shared_kv_layers": 0,
131
+ "gemma-embedding2.embedding_length_per_layer_input": 512,
132
+ "gemma-embedding2.attention.sliding_window_pattern": [
133
+ true,
134
+ true,
135
+ true,
136
+ true,
137
+ true,
138
+ false,
139
+ true,
140
+ true,
141
+ true,
142
+ true,
143
+ true,
144
+ false,
145
+ true,
146
+ true,
147
+ true,
148
+ true,
149
+ true,
150
+ false,
151
+ true,
152
+ true,
153
+ true,
154
+ true,
155
+ true,
156
+ false
157
+ ],
158
+ "gemma-embedding2.attention.key_length_swa": 256,
159
+ "gemma-embedding2.attention.value_length_swa": 256,
160
+ "gemma-embedding2.rope.dimension_count": 512,
161
+ "gemma-embedding2.rope.dimension_count_swa": 256,
162
+ "gemma-embedding2.embedding_length_out": 768,
163
+ "gemma-embedding2.attention.causal": false,
164
+ "gemma-embedding2.pooling_type": 1,
165
+ "general.quantization_version": 2
166
+ }
167
+ },
168
+ {
169
+ "path": "release/embeddinggemma-2-Q4_K_M.gguf",
170
+ "size_bytes": 181694688,
171
+ "sha256": "d610afe26dd783739275646d51d4d85b4167820fd051600696d7a49e6f68609f",
172
+ "tensor_count": 413,
173
+ "tensor_types": {
174
+ "Q6_K": 25,
175
+ "F32": 194,
176
+ "BF16": 1,
177
+ "Q4_K": 193
178
+ },
179
+ "tensor_prefixes": {
180
+ "output": 1,
181
+ "output_norm": 1,
182
+ "per_layer_model_proj": 1,
183
+ "per_layer_proj_norm": 1,
184
+ "token_embd": 1,
185
+ "blk": 408
186
+ },
187
+ "metadata": {
188
+ "general.architecture": "gemma-embedding2",
189
+ "general.type": "model",
190
+ "general.name": "embeddinggemma-2",
191
+ "general.size_label": "271M",
192
+ "general.license": "apache-2.0",
193
+ "general.tags": [
194
+ "embedding",
195
+ "feature-extraction",
196
+ "sentence-transformers",
197
+ "multimodal-embedding",
198
+ "multimodal",
199
+ "vision",
200
+ "audio",
201
+ "video",
202
+ "image-feature-extraction",
203
+ "audio-feature-extraction",
204
+ "video-feature-extraction",
205
+ "sentence-similarity",
206
+ "feature-extraction"
207
+ ],
208
+ "general.languages": [
209
+ "multilingual"
210
+ ],
211
+ "gemma-embedding2.block_count": 24,
212
+ "gemma-embedding2.context_length": 262144,
213
+ "gemma-embedding2.embedding_length": 512,
214
+ "gemma-embedding2.feed_forward_length": 2048,
215
+ "gemma-embedding2.attention.head_count": 4,
216
+ "gemma-embedding2.attention.head_count_kv": [
217
+ 2,
218
+ 2,
219
+ 2,
220
+ 2,
221
+ 2,
222
+ 1,
223
+ 2,
224
+ 2,
225
+ 2,
226
+ 2,
227
+ 2,
228
+ 1,
229
+ 2,
230
+ 2,
231
+ 2,
232
+ 2,
233
+ 2,
234
+ 1,
235
+ 2,
236
+ 2,
237
+ 2,
238
+ 2,
239
+ 2,
240
+ 1
241
+ ],
242
+ "gemma-embedding2.rope.freq_base": 1000000.0,
243
+ "gemma-embedding2.rope.freq_base_swa": 10000.0,
244
+ "gemma-embedding2.attention.layer_norm_rms_epsilon": 9.999999974752427e-07,
245
+ "gemma-embedding2.attention.key_length": 512,
246
+ "gemma-embedding2.attention.value_length": 512,
247
+ "gemma-embedding2.attention.sliding_window": 1024,
248
+ "gemma-embedding2.attention.shared_kv_layers": 0,
249
+ "gemma-embedding2.embedding_length_per_layer_input": 512,
250
+ "gemma-embedding2.attention.sliding_window_pattern": [
251
+ true,
252
+ true,
253
+ true,
254
+ true,
255
+ true,
256
+ false,
257
+ true,
258
+ true,
259
+ true,
260
+ true,
261
+ true,
262
+ false,
263
+ true,
264
+ true,
265
+ true,
266
+ true,
267
+ true,
268
+ false,
269
+ true,
270
+ true,
271
+ true,
272
+ true,
273
+ true,
274
+ false
275
+ ],
276
+ "gemma-embedding2.attention.key_length_swa": 256,
277
+ "gemma-embedding2.attention.value_length_swa": 256,
278
+ "gemma-embedding2.rope.dimension_count": 512,
279
+ "gemma-embedding2.rope.dimension_count_swa": 256,
280
+ "gemma-embedding2.embedding_length_out": 768,
281
+ "gemma-embedding2.attention.causal": false,
282
+ "gemma-embedding2.pooling_type": 1,
283
+ "general.quantization_version": 2,
284
+ "general.file_type": 15
285
+ }
286
+ },
287
+ {
288
+ "path": "release/mmproj-embeddinggemma-2-Q8_0.gguf",
289
+ "size_bytes": 554821056,
290
+ "sha256": "0531309472a6bc6f4b146c3736eee7795ec9db1903c25490d3c937490cef6dd8",
291
+ "tensor_count": 963,
292
+ "tensor_types": {
293
+ "F32": 716,
294
+ "Q8_0": 247
295
+ },
296
+ "tensor_prefixes": {
297
+ "a": 751,
298
+ "mm": 2,
299
+ "v": 210
300
+ },
301
+ "metadata": {
302
+ "general.architecture": "clip",
303
+ "general.type": "mmproj",
304
+ "general.name": "embeddinggemma-2",
305
+ "general.size_label": "473M",
306
+ "general.license": "apache-2.0",
307
+ "general.tags": [
308
+ "embedding",
309
+ "feature-extraction",
310
+ "sentence-transformers",
311
+ "multimodal-embedding",
312
+ "multimodal",
313
+ "vision",
314
+ "audio",
315
+ "video",
316
+ "image-feature-extraction",
317
+ "audio-feature-extraction",
318
+ "video-feature-extraction",
319
+ "sentence-similarity",
320
+ "feature-extraction"
321
+ ],
322
+ "general.languages": [
323
+ "multilingual"
324
+ ],
325
+ "general.file_type": 7,
326
+ "clip.has_vision_encoder": true,
327
+ "clip.vision.projection_dim": 512,
328
+ "clip.vision.image_size": 224,
329
+ "clip.vision.patch_size": 16,
330
+ "clip.vision.embedding_length": 768,
331
+ "clip.vision.feed_forward_length": 3072,
332
+ "clip.vision.block_count": 16,
333
+ "clip.vision.attention.head_count": 12,
334
+ "clip.vision.image_mean": [
335
+ 0.0,
336
+ 0.0,
337
+ 0.0
338
+ ],
339
+ "clip.vision.image_std": [
340
+ 1.0,
341
+ 1.0,
342
+ 1.0
343
+ ],
344
+ "clip.has_audio_encoder": true,
345
+ "clip.audio.projection_dim": 512,
346
+ "clip.audio.embedding_length": 1024,
347
+ "clip.audio.feed_forward_length": 4096,
348
+ "clip.audio.block_count": 12,
349
+ "clip.audio.attention.head_count": 8,
350
+ "clip.vision.projector_type": "gemma4v",
351
+ "clip.vision.attention.layer_norm_epsilon": 9.999999974752427e-07,
352
+ "clip.use_gelu": true,
353
+ "clip.audio.projector_type": "gemma4a",
354
+ "clip.audio.num_mel_bins": 128,
355
+ "clip.audio.attention.layer_norm_epsilon": 9.999999974752427e-07,
356
+ "general.quantization_version": 2
357
+ }
358
+ }
359
+ ]
360
+ }
LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
PROVENANCE.json ADDED
@@ -0,0 +1,764 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "publisher": "MirrorNeuronLab",
3
+ "repository": "MirrorNeuronLab/embeddinggemma-2-GGUF",
4
+ "created_utc": "2026-11-01T15:08:34.179820+00:00",
5
+ "original_developer": "Google DeepMind",
6
+ "source": {
7
+ "repo_id": "google/embeddinggemma-2",
8
+ "revision": "f9972ac22e696a105c482202646979e33e4b5a1e",
9
+ "files": [
10
+ {
11
+ "path": ".gitattributes",
12
+ "size_bytes": 1301,
13
+ "sha256": "bcdccfaa66bc1240c7192dbd374cfb39b695bb1d8ff6b7ce0113aa5e9ac21a44",
14
+ "upstream_lfs_sha256": null
15
+ },
16
+ {
17
+ "path": "1_Pooling/config.json",
18
+ "size_bytes": 90,
19
+ "sha256": "8759bdf7c77efc7df7723f64856a593c8943b71ee38baf2a88771fbaf78438f9",
20
+ "upstream_lfs_sha256": null
21
+ },
22
+ {
23
+ "path": "2_Normalize/config.json",
24
+ "size_bytes": 97,
25
+ "sha256": "cdb09dfca347a56aa2d691744e38d5ad3c7cbc2834e7181272b9a15328b82524",
26
+ "upstream_lfs_sha256": null
27
+ },
28
+ {
29
+ "path": "README.md",
30
+ "size_bytes": 22234,
31
+ "sha256": "2c058c304c68221f1de80979594036eff3972b2bce686bb7b0f43621a6b0b011",
32
+ "upstream_lfs_sha256": null
33
+ },
34
+ {
35
+ "path": "chat_template.jinja",
36
+ "size_bytes": 1016,
37
+ "sha256": "4b852efc0b9960283e735363331e6f325b33bc74bdbaa076f595bc4e9b94d85e",
38
+ "upstream_lfs_sha256": null
39
+ },
40
+ {
41
+ "path": "config.json",
42
+ "size_bytes": 4455,
43
+ "sha256": "b8f1e9931b57fbc054acdb445c41765d55b0074c58d145fa82839941ad1b5bb3",
44
+ "upstream_lfs_sha256": null
45
+ },
46
+ {
47
+ "path": "config_sentence_transformers.json",
48
+ "size_bytes": 1565,
49
+ "sha256": "031e56a498d33c349ab489a21885bcfe25b4fcba841149dc99e1e90d4a7c28f5",
50
+ "upstream_lfs_sha256": null
51
+ },
52
+ {
53
+ "path": "model.safetensors",
54
+ "size_bytes": 1488915288,
55
+ "sha256": "197a32965d4b1105faf060417baa899e193fb73cd401f42ec9295234d5553d79",
56
+ "upstream_lfs_sha256": "197a32965d4b1105faf060417baa899e193fb73cd401f42ec9295234d5553d79"
57
+ },
58
+ {
59
+ "path": "modules.json",
60
+ "size_bytes": 413,
61
+ "sha256": "3d02572a0455b832de67fb8e63a54981bc7e8b46e337c95e917bd8122a533bfd",
62
+ "upstream_lfs_sha256": null
63
+ },
64
+ {
65
+ "path": "preprocessor_config.json",
66
+ "size_bytes": 511,
67
+ "sha256": "ea2ae257e901064abdd98dceb19f2b0da06af600bed15e0f99f5c85c37ee9d78",
68
+ "upstream_lfs_sha256": null
69
+ },
70
+ {
71
+ "path": "processor_config.json",
72
+ "size_bytes": 1788,
73
+ "sha256": "168f6a08522f3ce5dea596d94d003af2fd691742d4f41fe1f9d8cce76bfbf69c",
74
+ "upstream_lfs_sha256": null
75
+ },
76
+ {
77
+ "path": "sentence_bert_config.json",
78
+ "size_bytes": 747,
79
+ "sha256": "b1bcd9f2dce3ae863b359e87d0710b5dbc3314a59ecb4e2f97c7778fc8e4b228",
80
+ "upstream_lfs_sha256": null
81
+ },
82
+ {
83
+ "path": "tokenizer.json",
84
+ "size_bytes": 32170510,
85
+ "sha256": "4d777ef5bdc1aa36227abdfb77c3e49e7b9c892d16e1b6bda41c393504828be4",
86
+ "upstream_lfs_sha256": "4d777ef5bdc1aa36227abdfb77c3e49e7b9c892d16e1b6bda41c393504828be4"
87
+ },
88
+ {
89
+ "path": "tokenizer.model",
90
+ "size_bytes": 4689013,
91
+ "sha256": "e594c8a90eb08d8bda498ff4747977dc827ae0c3c56b5c0d41a605a22d02ef03",
92
+ "upstream_lfs_sha256": "e594c8a90eb08d8bda498ff4747977dc827ae0c3c56b5c0d41a605a22d02ef03"
93
+ },
94
+ {
95
+ "path": "tokenizer_config.json",
96
+ "size_bytes": 1599,
97
+ "sha256": "17bd5d6e9364ca49a534e1502076593317c298d4a663623091ed45388f004874",
98
+ "upstream_lfs_sha256": null
99
+ }
100
+ ]
101
+ },
102
+ "llama_cpp": {
103
+ "repository": "https://github.com/ggml-org/llama.cpp",
104
+ "revision": "dde879bc4f954b809892fd0d660515f42536394a",
105
+ "working_tree_clean": true
106
+ },
107
+ "conversion": {
108
+ "intermediate": "BF16",
109
+ "text_quantization": "Q4_K_M",
110
+ "importance_matrix": null,
111
+ "additional_training": false,
112
+ "companion_quantization": "Q8_0",
113
+ "companion_modalities": [
114
+ "vision",
115
+ "audio"
116
+ ],
117
+ "tokenizer_compatibility": "Transformers 5 config keys mapped in memory to Transformers 4.57.6 arguments; all 262144 token strings and IDs checked against tokenizer.json; source and llama.cpp files unchanged.",
118
+ "adapter_sha256": "9591828d8b0bfa92da1725c2dc27c2bc01e8b6a47cb7402afa6c26ed3c114f6d"
119
+ },
120
+ "files": [
121
+ {
122
+ "path": "work/embeddinggemma-2-BF16.gguf",
123
+ "size_bytes": 557950176,
124
+ "sha256": "68bae29d62fb8c7d23e98d21fd4662753ddd636e6b62b8a70dfe059a9844f216",
125
+ "tensor_count": 413,
126
+ "tensor_types": {
127
+ "BF16": 219,
128
+ "F32": 194
129
+ },
130
+ "tensor_prefixes": {
131
+ "token_embd": 1,
132
+ "output": 1,
133
+ "blk": 408,
134
+ "output_norm": 1,
135
+ "per_layer_model_proj": 1,
136
+ "per_layer_proj_norm": 1
137
+ },
138
+ "metadata": {
139
+ "general.architecture": "gemma-embedding2",
140
+ "general.type": "model",
141
+ "general.name": "embeddinggemma-2",
142
+ "general.size_label": "271M",
143
+ "general.license": "apache-2.0",
144
+ "general.tags": [
145
+ "embedding",
146
+ "feature-extraction",
147
+ "sentence-transformers",
148
+ "multimodal-embedding",
149
+ "multimodal",
150
+ "vision",
151
+ "audio",
152
+ "video",
153
+ "image-feature-extraction",
154
+ "audio-feature-extraction",
155
+ "video-feature-extraction",
156
+ "sentence-similarity",
157
+ "feature-extraction"
158
+ ],
159
+ "general.languages": [
160
+ "multilingual"
161
+ ],
162
+ "gemma-embedding2.block_count": 24,
163
+ "gemma-embedding2.context_length": 262144,
164
+ "gemma-embedding2.embedding_length": 512,
165
+ "gemma-embedding2.feed_forward_length": 2048,
166
+ "gemma-embedding2.attention.head_count": 4,
167
+ "gemma-embedding2.attention.head_count_kv": [
168
+ 2,
169
+ 2,
170
+ 2,
171
+ 2,
172
+ 2,
173
+ 1,
174
+ 2,
175
+ 2,
176
+ 2,
177
+ 2,
178
+ 2,
179
+ 1,
180
+ 2,
181
+ 2,
182
+ 2,
183
+ 2,
184
+ 2,
185
+ 1,
186
+ 2,
187
+ 2,
188
+ 2,
189
+ 2,
190
+ 2,
191
+ 1
192
+ ],
193
+ "gemma-embedding2.rope.freq_base": 1000000.0,
194
+ "gemma-embedding2.rope.freq_base_swa": 10000.0,
195
+ "gemma-embedding2.attention.layer_norm_rms_epsilon": 9.999999974752427e-07,
196
+ "gemma-embedding2.attention.key_length": 512,
197
+ "gemma-embedding2.attention.value_length": 512,
198
+ "general.file_type": 32,
199
+ "gemma-embedding2.attention.sliding_window": 1024,
200
+ "gemma-embedding2.attention.shared_kv_layers": 0,
201
+ "gemma-embedding2.embedding_length_per_layer_input": 512,
202
+ "gemma-embedding2.attention.sliding_window_pattern": [
203
+ true,
204
+ true,
205
+ true,
206
+ true,
207
+ true,
208
+ false,
209
+ true,
210
+ true,
211
+ true,
212
+ true,
213
+ true,
214
+ false,
215
+ true,
216
+ true,
217
+ true,
218
+ true,
219
+ true,
220
+ false,
221
+ true,
222
+ true,
223
+ true,
224
+ true,
225
+ true,
226
+ false
227
+ ],
228
+ "gemma-embedding2.attention.key_length_swa": 256,
229
+ "gemma-embedding2.attention.value_length_swa": 256,
230
+ "gemma-embedding2.rope.dimension_count": 512,
231
+ "gemma-embedding2.rope.dimension_count_swa": 256,
232
+ "gemma-embedding2.embedding_length_out": 768,
233
+ "gemma-embedding2.attention.causal": false,
234
+ "gemma-embedding2.pooling_type": 1,
235
+ "general.quantization_version": 2
236
+ }
237
+ },
238
+ {
239
+ "path": "release/embeddinggemma-2-Q4_K_M.gguf",
240
+ "size_bytes": 181694688,
241
+ "sha256": "d610afe26dd783739275646d51d4d85b4167820fd051600696d7a49e6f68609f",
242
+ "tensor_count": 413,
243
+ "tensor_types": {
244
+ "Q6_K": 25,
245
+ "F32": 194,
246
+ "BF16": 1,
247
+ "Q4_K": 193
248
+ },
249
+ "tensor_prefixes": {
250
+ "output": 1,
251
+ "output_norm": 1,
252
+ "per_layer_model_proj": 1,
253
+ "per_layer_proj_norm": 1,
254
+ "token_embd": 1,
255
+ "blk": 408
256
+ },
257
+ "metadata": {
258
+ "general.architecture": "gemma-embedding2",
259
+ "general.type": "model",
260
+ "general.name": "embeddinggemma-2",
261
+ "general.size_label": "271M",
262
+ "general.license": "apache-2.0",
263
+ "general.tags": [
264
+ "embedding",
265
+ "feature-extraction",
266
+ "sentence-transformers",
267
+ "multimodal-embedding",
268
+ "multimodal",
269
+ "vision",
270
+ "audio",
271
+ "video",
272
+ "image-feature-extraction",
273
+ "audio-feature-extraction",
274
+ "video-feature-extraction",
275
+ "sentence-similarity",
276
+ "feature-extraction"
277
+ ],
278
+ "general.languages": [
279
+ "multilingual"
280
+ ],
281
+ "gemma-embedding2.block_count": 24,
282
+ "gemma-embedding2.context_length": 262144,
283
+ "gemma-embedding2.embedding_length": 512,
284
+ "gemma-embedding2.feed_forward_length": 2048,
285
+ "gemma-embedding2.attention.head_count": 4,
286
+ "gemma-embedding2.attention.head_count_kv": [
287
+ 2,
288
+ 2,
289
+ 2,
290
+ 2,
291
+ 2,
292
+ 1,
293
+ 2,
294
+ 2,
295
+ 2,
296
+ 2,
297
+ 2,
298
+ 1,
299
+ 2,
300
+ 2,
301
+ 2,
302
+ 2,
303
+ 2,
304
+ 1,
305
+ 2,
306
+ 2,
307
+ 2,
308
+ 2,
309
+ 2,
310
+ 1
311
+ ],
312
+ "gemma-embedding2.rope.freq_base": 1000000.0,
313
+ "gemma-embedding2.rope.freq_base_swa": 10000.0,
314
+ "gemma-embedding2.attention.layer_norm_rms_epsilon": 9.999999974752427e-07,
315
+ "gemma-embedding2.attention.key_length": 512,
316
+ "gemma-embedding2.attention.value_length": 512,
317
+ "gemma-embedding2.attention.sliding_window": 1024,
318
+ "gemma-embedding2.attention.shared_kv_layers": 0,
319
+ "gemma-embedding2.embedding_length_per_layer_input": 512,
320
+ "gemma-embedding2.attention.sliding_window_pattern": [
321
+ true,
322
+ true,
323
+ true,
324
+ true,
325
+ true,
326
+ false,
327
+ true,
328
+ true,
329
+ true,
330
+ true,
331
+ true,
332
+ false,
333
+ true,
334
+ true,
335
+ true,
336
+ true,
337
+ true,
338
+ false,
339
+ true,
340
+ true,
341
+ true,
342
+ true,
343
+ true,
344
+ false
345
+ ],
346
+ "gemma-embedding2.attention.key_length_swa": 256,
347
+ "gemma-embedding2.attention.value_length_swa": 256,
348
+ "gemma-embedding2.rope.dimension_count": 512,
349
+ "gemma-embedding2.rope.dimension_count_swa": 256,
350
+ "gemma-embedding2.embedding_length_out": 768,
351
+ "gemma-embedding2.attention.causal": false,
352
+ "gemma-embedding2.pooling_type": 1,
353
+ "general.quantization_version": 2,
354
+ "general.file_type": 15
355
+ }
356
+ },
357
+ {
358
+ "path": "release/mmproj-embeddinggemma-2-Q8_0.gguf",
359
+ "size_bytes": 554821056,
360
+ "sha256": "0531309472a6bc6f4b146c3736eee7795ec9db1903c25490d3c937490cef6dd8",
361
+ "tensor_count": 963,
362
+ "tensor_types": {
363
+ "F32": 716,
364
+ "Q8_0": 247
365
+ },
366
+ "tensor_prefixes": {
367
+ "a": 751,
368
+ "mm": 2,
369
+ "v": 210
370
+ },
371
+ "metadata": {
372
+ "general.architecture": "clip",
373
+ "general.type": "mmproj",
374
+ "general.name": "embeddinggemma-2",
375
+ "general.size_label": "473M",
376
+ "general.license": "apache-2.0",
377
+ "general.tags": [
378
+ "embedding",
379
+ "feature-extraction",
380
+ "sentence-transformers",
381
+ "multimodal-embedding",
382
+ "multimodal",
383
+ "vision",
384
+ "audio",
385
+ "video",
386
+ "image-feature-extraction",
387
+ "audio-feature-extraction",
388
+ "video-feature-extraction",
389
+ "sentence-similarity",
390
+ "feature-extraction"
391
+ ],
392
+ "general.languages": [
393
+ "multilingual"
394
+ ],
395
+ "general.file_type": 7,
396
+ "clip.has_vision_encoder": true,
397
+ "clip.vision.projection_dim": 512,
398
+ "clip.vision.image_size": 224,
399
+ "clip.vision.patch_size": 16,
400
+ "clip.vision.embedding_length": 768,
401
+ "clip.vision.feed_forward_length": 3072,
402
+ "clip.vision.block_count": 16,
403
+ "clip.vision.attention.head_count": 12,
404
+ "clip.vision.image_mean": [
405
+ 0.0,
406
+ 0.0,
407
+ 0.0
408
+ ],
409
+ "clip.vision.image_std": [
410
+ 1.0,
411
+ 1.0,
412
+ 1.0
413
+ ],
414
+ "clip.has_audio_encoder": true,
415
+ "clip.audio.projection_dim": 512,
416
+ "clip.audio.embedding_length": 1024,
417
+ "clip.audio.feed_forward_length": 4096,
418
+ "clip.audio.block_count": 12,
419
+ "clip.audio.attention.head_count": 8,
420
+ "clip.vision.projector_type": "gemma4v",
421
+ "clip.vision.attention.layer_norm_epsilon": 9.999999974752427e-07,
422
+ "clip.use_gelu": true,
423
+ "clip.audio.projector_type": "gemma4a",
424
+ "clip.audio.num_mel_bins": 128,
425
+ "clip.audio.attention.layer_norm_epsilon": 9.999999974752427e-07,
426
+ "general.quantization_version": 2
427
+ }
428
+ }
429
+ ],
430
+ "machine": {
431
+ "name": "NVIDIA DGX Spark",
432
+ "architecture": "aarch64",
433
+ "gpu": "NVIDIA GB10",
434
+ "unified_memory": "128 GB nominal",
435
+ "python": "3.12.3",
436
+ "compiler": "GCC 13.3.0",
437
+ "cmake": "3.28.3",
438
+ "cuda_toolkit": "13.0.88",
439
+ "nvidia_driver": "580.178.04"
440
+ },
441
+ "docker": {
442
+ "engine": "29.6.2",
443
+ "client": "v1.2.9",
444
+ "server": "v1.2.9",
445
+ "image": "docker/model-runner@sha256:9967b6c1092ff01e7cf68119ab25067a1f58e3d1b06873bc16fe1e758bcd914f",
446
+ "llama_cpp_revision": "dde879bc4f954b809892fd0d660515f42536394a",
447
+ "llama_cpp_build": "b12032 / 0.8.0-dev",
448
+ "cuda_architecture": "121",
449
+ "local_model": "mirrorneuronlab/embeddinggemma-2:q4_k_m",
450
+ "endpoint": "http://127.0.0.1:12435",
451
+ "configuration": "-ngl 999 --pooling mean -b 2048 -ub 2048 --parallel 1 -t 10; context 2048; embedding mode",
452
+ "gpu_evidence": "Docker logged gpuSupport=true, backend arguments include -ngl 999, NVIDIA-SMI reports /opt/llama/llama-server GPU processes.",
453
+ "backend_version_note": "The stock images checked bundled older engines without this architecture. Validation used the official current v1.2.9 controller with the pinned upstream CUDA backend mounted read-only. The controller displays the backend version as unknown because its parser does not recognize llama.cpp's new version string."
454
+ },
455
+ "execution_timings": [
456
+ {
457
+ "stage": "download",
458
+ "command": [
459
+ "python3",
460
+ "scripts/download_source.py"
461
+ ],
462
+ "cwd": "$TASK_ROOT",
463
+ "started_utc": "2026-11-01T14:55:21.409343+00:00",
464
+ "finished_utc": "2026-11-01T14:55:53.401870+00:00",
465
+ "elapsed_seconds": 31.99252673998126,
466
+ "returncode": 0
467
+ },
468
+ {
469
+ "stage": "build-configure",
470
+ "command": [
471
+ "cmake",
472
+ "-S",
473
+ "llama.cpp",
474
+ "-B",
475
+ "llama.cpp/build",
476
+ "-DCMAKE_BUILD_TYPE=Release",
477
+ "-DGGML_CUDA=OFF",
478
+ "-DGGML_NATIVE=ON",
479
+ "-DLLAMA_BUILD_TESTS=OFF",
480
+ "-DLLAMA_CURL=OFF"
481
+ ],
482
+ "cwd": "$TASK_ROOT",
483
+ "started_utc": "2026-11-01T14:55:46.632685+00:00",
484
+ "finished_utc": "2026-11-01T14:55:48.362987+00:00",
485
+ "elapsed_seconds": 1.73029996099649,
486
+ "returncode": 0
487
+ },
488
+ {
489
+ "stage": "build",
490
+ "command": [
491
+ "cmake",
492
+ "--build",
493
+ "llama.cpp/build",
494
+ "--config",
495
+ "Release",
496
+ "-j",
497
+ "16",
498
+ "--target",
499
+ "llama-quantize",
500
+ "llama-server"
501
+ ],
502
+ "cwd": "$TASK_ROOT",
503
+ "started_utc": "2026-11-01T14:55:48.380276+00:00",
504
+ "finished_utc": "2026-11-01T14:56:48.044752+00:00",
505
+ "elapsed_seconds": 59.66447541900561,
506
+ "returncode": 0
507
+ },
508
+ {
509
+ "stage": "dependencies",
510
+ "command": [
511
+ ".venv/bin/python",
512
+ "-m",
513
+ "pip",
514
+ "install",
515
+ "-r",
516
+ "llama.cpp/requirements/requirements-convert_hf_to_gguf.txt",
517
+ "huggingface_hub>=0.34.0,<1.0"
518
+ ],
519
+ "cwd": "$TASK_ROOT",
520
+ "started_utc": "2026-11-01T14:55:49.275061+00:00",
521
+ "finished_utc": "2026-11-01T14:56:14.893959+00:00",
522
+ "elapsed_seconds": 25.618897876003757,
523
+ "returncode": 0
524
+ },
525
+ {
526
+ "stage": "dmr-image-pull",
527
+ "command": [
528
+ "docker",
529
+ "pull",
530
+ "docker/model-runner@sha256:9967b6c1092ff01e7cf68119ab25067a1f58e3d1b06873bc16fe1e758bcd914f"
531
+ ],
532
+ "cwd": "$TASK_ROOT",
533
+ "started_utc": "2026-11-01T14:56:23.532588+00:00",
534
+ "finished_utc": "2026-11-01T14:56:27.210774+00:00",
535
+ "elapsed_seconds": 3.6781821949989535,
536
+ "returncode": 0
537
+ },
538
+ {
539
+ "stage": "convert-bf16",
540
+ "command": [
541
+ ".venv/bin/python",
542
+ "llama.cpp/convert_hf_to_gguf.py",
543
+ "source",
544
+ "--outtype",
545
+ "bf16",
546
+ "--model-name",
547
+ "embeddinggemma-2",
548
+ "--outfile",
549
+ "work/embeddinggemma-2-BF16.gguf"
550
+ ],
551
+ "cwd": "$TASK_ROOT",
552
+ "started_utc": "2026-11-01T14:56:49.790088+00:00",
553
+ "finished_utc": "2026-11-01T14:56:53.358771+00:00",
554
+ "elapsed_seconds": 3.5686840260168537,
555
+ "returncode": 1
556
+ },
557
+ {
558
+ "stage": "convert-mmproj",
559
+ "command": [
560
+ ".venv/bin/python",
561
+ "llama.cpp/convert_hf_to_gguf.py",
562
+ "source",
563
+ "--mmproj",
564
+ "--outtype",
565
+ "q8_0",
566
+ "--model-name",
567
+ "embeddinggemma-2",
568
+ "--outfile",
569
+ "release/mmproj-embeddinggemma-2-Q8_0.gguf"
570
+ ],
571
+ "cwd": "$TASK_ROOT",
572
+ "started_utc": "2026-11-01T14:56:50.417675+00:00",
573
+ "finished_utc": "2026-11-01T14:56:53.964458+00:00",
574
+ "elapsed_seconds": 3.54678301900276,
575
+ "returncode": 0
576
+ },
577
+ {
578
+ "stage": "cuda-configure",
579
+ "command": [
580
+ "cmake",
581
+ "-S",
582
+ "llama.cpp",
583
+ "-B",
584
+ "llama.cpp/build-cuda",
585
+ "-DCMAKE_BUILD_TYPE=Release",
586
+ "-DGGML_CUDA=ON",
587
+ "-DCMAKE_CUDA_ARCHITECTURES=121",
588
+ "-DGGML_NATIVE=ON",
589
+ "-DLLAMA_BUILD_TESTS=OFF",
590
+ "-DLLAMA_CURL=OFF"
591
+ ],
592
+ "cwd": "$TASK_ROOT",
593
+ "started_utc": "2026-11-01T14:57:33.645338+00:00",
594
+ "finished_utc": "2026-11-01T14:57:36.272337+00:00",
595
+ "elapsed_seconds": 2.626998322986765,
596
+ "returncode": 0
597
+ },
598
+ {
599
+ "stage": "cuda-build",
600
+ "command": [
601
+ "cmake",
602
+ "--build",
603
+ "llama.cpp/build-cuda",
604
+ "--config",
605
+ "Release",
606
+ "-j",
607
+ "8",
608
+ "--target",
609
+ "llama-server"
610
+ ],
611
+ "cwd": "$TASK_ROOT",
612
+ "started_utc": "2026-11-01T14:57:36.303210+00:00",
613
+ "finished_utc": "2026-11-01T15:01:19.019507+00:00",
614
+ "elapsed_seconds": 222.71629584900802,
615
+ "returncode": 0
616
+ },
617
+ {
618
+ "stage": "convert-bf16-compatible",
619
+ "command": [
620
+ ".venv/bin/python",
621
+ "scripts/convert_compatible.py",
622
+ "source",
623
+ "--outtype",
624
+ "bf16",
625
+ "--model-name",
626
+ "embeddinggemma-2",
627
+ "--outfile",
628
+ "work/embeddinggemma-2-BF16.gguf"
629
+ ],
630
+ "cwd": "$TASK_ROOT",
631
+ "started_utc": "2026-11-01T14:58:26.671428+00:00",
632
+ "finished_utc": "2026-11-01T14:58:39.271335+00:00",
633
+ "elapsed_seconds": 12.599901882989798,
634
+ "returncode": 0
635
+ },
636
+ {
637
+ "stage": "quantize",
638
+ "command": [
639
+ "llama.cpp/build/bin/llama-quantize",
640
+ "work/embeddinggemma-2-BF16.gguf",
641
+ "release/embeddinggemma-2-Q4_K_M.gguf",
642
+ "Q4_K_M"
643
+ ],
644
+ "cwd": "$TASK_ROOT",
645
+ "started_utc": "2026-11-01T14:59:03.341119+00:00",
646
+ "finished_utc": "2026-11-01T14:59:05.780096+00:00",
647
+ "elapsed_seconds": 2.438970130024245,
648
+ "returncode": 0
649
+ },
650
+ {
651
+ "stage": "audit",
652
+ "command": [
653
+ ".venv/bin/python",
654
+ "scripts/audit_gguf.py"
655
+ ],
656
+ "cwd": "$TASK_ROOT",
657
+ "started_utc": "2026-11-01T14:59:48.642886+00:00",
658
+ "finished_utc": "2026-11-01T15:00:09.839507+00:00",
659
+ "elapsed_seconds": 21.196617795998463,
660
+ "returncode": 1
661
+ },
662
+ {
663
+ "stage": "audit-final",
664
+ "command": [
665
+ ".venv/bin/python",
666
+ "scripts/audit_gguf.py"
667
+ ],
668
+ "cwd": "$TASK_ROOT",
669
+ "started_utc": "2026-11-01T15:00:53.569576+00:00",
670
+ "finished_utc": "2026-11-01T15:01:15.285176+00:00",
671
+ "elapsed_seconds": 21.71559885001625,
672
+ "returncode": 0
673
+ },
674
+ {
675
+ "stage": "validate-bf16",
676
+ "command": [
677
+ ".venv/bin/python",
678
+ "scripts/validate_bf16.py"
679
+ ],
680
+ "cwd": "$TASK_ROOT",
681
+ "started_utc": "2026-11-01T15:01:15.314013+00:00",
682
+ "finished_utc": "2026-11-01T15:01:17.519620+00:00",
683
+ "elapsed_seconds": 2.2056051869876683,
684
+ "returncode": 0
685
+ },
686
+ {
687
+ "stage": "dmr-start",
688
+ "command": [
689
+ "bash",
690
+ "scripts/start_validation_runner.sh"
691
+ ],
692
+ "cwd": "$TASK_ROOT",
693
+ "started_utc": "2026-11-01T15:02:00.812758+00:00",
694
+ "finished_utc": "2026-11-01T15:02:01.138690+00:00",
695
+ "elapsed_seconds": 0.32593187599559315,
696
+ "returncode": 0
697
+ },
698
+ {
699
+ "stage": "dmr-package",
700
+ "command": [
701
+ "env",
702
+ "MODEL_RUNNER_HOST=http://127.0.0.1:12435",
703
+ "docker",
704
+ "model",
705
+ "package",
706
+ "--gguf",
707
+ "$TASK_ROOT/release/embeddinggemma-2-Q4_K_M.gguf",
708
+ "--mmproj",
709
+ "$TASK_ROOT/release/mmproj-embeddinggemma-2-Q8_0.gguf",
710
+ "--license",
711
+ "$TASK_ROOT/release/LICENSE",
712
+ "--context-size",
713
+ "2048",
714
+ "mirrorneuronlab/embeddinggemma-2:q4_k_m"
715
+ ],
716
+ "cwd": "$TASK_ROOT",
717
+ "started_utc": "2026-11-01T15:02:13.051800+00:00",
718
+ "finished_utc": "2026-11-01T15:02:15.412325+00:00",
719
+ "elapsed_seconds": 2.3605253199930303,
720
+ "returncode": 0
721
+ },
722
+ {
723
+ "stage": "validate-dmr",
724
+ "command": [
725
+ ".venv/bin/python",
726
+ "scripts/validate_dmr.py"
727
+ ],
728
+ "cwd": "$TASK_ROOT",
729
+ "started_utc": "2026-11-01T15:02:15.594479+00:00",
730
+ "finished_utc": "2026-11-01T15:02:17.820825+00:00",
731
+ "elapsed_seconds": 2.226341144007165,
732
+ "returncode": 0
733
+ },
734
+ {
735
+ "stage": "dmr-run",
736
+ "command": [
737
+ "env",
738
+ "MODEL_RUNNER_HOST=http://127.0.0.1:12435",
739
+ "docker",
740
+ "model",
741
+ "run",
742
+ "--detach",
743
+ "mirrorneuronlab/embeddinggemma-2:q4_k_m"
744
+ ],
745
+ "cwd": "$TASK_ROOT",
746
+ "started_utc": "2026-11-01T15:05:52.619080+00:00",
747
+ "finished_utc": "2026-11-01T15:05:52.670364+00:00",
748
+ "elapsed_seconds": 0.0512839280127082,
749
+ "returncode": 0
750
+ }
751
+ ],
752
+ "validation_fixtures": [
753
+ {
754
+ "name": "red-square.png",
755
+ "sha256": "66d2ca44529ac40d3d08a58d0fd0f10696eae138d288dc5cfc1351f263d4c0a3",
756
+ "size_bytes": 677
757
+ },
758
+ {
759
+ "name": "tone-440hz.wav",
760
+ "sha256": "3f806962fcdcc982acaca0e5180c701391a59c2635d82e4b0660dc148c01f528",
761
+ "size_bytes": 64044
762
+ }
763
+ ]
764
+ }
README.md ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: google/embeddinggemma-2
4
+ base_model_relation: quantized
5
+ library_name: llama.cpp
6
+ pipeline_tag: feature-extraction
7
+ tags:
8
+ - gguf
9
+ - embeddings
10
+ - multimodal
11
+ ---
12
+
13
+ # EmbeddingGemma 2 - MirrorNeuronLab Q4_K_M GGUF
14
+
15
+ [Google DeepMind](https://huggingface.co/google/embeddinggemma-2) developed the original EmbeddingGemma 2 model. MirrorNeuronLab converted Google's original weights to GGUF and quantized them without additional training.
16
+
17
+ The text backbone uses standard llama.cpp **Q4_K_M**, quantized directly from a **BF16** intermediate without an importance matrix. This is a MirrorNeuronLab GGUF conversion and quantization. The Q4_K_M preset mixes tensor types as defined by upstream llama.cpp, retaining small tensors and the embedding projection at higher precision where the preset requires it.
18
+
19
+ The separate **Q8_0 vision/audio companion** is required for image and audio inputs. It contains both encoders, including their projections. There is one text-model quantization and one multimodal companion in this repository. The Q8_0 companion supplements the Q4_K_M text model; it is not an alternative text model.
20
+
21
+ ## Files
22
+
23
+ | File | Purpose | Exact bytes | MiB |
24
+ | --- | --- | ---: | ---: |
25
+ | `embeddinggemma-2-Q4_K_M.gguf` | Text backbone, standard Q4_K_M | 181,694,688 | 173.278 |
26
+ | `mmproj-embeddinggemma-2-Q8_0.gguf` | Combined vision/audio companion | 554,821,056 | 529.119 |
27
+
28
+ Binary SHA-256 checksums:
29
+
30
+ ```text
31
+ d610afe26dd783739275646d51d4d85b4167820fd051600696d7a49e6f68609f embeddinggemma-2-Q4_K_M.gguf
32
+ 0531309472a6bc6f4b146c3736eee7795ec9db1903c25490d3c937490cef6dd8 mmproj-embeddinggemma-2-Q8_0.gguf
33
+ ```
34
+
35
+ `SHA256SUMS` covers the release files. `SOURCE_SHA256SUMS`, `PROVENANCE.json`, `GGUF_AUDIT.json`, `VALIDATION.json`, and `TIMINGS.json` document the original checkpoint, conversion, resulting tensor inventory, and checks. The BF16 intermediate is kept outside the release directory.
36
+
37
+ ## Source and tools
38
+
39
+ - Google checkpoint: [`google/embeddinggemma-2` at `f9972ac22e696a105c482202646979e33e4b5a1e`](https://huggingface.co/google/embeddinggemma-2/tree/f9972ac22e696a105c482202646979e33e4b5a1e).
40
+ - Original `model.safetensors` SHA-256: `197a32965d4b1105faf060417baa899e193fb73cd401f42ec9295234d5553d79`.
41
+ - Conversion and quantization: [`ggml-org/llama.cpp` at `dde879bc4f954b809892fd0d660515f42536394a`](https://github.com/ggml-org/llama.cpp/tree/dde879bc4f954b809892fd0d660515f42536394a), build b12032. The upstream checkout is unmodified.
42
+ - Python 3.12.3; PyTorch 2.11.0+cpu; Transformers 4.57.6; Hugging Face Hub 0.36.2. Hub and Transformers were resolved together under llama.cpp's constraints; `pip check` passed. The full environment lock is included under `reproduce/logs/`.
43
+
44
+ Google's tokenizer config uses a newer Transformers schema. A small compatibility adapter maps its special-token configuration to the pinned Transformers 4 format in memory. It verifies that all 262,144 token strings and IDs match the original `tokenizer.json`. Original source files remain byte-for-byte unchanged. GGUF auditing confirms preserved tokenizer metadata, noncausal architecture, mean pooling, the 512-to-768 embedding projection, and matching tensor shapes between BF16 and Q4_K_M.
45
+
46
+ The [AtomicChat model card](https://huggingface.co/AtomicChat/embeddinggemma-2-GGUF) was consulted for packaging and usage conventions. This release uses the standard Q4_K_M preset, with no AtomicChat weights, importance matrix, dynamic tensor layout, or benchmark results. It is not labeled `AD-Q4_K_M`.
47
+
48
+ ## Docker Model Runner
49
+
50
+ Use an up-to-date llama.cpp engine with `gemma-embedding2` and Gemma4 vision/audio support. The Docker Model Runner controller version alone does not establish engine compatibility: older bundled engines report an unknown architecture. The files are portable to Apple Silicon Macs and Ubuntu/NVIDIA systems with a supporting backend. Those platforms were not physically tested in this run.
51
+
52
+ Pull the Q4_K_M text release; Docker Model Runner also selects the sole multimodal companion automatically:
53
+
54
+ ```bash
55
+ docker model pull hf.co/MirrorNeuronLab/embeddinggemma-2-GGUF:Q4_K_M
56
+ docker model configure --mode embedding --context-size 2048 \
57
+ hf.co/MirrorNeuronLab/embeddinggemma-2-GGUF:Q4_K_M
58
+ docker model run --detach hf.co/MirrorNeuronLab/embeddinggemma-2-GGUF:Q4_K_M
59
+ ```
60
+
61
+ This is an embedding model. Use the embeddings API to obtain vectors after loading it:
62
+
63
+ ```bash
64
+ curl http://localhost:12434/engines/llama.cpp/v1/embeddings \
65
+ -H 'Content-Type: application/json' \
66
+ -d '{"model":"hf.co/MirrorNeuronLab/embeddinggemma-2-GGUF:Q4_K_M","input":["task: search result | query: What causes the northern lights?","title: none | text: Charged particles from the Sun interact with the atmosphere."],"encoding_format":"float"}'
67
+ ```
68
+
69
+ For local files, explicitly package both GGUFs and the license. Run this from the downloaded release directory:
70
+
71
+ ```bash
72
+ docker model package \
73
+ --gguf "$PWD/embeddinggemma-2-Q4_K_M.gguf" \
74
+ --mmproj "$PWD/mmproj-embeddinggemma-2-Q8_0.gguf" \
75
+ --license "$PWD/LICENSE" --context-size 2048 \
76
+ mirrorneuronlab/embeddinggemma-2:q4_k_m
77
+ docker model configure --mode embedding --context-size 2048 \
78
+ mirrorneuronlab/embeddinggemma-2:q4_k_m
79
+ docker model run --detach mirrorneuronlab/embeddinggemma-2:q4_k_m
80
+ ```
81
+
82
+ Use `mirrorneuronlab/embeddinggemma-2:q4_k_m` as the API model name for a locally packaged artifact. Packaging keeps the original GGUF files on disk. See [Docker packaging](https://docs.docker.com/reference/cli/docker/model/package/) and the [Docker Model Runner API](https://docs.docker.com/ai/model-runner/api-reference/).
83
+
84
+ ## llama.cpp and multimodal inputs
85
+
86
+ ```bash
87
+ llama-server -m embeddinggemma-2-Q4_K_M.gguf \
88
+ --mmproj mmproj-embeddinggemma-2-Q8_0.gguf \
89
+ --embeddings --pooling mean -c 2048 -b 2048 -ub 2048 -ngl 99
90
+ ```
91
+
92
+ For text-only use, omit `--mmproj`. GPU offloading uses the backend available on the machine, such as Metal on Apple Silicon or CUDA on NVIDIA systems.
93
+
94
+ The native output is a normalized 768-dimensional embedding. Use task prefixes such as `task: search result | query: {query}` and `title: {title or none} | text: {document}`. Index documents and query them with the same model file. For 512-, 256-, or 128-dimensional Matryoshka vectors, retain the first dimensions and normalize again.
95
+
96
+ For image/audio embeddings, send OpenAI-style content arrays as elements of `input`. Examples of the two element forms:
97
+
98
+ ```json
99
+ {"content":[{"type":"image_url","image_url":{"url":"data:image/png;base64,..."}}]}
100
+ {"content":[{"type":"input_audio","input_audio":{"data":"<base64 WAV>","format":"wav"}}]}
101
+ ```
102
+
103
+ Set `encoding_format` to `float`. Apply task prefixes to text inputs. Images and audio do not need a text prefix.
104
+
105
+ EmbeddingGemma 2 uses bidirectional attention: the whole input must fit in one microbatch. Size context (`-c`), batch (`-b`), and microbatch (`-ub`) together for the longest input. The validation used 2048 for all three. Google's published context limit is 8192; the source config and preserved GGUF metadata expose a larger positional limit of 262144, which this release does not establish as a supported input length. For 8K inputs, raise all three settings to 8192 in a supporting engine. Small microbatches can also reduce the engine's image token budget.
106
+
107
+ ## Measured validation
108
+
109
+ Validated on NVIDIA DGX Spark, native Linux ARM64, NVIDIA GB10, CUDA 13.0, through **Docker Model Runner v1.2.9** and the pinned upstream CUDA llama.cpp backend above. The official ARM64 CUDA runner image is pinned in `PROVENANCE.json`; its stock older engine was replaced for this isolated validation by a read-only mount of the newly compiled backend. The existing system runner was left intact. The controller reports the backend version as `unknown` because its parser does not recognize the new upstream version string; the executed binary and full commit are recorded.
110
+
111
+ `docker model package` and `docker model run --detach` succeeded. Text, image, audio, and mixed text/image/audio batches returned HTTP 200 with finite, L2-normalized 768-dimensional vectors. GPU detection and NVIDIA-SMI confirmed CUDA use. The four-text repeat check had maximum absolute difference 0.0.
112
+
113
+ On the small text sanity fixture, query-to-relevant-passage cosine was 0.865082, versus 0.548627 for an unrelated passage. Cosines to a BF16 CPU reference on four texts ranged from 0.988963 to 0.997227. These measurements include quantization and CPU/CUDA execution differences.
114
+
115
+ These are functional smoke checks on four texts, a solid-color image, and a synthetic two-second tone. They do not measure retrieval accuracy or image/audio semantic quality. Video was not tested. llama.cpp marks audio input experimental. No MTEB, MIEB, MMEB, or audio benchmark score is claimed for this conversion.
116
+
117
+ ## Reproduce
118
+
119
+ The conversion commands are:
120
+
121
+ ```bash
122
+ python scripts/convert_compatible.py source --outtype bf16 \
123
+ --model-name embeddinggemma-2 --outfile work/embeddinggemma-2-BF16.gguf
124
+ ./llama.cpp/build/bin/llama-quantize work/embeddinggemma-2-BF16.gguf \
125
+ release/embeddinggemma-2-Q4_K_M.gguf Q4_K_M
126
+ python llama.cpp/convert_hf_to_gguf.py source --mmproj --outtype q8_0 \
127
+ --model-name embeddinggemma-2 --outfile release/mmproj-embeddinggemma-2-Q8_0.gguf
128
+ ```
129
+
130
+ For a fresh Linux ARM64 workspace, run the bundled script with a new destination path:
131
+
132
+ ```bash
133
+ bash reproduce/scripts/reproduce.sh /absolute/path/to/new-workspace
134
+ ```
135
+
136
+ It downloads the pinned original source, installs the locked converter dependencies, checks out the full llama.cpp revision, builds native tools, converts, quantizes, and audits. Its dependency lock records the tested ARM64 CPU converter environment. For other operating systems, resolve platform wheels while retaining llama.cpp's package constraints. CUDA validation setup is supplied in `reproduce/scripts/start_validation_runner.sh`; build the backend first with `-DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=121` for GB10. This GPU target applies to the tested backend build, not to the portable GGUF files.
137
+
138
+ Measured elapsed seconds for the successful stages:
139
+
140
+ | Stage | Seconds |
141
+ | --- | ---: |
142
+ | Original checkpoint download | 31.993 |
143
+ | Python dependencies | 25.619 |
144
+ | CPU build (quantizer and reference server) | 59.664 |
145
+ | CUDA build | 222.716 |
146
+ | BF16 text conversion | 12.600 |
147
+ | Q4_K_M quantization | 2.439 |
148
+ | Q8_0 vision/audio conversion | 3.547 |
149
+ | GGUF audit | 21.716 |
150
+ | BF16 reference validation | 2.206 |
151
+ | Docker packaging | 2.361 |
152
+ | Docker CUDA embedding validation | 2.226 |
153
+ | docker model run --detach | 0.051 |
154
+
155
+ Stages ran partly in parallel, so these durations should not be added as an end-to-end runtime. `TIMINGS.json` records start/end times, commands, configure stages, and attempts. The first unadapted text-conversion attempt failed on the tokenizer schema before the successful compatible conversion.
156
+
157
+ ## License and attribution
158
+
159
+ Apache-2.0. Original model: Google DeepMind. GGUF conversion and quantization: MirrorNeuronLab. See `LICENSE` and the [original model card](https://huggingface.co/google/embeddinggemma-2) for intended uses and limitations.
SHA256SUMS ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 4cf00e98dded8779b234ba8d2356ce03ef5360f69632bd81f0f10c4c944b89d9 .gitattributes
2
+ 19ee2fd9f0440f865f43bbdb052cb159e9156e5d1df0a5ef60159a5dce7008f4 GGUF_AUDIT.json
3
+ cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
4
+ cffa1796862050596e7e071b181883485b8c32de9da54fed01fcf14933806656 PROVENANCE.json
5
+ 83a5b5162de5d9d0e96b585649549fe0674159a53da24f74f4e955720aa90c8c README.md
6
+ 3a30564979129978d26ad4c1160fab0a04173e76a9fdf1c1f572bab4dc3055e4 SOURCE_SHA256SUMS
7
+ dd2534e2d1234730936c43a9bb2b766b33a96dc2bcc1f8834fef839ca869332f TIMINGS.json
8
+ 0a1e1e46a434406b06b5c2b4484cfe05aa5b0f5ef704caaee92e0c50d58a73dc VALIDATION.json
9
+ d610afe26dd783739275646d51d4d85b4167820fd051600696d7a49e6f68609f embeddinggemma-2-Q4_K_M.gguf
10
+ 0531309472a6bc6f4b146c3736eee7795ec9db1903c25490d3c937490cef6dd8 mmproj-embeddinggemma-2-Q8_0.gguf
11
+ a192756b5f6e0fe77e57596ff5a723bbaf16ab16e5817e0588a3144b8f69e2da reproduce/logs/requirements-lock.txt
12
+ c61b7c2e3c2c73d1f2e1b910e1b10a74716bc04511c85f8bec0ed0541cb5e5da reproduce/scripts/audit_gguf.py
13
+ 9591828d8b0bfa92da1725c2dc27c2bc01e8b6a47cb7402afa6c26ed3c114f6d reproduce/scripts/convert_compatible.py
14
+ 8a2336055793f9398523f9a3f97c0cef5e37e08b8a16674e2ba7a9ea1346eacb reproduce/scripts/download_source.py
15
+ cf87edf345e6c1219c67f4053666814a7e55c2080d4ffea53bec0eb4d4cf6c59 reproduce/scripts/reproduce.sh
16
+ 727f566dec90b50ff3f6c7a3db0c1a84eb7d6085521f69eaa843d7cc35088a08 reproduce/scripts/run_step.py
17
+ 896ede8b40952e6dff8f2538e3e58bd460dc1de174bd664a8c5a44409e2cf1c3 reproduce/scripts/start_validation_runner.sh
18
+ 14d4965f07340f7343281f6e54cabf3088a3b45d1149dc195a7bdc9a46367e94 reproduce/scripts/validate_bf16.py
19
+ 510a92196328acf88ab0498dd1382efb3636ae40c5387689c0b0779336dc7844 reproduce/scripts/validate_dmr.py
20
+ 9317c991823f589960258b4c6fba6ba4cabaebe6a649e9051161c09ca3149c28 reproduce/scripts/validation_common.py
SOURCE_SHA256SUMS ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ bcdccfaa66bc1240c7192dbd374cfb39b695bb1d8ff6b7ce0113aa5e9ac21a44 .gitattributes
2
+ 8759bdf7c77efc7df7723f64856a593c8943b71ee38baf2a88771fbaf78438f9 1_Pooling/config.json
3
+ cdb09dfca347a56aa2d691744e38d5ad3c7cbc2834e7181272b9a15328b82524 2_Normalize/config.json
4
+ 2c058c304c68221f1de80979594036eff3972b2bce686bb7b0f43621a6b0b011 README.md
5
+ 4b852efc0b9960283e735363331e6f325b33bc74bdbaa076f595bc4e9b94d85e chat_template.jinja
6
+ b8f1e9931b57fbc054acdb445c41765d55b0074c58d145fa82839941ad1b5bb3 config.json
7
+ 031e56a498d33c349ab489a21885bcfe25b4fcba841149dc99e1e90d4a7c28f5 config_sentence_transformers.json
8
+ 197a32965d4b1105faf060417baa899e193fb73cd401f42ec9295234d5553d79 model.safetensors
9
+ 3d02572a0455b832de67fb8e63a54981bc7e8b46e337c95e917bd8122a533bfd modules.json
10
+ ea2ae257e901064abdd98dceb19f2b0da06af600bed15e0f99f5c85c37ee9d78 preprocessor_config.json
11
+ 168f6a08522f3ce5dea596d94d003af2fd691742d4f41fe1f9d8cce76bfbf69c processor_config.json
12
+ b1bcd9f2dce3ae863b359e87d0710b5dbc3314a59ecb4e2f97c7778fc8e4b228 sentence_bert_config.json
13
+ 4d777ef5bdc1aa36227abdfb77c3e49e7b9c892d16e1b6bda41c393504828be4 tokenizer.json
14
+ e594c8a90eb08d8bda498ff4747977dc827ae0c3c56b5c0d41a605a22d02ef03 tokenizer.model
15
+ 17bd5d6e9364ca49a534e1502076593317c298d4a663623091ed45388f004874 tokenizer_config.json
TIMINGS.json ADDED
@@ -0,0 +1,297 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "stage": "download",
4
+ "command": [
5
+ "python3",
6
+ "scripts/download_source.py"
7
+ ],
8
+ "cwd": "$TASK_ROOT",
9
+ "started_utc": "2026-11-01T14:55:21.409343+00:00",
10
+ "finished_utc": "2026-11-01T14:55:53.401870+00:00",
11
+ "elapsed_seconds": 31.99252673998126,
12
+ "returncode": 0
13
+ },
14
+ {
15
+ "stage": "build-configure",
16
+ "command": [
17
+ "cmake",
18
+ "-S",
19
+ "llama.cpp",
20
+ "-B",
21
+ "llama.cpp/build",
22
+ "-DCMAKE_BUILD_TYPE=Release",
23
+ "-DGGML_CUDA=OFF",
24
+ "-DGGML_NATIVE=ON",
25
+ "-DLLAMA_BUILD_TESTS=OFF",
26
+ "-DLLAMA_CURL=OFF"
27
+ ],
28
+ "cwd": "$TASK_ROOT",
29
+ "started_utc": "2026-11-01T14:55:46.632685+00:00",
30
+ "finished_utc": "2026-11-01T14:55:48.362987+00:00",
31
+ "elapsed_seconds": 1.73029996099649,
32
+ "returncode": 0
33
+ },
34
+ {
35
+ "stage": "build",
36
+ "command": [
37
+ "cmake",
38
+ "--build",
39
+ "llama.cpp/build",
40
+ "--config",
41
+ "Release",
42
+ "-j",
43
+ "16",
44
+ "--target",
45
+ "llama-quantize",
46
+ "llama-server"
47
+ ],
48
+ "cwd": "$TASK_ROOT",
49
+ "started_utc": "2026-11-01T14:55:48.380276+00:00",
50
+ "finished_utc": "2026-11-01T14:56:48.044752+00:00",
51
+ "elapsed_seconds": 59.66447541900561,
52
+ "returncode": 0
53
+ },
54
+ {
55
+ "stage": "dependencies",
56
+ "command": [
57
+ ".venv/bin/python",
58
+ "-m",
59
+ "pip",
60
+ "install",
61
+ "-r",
62
+ "llama.cpp/requirements/requirements-convert_hf_to_gguf.txt",
63
+ "huggingface_hub>=0.34.0,<1.0"
64
+ ],
65
+ "cwd": "$TASK_ROOT",
66
+ "started_utc": "2026-11-01T14:55:49.275061+00:00",
67
+ "finished_utc": "2026-11-01T14:56:14.893959+00:00",
68
+ "elapsed_seconds": 25.618897876003757,
69
+ "returncode": 0
70
+ },
71
+ {
72
+ "stage": "dmr-image-pull",
73
+ "command": [
74
+ "docker",
75
+ "pull",
76
+ "docker/model-runner@sha256:9967b6c1092ff01e7cf68119ab25067a1f58e3d1b06873bc16fe1e758bcd914f"
77
+ ],
78
+ "cwd": "$TASK_ROOT",
79
+ "started_utc": "2026-11-01T14:56:23.532588+00:00",
80
+ "finished_utc": "2026-11-01T14:56:27.210774+00:00",
81
+ "elapsed_seconds": 3.6781821949989535,
82
+ "returncode": 0
83
+ },
84
+ {
85
+ "stage": "convert-bf16",
86
+ "command": [
87
+ ".venv/bin/python",
88
+ "llama.cpp/convert_hf_to_gguf.py",
89
+ "source",
90
+ "--outtype",
91
+ "bf16",
92
+ "--model-name",
93
+ "embeddinggemma-2",
94
+ "--outfile",
95
+ "work/embeddinggemma-2-BF16.gguf"
96
+ ],
97
+ "cwd": "$TASK_ROOT",
98
+ "started_utc": "2026-11-01T14:56:49.790088+00:00",
99
+ "finished_utc": "2026-11-01T14:56:53.358771+00:00",
100
+ "elapsed_seconds": 3.5686840260168537,
101
+ "returncode": 1
102
+ },
103
+ {
104
+ "stage": "convert-mmproj",
105
+ "command": [
106
+ ".venv/bin/python",
107
+ "llama.cpp/convert_hf_to_gguf.py",
108
+ "source",
109
+ "--mmproj",
110
+ "--outtype",
111
+ "q8_0",
112
+ "--model-name",
113
+ "embeddinggemma-2",
114
+ "--outfile",
115
+ "release/mmproj-embeddinggemma-2-Q8_0.gguf"
116
+ ],
117
+ "cwd": "$TASK_ROOT",
118
+ "started_utc": "2026-11-01T14:56:50.417675+00:00",
119
+ "finished_utc": "2026-11-01T14:56:53.964458+00:00",
120
+ "elapsed_seconds": 3.54678301900276,
121
+ "returncode": 0
122
+ },
123
+ {
124
+ "stage": "cuda-configure",
125
+ "command": [
126
+ "cmake",
127
+ "-S",
128
+ "llama.cpp",
129
+ "-B",
130
+ "llama.cpp/build-cuda",
131
+ "-DCMAKE_BUILD_TYPE=Release",
132
+ "-DGGML_CUDA=ON",
133
+ "-DCMAKE_CUDA_ARCHITECTURES=121",
134
+ "-DGGML_NATIVE=ON",
135
+ "-DLLAMA_BUILD_TESTS=OFF",
136
+ "-DLLAMA_CURL=OFF"
137
+ ],
138
+ "cwd": "$TASK_ROOT",
139
+ "started_utc": "2026-11-01T14:57:33.645338+00:00",
140
+ "finished_utc": "2026-11-01T14:57:36.272337+00:00",
141
+ "elapsed_seconds": 2.626998322986765,
142
+ "returncode": 0
143
+ },
144
+ {
145
+ "stage": "cuda-build",
146
+ "command": [
147
+ "cmake",
148
+ "--build",
149
+ "llama.cpp/build-cuda",
150
+ "--config",
151
+ "Release",
152
+ "-j",
153
+ "8",
154
+ "--target",
155
+ "llama-server"
156
+ ],
157
+ "cwd": "$TASK_ROOT",
158
+ "started_utc": "2026-11-01T14:57:36.303210+00:00",
159
+ "finished_utc": "2026-11-01T15:01:19.019507+00:00",
160
+ "elapsed_seconds": 222.71629584900802,
161
+ "returncode": 0
162
+ },
163
+ {
164
+ "stage": "convert-bf16-compatible",
165
+ "command": [
166
+ ".venv/bin/python",
167
+ "scripts/convert_compatible.py",
168
+ "source",
169
+ "--outtype",
170
+ "bf16",
171
+ "--model-name",
172
+ "embeddinggemma-2",
173
+ "--outfile",
174
+ "work/embeddinggemma-2-BF16.gguf"
175
+ ],
176
+ "cwd": "$TASK_ROOT",
177
+ "started_utc": "2026-11-01T14:58:26.671428+00:00",
178
+ "finished_utc": "2026-11-01T14:58:39.271335+00:00",
179
+ "elapsed_seconds": 12.599901882989798,
180
+ "returncode": 0
181
+ },
182
+ {
183
+ "stage": "quantize",
184
+ "command": [
185
+ "llama.cpp/build/bin/llama-quantize",
186
+ "work/embeddinggemma-2-BF16.gguf",
187
+ "release/embeddinggemma-2-Q4_K_M.gguf",
188
+ "Q4_K_M"
189
+ ],
190
+ "cwd": "$TASK_ROOT",
191
+ "started_utc": "2026-11-01T14:59:03.341119+00:00",
192
+ "finished_utc": "2026-11-01T14:59:05.780096+00:00",
193
+ "elapsed_seconds": 2.438970130024245,
194
+ "returncode": 0
195
+ },
196
+ {
197
+ "stage": "audit",
198
+ "command": [
199
+ ".venv/bin/python",
200
+ "scripts/audit_gguf.py"
201
+ ],
202
+ "cwd": "$TASK_ROOT",
203
+ "started_utc": "2026-11-01T14:59:48.642886+00:00",
204
+ "finished_utc": "2026-11-01T15:00:09.839507+00:00",
205
+ "elapsed_seconds": 21.196617795998463,
206
+ "returncode": 1
207
+ },
208
+ {
209
+ "stage": "audit-final",
210
+ "command": [
211
+ ".venv/bin/python",
212
+ "scripts/audit_gguf.py"
213
+ ],
214
+ "cwd": "$TASK_ROOT",
215
+ "started_utc": "2026-11-01T15:00:53.569576+00:00",
216
+ "finished_utc": "2026-11-01T15:01:15.285176+00:00",
217
+ "elapsed_seconds": 21.71559885001625,
218
+ "returncode": 0
219
+ },
220
+ {
221
+ "stage": "validate-bf16",
222
+ "command": [
223
+ ".venv/bin/python",
224
+ "scripts/validate_bf16.py"
225
+ ],
226
+ "cwd": "$TASK_ROOT",
227
+ "started_utc": "2026-11-01T15:01:15.314013+00:00",
228
+ "finished_utc": "2026-11-01T15:01:17.519620+00:00",
229
+ "elapsed_seconds": 2.2056051869876683,
230
+ "returncode": 0
231
+ },
232
+ {
233
+ "stage": "dmr-start",
234
+ "command": [
235
+ "bash",
236
+ "scripts/start_validation_runner.sh"
237
+ ],
238
+ "cwd": "$TASK_ROOT",
239
+ "started_utc": "2026-11-01T15:02:00.812758+00:00",
240
+ "finished_utc": "2026-11-01T15:02:01.138690+00:00",
241
+ "elapsed_seconds": 0.32593187599559315,
242
+ "returncode": 0
243
+ },
244
+ {
245
+ "stage": "dmr-package",
246
+ "command": [
247
+ "env",
248
+ "MODEL_RUNNER_HOST=http://127.0.0.1:12435",
249
+ "docker",
250
+ "model",
251
+ "package",
252
+ "--gguf",
253
+ "$TASK_ROOT/release/embeddinggemma-2-Q4_K_M.gguf",
254
+ "--mmproj",
255
+ "$TASK_ROOT/release/mmproj-embeddinggemma-2-Q8_0.gguf",
256
+ "--license",
257
+ "$TASK_ROOT/release/LICENSE",
258
+ "--context-size",
259
+ "2048",
260
+ "mirrorneuronlab/embeddinggemma-2:q4_k_m"
261
+ ],
262
+ "cwd": "$TASK_ROOT",
263
+ "started_utc": "2026-11-01T15:02:13.051800+00:00",
264
+ "finished_utc": "2026-11-01T15:02:15.412325+00:00",
265
+ "elapsed_seconds": 2.3605253199930303,
266
+ "returncode": 0
267
+ },
268
+ {
269
+ "stage": "validate-dmr",
270
+ "command": [
271
+ ".venv/bin/python",
272
+ "scripts/validate_dmr.py"
273
+ ],
274
+ "cwd": "$TASK_ROOT",
275
+ "started_utc": "2026-11-01T15:02:15.594479+00:00",
276
+ "finished_utc": "2026-11-01T15:02:17.820825+00:00",
277
+ "elapsed_seconds": 2.226341144007165,
278
+ "returncode": 0
279
+ },
280
+ {
281
+ "stage": "dmr-run",
282
+ "command": [
283
+ "env",
284
+ "MODEL_RUNNER_HOST=http://127.0.0.1:12435",
285
+ "docker",
286
+ "model",
287
+ "run",
288
+ "--detach",
289
+ "mirrorneuronlab/embeddinggemma-2:q4_k_m"
290
+ ],
291
+ "cwd": "$TASK_ROOT",
292
+ "started_utc": "2026-11-01T15:05:52.619080+00:00",
293
+ "finished_utc": "2026-11-01T15:05:52.670364+00:00",
294
+ "elapsed_seconds": 0.0512839280127082,
295
+ "returncode": 0
296
+ }
297
+ ]
VALIDATION.json ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "passed": true,
3
+ "model": "mirrorneuronlab/embeddinggemma-2:q4_k_m",
4
+ "endpoint": "http://127.0.0.1:12435/engines/llama.cpp/v1/embeddings",
5
+ "text": {
6
+ "http_status": 200,
7
+ "elapsed_seconds": 1.8947369380039163,
8
+ "vectors": 4,
9
+ "dimensions": 768,
10
+ "finite": true,
11
+ "l2_norms": [
12
+ 0.9999999906183037,
13
+ 0.9999999717982236,
14
+ 0.9999999449210023,
15
+ 0.9999999732160483
16
+ ],
17
+ "related_cosine": 0.8650823975051903,
18
+ "unrelated_cosine": 0.5486270130835971
19
+ },
20
+ "repeat": {
21
+ "http_status": 200,
22
+ "elapsed_seconds": 0.03770295198773965,
23
+ "vectors": 4,
24
+ "dimensions": 768,
25
+ "finite": true,
26
+ "l2_norms": [
27
+ 0.9999999906183037,
28
+ 0.9999999717982236,
29
+ 0.9999999449210023,
30
+ 0.9999999732160483
31
+ ],
32
+ "max_abs_difference": 0.0
33
+ },
34
+ "cosine_to_bf16_text": [
35
+ 0.9941200584690152,
36
+ 0.9908234124220315,
37
+ 0.9889631445265419,
38
+ 0.9972267675976894
39
+ ],
40
+ "image": {
41
+ "http_status": 200,
42
+ "elapsed_seconds": 0.12217680300818756,
43
+ "vectors": 1,
44
+ "dimensions": 768,
45
+ "finite": true,
46
+ "l2_norms": [
47
+ 1.0000000458974723
48
+ ]
49
+ },
50
+ "audio": {
51
+ "http_status": 200,
52
+ "elapsed_seconds": 0.04252175899455324,
53
+ "vectors": 1,
54
+ "dimensions": 768,
55
+ "finite": true,
56
+ "l2_norms": [
57
+ 1.0000000058851288
58
+ ]
59
+ },
60
+ "mixed_batch": {
61
+ "http_status": 200,
62
+ "elapsed_seconds": 0.06744719200651161,
63
+ "vectors": 3,
64
+ "dimensions": 768,
65
+ "finite": true,
66
+ "l2_norms": [
67
+ 0.9999999906183037,
68
+ 1.0000000458974723,
69
+ 1.0000000058851288
70
+ ]
71
+ },
72
+ "scope": "Functional smoke checks on four texts, one solid-color image, and one synthetic audio tone. Not a retrieval or multimodal quality benchmark.",
73
+ "docker": {
74
+ "engine": "29.6.2",
75
+ "client": "v1.2.9",
76
+ "server": "v1.2.9",
77
+ "image": "docker/model-runner@sha256:9967b6c1092ff01e7cf68119ab25067a1f58e3d1b06873bc16fe1e758bcd914f",
78
+ "llama_cpp_revision": "dde879bc4f954b809892fd0d660515f42536394a",
79
+ "llama_cpp_build": "b12032 / 0.8.0-dev",
80
+ "cuda_architecture": "121",
81
+ "local_model": "mirrorneuronlab/embeddinggemma-2:q4_k_m",
82
+ "endpoint": "http://127.0.0.1:12435",
83
+ "configuration": "-ngl 999 --pooling mean -b 2048 -ub 2048 --parallel 1 -t 10; context 2048; embedding mode",
84
+ "gpu_evidence": "Docker logged gpuSupport=true, backend arguments include -ngl 999, NVIDIA-SMI reports /opt/llama/llama-server GPU processes.",
85
+ "backend_version_note": "The stock images checked bundled older engines without this architecture. Validation used the official current v1.2.9 controller with the pinned upstream CUDA backend mounted read-only. The controller displays the backend version as unknown because its parser does not recognize llama.cpp's new version string."
86
+ },
87
+ "bf16_reference": {
88
+ "http_status": 200,
89
+ "elapsed_seconds": 1.0279945080110338,
90
+ "vectors": 4,
91
+ "dimensions": 768,
92
+ "finite": true,
93
+ "l2_norms": [
94
+ 1.0000000336112962,
95
+ 1.0000000038732915,
96
+ 0.9999999638015133,
97
+ 1.0000000373879046
98
+ ],
99
+ "related_cosine": 0.8629100120127821,
100
+ "unrelated_cosine": 0.5291825480995416
101
+ },
102
+ "docker_model_run": {
103
+ "stage": "dmr-run",
104
+ "command": [
105
+ "env",
106
+ "MODEL_RUNNER_HOST=http://127.0.0.1:12435",
107
+ "docker",
108
+ "model",
109
+ "run",
110
+ "--detach",
111
+ "mirrorneuronlab/embeddinggemma-2:q4_k_m"
112
+ ],
113
+ "cwd": "/home/homer/Sandbox/hf_model/embeddinggemma2-q4",
114
+ "started_utc": "2026-11-01T15:05:52.619080+00:00",
115
+ "finished_utc": "2026-11-01T15:05:52.670364+00:00",
116
+ "elapsed_seconds": 0.0512839280127082,
117
+ "returncode": 0
118
+ },
119
+ "fixtures": [
120
+ {
121
+ "name": "red-square.png",
122
+ "sha256": "66d2ca44529ac40d3d08a58d0fd0f10696eae138d288dc5cfc1351f263d4c0a3",
123
+ "size_bytes": 677
124
+ },
125
+ {
126
+ "name": "tone-440hz.wav",
127
+ "sha256": "3f806962fcdcc982acaca0e5180c701391a59c2635d82e4b0660dc148c01f528",
128
+ "size_bytes": 64044
129
+ }
130
+ ],
131
+ "other_platforms": "Apple Silicon Macs and Ubuntu/NVIDIA systems were not physically tested. GGUF files are platform portable; their llama.cpp backend must support gemma-embedding2 and the Gemma4 vision/audio encoders."
132
+ }
embeddinggemma-2-Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d610afe26dd783739275646d51d4d85b4167820fd051600696d7a49e6f68609f
3
+ size 181694688
mmproj-embeddinggemma-2-Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0531309472a6bc6f4b146c3736eee7795ec9db1903c25490d3c937490cef6dd8
3
+ size 554821056
reproduce/logs/requirements-lock.txt ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ certifi==2026.10.23
2
+ charset-normalizer==3.5.2
3
+ filelock==4.2.6
4
+ fsspec==2026.9.0
5
+ gguf==0.19.0
6
+ hf-xet==1.8.0
7
+ huggingface_hub==0.36.2
8
+ idna==3.20
9
+ Jinja2==3.1.6
10
+ MarkupSafe==3.0.4
11
+ mpmath==1.3.0
12
+ networkx==3.7
13
+ numpy==2.2.6
14
+ packaging==26.3
15
+ protobuf==4.25.9
16
+ PyYAML==6.0.3
17
+ regex==2026.9.29
18
+ requests==2.34.2
19
+ safetensors==0.8.0
20
+ sentencepiece==0.2.2
21
+ setuptools==81.0.0
22
+ sympy==1.14.0
23
+ tokenizers==0.22.2
24
+ torch==2.11.0+cpu
25
+ tqdm==4.70.1
26
+ transformers==4.57.6
27
+ typing_extensions==4.16.0
28
+ urllib3==2.8.0
reproduce/scripts/audit_gguf.py ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Check release structure, original tokenizer IDs, architecture and tensor shapes."""
3
+ import collections
4
+ import hashlib
5
+ import json
6
+ import pathlib
7
+ import sys
8
+
9
+ ROOT = pathlib.Path(__file__).resolve().parents[1]
10
+ sys.path.insert(0, str(ROOT / "llama.cpp/gguf-py"))
11
+ from gguf import GGUFReader
12
+
13
+
14
+ def digest(path):
15
+ h = hashlib.sha256()
16
+ with path.open("rb") as source:
17
+ while block := source.read(8 * 1024 * 1024):
18
+ h.update(block)
19
+ return h.hexdigest()
20
+
21
+
22
+ paths = [ROOT / "work/embeddinggemma-2-BF16.gguf",
23
+ ROOT / "release/embeddinggemma-2-Q4_K_M.gguf",
24
+ ROOT / "release/mmproj-embeddinggemma-2-Q8_0.gguf"]
25
+ readers = [GGUFReader(str(p)) for p in paths]
26
+ bf16, text, mmproj = readers
27
+
28
+ def value(reader, key):
29
+ return reader.fields[key].contents()
30
+
31
+
32
+ assert value(bf16, "general.file_type") == 32
33
+ assert value(text, "general.architecture") == "gemma-embedding2"
34
+ assert value(text, "general.file_type") == 15 # MOSTLY_Q4_K_M
35
+ assert value(text, "gemma-embedding2.embedding_length_out") == 768
36
+ assert value(text, "gemma-embedding2.attention.causal") is False
37
+ assert value(text, "gemma-embedding2.pooling_type") == 1 # MEAN
38
+ assert value(text, "tokenizer.ggml.model") == "gemma4"
39
+ preserved = [key for key in bf16.fields if key.startswith(("gemma-embedding2.", "tokenizer."))]
40
+ for key in preserved:
41
+ assert value(bf16, key) == value(text, key), key
42
+ bf_tensors = {t.name: list(map(int, t.shape)) for t in bf16.tensors}
43
+ q_tensors = {t.name: list(map(int, t.shape)) for t in text.tensors}
44
+ assert bf_tensors == q_tensors
45
+ assert "output.weight" in q_tensors and q_tensors["output.weight"] == [512, 768]
46
+ assert value(mmproj, "general.file_type") == 7 # MOSTLY_Q8_0
47
+ assert value(mmproj, "clip.has_vision_encoder") is True
48
+ assert value(mmproj, "clip.has_audio_encoder") is True
49
+ assert value(mmproj, "clip.vision.projector_type") == "gemma4v"
50
+ assert value(mmproj, "clip.audio.projector_type") == "gemma4a"
51
+ assert any(t.name.startswith("v.") for t in mmproj.tensors)
52
+ assert any(t.name.startswith("a.") for t in mmproj.tensors)
53
+ assert set(p.name for p in (ROOT / "release").glob("*.gguf")) == set(p.name for p in paths[1:])
54
+ report = {"passed": True, "preserved_metadata_fields": preserved,
55
+ "tokenizer_tokens": len(value(text, "tokenizer.ggml.tokens")),
56
+ "projection_tensor": {"name": "output.weight", "shape_ggml": q_tensors["output.weight"]},
57
+ "files": []}
58
+ for path, reader in zip(paths, readers):
59
+ metadata = {key: field.contents() for key, field in reader.fields.items()
60
+ if key.startswith(("general.", "gemma-embedding2.", "clip."))}
61
+ report["files"].append(dict(path=str(path.relative_to(ROOT)), size_bytes=path.stat().st_size,
62
+ sha256=digest(path), tensor_count=len(reader.tensors),
63
+ tensor_types=dict(collections.Counter(t.tensor_type.name for t in reader.tensors)),
64
+ tensor_prefixes=dict(collections.Counter(t.name.split('.')[0] for t in reader.tensors)),
65
+ metadata=metadata))
66
+ (ROOT / "logs/gguf-audit.json").write_text(json.dumps(report, indent=2) + "\n")
67
+ print(json.dumps(report, indent=2))
reproduce/scripts/convert_compatible.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Run upstream conversion with a lossless Transformers 5 -> 4 config adapter.
3
+
4
+ The pinned upstream requirements use Transformers 4.57.6. Google's tokenizer
5
+ configuration uses Transformers 5's list-valued extra_special_tokens and
6
+ model_specific_special_tokens mapping. Supply the equivalent Transformers 4
7
+ arguments in memory; leave all checkpoint and upstream tool files untouched.
8
+ """
9
+ import json
10
+ import pathlib
11
+ import runpy
12
+ import sys
13
+
14
+ from tokenizers import Tokenizer
15
+ from transformers import AutoTokenizer
16
+
17
+ root = pathlib.Path(__file__).resolve().parents[1]
18
+ original_loader = AutoTokenizer.from_pretrained
19
+
20
+
21
+ def load_compatible(model_path, *args, **kwargs):
22
+ path = pathlib.Path(model_path)
23
+ config = json.loads((path / "tokenizer_config.json").read_text())
24
+ extra = config.get("extra_special_tokens")
25
+ if isinstance(extra, list):
26
+ kwargs["extra_special_tokens"] = config["model_specific_special_tokens"]
27
+ kwargs["additional_special_tokens"] = extra
28
+ tokenizer = original_loader(model_path, *args, **kwargs)
29
+ original = Tokenizer.from_file(str(path / "tokenizer.json"))
30
+ assert tokenizer.get_vocab() == original.get_vocab(), "Tokenizer vocabulary or IDs changed"
31
+ for name, token in config.get("model_specific_special_tokens", {}).items():
32
+ assert tokenizer.convert_tokens_to_ids(token) == original.token_to_id(token), name
33
+ assert token in tokenizer.all_special_tokens, name
34
+ print(f"Tokenizer compatibility audit: all {len(tokenizer)} token strings/IDs preserved; all model-specific special tokens preserved.", flush=True)
35
+ return tokenizer
36
+
37
+
38
+ AutoTokenizer.from_pretrained = staticmethod(load_compatible)
39
+ sys.path.insert(0, str(root / "llama.cpp"))
40
+ runpy.run_path(str(root / "llama.cpp/convert_hf_to_gguf.py"), run_name="__main__")
reproduce/scripts/download_source.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Download the original public checkpoint at one immutable Hugging Face revision."""
3
+ import concurrent.futures
4
+ import hashlib
5
+ import json
6
+ import pathlib
7
+ import time
8
+ import urllib.request
9
+
10
+ ROOT = pathlib.Path(__file__).resolve().parents[1]
11
+ REPO = "google/embeddinggemma-2"
12
+ REVISION = "f9972ac22e696a105c482202646979e33e4b5a1e"
13
+ url = f"https://huggingface.co/api/models/{REPO}/revision/{REVISION}?blobs=true"
14
+ with urllib.request.urlopen(url, timeout=120) as response:
15
+ metadata = json.load(response)
16
+ assert metadata["sha"] == REVISION
17
+ (ROOT / "logs/source-api.json").write_text(json.dumps(metadata, indent=2) + "\n")
18
+
19
+ def fetch(entry):
20
+ name = entry["rfilename"]
21
+ path = ROOT / "source" / name
22
+ path.parent.mkdir(parents=True, exist_ok=True)
23
+ expected = entry.get("lfs", {}).get("sha256")
24
+ for attempt in range(4):
25
+ try:
26
+ digest = hashlib.sha256()
27
+ with urllib.request.urlopen(f"https://huggingface.co/{REPO}/resolve/{REVISION}/{name}", timeout=180) as response, path.with_suffix(path.suffix + ".part").open("wb") as target:
28
+ while block := response.read(8 * 1024 * 1024):
29
+ digest.update(block)
30
+ target.write(block)
31
+ sha = digest.hexdigest()
32
+ if expected:
33
+ assert sha == expected, (name, sha, expected)
34
+ path.with_suffix(path.suffix + ".part").replace(path)
35
+ print(f"{name}: {path.stat().st_size} bytes sha256={sha}", flush=True)
36
+ return dict(path=name, size_bytes=path.stat().st_size, sha256=sha,
37
+ upstream_lfs_sha256=expected)
38
+ except Exception:
39
+ if attempt == 3:
40
+ raise
41
+ time.sleep(2 ** attempt)
42
+
43
+ with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
44
+ files = sorted(executor.map(fetch, metadata["siblings"]), key=lambda item: item["path"])
45
+ (ROOT / "logs/source-manifest.json").write_text(json.dumps(dict(repo_id=REPO, revision=REVISION, files=files), indent=2) + "\n")
46
+ (ROOT / "logs/source-SHA256SUMS").write_text("".join(f"{item['sha256']} {item['path']}\n" for item in files))
reproduce/scripts/reproduce.sh ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ BUNDLE_ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
4
+ if [[ $# != 1 ]]; then
5
+ printf 'Usage: bash reproduce.sh /absolute/path/to/new-workspace\n' >&2
6
+ exit 2
7
+ fi
8
+ TASK_ROOT=$1
9
+ if [[ -e "$TASK_ROOT" ]]; then
10
+ printf 'Choose a new workspace path; destination already exists: %s\n' "$TASK_ROOT" >&2
11
+ exit 2
12
+ fi
13
+ mkdir -p "$TASK_ROOT"/{source,work,release,logs,scripts}
14
+ cp "$BUNDLE_ROOT"/scripts/*.py "$TASK_ROOT/scripts/"
15
+ cp "$BUNDLE_ROOT/logs/requirements-lock.txt" "$TASK_ROOT/logs/requirements-lock.txt"
16
+ cd -- "$TASK_ROOT"
17
+ git init llama.cpp
18
+ git -C llama.cpp remote add origin https://github.com/ggml-org/llama.cpp.git
19
+ git -C llama.cpp fetch --depth 1 origin dde879bc4f954b809892fd0d660515f42536394a
20
+ git -C llama.cpp checkout --detach FETCH_HEAD
21
+ test "$(git -C llama.cpp rev-parse HEAD)" = dde879bc4f954b809892fd0d660515f42536394a
22
+ python3 -m venv .venv
23
+ python3 scripts/run_step.py dependencies .venv/bin/python -m pip install \
24
+ -r llama.cpp/requirements/requirements-convert_hf_to_gguf.txt \
25
+ -r logs/requirements-lock.txt
26
+ .venv/bin/python -m pip check
27
+ python3 scripts/run_step.py download .venv/bin/python scripts/download_source.py
28
+ python3 scripts/run_step.py build-configure cmake -S llama.cpp -B llama.cpp/build \
29
+ -DCMAKE_BUILD_TYPE=Release -DGGML_CUDA=OFF -DGGML_NATIVE=ON \
30
+ -DLLAMA_BUILD_TESTS=OFF -DLLAMA_CURL=OFF
31
+ python3 scripts/run_step.py build cmake --build llama.cpp/build --config Release \
32
+ -j 16 --target llama-quantize llama-server
33
+ python3 scripts/run_step.py convert-bf16-compatible .venv/bin/python scripts/convert_compatible.py source \
34
+ --outtype bf16 --model-name embeddinggemma-2 --outfile work/embeddinggemma-2-BF16.gguf
35
+ python3 scripts/run_step.py quantize llama.cpp/build/bin/llama-quantize \
36
+ work/embeddinggemma-2-BF16.gguf release/embeddinggemma-2-Q4_K_M.gguf Q4_K_M
37
+ python3 scripts/run_step.py convert-mmproj .venv/bin/python llama.cpp/convert_hf_to_gguf.py source \
38
+ --mmproj --outtype q8_0 --model-name embeddinggemma-2 \
39
+ --outfile release/mmproj-embeddinggemma-2-Q8_0.gguf
40
+ python3 scripts/run_step.py audit .venv/bin/python scripts/audit_gguf.py
reproduce/scripts/run_step.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Run a reproducible pipeline step, capturing its command, output and wall time."""
3
+ import datetime
4
+ import json
5
+ import pathlib
6
+ import shlex
7
+ import subprocess
8
+ import sys
9
+ import time
10
+
11
+ root = pathlib.Path(__file__).resolve().parents[1]
12
+ name, *command = sys.argv[1:]
13
+ if command and command[0] == "--":
14
+ command.pop(0)
15
+ start = datetime.datetime.now(datetime.timezone.utc)
16
+ tick = time.monotonic()
17
+ with (root / "logs" / f"{name}.log").open("w") as log:
18
+ log.write(f"$ {shlex.join(command)}\n")
19
+ log.flush()
20
+ result = subprocess.run(command, cwd=root, stdout=log, stderr=subprocess.STDOUT)
21
+ record = dict(stage=name, command=command, cwd=str(root),
22
+ started_utc=start.isoformat(),
23
+ finished_utc=datetime.datetime.now(datetime.timezone.utc).isoformat(),
24
+ elapsed_seconds=time.monotonic() - tick, returncode=result.returncode)
25
+ (root / "logs" / f"{name}.timing.json").write_text(json.dumps(record, indent=2) + "\n")
26
+ print(json.dumps(record), flush=True)
27
+ sys.exit(result.returncode)
reproduce/scripts/start_validation_runner.sh ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ TASK_ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
4
+ docker run -d --name embeddinggemma2-q4-validation \
5
+ --gpus all \
6
+ --publish 127.0.0.1:12435:12434 \
7
+ --mount type=volume,src=embeddinggemma2-q4-validation-models,dst=/models \
8
+ --mount "type=bind,src=${TASK_ROOT}/llama.cpp/build-cuda/bin,dst=/opt/llama,readonly" \
9
+ --env MODEL_RUNNER_PORT=12434 \
10
+ --env LLAMA_SERVER_PATH=/opt/llama \
11
+ --env LD_LIBRARY_PATH=/opt/llama:/app \
12
+ --env DISABLE_SERVER_UPDATE=1 \
13
+ --env 'LLAMA_ARGS=-ngl 999 --pooling mean -b 2048 -ub 2048 --parallel 1 -t 10' \
14
+ docker/model-runner@sha256:9967b6c1092ff01e7cf68119ab25067a1f58e3d1b06873bc16fe1e758bcd914f
reproduce/scripts/validate_bf16.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import json
3
+ import subprocess
4
+ import time
5
+ import urllib.request
6
+ from validation_common import ROOT, TEXTS, cosine, post
7
+
8
+ with (ROOT / "logs/bf16-server.log").open("w") as log:
9
+ command = [str(ROOT / "llama.cpp/build/bin/llama-server"),
10
+ "-m", str(ROOT / "work/embeddinggemma-2-BF16.gguf"),
11
+ "--embeddings", "--pooling", "mean", "-c", "2048", "-b", "2048", "-ub", "2048",
12
+ "--parallel", "1", "-ngl", "0", "-t", "10", "--host", "127.0.0.1", "--port", "18080"]
13
+ log.write(json.dumps(command)+"\n"); log.flush()
14
+ server = subprocess.Popen(command, stdout=log, stderr=subprocess.STDOUT)
15
+ try:
16
+ for attempt in range(120):
17
+ if server.poll() is not None:
18
+ raise RuntimeError("BF16 server exited; inspect logs/bf16-server.log")
19
+ try:
20
+ with urllib.request.urlopen("http://127.0.0.1:18080/health", timeout=1) as response:
21
+ if response.status == 200:
22
+ break
23
+ except Exception:
24
+ time.sleep(0.5)
25
+ else:
26
+ raise TimeoutError("BF16 server startup timed out")
27
+ vectors, report = post("http://127.0.0.1:18080/v1/embeddings", {"input": TEXTS, "encoding_format": "float"}, "bf16-text")
28
+ report.update(related_cosine=cosine(vectors[0], vectors[1]), unrelated_cosine=cosine(vectors[0], vectors[2]))
29
+ assert report["related_cosine"] > report["unrelated_cosine"]
30
+ (ROOT / "logs/bf16-validation.json").write_text(json.dumps(report, indent=2)+"\n")
31
+ print(json.dumps(report, indent=2))
32
+ finally:
33
+ server.terminate()
34
+ try:
35
+ server.wait(timeout=10)
36
+ except subprocess.TimeoutExpired:
37
+ server.kill(); server.wait()
reproduce/scripts/validate_dmr.py ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import argparse
3
+ import json
4
+ from validation_common import ROOT, TEXTS, content_audio, content_image, cosine, fixtures, post
5
+
6
+ parser = argparse.ArgumentParser()
7
+ parser.add_argument("--base-url", default="http://127.0.0.1:12435")
8
+ parser.add_argument("--model", default="mirrorneuronlab/embeddinggemma-2:q4_k_m")
9
+ args = parser.parse_args()
10
+ url = args.base_url.rstrip("/") + "/engines/llama.cpp/v1/embeddings"
11
+
12
+ def request(name, inputs):
13
+ return post(url, dict(model=args.model, input=inputs, encoding_format="float"), "dmr-"+name)
14
+
15
+
16
+ vectors, text = request("text", TEXTS)
17
+ text.update(related_cosine=cosine(vectors[0], vectors[1]), unrelated_cosine=cosine(vectors[0], vectors[2]))
18
+ assert text["related_cosine"] > text["unrelated_cosine"]
19
+ repeat, repeated = request("repeat", TEXTS)
20
+ repeated["max_abs_difference"] = max(abs(x-y) for a,b in zip(vectors, repeat) for x,y in zip(a,b))
21
+ assert repeated["max_abs_difference"] < 1e-5
22
+ reference = json.loads((ROOT / "logs/bf16-text.response.json").read_text())
23
+ reference = [item["embedding"] for item in sorted(reference["data"], key=lambda x: x["index"])]
24
+ bf16_cosines = [cosine(a, b) for a, b in zip(vectors, reference)]
25
+ assert min(bf16_cosines) > 0.90
26
+ image_path, audio_path = fixtures()
27
+ _, image = request("image", [content_image(image_path)])
28
+ _, audio = request("audio", [content_audio(audio_path)])
29
+ _, mixed = request("mixed-batch", [TEXTS[0], content_image(image_path), content_audio(audio_path)])
30
+ report = dict(passed=True, model=args.model, endpoint=url, text=text, repeat=repeated,
31
+ cosine_to_bf16_text=bf16_cosines, image=image, audio=audio, mixed_batch=mixed,
32
+ scope="Functional smoke checks on four texts, one solid-color image, and one synthetic audio tone. Not a retrieval or multimodal quality benchmark.")
33
+ (ROOT / "logs/dmr-validation.json").write_text(json.dumps(report, indent=2)+"\n")
34
+ print(json.dumps(report, indent=2))
reproduce/scripts/validation_common.py ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import base64
2
+ import json
3
+ import math
4
+ import pathlib
5
+ import struct
6
+ import time
7
+ import urllib.error
8
+ import urllib.request
9
+ import wave
10
+ import zlib
11
+
12
+ ROOT = pathlib.Path(__file__).resolve().parents[1]
13
+ TEXTS = [
14
+ "task: search result | query: What causes the northern lights?",
15
+ "title: none | text: The northern lights are caused by charged particles from the Sun interacting with Earth's atmosphere.",
16
+ "title: none | text: To bake a chocolate cake, mix flour, eggs, cocoa powder, and sugar, then bake in the oven.",
17
+ "task: sentence similarity | query: Bonjour, le soleil brille aujourd'hui.",
18
+ ]
19
+
20
+
21
+ def post(url, payload, log_name):
22
+ (ROOT / f"logs/{log_name}.request.json").write_text(json.dumps(payload, indent=2) + "\n")
23
+ start = time.monotonic()
24
+ request = urllib.request.Request(url, data=json.dumps(payload).encode(), headers={"Content-Type": "application/json"})
25
+ try:
26
+ with urllib.request.urlopen(request, timeout=240) as response:
27
+ status = response.status
28
+ body = response.read()
29
+ except urllib.error.HTTPError as error:
30
+ (ROOT / f"logs/{log_name}.error.txt").write_bytes(error.read())
31
+ raise
32
+ (ROOT / f"logs/{log_name}.response.json").write_bytes(body)
33
+ result = json.loads(body)
34
+ vectors = [item["embedding"] for item in sorted(result["data"], key=lambda x: x["index"])]
35
+ assert len(vectors) == len(payload["input"]), result
36
+ for vector in vectors:
37
+ assert len(vector) == 768, len(vector)
38
+ assert all(math.isfinite(x) for x in vector)
39
+ assert abs(norm(vector) - 1.0) < 1e-4, norm(vector)
40
+ return vectors, dict(http_status=status, elapsed_seconds=time.monotonic()-start,
41
+ vectors=len(vectors), dimensions=768, finite=True,
42
+ l2_norms=[norm(v) for v in vectors])
43
+
44
+
45
+ def norm(vector):
46
+ return math.sqrt(sum(x*x for x in vector))
47
+
48
+
49
+ def cosine(a, b):
50
+ return sum(x*y for x, y in zip(a, b)) / (norm(a)*norm(b))
51
+
52
+
53
+ def fixtures():
54
+ folder = ROOT / "work/fixtures"
55
+ folder.mkdir(parents=True, exist_ok=True)
56
+ def chunk(kind, data):
57
+ return struct.pack(">I", len(data)) + kind + data + struct.pack(">I", zlib.crc32(kind+data) & 0xffffffff)
58
+ # A simple deterministic raster fixture, not an evaluation dataset.
59
+ png = b"\x89PNG\r\n\x1a\n" + chunk(b"IHDR", struct.pack(">IIBBBBB", 224, 224, 8, 2, 0, 0, 0))
60
+ png += chunk(b"IDAT", zlib.compress((b"\x00" + bytes([230, 20, 20])*224)*224)) + chunk(b"IEND", b"")
61
+ image = folder / "red-square.png"
62
+ image.write_bytes(png)
63
+ audio = folder / "tone-440hz.wav"
64
+ samples = [int(8000*math.sin(2*math.pi*440*i/16000)) for i in range(32000)]
65
+ with wave.open(str(audio), "wb") as output:
66
+ output.setnchannels(1)
67
+ output.setsampwidth(2)
68
+ output.setframerate(16000)
69
+ output.writeframes(struct.pack("<"+"h"*len(samples), *samples))
70
+ return image, audio
71
+
72
+
73
+ def content_image(path):
74
+ return {"content": [{"type": "image_url", "image_url": {"url": "data:image/png;base64," + base64.b64encode(path.read_bytes()).decode()}}]}
75
+
76
+
77
+ def content_audio(path):
78
+ return {"content": [{"type": "input_audio", "input_audio": {"data": base64.b64encode(path.read_bytes()).decode(), "format": "wav"}}]}