nypswift commited on
Commit
6efa48b
·
verified ·
1 Parent(s): 5ac66eb

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
  license: apache-2.0
3
- base_model: google/gemma-4-12B-it
4
  library_name: mlx
5
  pipeline_tag: text-generation
6
  tags:
@@ -9,162 +9,7 @@ tags:
9
  - code
10
  - reasoning
11
  - thinking
12
- - local-llm
13
- - mlx-conversion
14
  - mlx
15
- - apple
16
  ---
17
- # This is the MLX converted version of the *gemma-4-12b-coder-fable5-composer2.5* with 4-Bit quantization.
18
-
19
- We hope that more individuals in the community can test such models in real world coding scenarios.
20
-
21
- ---
22
-
23
- # 💻 Gemma4-12B-Coder (GGUF) — Composer 2.5 × Fable 5 ✨
24
- ### 🐣 Tiny footprint, big brain — a local **coding** model for *everyone*
25
-
26
- > **No matter your GPU. No matter your RAM.** If you've got **~4.5 GB** of VRAM *or* unified memory free,
27
- > you can run your own private, offline coding assistant right now. 🚀
28
- > This is the **v1 / code edition** — distilled from **real chain-of-thought** so it *thinks through* a problem
29
- > before writing the solution. 🧠💻 All local, all yours, no API, no cloud.
30
-
31
- ### 🎯 What it is
32
- A focused fine-tune of Gemma 4 12B on **verifiable Python coding** data — every training example's reasoning leads to
33
- code that **actually passed its tests**. The result reasons in the open (edge cases, complexity, approach) and then
34
- emits a clean, runnable solution. 💚
35
-
36
- ---
37
-
38
- ## 📌 Announcements
39
-
40
- **🚀🔥 IT'S HERE — v2 is OUT NOW!** v2 has shipped — the **GGUF quants are live and ready to run** →
41
- **[grab v2 here](https://huggingface.co/yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF)**. 🎉
42
- The **full `safetensors` master** (build / fine-tune on top) goes up **tomorrow**. v2 is **agentic + coding** focused —
43
- the piece v1 was missing.
44
-
45
- **Here's the result that got me most excited.** When I saw v2's **tau2-bench `telecom`** result — an agentic tool-use
46
- benchmark where the model has to *diagnose → fix → verify*, exactly like real terminal/debugging work — I literally got
47
- **launched out of my chair** (…okay, *kidding* 😄). The jump in **actually solving the problem** is wild:
48
-
49
- | tau2-bench **telecom** · local, same harness, **Q8_0** | score |
50
- |---|---|
51
- | official `gemma-4-12B-it` (base) | **~15%** |
52
- | 🟢 **v2 (this release)** | **~55%** |
53
-
54
- The base model tends to **give up early** (hands the problem off to a human); **v2 keeps going** and works it the way a
55
- much bigger model would. Full benchmark details are in the **[v2 card](https://huggingface.co/yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF)** now. 🔧
56
-
57
- **✅ safetensors master (this v1 model) is UP.** Full-precision weights are live →
58
- **[yuxinlu1/gemma-4-12B-coder-fable5-composer2.5-v1](https://huggingface.co/yuxinlu1/gemma-4-12B-coder-fable5-composer2.5-v1)**
59
- — roll your own GGUF / MLX / AWQ quants or fine-tune straight from the master. 🎉
60
-
61
- ---
62
-
63
- ## 📣 Context length fixed: now **256K** (was 131K) — thanks, community! 💚
64
-
65
- A community member spotted that this model was reporting only a **131K** context window. That turned out to be
66
- the well-known upstream **Gemma 4 metadata bug** — Google's initial `config.json` shipped with
67
- `max_position_embeddings: 131072` instead of the real **262144 (256K)**, and that value got baked into a lot of
68
- downstream finetunes and quants (including this one) before it was fixed upstream.
69
-
70
- The weights were always fine — it was purely a metadata field. **All GGUF quants have been re-patched to the
71
- full 256K context** (`gemma4.context_length = 262144`). Just re-download if you grabbed an earlier copy. 🙏
72
-
73
- ---
74
-
75
- ## 📚 Training data (the interesting part 🍳)
76
-
77
- This is a **distillation** of two complementary chain-of-thought sources, both over verifiable Python coding tasks
78
- (algorithmic / function-level problems that come with deterministic tests):
79
-
80
- - **🥇 Main set — Composer 2.5 *real* CoT.** Genuine, model-authored reasoning traces. The teacher solved each problem,
81
- its code was **run against the task's tests, and only the passing solutions were kept**. So the reasoning you're
82
- learning from leads to code that *actually works*.
83
- - **🥈 Aux set — Fable 5 (released today! 🎉).** A clever twist: we took the problems where **Composer 2.5 got it wrong**
84
- and handed them to **Fable 5** to *redo* — re-deriving a fresh, self-consistent chain-of-thought and a correct
85
- solution, again **gated on passing the tests**. This recovers the hard cases the main teacher missed. These traces
86
- are **synthetic** (rationalized CoT), and are tagged separately so the two sources stay distinguishable.
87
-
88
- The recipe: real CoT for the bulk of solid coverage, plus synthetic "second-attempt" CoT to patch the failures —
89
- both verified by execution before anything entered training. ✅
90
-
91
- ---
92
-
93
- ## 📦 Pick your size (GGUF quants)
94
-
95
- | Quant | Size | Vibe |
96
- |------|------|------|
97
- | 🟢 **Q2_K** | **4.5 GB** | tiniest — runs almost anywhere |
98
- | 🟡 **Q3_K_M** | **5.7 GB** | great for 8 GB VRAM — much better than Q2 |
99
- | 🔵 **Q4_K_M** | **6.87 GB** | the sweet spot 👌 (recommended) |
100
- | 🟣 **Q6_K** | **9.11 GB** | near-lossless |
101
- | ⚪ **Q8_0** | **11.8 GB** | basically full quality |
102
-
103
- ---
104
-
105
- ## 🧮 "Will it fit?" — context length cheat-sheet
106
-
107
- Rough estimates 🤓 (assumes `q8_0` KV cache + ~1.5 GB overhead; **use `q4_0` KV cache for ≈2× more context!**).
108
- Max context is **256K**. "—" = won't fit, pick a smaller quant. ✂️
109
-
110
- | Your VRAM / unified mem | 🟢 Q2_K (4.5G) | 🟡 Q3_K_M (5.7G) | 🔵 Q4_K_M (6.87G) | 🟣 Q6_K (9.11G) | ⚪ Q8_0 (11.8G) |
111
- |---|---|---|---|---|---|
112
- | **8 GB** | ~16K ctx | ~10K | tight (~2–4K) | — | — |
113
- | **12 GB** | ~48K | ~38K | ~30K | ~12K | — |
114
- | **16 GB** | ~80K | ~72K | ~64K | ~44K | ~22K |
115
- | **24 GB** | ~200K | ~160K | ~128K | ~110K | ~88K |
116
- | **32 GB** | 256K (max) 🎉 | 256K | 256K | ~230K | ~190K |
117
-
118
- > 💡 Apple Silicon / integrated GPUs with **unified memory** count too — same numbers, just slower than a dGPU.
119
- > 💡 Low on room? Drop a quant or switch KV cache to `q4_0` and your context roughly doubles.
120
-
121
- ---
122
-
123
- ## 🚀 How to run it (super easy)
124
-
125
- ### Option A — llama.cpp (recommended) 🦙
126
- 1. Grab a quant above (e.g. `…-Q4_K_M.gguf`) and `llama-server` from [llama.cpp](https://github.com/ggml-org/llama.cpp).
127
- > ⚠️ Needs a **recent llama.cpp** (this is the `gemma4_unified` architecture — older builds won't load it).
128
- 2. Run a server (Windows `.bat` shown — tweak `--port`, `--ctx-size` to taste):
129
-
130
- ```bat
131
- @echo off
132
- cd /d C:\llama.cpp
133
- llama-server.exe ^
134
- -m C:\models\gemma4-coding-Q4_K_M.gguf ^
135
- --ctx-size 16384 ^
136
- --n-gpu-layers 99 ^
137
- --no-mmap ^
138
- -fa on ^
139
- --cache-type-k q8_0 --cache-type-v q8_0 ^
140
- --temp 1.0 --top-p 0.95 --top-k 64 ^
141
- --host 0.0.0.0 --port 18080
142
- pause
143
- ```
144
- 3. Open `http://localhost:18080` and chat. 🎉 (Tip: bump `--ctx-size` per the table; use `q4_0` KV for more.)
145
-
146
- ### Option B — one-click apps 🖱️
147
- Works in **LM Studio**, **Jan**, **Ollama**, etc. — just import the GGUF, pick your quant, go. 🐾
148
-
149
- ### 🧠 Thinking mode
150
- This model thinks in Gemma's native thought channel before answering — exactly how it was trained. Keep
151
- **`enable_thinking=true`** (the default chat template handles it). Recommended sampling: `temp 1.0, top_p 0.95, top_k 64`.
152
- For coding you can also go greedy (`temp 0`) for more deterministic solutions.
153
-
154
- ---
155
-
156
- ## ⚠️ Good to know
157
- - **Reduced refusals:** the training data is task-focused with no safety hedging, so this refuses less than the base
158
- model. It is **not** safety-aligned — add your own guardrails for production. Use responsibly. 🙏
159
- - Specialized for **Python / algorithmic** coding. Reasoning quality is strongest in that domain; general-knowledge
160
- facts/numbers should still be double-checked.
161
- - English-centric.
162
-
163
- ---
164
-
165
- ## 📚 Base & License
166
- - **License: Apache 2.0.** Gemma 4 is released by Google under
167
- **[Apache 2.0](https://ai.google.dev/gemma/apache_2)** (unlike the older Gemma 1/2/3 terms), so this fine-tune is
168
- **Apache 2.0** too — free to use, modify, and redistribute. 🎉
169
- - **Base model:** [`google/gemma-4-12B-it`](https://huggingface.co/google/gemma-4-12B-it).
170
- - Personal/hobby project — shared as-is, no warranty. Have fun, and happy hacking! 🐾✨
 
1
  ---
2
  license: apache-2.0
3
+ base_model: yuxinlu1/gemma-4-12B-coder-fable5-composer2.5-v1
4
  library_name: mlx
5
  pipeline_tag: text-generation
6
  tags:
 
9
  - code
10
  - reasoning
11
  - thinking
12
+ - safetensors
13
+ - transformers
14
  - mlx
 
15
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
model-00001-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4c1a2e5c7ec05450ae8b6769ad6c83aea851f41ed79a5062fd91dd16190ac7ac
3
- size 5351755819
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:363fc1c33743756a227cd716fcd3336e0d0ebcd10f38bacae46777a039184274
3
+ size 5351755805
model-00002-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:13f45e36d0049c6fb9a6fd7cd1ae7f94344dea50d872a50c84bbda5145458fb8
3
- size 1347404808
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6dde26be2ed58474e85d3b3a2f724354f118bf6c8d09ee67b2123b88d7ce724
3
+ size 1347404878