Text Generation
MLX
Safetensors
gemma4_unified
nvfp4
krill
gemma4
apple-silicon
agentic
tool-use
conversational
Instructions to use srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4
Run Hermes
hermes
- MLX LM
How to use srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4", "messages": [ {"role": "user", "content": "Hello"} ] }'
Card: Krill naming/install fix + shared benchmark comparison table (partial)
Browse files
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 |
-
-
|
|
|
|
| 10 |
- agentic
|
| 11 |
-
|
| 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 |
-
|
| 21 |
-
inference engine for Apple Silicon). Loads in **~1.7 s** at **6.8 GB**.
|
| 22 |
|
| 23 |
## The format
|
| 24 |
|
| 25 |
-
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 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
|
| 36 |
-
|
| 37 |
-
|
| 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 |
-
##
|
| 46 |
|
| 47 |
```bash
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
krill run srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 "Write a Python LRU cache."
|
| 50 |
-
# OpenAI-compatible
|
| 51 |
-
krill
|
| 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 |
-
|
| 59 |
-
|
| 60 |
-
[EvalPlus](https://github.com/evalplus/evalplus) (stricter tests); MBPP
|
| 61 |
-
|
| 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 |
-
|
|
| 68 |
-
| agentic v2
|
|
|
|
| 69 |
|
| 70 |
-
> ⚠️ **Partial
|
| 71 |
|
| 72 |
-
**
|
| 73 |
-
|
| 74 |
-
|
| 75 |
|
| 76 |
## Credits & license
|
| 77 |
|
| 78 |
-
Fine‑tune © its original author ([yuxinlu1](https://huggingface.co/yuxinlu1)); base model is
|
| 79 |
-
|
| 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 → key‑remap 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.
|
|
|