Instructions to use modelcaddy/gemma-4-12b-it-qat-4bit-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use modelcaddy/gemma-4-12b-it-qat-4bit-mlx 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("modelcaddy/gemma-4-12b-it-qat-4bit-mlx") 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 modelcaddy/gemma-4-12b-it-qat-4bit-mlx with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "modelcaddy/gemma-4-12b-it-qat-4bit-mlx"
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": "modelcaddy/gemma-4-12b-it-qat-4bit-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use modelcaddy/gemma-4-12b-it-qat-4bit-mlx with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "modelcaddy/gemma-4-12b-it-qat-4bit-mlx"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "modelcaddy/gemma-4-12b-it-qat-4bit-mlx" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modelcaddy/gemma-4-12b-it-qat-4bit-mlx", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use modelcaddy/gemma-4-12b-it-qat-4bit-mlx 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 "modelcaddy/gemma-4-12b-it-qat-4bit-mlx"
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 modelcaddy/gemma-4-12b-it-qat-4bit-mlx
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use modelcaddy/gemma-4-12b-it-qat-4bit-mlx with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "modelcaddy/gemma-4-12b-it-qat-4bit-mlx"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "modelcaddy/gemma-4-12b-it-qat-4bit-mlx" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
gemma-4-12b-it-qat-4bit-mlx
Uniform 4-bit MLX conversion of Google's QAT (quantization-aware trained) Gemma 4 12B instruction-tuned checkpoint. Built and used by ModelCaddy as the on-device generation model for its Pro tier (local conversation extraction and memory synthesis on Apple Silicon).
Provenance
- Source:
google/gemma-4-12B-it-qat-q4_0-unquantized— the bf16 QAT weights Google publishes for downstream quantization. - Conversion:
mlx_vlm.convert -q --q-bits 4 --q-group-size 64(mlx-vlm 0.6.13, mlx 0.32.0). - Result: ~6.3 GB on disk, 4.51 effective bits per weight, uniform 4-bit affine quantization (group size 64). No layers held back at higher precision — the QAT training is what preserves quality at uniform 4-bit.
Why the Hub shows "~2B params" for a 12B model
The Hub counts stored safetensors elements. MLX packs eight 4-bit weights into each stored U32, so the counter sees 1.49B U32 containers + 0.38B BF16 quantization scales ≈ 1.9B stored elements and rounds to "2B". Unpacked, the model is 12.33B parameters (1.49B × 8 + 0.38B) — the full Gemma 4 12B. Cross-check: 12.33B × 4.51 bits ÷ 8 ≈ 6.9 GB, matching the shard sizes. Every 4-bit MLX repo on the Hub under-displays the same way.
Requirements
Apple Silicon and mlx-vlm >= 0.6.x
(the gemma4_unified architecture is not supported by mlx-vlm 0.5.x).
pip install -U mlx-vlm
python -m mlx_vlm generate --model modelcaddy/gemma-4-12b-it-qat-4bit-mlx \
--prompt "Summarize: ..." --max-tokens 256
License
Gemma is provided under and subject to the Gemma Terms of Use. This repository redistributes a quantized derivative of Google's Gemma 4 weights; use is governed by those terms and the Gemma Prohibited Use Policy.
- Downloads last month
- 61
4-bit
Model tree for modelcaddy/gemma-4-12b-it-qat-4bit-mlx
Base model
google/gemma-4-12B