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"} ] }'
license: gemma
library_name: mlx
base_model: yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF
base_model_relation: quantized
pipeline_tag: text-generation
model_type: gemma4_unified
tags:
- nvfp4
- mlx
- krill
- gemma4
- gemma4_unified
- apple-silicon
- agentic
- tool-use
gemma-4-12B-agentic-fable5-composer2.5-v2 — NVFP4 (MLX)
Original fine-tune by 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.
A mixed-precision NVFP4 conversion of the Gemma‑4‑12B agentic fine‑tune (optimized for tool‑use / τ²‑bench). The weights are plain MLX safetensors; built for and tested with Krill — a pure Swift + MLX inference engine for Apple Silicon (no Python, no GGUF at inference). Loads in ~1.7 s at ~6.8 GB.
The format
- Bulk weights are NVFP4 (4‑bit float, group_size 16); attention
o_projand the vision/audio projectors are kept at 8‑bit affine (group_size 64). This "protected" mixed recipe recovers the quality uniform 4‑bit loses on those sensitive modules while keeping 4‑bit speed and size. - Conversion: bf16 safetensors → key‑remap to MLX layout → NVFP4 requant. No GGUF round‑trip.
Compatibility (please read)
This is an MLX checkpoint — not GGUF, not a HF/transformers checkpoint. To load it an engine needs
(1) the gemma4_unified architecture (text+vision+audio) and (2) the mixed‑precision NVFP4 config
(top‑level nvfp4 + per‑module 8‑bit overrides). Today that means Krill; it is not drop‑in for
vanilla mlx_lm/mlx_vlm, and not loadable by llama.cpp/Ollama (GGUF) or transformers/vLLM.
Install Krill & run
# Homebrew:
brew tap srvsngh99/krill && brew install krill
# …or one-line installer (Apple Silicon):
curl -fsSL https://raw.githubusercontent.com/srvsngh99/Krill/main/install.sh | sh
krill pull srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 # by full path (alias TBD)
krill run srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 "Write a Python LRU cache."
krill serve --model srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 --port 57455 # OpenAI-compatible API
KRILL_ENABLE_THINKING=1 krill run srv-sngh/gemma-4-12B-agentic-fable5-composer2.5-v2-nvfp4 "..." # reasoning channel
Benchmarks
pass@1 / accuracy, single greedy pass, run with Krill on an M4 Pro. All three models are in this same NVFP4 format (true apples‑to‑apples). HumanEval+/MBPP+ are EvalPlus (stricter tests); MBPP = the 378‑problem EvalPlus set; GSM8K = 150‑problem subset, 8‑shot. Not EvalPlus‑leaderboard‑comparable.
| Model | mode | HumanEval | HumanEval+ | MBPP | MBPP+ | GSM8K |
|---|---|---|---|---|---|---|
| Google gemma-4-12B-it (base) | off | 57.3 | 56.7 | 42.1 | 37.6 | 95.3 |
| Google gemma-4-12B-it (base) | on | 48.8 | 48.8 | 49.5 | 43.9 | 90.7 |
| coder v1 | off | 81.7 | 78.0 | 79.4 | 68.3 | 90.7 |
| coder v1 | on | 80.5 | 76.2 | 80.4 | 68.8 | 90.0 |
| agentic v2 ⟵ this model | off | 83.5 | 81.7 | 84.1 | 74.1 | 90.7 |
| agentic v2 ⟵ this model | on | 86.0 | 82.9 | 83.6 | 73.0 | 91.3 |
Takeaways: the code/agentic fine‑tunes massively out‑code the Google base on HumanEval/MBPP, while the base is stronger at math (GSM8K). Reasoning‑on helps the fine‑tunes but tends to hurt the base's coding (it over‑reasons and mangles the code block). Decode ≈ 28 tok/s.
Credits & license
Fine‑tune © its original author (yuxinlu1 (gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2)); base model is Google Gemma 4, under the
Gemma license. This repo only changes quantization/packaging.