Instructions to use Omega-Factory/gemma-4-31b-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 Omega-Factory/gemma-4-31b-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 Omega-Factory/gemma-4-31b-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Omega-Factory/gemma-4-31b-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Omega-Factory/gemma-4-31b-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Omega-Factory/gemma-4-31b-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Omega-Factory/gemma-4-31b-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Omega-Factory/gemma-4-31b-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Omega-Factory/gemma-4-31b-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Omega-Factory/gemma-4-31b-GGUF:Q4_K_M
Use Docker
docker model run hf.co/Omega-Factory/gemma-4-31b-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Omega-Factory/gemma-4-31b-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Omega-Factory/gemma-4-31b-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Omega-Factory/gemma-4-31b-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Omega-Factory/gemma-4-31b-GGUF:Q4_K_M
- Ollama
How to use Omega-Factory/gemma-4-31b-GGUF with Ollama:
ollama run hf.co/Omega-Factory/gemma-4-31b-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use Omega-Factory/gemma-4-31b-GGUF with Docker Model Runner:
docker model run hf.co/Omega-Factory/gemma-4-31b-GGUF:Q4_K_M
- Lemonade
How to use Omega-Factory/gemma-4-31b-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Omega-Factory/gemma-4-31b-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.gemma-4-31b-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Gemma 4 31B Dense GGUF Precision Ladder
Official Release & Multi-Quant Benchmarks:
View full precision comparison tables (Q8_0, Q4_K_M, Q2_K vs. FP16 Base), item-level McNemar discordance flips, and verified cryptographic receipts on the Omega Factory Gemma 4 31B Dense Model Page.
Certified GGUF precision quantization ladder for google/gemma-4-31b dense architecture.
Certified quant ladder
Every rung below was certified on its own exact bytes (sha256-bound). A verdict is never transferred between formats or rungs, and a rung that did not clear its bands is published with its real verdict rather than omitted.
| Rung | Verdict | Seeds | Size | SHA256 | Receipt |
|---|---|---|---|---|---|
Q8_0 |
CERTIFIED | 1 | 32.64 GB | 22a8ab2d7a3d |
receipts/cert_Q8_0.json |
Q4_K_M |
CERTIFIED | 1 | 18.69 GB | 7584d5b09832 |
receipts/cert_Q4_K_M.json |
Q2_K |
CERTIFIED | 1 | 11.92 GB | e8e9bcfe6e1a |
receipts/cert_Q2_K.json |
SCREENmeans the result did not use the full seed set and therefore is not a certification.
FP16 Baseline vs. Quantization Precision Comparison
To evaluate quantization precision loss and capability retention, quant variants were benchmarked against the unquantized base model (google/gemma-4-31b) under controlled deterministic evaluation settings.
Precision & Accuracy Matrix vs. FP16 Baseline
| Variant / Format | Size (Disk/VRAM) | GSM8K Accuracy | MATH-500 Accuracy | ARC-MC Accuracy | Babble Rate | Status |
|---|---|---|---|---|---|---|
| FP16 Baseline | 61.4 GB | 86.0% (172/200) | 36.5% (73/200) | 85.0% (170/200) | 0.0333 | Baseline Ground Truth |
Q8_0 |
32.64 GB | 84.5% (Ξ -1.5 pp) | 37.0% (Ξ +0.5 pp) | 95.0% (Ξ +10.0 pp) | 0.0000 | CERTIFIED |
Q4_K_M |
18.69 GB | 87.5% (Ξ +1.5 pp) | 35.5% (Ξ -1.0 pp) | 94.5% (Ξ +9.5 pp) | 0.0000 | CERTIFIED |
Q2_K |
11.92 GB | 2.0% (Ξ -84.0 pp) | 6.0% (Ξ -30.5 pp) | 91.0% (Ξ +6.0 pp) | 0.0000 | CERTIFIED |
Detailed Item-Level Contingency & Flips vs. FP16
Per-item McNemar discordance analysis measuring questions that changed answer status relative to the unquantized FP16 baseline:
| Quantization Variant | Category | Quant Correct | FP16 Base Correct | Flips Broke (FP16 β β Quant β) | Flips Fixed (FP16 β β Quant β) | Net Delta (pp) |
|---|---|---|---|---|---|---|
Q8_0 |
ARC-MC | 190 / 200 | 170 / 200 | 0 | 20 | +10.0 pp |
Q8_0 |
GSM8K | 169 / 200 | 172 / 200 | 4 | 1 | -1.5 pp |
Q8_0 |
MATH-500 | 74 / 200 | 73 / 200 | 0 | 1 | +0.5 pp |
Q4_K_M |
ARC-MC | 189 / 200 | 170 / 200 | 0 | 19 | +9.5 pp |
Q4_K_M |
GSM8K | 175 / 200 | 172 / 200 | 8 | 11 | +1.5 pp |
Q4_K_M |
MATH-500 | 71 / 200 | 73 / 200 | 12 | 10 | -1.0 pp |
Q2_K |
ARC-MC | 182 / 200 | 170 / 200 | 9 | 21 | +6.0 pp |
Q2_K |
GSM8K | 4 / 200 | 172 / 200 | 168 | 0 | -84.0 pp |
Q2_K |
MATH-500 | 12 / 200 | 73 / 200 | 65 | 4 | -30.5 pp |
Hardware & VRAM Allocation Recommendations
Artifact size is disk usage, not a measured VRAM requirement. Runtime memory and the KV cache depend on architecture, backend, batch settings, and context length. Validate actual deployment with peak-memory profiling.
Reference capacity bands only:
| Artifact size (disk) | Reference capacity band |
|---|---|
| Up to 8 GB | 6β8 GB |
| Over 8 GB through 16 GB | 12β16 GB |
| Over 16 GB through 24 GB | 20β24 GB |
| Over 24 GB through 48 GB | 32β48 GB |
| Over 48 GB | Multi-GPU or CPU offload; no single listed tier |
| Quant Variant | Artifact Size (disk) | Deployment sizing notes |
|---|---|---|
Q8_0 |
32.64 GB | 32β48 GB reference capacity. Candidate only, not a measured fit guarantee. |
Q4_K_M |
18.69 GB | 20β24 GB reference capacity. Candidate only, not a measured fit guarantee. |
Q2_K |
11.92 GB | 12β16 GB reference capacity. Candidate only, not a measured fit guarantee. |
Recommended Sampling Parameters
- Thinking Mode:
temperature = 1.0top_p = 0.95top_k = 20repetition_penalty = 1.0
- Instruct Mode:
temperature = 0.7top_p = 0.8top_k = 20presence_penalty = 1.5
Model Architecture Specifications
- Parameters: 32.7 Billion
- Layers: 60
- Context Length: 262144
- Attention: Standard Attention with SWA
Chat template
{{ bos_token }}{% for message in messages %}{% if message['role'] == 'user' %}{{ '<start_of_turn>user
' + message['content'] + '<end_of_turn>
' }}{% elif message['role'] == 'assistant' %}{{ '<start_of_turn>model
' + message['content'] + '<end_of_turn>
' }}{% endif %}{% endfor %}
License and attribution
- License: Gemma Terms of Use (inherited from the base model).
- Base model:
google/gemma-4-31b-- all credit for the underlying model belongs to its authors. - This repository publishes a compressed derivative: experts were pruned and the result re-quantised. It is not a new base model.
- Research / free use only. This model inherits a community license: it is published for research and free use, and this repository makes no commercial-serving claims.
- You remain responsible for complying with the base model's license terms.
Contact / reporting an issue
Found a problem with these weights or this card? Open a discussion on this repository, or report a security concern to the maintainers via the organisation page at https://huggingface.co/Omega-Factory. We publish corrections and, where warranted, retract a release rather than leave a wrong card standing.
- Official Model Page: Gemma 4 31B Dense on Omega Factory
- Organization Website: https://omega-factory.ai
- Downloads last month
- 267
2-bit
4-bit
8-bit