srv-sngh commited on
Commit
8d1b2e7
·
verified ·
1 Parent(s): a4a7da5

Card: Krill naming/install fix + shared benchmark comparison table (partial)

Browse files
Files changed (1) hide show
  1. README.md +41 -42
README.md CHANGED
@@ -1,80 +1,79 @@
1
  ---
2
  license: gemma
3
  library_name: mlx
 
 
 
 
4
  tags:
5
  - nvfp4
6
  - mlx
7
  - krill
8
  - gemma4
9
- - code
 
10
  - agentic
11
- base_model: yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF
12
- pipeline_tag: text-generation
13
  ---
14
 
15
  # gemma-4-12B-agentic-fable5-composer2.5-v2 — NVFP4 (MLX)
16
 
17
  > Original fine-tune by [yuxinlu1](https://huggingface.co/yuxinlu1) (`gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2`); this repo is an NVFP4 (MLX) requant for fast local inference on Apple Silicon.
18
 
19
- A mixed-precision **NVFP4** conversion of the Gemma‑4‑12B *agentic* fine‑tune. The weights are
20
- plain MLX safetensors; it was built for and is tested with **Krill** (a pure Swift + MLX
21
- inference engine for Apple Silicon). Loads in **~1.7 s** at **6.8 GB**.
22
 
23
  ## The format
24
 
25
- - The bulk of the weights are **NVFP4** (4‑bit float, group_size 16); the attention `o_proj`
26
- and the vision/audio projectors are kept at **8‑bit affine** (group_size 64). This "protected"
27
- mixed recipe recovers the quality uniform 4‑bit loses on those sensitive modules while keeping
28
- 4bit speed and size. Same recipe as
29
- [`srv-sngh/gemma-4-12B-coder-fable5-composer2.5-nvfp4`](https://huggingface.co/srv-sngh/gemma-4-12B-coder-fable5-composer2.5-nvfp4).
30
- - **Conversion path:** plain‑bf16 safetensors → key‑remap to MLX layout → NVFP4 requant. No GGUF
31
- round‑trip (so none of GGUF's k‑quant quality loss).
32
 
33
  ## Compatibility (please read)
34
 
35
- This is an **MLX** checkpoint, not GGUF and not a HF/transformers checkpoint. To run it an engine
36
- needs (1) the `gemma4_unified` architecture (text+vision+audio) and (2) support for the
37
- mixed‑precision NVFP4 config (top‑level nvfp4 block + per‑module 8‑bit overrides keyed by path).
38
-
39
- - ✅ **Krill** — runs natively today (the recipe was designed for its loader).
40
- - ⚙️ **Other MLX engines** — possible if they add `gemma4_unified` + this quant schema; not
41
- drop‑in with vanilla `mlx_lm`/`mlx_vlm` as‑is.
42
- - ❌ **llama.cpp / Ollama** — no (GGUF only).
43
- - ❌ **transformers / vLLM** — no (these want bf16 or their own quant formats).
44
 
45
- ## Run it with Krill
46
 
47
  ```bash
48
- krill pull srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4
 
 
 
 
 
49
  krill run srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 "Write a Python LRU cache."
50
- # OpenAI-compatible server:
51
- krill serve --model srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 --port 57455
52
- # enable the reasoning channel:
53
- KRILL_ENABLE_THINKING=1 krill run srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 "..."
54
  ```
55
 
56
  ## Benchmarks
57
 
58
- All numbers are **pass@1 / accuracy**, single greedy pass, run with Krill on an M4 Pro. All three
59
- models are in this **same NVFP4 format** (true apples‑to‑apples). HumanEval+/MBPP+ are
60
- [EvalPlus](https://github.com/evalplus/evalplus) (stricter tests); MBPP uses the 378‑problem
61
- EvalPlus set; GSM8K is a 150‑problem subset, 8‑shot. **Not** EvalPlus‑leaderboard‑comparable.
62
 
63
  | Model | mode | HumanEval | HumanEval+ | MBPP | MBPP+ | GSM8K |
64
  |---|---|---|---|---|---|---|
65
  | Google gemma-4-12B-it (base) | off | 57.3 | 56.7 | 42.1 | 37.6 | 95.3 |
66
- | Google gemma-4-12B-it (base) | on | 48.8 | 48.8 | 49.5 | 43.9 | |
67
- | agentic v2 (this model) | off | 83.5 | 81.7 | — | | — |
68
- | agentic v2 (this model) | on | 86.0 | 82.9 | — | — | — |
 
69
 
70
- > ⚠️ **Partial results this run is still in progress.** Empty cells (—) are filling in; the card will be updated as the full sweep (coder + remaining agentic/GSM8K) completes.
71
 
72
- **Read so far:** the code/agentic fine‑tunes massively out‑code the Google base (HumanEval ~83% vs
73
- 57%), while the base is stronger at math (GSM8K). Reasoning‑on helps the fine‑tunes but tends to
74
- *hurt* the base model's coding (it over‑reasons and mangles the code block). Decode ≈ **28 tok/s**.
75
 
76
  ## Credits & license
77
 
78
- Fine‑tune © its original author ([yuxinlu1](https://huggingface.co/yuxinlu1)); base model is
79
- Google Gemma 4, under the [Gemma license](https://ai.google.dev/gemma/terms). This repo only
80
- changes quantization/packaging.
 
1
  ---
2
  license: gemma
3
  library_name: mlx
4
+ base_model: yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF
5
+ base_model_relation: quantized
6
+ pipeline_tag: text-generation
7
+ model_type: gemma4_unified
8
  tags:
9
  - nvfp4
10
  - mlx
11
  - krill
12
  - gemma4
13
+ - gemma4_unified
14
+ - apple-silicon
15
  - agentic
16
+ - tool-use
 
17
  ---
18
 
19
  # gemma-4-12B-agentic-fable5-composer2.5-v2 — NVFP4 (MLX)
20
 
21
  > Original fine-tune by [yuxinlu1](https://huggingface.co/yuxinlu1) (`gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2`); this repo is an NVFP4 (MLX) requant for fast local inference on Apple Silicon.
22
 
23
+ A mixed-precision **NVFP4** conversion of the Gemma‑4‑12B *agentic* fine‑tune (optimized for tool‑use / τ²‑bench). The weights are plain MLX safetensors;
24
+ built for and tested with **[Krill](https://github.com/srvsngh99/Krill)** a pure Swift + MLX
25
+ inference engine for Apple Silicon (no Python, no GGUF at inference). Loads in **~1.7 s** at **~6.8 GB**.
26
 
27
  ## The format
28
 
29
+ - Bulk weights are **NVFP4** (4‑bit float, group_size 16); attention `o_proj` and the vision/audio
30
+ projectors are kept at **8‑bit affine** (group_size 64). This "protected" mixed recipe recovers the
31
+ quality uniform 4‑bit loses on those sensitive modules while keeping 4‑bit speed and size.
32
+ - **Conversion:** bf16 safetensors → keyremap to MLX layout → NVFP4 requant. No GGUF round‑trip.
 
 
 
33
 
34
  ## Compatibility (please read)
35
 
36
+ This is an **MLX** checkpoint not GGUF, not a HF/transformers checkpoint. To load it an engine needs
37
+ (1) the `gemma4_unified` architecture (text+vision+audio) and (2) the mixed‑precision NVFP4 config
38
+ (top‑level nvfp4 + per‑module 8‑bit overrides). Today that means **Krill**; it is **not** drop‑in for
39
+ vanilla `mlx_lm`/`mlx_vlm`, and **not** loadable by llama.cpp/Ollama (GGUF) or transformers/vLLM.
 
 
 
 
 
40
 
41
+ ## Install Krill & run
42
 
43
  ```bash
44
+ # Homebrew:
45
+ brew tap srvsngh99/krill && brew install krill
46
+ # …or one-line installer (Apple Silicon):
47
+ curl -fsSL https://raw.githubusercontent.com/srvsngh99/Krill/main/install.sh | sh
48
+
49
+ krill pull srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 # by full path (alias TBD)
50
  krill run srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 "Write a Python LRU cache."
51
+ krill serve --model srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 --port 57455 # OpenAI-compatible API
52
+ KRILL_ENABLE_THINKING=1 krill run srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 "..." # reasoning channel
 
 
53
  ```
54
 
55
  ## Benchmarks
56
 
57
+ **pass@1 / accuracy**, single greedy pass, run with Krill on an M4 Pro. All three models are in this
58
+ **same NVFP4 format** (true apples‑to‑apples). HumanEval+/MBPP+ are
59
+ [EvalPlus](https://github.com/evalplus/evalplus) (stricter tests); MBPP = the 378‑problem EvalPlus set;
60
+ GSM8K = 150‑problem subset, 8‑shot. **Not** EvalPlus‑leaderboard‑comparable.
61
 
62
  | Model | mode | HumanEval | HumanEval+ | MBPP | MBPP+ | GSM8K |
63
  |---|---|---|---|---|---|---|
64
  | Google gemma-4-12B-it (base) | off | 57.3 | 56.7 | 42.1 | 37.6 | 95.3 |
65
+ | Google gemma-4-12B-it (base) | on | 48.8 | 48.8 | 49.5 | 43.9 | 90.7 |
66
+ | coder v1 | off | 81.7 | — | 79.4 | — | 90.7 |
67
+ | **agentic v2** this model | off | 83.5 | 81.7 | — | — | — |
68
+ | **agentic v2** ⟵ this model | on | 86.0 | 82.9 | — | — | — |
69
 
70
+ > ⚠️ **Partial — benchmark run still in progress.** Empty cells (—) are filling in; this card updates as the full sweep completes.
71
 
72
+ **Takeaways:** the code/agentic fine‑tunes massively out‑code the Google base on HumanEval/MBPP, while
73
+ the base is stronger at math (GSM8K). Reasoning‑on helps the fine‑tunes but tends to *hurt* the base's
74
+ coding (it over‑reasons and mangles the code block). Decode ≈ **28 tok/s**.
75
 
76
  ## Credits & license
77
 
78
+ Fine‑tune © its original author ([yuxinlu1](https://huggingface.co/yuxinlu1) (`gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2`)); base model is Google Gemma 4, under the
79
+ [Gemma license](https://ai.google.dev/gemma/terms). This repo only changes quantization/packaging.