Text Generation
MLX
Safetensors
English
gemma4_unified_assistant
mlx-vlm
gemma-4
gemma-4-12b
gemma
mtp
speculative-decoding
draft-model
nvfp4
conversational
4-bit precision
Instructions to use mlx-community/gemma-4-12B-it-qat-assistant-nvfp4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/gemma-4-12B-it-qat-assistant-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("mlx-community/gemma-4-12B-it-qat-assistant-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 mlx-community/gemma-4-12B-it-qat-assistant-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 "mlx-community/gemma-4-12B-it-qat-assistant-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": "mlx-community/gemma-4-12B-it-qat-assistant-nvfp4" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use mlx-community/gemma-4-12B-it-qat-assistant-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 "mlx-community/gemma-4-12B-it-qat-assistant-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 mlx-community/gemma-4-12B-it-qat-assistant-nvfp4
Run Hermes
hermes
- MLX LM
How to use mlx-community/gemma-4-12B-it-qat-assistant-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 "mlx-community/gemma-4-12B-it-qat-assistant-nvfp4"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "mlx-community/gemma-4-12B-it-qat-assistant-nvfp4" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/gemma-4-12B-it-qat-assistant-nvfp4", "messages": [ {"role": "user", "content": "Hello"} ] }'
Add MTP drafter model card
Browse files
README.md
CHANGED
|
@@ -1,19 +1,69 @@
|
|
| 1 |
---
|
| 2 |
-
language:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
- mlx
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
---
|
| 8 |
|
| 9 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
## Use with mlx
|
| 12 |
|
| 13 |
```bash
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
```
|
| 16 |
|
|
|
|
|
|
|
| 17 |
```bash
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: gemma
|
| 5 |
+
base_model:
|
| 6 |
+
- google/gemma-4-12B-it-qat-q4_0-unquantized-assistant
|
| 7 |
+
library_name: mlx
|
| 8 |
+
pipeline_tag: text-generation
|
| 9 |
tags:
|
| 10 |
- mlx
|
| 11 |
+
- mlx-vlm
|
| 12 |
+
- gemma4_unified_assistant
|
| 13 |
+
- gemma-4
|
| 14 |
+
- gemma-4-12b
|
| 15 |
+
- gemma
|
| 16 |
+
- mtp
|
| 17 |
+
- speculative-decoding
|
| 18 |
+
- draft-model
|
| 19 |
+
- nvfp4
|
| 20 |
+
inference: false
|
| 21 |
---
|
| 22 |
|
| 23 |
+
# gemma-4-12B-it-qat-assistant-nvfp4
|
| 24 |
+
|
| 25 |
+
This repository contains Multi-Token Prediction (MTP) drafter weights split from `google/gemma-4-12B-it-qat-q4_0-unquantized-assistant` for use with `mlx-vlm` speculative decoding.
|
| 26 |
+
|
| 27 |
+
This is not a standalone chat or text-generation model. Load it as the draft model alongside a compatible Gemma 4 12B target checkpoint.
|
| 28 |
|
| 29 |
+
## Use with mlx-vlm
|
| 30 |
|
| 31 |
```bash
|
| 32 |
+
uv run mlx_vlm.generate \
|
| 33 |
+
--model google/gemma-4-12B-it \
|
| 34 |
+
--draft-model mlx-community/gemma-4-12B-it-qat-assistant-nvfp4 \
|
| 35 |
+
--draft-kind mtp \
|
| 36 |
+
--prompt "Describe this image." \
|
| 37 |
+
--max-tokens 256
|
| 38 |
```
|
| 39 |
|
| 40 |
+
For local weights:
|
| 41 |
+
|
| 42 |
```bash
|
| 43 |
+
uv run mlx_vlm.generate \
|
| 44 |
+
--model /path/to/target-model \
|
| 45 |
+
--draft-model /path/to/gemma-4-12B-mtp \
|
| 46 |
+
--draft-kind mtp \
|
| 47 |
+
--prompt "Describe this image." \
|
| 48 |
+
--max-tokens 256
|
| 49 |
```
|
| 50 |
+
|
| 51 |
+
## Model Details
|
| 52 |
+
|
| 53 |
+
- Model type: `gemma4_unified_assistant`
|
| 54 |
+
- Target architecture: Gemma 4 12B
|
| 55 |
+
- Precision: nvfp4
|
| 56 |
+
- Runtime: MLX / `mlx-vlm`
|
| 57 |
+
- Format: Safetensors with MLX-compatible config and tokenizer files
|
| 58 |
+
|
| 59 |
+
The stored tensors are nvfp4 MLX-compatible drafter weights.
|
| 60 |
+
|
| 61 |
+
## Intended Use
|
| 62 |
+
|
| 63 |
+
Use this repo only as a speculative decoding drafter for compatible Gemma 4 12B checkpoints. The target model verifies drafted tokens, while this MTP model proposes candidate tokens per decoding step.
|
| 64 |
+
|
| 65 |
+
## Limitations
|
| 66 |
+
|
| 67 |
+
This checkpoint requires runtime support for Gemma 4 MTP draft models in `mlx-vlm`. Standard standalone generation through generic Transformers APIs is not expected to work with this repository by itself.
|
| 68 |
+
|
| 69 |
+
Please refer to the upstream `google/gemma-4-12B-it` model card and license terms for model usage constraints.
|