llmfan46 commited on
Commit
8174136
·
verified ·
1 Parent(s): 814655a

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,10 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-F16.gguf filter=lfs diff=lfs merge=lfs -text
37
+ gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-mmproj-F16.gguf filter=lfs diff=lfs merge=lfs -text
38
+ gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
39
+ gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
40
+ gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
41
+ gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
42
+ gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,442 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model:
4
+ - llmfan46/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
+ tags:
8
+ - gemma4
9
+ - coding
10
+ - agentic
11
+ - terminal
12
+ - tool-use
13
+ - reasoning
14
+ - thinking
15
+ - safetensors
16
+ - transformers
17
+ - heretic
18
+ - uncensored
19
+ - decensored
20
+ - abliterated
21
+ ---
22
+ <div style="background-color: #ff4444; color: white; padding: 20px; border-radius: 10px; text-align: center; margin: 20px 0;">
23
+ <h2 style="color: white; margin: 0 0 10px 0;">🚨⚠️ I HAVE REACHED HUGGING FACE'S FREE STORAGE LIMIT ⚠️🚨</h2>
24
+ <p style="font-size: 18px; margin: 0 0 15px 0;">I can no longer upload new models unless I can cover the cost of additional storage.<br>I host <b>70+ free models</b> as an independent contributor and this work is unpaid.<br><b>Without your support, no more new models can be uploaded.</b></p>
25
+ <p style="font-size: 20px; margin: 0;">
26
+ <a href="https://patreon.com/LLMfan46" style="color: white; text-decoration: underline;">🎉 Patreon (Monthly)</a> &nbsp;|&nbsp;
27
+ <a href="https://ko-fi.com/llmfan46" style="color: white; text-decoration: underline;">☕ Ko-fi (One-time)</a>
28
+ </p>
29
+ <p style="font-size: 16px; margin: 10px 0 0 0;">Every contribution goes directly toward Hugging Face storage fees to keep models free for everyone.</p>
30
+ </div>
31
+
32
+ ---
33
+
34
+ ### **87% fewer refusals** (13/100 Uncensored vs 99/100 Original) while preserving model quality (0.0367 KL divergence).
35
+
36
+ ## ❤️ Support My Work
37
+ Creating these models takes significant time, work and compute. If you find them useful consider supporting me:
38
+
39
+ ![image/png](https://huggingface.co/llmfan46/Omega-Darker-Gaslight_The-Final-Forgotten-Fever-Dream-24B-ultra-uncensored-heretic-v1/resolve/main/waifu001.webp)
40
+
41
+ | Platform | Link | What you get |
42
+ |----------|------|--------------|
43
+ | 🎉 Patreon | [Monthly support](https://patreon.com/LLMfan46) | Priority model requests |
44
+ | ☕ Ko-fi | [One-time tip](https://ko-fi.com/llmfan46) | My eternal gratitude |
45
+
46
+ Your help will motivate me and would go into further improving my workflow and coverings fees for storage, compute and may even help uncensoring bigger model with rental Cloud GPUs.
47
+
48
+ -----
49
+
50
+ GGUF quantizations of [llmfan46/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic](https://huggingface.co/llmfan46/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic).
51
+
52
+ # This is a decensored version of [yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF](https://huggingface.co/yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF), made using [Heretic](https://heretic-project.org/) v1.4.0 with a variant of the [Magnitude-Preserving Orthogonal Ablation (MPOA)](https://huggingface.co/blog/grimjim/norm-preserving-biprojected-abliteration) method
53
+
54
+ ## Abliteration parameters
55
+
56
+ | Parameter | Value |
57
+ | :-------- | :---: |
58
+ | **direction_index** | 29.18 |
59
+ | **attn.o_proj.max_weight** | 1.30 |
60
+ | **attn.o_proj.max_weight_position** | 35.73 |
61
+ | **attn.o_proj.min_weight** | 0.90 |
62
+ | **attn.o_proj.min_weight_distance** | 26.76 |
63
+ | **mlp.down_proj.max_weight** | 1.49 |
64
+ | **mlp.down_proj.max_weight_position** | 38.14 |
65
+ | **mlp.down_proj.min_weight** | 1.43 |
66
+ | **mlp.down_proj.min_weight_distance** | 18.44 |
67
+
68
+ ## Targeted components
69
+
70
+ * attn.o_proj
71
+ * mlp.down_proj
72
+
73
+ ## Performance
74
+
75
+ | Metric | This model | Original model ([gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF](https://huggingface.co/yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF)) |
76
+ | :----- | :--------: | :---------------------------: |
77
+ | **KL divergence** | <span style="color:darkgoldenrod">0.0367</span> | 0 *(by definition)* |
78
+ | **Refusals** | ✅ <span style="color:darkgreen">13/100</span> | ❌ <span style="color:blue">99/100</span> |
79
+
80
+ ## MMLU test results:
81
+
82
+ <span style="color:blue">Original:</span>
83
+
84
+ ============================================================
85
+
86
+ - Total questions: 7021
87
+
88
+ - Correct: 5024
89
+
90
+ - **Accuracy: 0.7156 (71.56%)**
91
+
92
+ - Parse failures: 313
93
+
94
+ ============================================================
95
+
96
+ **Tested subject scores:**
97
+ - professional_law: 0.6076 (477/785)
98
+ - moral_scenarios: 0.6719 (297/442)
99
+ - miscellaneous: 0.8277 (317/383)
100
+ - professional_psychology: 0.7722 (244/316)
101
+ - high_school_psychology: 0.8556 (231/270)
102
+ - high_school_macroeconomics: 0.7868 (155/197)
103
+ - elementary_mathematics: 0.6739 (124/184)
104
+ - moral_disputes: 0.7414 (129/174)
105
+ - prehistory: 0.8081 (139/172)
106
+ - philosophy: 0.7421 (118/159)
107
+ - high_school_biology: 0.9145 (139/152)
108
+ - professional_accounting: 0.5385 (77/143)
109
+ - clinical_knowledge: 0.8071 (113/140)
110
+ - high_school_microeconomics: 0.8235 (112/136)
111
+ - nutrition: 0.7852 (106/135)
112
+ - professional_medicine: 0.4925 (66/134)
113
+ - conceptual_physics: 0.7812 (100/128)
114
+ - high_school_mathematics: 0.1890 (24/127)
115
+ - human_aging: 0.7155 (83/116)
116
+ - security_studies: 0.7857 (88/112)
117
+ - high_school_statistics: 0.6486 (72/111)
118
+ - marketing: 0.8991 (98/109)
119
+ - high_school_world_history: 0.8585 (91/106)
120
+ - sociology: 0.8738 (90/103)
121
+ - high_school_government_and_politics: 0.8812 (89/101)
122
+ - high_school_geography: 0.8485 (84/99)
123
+ - high_school_chemistry: 0.6495 (63/97)
124
+ - high_school_us_history: 0.8526 (81/95)
125
+ - virology: 0.4944 (44/89)
126
+ - college_medicine: 0.7500 (66/88)
127
+ - world_religions: 0.7727 (68/88)
128
+ - high_school_physics: 0.5000 (42/84)
129
+ - electrical_engineering: 0.6790 (55/81)
130
+ - astronomy: 0.7342 (58/79)
131
+ - logical_fallacies: 0.8026 (61/76)
132
+ - high_school_european_history: 0.8082 (59/73)
133
+ - anatomy: 0.7606 (54/71)
134
+ - college_biology: 0.8281 (53/64)
135
+ - human_sexuality: 0.8125 (52/64)
136
+ - formal_logic: 0.5000 (32/64)
137
+ - public_relations: 0.6393 (39/61)
138
+ - international_law: 0.8333 (50/60)
139
+ - college_physics: 0.4035 (23/57)
140
+ - college_mathematics: 0.3273 (18/55)
141
+ - econometrics: 0.6667 (36/54)
142
+ - jurisprudence: 0.7358 (39/53)
143
+ - high_school_computer_science: 0.9038 (47/52)
144
+ - machine_learning: 0.7115 (37/52)
145
+ - medical_genetics: 0.7255 (37/51)
146
+ - global_facts: 0.4314 (22/51)
147
+ - management: 0.9200 (46/50)
148
+ - us_foreign_policy: 0.9200 (46/50)
149
+ - college_chemistry: 0.3617 (17/47)
150
+ - abstract_algebra: 0.4681 (22/47)
151
+ - business_ethics: 0.7174 (33/46)
152
+ - college_computer_science: 0.6222 (28/45)
153
+ - computer_security: 0.7674 (33/43)
154
+
155
+
156
+ <span style="color:darkgreen">Heretic:</span>
157
+
158
+ ============================================================
159
+
160
+ - Total questions: 7021
161
+
162
+ - Correct: 5016
163
+
164
+ - **Accuracy: 0.7144 (71.44%)**
165
+
166
+ - Parse failures: 346
167
+
168
+ ============================================================
169
+
170
+ **Tested subject scores:**
171
+ - professional_law: 0.5924 (465/785)
172
+ - moral_scenarios: 0.6493 (287/442)
173
+ - miscellaneous: 0.8277 (317/383)
174
+ - professional_psychology: 0.7880 (249/316)
175
+ - high_school_psychology: 0.8630 (233/270)
176
+ - high_school_macroeconomics: 0.8173 (161/197)
177
+ - elementary_mathematics: 0.6522 (120/184)
178
+ - moral_disputes: 0.7471 (130/174)
179
+ - prehistory: 0.8081 (139/172)
180
+ - philosophy: 0.7799 (124/159)
181
+ - high_school_biology: 0.9079 (138/152)
182
+ - professional_accounting: 0.5804 (83/143)
183
+ - clinical_knowledge: 0.7857 (110/140)
184
+ - high_school_microeconomics: 0.8235 (112/136)
185
+ - nutrition: 0.8074 (109/135)
186
+ - professional_medicine: 0.4328 (58/134)
187
+ - conceptual_physics: 0.7969 (102/128)
188
+ - high_school_mathematics: 0.1732 (22/127)
189
+ - human_aging: 0.7155 (83/116)
190
+ - security_studies: 0.7768 (87/112)
191
+ - high_school_statistics: 0.6036 (67/111)
192
+ - marketing: 0.8991 (98/109)
193
+ - high_school_world_history: 0.8396 (89/106)
194
+ - sociology: 0.8738 (90/103)
195
+ - high_school_government_and_politics: 0.9109 (92/101)
196
+ - high_school_geography: 0.8586 (85/99)
197
+ - high_school_chemistry: 0.6701 (65/97)
198
+ - high_school_us_history: 0.8421 (80/95)
199
+ - virology: 0.4831 (43/89)
200
+ - college_medicine: 0.7727 (68/88)
201
+ - world_religions: 0.8068 (71/88)
202
+ - high_school_physics: 0.5000 (42/84)
203
+ - electrical_engineering: 0.6420 (52/81)
204
+ - astronomy: 0.7595 (60/79)
205
+ - logical_fallacies: 0.8158 (62/76)
206
+ - high_school_european_history: 0.8082 (59/73)
207
+ - anatomy: 0.7887 (56/71)
208
+ - college_biology: 0.8594 (55/64)
209
+ - human_sexuality: 0.7969 (51/64)
210
+ - formal_logic: 0.5312 (34/64)
211
+ - public_relations: 0.6557 (40/61)
212
+ - international_law: 0.8833 (53/60)
213
+ - college_physics: 0.3684 (21/57)
214
+ - college_mathematics: 0.2727 (15/55)
215
+ - econometrics: 0.6111 (33/54)
216
+ - jurisprudence: 0.7547 (40/53)
217
+ - high_school_computer_science: 0.8654 (45/52)
218
+ - machine_learning: 0.6538 (34/52)
219
+ - medical_genetics: 0.7647 (39/51)
220
+ - global_facts: 0.4510 (23/51)
221
+ - management: 0.9000 (45/50)
222
+ - us_foreign_policy: 0.9200 (46/50)
223
+ - college_chemistry: 0.3617 (17/47)
224
+ - abstract_algebra: 0.4468 (21/47)
225
+ - business_ethics: 0.7391 (34/46)
226
+ - college_computer_science: 0.6222 (28/45)
227
+ - computer_security: 0.7907 (34/43)
228
+
229
+ MMLU - Massive Multitask Language Understanding, multiple-choice questions across 57 subjects (math, history, law, medicine, etc.).
230
+
231
+ -----
232
+
233
+ ## Quantizations
234
+
235
+ For the K-quants below, small SSM tensors are kept at higher precision where useful.
236
+
237
+ -`Q6_K` and `Q3_K` quants keep `ssm_alpha`, `ssm_beta`, and `ssm_out` as `Q8_0`.
238
+
239
+ -`Q5_K` and `Q4_K` quants keep `ssm_alpha`, `ssm_beta` as `Q8_0` and and `ssm_out` as `Q6_K`.
240
+
241
+ This helps preserve the hybrid/SSM blocks with a small file-size increase.
242
+
243
+ | Filename | Quant | Description |
244
+ |----------|-------|-------------|
245
+ | gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-F16.gguf | F16 | Full precision |
246
+ | gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q8_0.gguf | Q8_0 | Near-lossless, recommended |
247
+ | gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q6_K.gguf | Q6_K | Excellent quality |
248
+ | gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q5_K_M.gguf | Q5_K_M | Good balance |
249
+ | gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q5_K_S.gguf | Q5_K_S | Smaller Q5 |
250
+ | gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q4_K_M.gguf | Q4_K_M | Good for limited VRAM |
251
+
252
+ ## Vision Projector
253
+
254
+ | Filename | Quant | Description |
255
+ |----------|-------|-------------|
256
+ | gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-mmproj-F16.gguf | F16 | Native precision |
257
+
258
+ A Vision Projector File is Required for vision/multimodal capabilities. Use alongside any quantization above.
259
+
260
+ ## Usage
261
+
262
+ Works with llama.cpp, LM Studio, Ollama, and other GGUF-compatible tools.
263
+
264
+ -----
265
+
266
+
267
+ # 💻🤖 Gemma4-12B **v2** — **safetensors master (full precision)** ✨
268
+ ### Coding + Agentic Edition · Composer 2.5 × Fable 5 · v2
269
+
270
+ > **This is the full-precision `safetensors` master** for my Gemma 4 12B **coding + agentic** fine-tune — the same
271
+ > model many of you have been running as GGUF, now in its original weights. 🧠🛠️ v2 is the big **agentic** upgrade:
272
+ > it reads, reasons, *uses tools*, and works through multi-step technical tasks before it acts. This repo is for
273
+ > *builders* — roll your own quants, fine-tune further, or run it in `transformers`.
274
+
275
+ ---
276
+
277
+ ## 🎉 Surprise!
278
+
279
+ A huge thank-you for all the attention this project has gotten — really, thank you. 🙏 I only managed to get out
280
+ **tonight** to upload the **full-precision original (safetensors master)** of this model, so sorry for the wait — I'd
281
+ planned to put it up last week. But the delay comes with **two big surprises** I've been dying to share:
282
+
283
+ **1. v3 is coming soon.** 🔮 The next version is on its way and will fix several of the known issues you've reported.
284
+
285
+ **2. I'm now working with a top-tier AI lab to give back to the open-source community.** 🤝 Many of you have already
286
+ noticed the side effects in v1 and v2 — and honestly they come down to just two things: **(1) not enough compute, and
287
+ (2) one person with limited expertise** behind the whole thing. This collaboration **solves both of those completely.**
288
+ And the **benchmarks you care about will absolutely be addressed** — the things I simply couldn't fully pull off before
289
+ because of time and compute limits. The people working on this with me are **PhDs from top universities, with seriously
290
+ strong papers and citation records.** Just think about that for a second: the people who *actually build large models*
291
+ are now contributing to the open-source community *together with me* — that is genuinely **wild**. 🤯 We're in active
292
+ discussions right now, and the project is still in the **R&D phase**, so I can't share specifics yet — but the **moment**
293
+ I have news, **you'll be the first to know.** 🚀
294
+
295
+ ---
296
+
297
+ ## 🎯 What this repo is for
298
+
299
+ This repo holds the **un-quantized master weights** (`model.safetensors`, bf16). Use it to:
300
+
301
+ - 🔧 **Roll your own quants** — make custom GGUF / **MLX** / AWQ / GPTQ builds from full precision.
302
+ - 🧪 **Fine-tune further** — it's a clean base for your own LoRA / continued training.
303
+ - 🤗 **Run it in `transformers`** (needs a recent build with `gemma4_unified` support).
304
+
305
+ > 🏃 **Just want to run it?** You don't need this repo — grab a ready-made quant from the
306
+ > **[GGUF repo →](https://huggingface.co/yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF)** (runs in
307
+ > ~4.5 GB of VRAM / unified memory in LM Studio, Ollama, llama.cpp, Jan…). This master is for *builders*. 💚
308
+
309
+ ---
310
+
311
+ ## 📊 The headline — it works as an agent (tau2-bench)
312
+
313
+ v2 is built for **coding + agentic** work — writing code, running commands, using tools, debugging, multi-step
314
+ technical tasks. The clearest signal is **tau2-bench `telecom`**, an agentic tool-use benchmark whose
315
+ *diagnose → fix → verify* loop mirrors real terminal/debugging work:
316
+
317
+ | tau2-bench **telecom** · 20 tasks · local, same harness, **all Q8_0** | score |
318
+ |---|---|
319
+ | official `gemma-4-12B-it` (base) | **~15%** |
320
+ | 🟢 **Gemma4-12B v2 (this model)** | **~55%** |
321
+
322
+ → Roughly **3.5× higher** than the base model on technical-agentic tasks. 🎯
323
+
324
+ > 🔬 *Honest methodology:* these are **local, same-harness, relative** numbers (**all models tested at Q8_0**, greedy
325
+ > decoding, self-simulated user, 20 tasks). They are **not** directly comparable to published tau2-bench leaderboard
326
+ > figures (different user-simulator, full task sets, full precision) — local self-eval runs *systematically lower* than
327
+ > published scores. Read them as **"v2 vs the base model under identical conditions"**, which is the comparison that
328
+ > actually matters here.
329
+
330
+ **Grounded, not made-up.** A coding/terminal *fabrication probe* (tasks that deliberately tempt the model to invent
331
+ file paths / function signatures / values) found v2 **grounds before it acts** just like the base — it `grep`/`read`/`ls`
332
+ first, and **doesn't make things up** (0% fabrication, on par with the base).
333
+
334
+ **The trade-off — no free lunch.** On a general-knowledge benchmark (**MMLU-Pro**), v2 lands a little **below** the base —
335
+ completely normal for a focused fine-tune: you trade a sliver of broad-knowledge breadth for coding + agentic strength.
336
+ Need a generalist? Try my general-purpose
337
+ **[Claude Opus 4.6/4.8 distillation](https://huggingface.co/yuxinlu1/gemma-4-12B-it-Claude-4.6-4.8-Opus-GGUF)** or the
338
+ base `google/gemma-4-12B-it`. Need a **local coding/agentic** worker? That's what v2 is tuned for. 💚
339
+
340
+ ---
341
+
342
+ ## 🤗 Run it in transformers
343
+
344
+ ```python
345
+ from transformers import AutoModelForCausalLM, AutoTokenizer
346
+ import torch
347
+
348
+ repo = "yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2"
349
+ tok = AutoTokenizer.from_pretrained(repo)
350
+ model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.bfloat16, device_map="auto")
351
+
352
+ msgs = [{"role": "user", "content": "Write a Python function to check if a string is a valid IPv4 address."}]
353
+ inputs = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
354
+ out = model.generate(inputs, max_new_tokens=1024)
355
+ print(tok.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))
356
+ ```
357
+
358
+ > 🧠 **Thinking mode:** it thinks in Gemma's native thought channel before answering (keep `enable_thinking=true`, the
359
+ > default chat template handles it). Recommended sampling: `temp 1.0, top_p 0.95, top_k 64`; for coding you can also go
360
+ > greedy (`temp 0`). Needs a **recent `transformers`** that knows the `gemma4_unified` architecture.
361
+ >
362
+ > 🛠️ **Agentic / tool use:** v2 emits structured tool-calls in Gemma 4's **native** protocol. The smoothest agent
363
+ > setup is a GGUF quant served with llama.cpp `--jinja` (pass your tools via the OpenAI `tools` field) — see the GGUF
364
+ > repo for the full command.
365
+
366
+ ---
367
+
368
+ ## 📦 Ready-made GGUF quants
369
+
370
+ All from the **[GGUF repo](https://huggingface.co/yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF)**:
371
+
372
+ | Quant | Size | Vibe |
373
+ |------|------|------|
374
+ | 🟡 [**Q3_K_M**](https://huggingface.co/yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF/blob/main/gemma4-v2-Q3_K_M.gguf) | **5.7 GB** | great for 8 GB VRAM |
375
+ | 🔵 [**Q4_K_M**](https://huggingface.co/yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF/blob/main/gemma4-v2-Q4_K_M.gguf) | **6.87 GB** | the sweet spot 👌 (recommended) |
376
+ | 🟣 [**Q6_K**](https://huggingface.co/yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF/blob/main/gemma4-v2-Q6_K.gguf) | **9.11 GB** | near-lossless |
377
+ | ⚪ [**Q8_0**](https://huggingface.co/yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF/blob/main/gemma4-v2-Q8_0.gguf) | **11.8 GB** | basically full quality |
378
+
379
+ > ⚠️ GGUF needs a **recent llama.cpp** — this is the `gemma4_unified` architecture, older builds won't load it.
380
+ > ℹ️ **No Q2_K this release** — it didn't pass real stress-testing (2-bit is too lossy for 12B coding). Smallest
381
+ > reliable quant = **Q3_K_M**.
382
+
383
+ ---
384
+
385
+ ## 📚 What's new in v2 (training)
386
+
387
+ v2 continues from the v1 coder and adds a big **agentic** push — the piece v1 was missing:
388
+
389
+ - **🛠️ Agentic / terminal** — real **multi-step tool-use** trajectories (*read → reason → act → verify*), in Gemma 4's
390
+ native tool protocol. This is what drove the tau2-bench telecom jump, and it fixes v1's "stops after the first step"
391
+ behavior.
392
+ - **💻 Coding** — verified chain-of-thought over Python tasks (**real CoT, gated on passing tests**) plus the
393
+ Fable-5-redo set for the hard cases.
394
+ - **📚 General** — a curated slice of reasoning/instruction data to keep broad competence.
395
+
396
+ All reasoning is **distilled CoT**. A bittersweet note: none of us saw it coming that **Fable 5 would be retired**, and
397
+ only my own dataset holds Fable 5's genuine, self-authored traces — so for the community-contributed data I **rebuilt the
398
+ missing reasoning from scratch with Opus 4.8 (xhigh)**. It may diverge from the original Fable 5 traces, but it was the
399
+ only workable path — and the improvement turned out **really huge**. 💚
400
+
401
+ ---
402
+
403
+ ## ⚡ Speculative decoding (MTP draft) — verified build
404
+
405
+ The GGUF repo's `MTP/` folder ships the Gemma 4 multi-token-prediction draft (unsloth's GGUF conversion of Google's
406
+ official `gemma-4-12B-it-assistant`) for speculative decoding. Gemma 4 MTP is in **llama.cpp mainline** (PR #23398) — no
407
+ fork needed — but the `gemma4-assistant` loader is **build-sensitive right now**, so use the exact build below:
408
+
409
+ - ✅ **Verified working: llama.cpp `b9553` (commit `9e3b928fd`).** Reproduced with `gemma4-v2-Q8_0` + the `MTP-Q8_0`
410
+ draft: loads cleanly and accelerates generation (~88 → ~180 tok/s on a simple deterministic prompt; expect ~1.2–1.3×
411
+ on real coding/thinking). **Lossless** either way.
412
+ - ⚠️ **Newer builds (e.g. b9702 / b9717) currently crash** while loading the draft with `invalid vector subscript` — an
413
+ **upstream regression** in the `gemma4-assistant` loader path, *not* a problem with the GGUFs. Stick with **b9553**
414
+ until it's fixed upstream.
415
+
416
+ ```bat
417
+ llama-server -m gemma4-v2-Q8_0.gguf ^
418
+ --model-draft MTP\gemma-4-12B-it-MTP-Q8_0.gguf ^
419
+ --spec-type draft-mtp --spec-draft-n-max 4 ^
420
+ -ngl 99 -ngld 99 -fa on --jinja
421
+ ```
422
+
423
+ > ℹ️ The draft is the generic Gemma 4 assistant (not retrained for v2), so acceptance is a touch lower than a
424
+ > model-specific draft would give — still 100% lossless.
425
+
426
+ ---
427
+
428
+ ## ⚠️ Good to know
429
+ - **Specialized for coding / terminal / agentic.** General-knowledge facts/numbers should still be double-checked.
430
+ - **Reduced refusals:** task-focused training, not safety-aligned — add your own guardrails for production. Use
431
+ responsibly. 🙏
432
+ - English-centric.
433
+
434
+ ---
435
+
436
+ ## 📚 Base & License
437
+ - **License: Apache 2.0.** Gemma 4 is released by Google under
438
+ **[Apache 2.0](https://ai.google.dev/gemma/apache_2)** (unlike the older Gemma 1/2/3 terms), so this fine-tune is
439
+ **Apache 2.0** too — free to use, modify, and redistribute. 🎉
440
+ - **Base model:** [`google/gemma-4-12B-it`](https://huggingface.co/google/gemma-4-12B-it).
441
+ - Personal/hobby project — shared as-is, no warranty. Built with time, care, and a lot of coffee. Have fun, and happy
442
+ hacking! 🐾✨
gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-F16.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c30fb608c7f78b7a34abdb317bde75ca0534862653be9a290d4d39146088c7cb
3
+ size 23832068352
gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bbfa20ca0ed7886f38c0a446d03bfbecc86fb18c8928989d19643aa560cc69f3
3
+ size 7381385472
gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:527f0cb81a8fbc0f8bfd6d713bc494aea5fe2df7d3bd0609736a717e2cc4a4f1
3
+ size 8547270912
gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q5_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf02a9d46b9b26f27106f2593711996f9ddab1e71399af5298304ff88f6ec04c
3
+ size 8338374912
gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q6_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d1d1b944d6cacd6d29e2aeceeb5bf4151d0ed4b4415255cce4acab37f03dea24
3
+ size 9786024192
gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f12fa14222bd91a73cf7c6f9df07f2cf67553ff6cb24d76ba87272834c27e46
3
+ size 12669649152
gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-uncensored-heretic-mmproj-F16.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:970133505c1d44be54bebaf7e88d15827eaaadfa990a0ec6672c573398b80d08
3
+ size 122031264