Instructions to use Xylolabs/gemma-4-12B-it-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Xylolabs/gemma-4-12B-it-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS # Run inference directly in the terminal: llama cli -hf Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS # Run inference directly in the terminal: llama cli -hf Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS # Run inference directly in the terminal: ./build/bin/llama cli -hf Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS
Use Docker
docker model run hf.co/Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS
- Llama new
- LM Studio
- Jan
- vLLM
How to use Xylolabs/gemma-4-12B-it-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Xylolabs/gemma-4-12B-it-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xylolabs/gemma-4-12B-it-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS
- Ollama
How to use Xylolabs/gemma-4-12B-it-GGUF with Ollama:
ollama run hf.co/Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS
- Unsloth Desktop
- Pi
How to use Xylolabs/gemma-4-12B-it-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Xylolabs/gemma-4-12B-it-GGUF with Docker Model Runner:
docker model run hf.co/Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS
- Lemonade
How to use Xylolabs/gemma-4-12B-it-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS
Run and chat with the model
lemonade run user.gemma-4-12B-it-GGUF-IQ4_XS
List all available models
lemonade list
- Hermes Agent
How to use Xylolabs/gemma-4-12B-it-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS
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:9931/v1 hermes config set model.default Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Xylolabs/gemma-4-12B-it-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS
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:9931/v1 \ --custom-model-id "Xylolabs/gemma-4-12B-it-GGUF:IQ4_XS" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
GGUF quants of google/gemma-4-12B-it for llama.cpp, on CUDA, Metal or CPU. The vision and audio encoders are left out.
Files
| GGUF file | Size |
|---|---|
| gemma-4-12B-it-Q5_K_M.gguf | 8.55 GB |
| gemma-4-12B-it-IQ4_XS.gguf | 6.69 GB |
| gemma-4-12B-it-IQ4_XS-imat.gguf | 6.64 GB |
| gemma-4-12B-it-Q3_K_M-imat.gguf | 6.09 GB |
How to run
Needs llama.cpp b8753 or newer.
llama-cli -m gemma-4-12B-it-Q5_K_M.gguf -c 2048 -n 32 --temp 0 --jinja \
--chat-template-kwargs '{"enable_thinking":false}' \
--single-turn -p "Name the capital of France. Reply with only the city."
Accuracy
Mean KL divergence and top-1 agreement against BF16 on 8 English and Korean chat conversations.
| Quant | Size | Mean KL | top-1 |
|---|---|---|---|
| Q3_K_M-imat | 6.087 GB | 0.220635 | 84.198% |
| IQ4_XS-imat | 6.635 GB | 0.081309 | 90.386% |
| IQ4_XS | 6.691 GB | 0.153501 | 85.396% |
| Q5_K_M | 8.547 GB | 0.044045 | 92.661% |
Which file for your hardware
| Hardware | Memory | Recommended file | Context that fits | Notes |
|---|---|---|---|---|
| RTX 4090 / RTX 3090 | 24 GB | gemma-4-12B-it-Q5_K_M.gguf (8.5 GB) |
256K | |
| RTX 5090 | 32 GB | gemma-4-12B-it-Q5_K_M.gguf (8.5 GB) |
256K | |
| RTX 6000 Ada, or 2 x 24 GB | 48 GB | gemma-4-12B-it-Q5_K_M.gguf (8.5 GB) |
256K | Two 24 GB cards need the layers split across them. |
| One H100 | 80 GB | gemma-4-12B-it-Q5_K_M.gguf (8.5 GB) |
256K | |
| RTX PRO 6000 Blackwell (GDDR7) | 96 GB | gemma-4-12B-it-Q5_K_M.gguf (8.5 GB) |
256K | |
| DGX Spark | 128 GB unified | gemma-4-12B-it-Q5_K_M.gguf (8.5 GB) |
256K | |
| Mac Studio M5 Max | 128 GB unified | gemma-4-12B-it-Q5_K_M.gguf (8.5 GB) |
256K | |
| One H200 (HBM3e) | 141 GB | gemma-4-12B-it-Q5_K_M.gguf (8.5 GB) |
256K | |
| One B200 | 192 GB | gemma-4-12B-it-Q5_K_M.gguf (8.5 GB) |
256K | |
| Mac Studio M5 Ultra | 256 GB unified | gemma-4-12B-it-Q5_K_M.gguf (8.5 GB) |
256K | |
| Mac Studio M5 Ultra | 512 GB unified | gemma-4-12B-it-Q5_K_M.gguf (8.5 GB) |
256K | |
| One B300 (HBM3e) | 288 GB | gemma-4-12B-it-Q5_K_M.gguf (8.5 GB) |
256K |
License
Apache 2.0, as declared by the original Unified model card and
its Google license link. Full standard terms are in LICENSE, and
NOTICE identifies the source and text conversion.
Citation
Cite the original Gemma 4 12B Unified model card and its linked Gemma 4 technical report.
Updates
- 2026-11-27: KL re-measured on chat-template text; earlier values used a faulty reference.
- 2026-11-23: Added a hardware recommendation table.
- 2026-11-14: First release.
- Downloads last month
- 3,750
3-bit
4-bit
5-bit