Instructions to use AtomicChat/gemma-4-12b-it-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use AtomicChat/gemma-4-12b-it-MLX-4bit 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("AtomicChat/gemma-4-12b-it-MLX-4bit") 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 AtomicChat/gemma-4-12b-it-MLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "AtomicChat/gemma-4-12b-it-MLX-4bit"
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": "AtomicChat/gemma-4-12b-it-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use AtomicChat/gemma-4-12b-it-MLX-4bit 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 "AtomicChat/gemma-4-12b-it-MLX-4bit"
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 AtomicChat/gemma-4-12b-it-MLX-4bit
Run Hermes
hermes
- OpenClaw new
How to use AtomicChat/gemma-4-12b-it-MLX-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "AtomicChat/gemma-4-12b-it-MLX-4bit"
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 "AtomicChat/gemma-4-12b-it-MLX-4bit" \ --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"
- MLX LM
How to use AtomicChat/gemma-4-12b-it-MLX-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "AtomicChat/gemma-4-12b-it-MLX-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "AtomicChat/gemma-4-12b-it-MLX-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AtomicChat/gemma-4-12b-it-MLX-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
Gemma 4 12B, self-quantized to MLX by Atomic Chat. Built straight from Google's original weights with a per-tensor importance matrix, so this is not a repack of somebody else's files. Runs fully offline.
Highlights
- 11.95B parameters: the weights this repo quantizes.
- Context length: 256K tokens, as published by Google.
- 48 layers: Dense decoder, hybrid sliding-window (1024) and global attention.
- Modalities: Text, Image, Audio.
- Full imatrix ladder: every quant is calibrated with an importance matrix.
- Reasoning: All models in the family are designed as highly capable reasoners, with configurable thinking modes.
- Diverse & Efficient Architectures: Offers Dense and Mixture-of-Experts (MoE) variants of different sizes for scalable deployment.
These MLXs are self-quantized from the original weights, not a repack. The importance matrix keeps low-bit quants closer to the full-precision model.
Model Overview
| Property | Value |
|---|---|
| Base model | google/gemma-4-12B-it |
| Parameters | 11.95B |
| Layers | 48 |
| Sliding window | 1024 tokens |
| Context length | 256K tokens |
| Vocabulary | 262K |
| Modalities | Text, Image, Audio |
| Architecture | Dense decoder, hybrid sliding-window (1024) and global attention, 16 attention heads over 8 KV heads, Gemma4UnifiedForConditionalGeneration |
| This repo | MLX weights |
Benchmarks
| Benchmark | Score |
|---|---|
| MMLU Pro | 77.2% |
| AIME 2026 no tools | 77.5% |
| LiveCodeBench v6 | 72.0% |
| Codeforces ELO | 1659 |
| GPQA Diamond | 78.8% |
| Tau2 (average over 3) | 69.0% |
| HLE no tools | 5.2% |
| BigBench Extra Hard | 53.0% |
| MMMLU | 83.4% |
| MMMU Pro | 69.1% |
| OmniDocBench 1.5 (average edit distance, lower is better) | 0.164 |
| MATH-Vision | 79.7% |
| MedXPertQA MM | 48.7% |
| CoVoST | 38.5 |
| FLEURS (lower is better) | 0.069 |
| MRCR v2 8 needle 128k (average) | 43.4% |
Scores are Google's published results for the base google/gemma-4-12B-it, not our own measurements. Quantization preserves the large majority of this; Q4_K_M and up stay close to full precision.
Get started
- Atomic Chat: search
AtomicChat/gemma-4-12b-it-MLX-4bitand hit Use this model. - mlx-lm:
mlx_lm.generate --model AtomicChat/gemma-4-12b-it-MLX-4bit --prompt "Hello" --max-tokens 512 - Server:
mlx_lm.server --model AtomicChat/gemma-4-12b-it-MLX-4bit --port 8080
Best practices
| Parameter | Value |
|---|---|
| temperature | 1.0 |
| top_p | 0.95 |
| top_k | 64 |
Google's recommended sampling configuration for google/gemma-4-12B-it.
How these were made
- Download
google/gemma-4-12B-it(original weights). - Convert and quantize with
mlx_lm.converton our pipeline.
License
Original model by Google, released under the Apache 2.0 license. Full terms: Apache 2.0. Quantized by Atomic Chat.
- Downloads last month
- 737
4-bit


