Gemma 4 31B-it GGUF โ€” Quantized by BatiAI

BatiFlow Ollama Upstream

Optimized GGUF quantizations of google/gemma-4-31B-it โ€” Google's largest dense Gemma 4 model with native multilingual + vision capabilities. Built directly from official Google BF16 weights by BatiAI for BatiFlow.

Gemma 4 31B-it is a dense 31 B model (every parameter active per token) โ€” different trade-off from 26B-A4B's MoE design (26 B total / 3.8 B active). Pick 31B for deeper reasoning per query, 26B-A4B for higher throughput.

Quick Start

# 24 GB Mac โ€” Smaller, imatrix-calibrated
ollama pull batiai/gemma4-31b:iq3

# 24 GB+ Mac โ€” Imatrix 4-bit (recommended)
ollama pull batiai/gemma4-31b:iq4

# 32 GB+ Mac โ€” Higher quality
ollama pull batiai/gemma4-31b:q4

# 36 GB+ Mac โ€” Highest on-device quality
ollama pull batiai/gemma4-31b:q6

Available Quantizations

Tag Quant Recommended For
:iq3 IQ3_M (imatrix) 24 GB Mac, smaller footprint
:iq4 IQ4_XS (imatrix) 24 GB+ Mac, recommended
:q4 Q4_K_M 32 GB+ Mac, higher quality
:q6 Q6_K 36 GB+ Mac, near-lossless

Two modes โ€” text-only by default, multimodal opt-in

Upstream Gemma 4 31B-it is multimodal (text + image + video understanding โ€” but no audio; for audio see the smaller E2B / E4B variants). In the GGUF ecosystem this is delivered as two files: a main model.gguf (text tower) and a separate mmproj.gguf (multi-modal projector โ€” the vision tower). We ship both, separate, so you can pick:

Text-only (default) Multimodal (opt-in)
Files needed main GGUF only main GGUF + mmproj-*.gguf
Capabilities Q&A, coding, tool calling, RAG, agents + image / video understanding (OCR, captioning, visual reasoning)
ollama pull โœ… single command โš  Ollama mmproj integration is still rough โ€” use llama.cpp directly
Disk / RAM smaller (no vision weights) larger (+ ~770 MB to ~1.2 GB)
Recommended for most users (chat, code, agents) OCR, image understanding

Multimodal usage (llama.cpp)

Download the main GGUF + the mmproj file:

# Pick a main model (text tower)
wget https://huggingface.co/batiai/Gemma-4-31B-it-GGUF/resolve/main/google-gemma-4-31B-it-IQ4_XS.gguf

# Pick the mmproj (vision tower) โ€” Q6_K is the sweet spot, BF16 if you want zero loss
wget https://huggingface.co/batiai/Gemma-4-31B-it-GGUF/resolve/main/mmproj-Q6_K.gguf

Server mode (OpenAI-compatible Vision API):

llama-server \
  -m google-gemma-4-31B-it-IQ4_XS.gguf \
  --mmproj mmproj-Q6_K.gguf \
  -c 32768 --host 127.0.0.1 --port 8080

curl http://127.0.0.1:8080/v1/chat/completions -d '{
  "messages": [{
    "role": "user",
    "content": [
      {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,..."}},
      {"type": "text", "text": "What does this screenshot show?"}
    ]
  }]
}'

One-shot CLI:

llama-mtmd-cli \
  -m google-gemma-4-31B-it-IQ4_XS.gguf \
  --mmproj mmproj-Q6_K.gguf \
  --image ~/Desktop/photo.jpg \
  -p "describe this image"

mmproj quantizations available

File Quant Size When to use
mmproj-Q6_K.gguf Q6_K ~770 MB balanced (recommended)
mmproj-BF16.gguf BF16 ~1.2 GB absolute zero quantization loss for vision

(Q8_0 not available because some vision tensors have shapes incompatible with Q8_0's column alignment โ€” applies to every quantizer of this model. Q6_K's K-quant block layout handles them.)

Dense vs MoE โ€” when to pick 31B vs 26B-A4B?

31B-it (dense) 26B-A4B-it (MoE)
Active params / token 31 B (all) 3.8 B (8 experts of 32)
Throughput slower (more compute per token) faster
Reasoning depth better (denser computation) good
Memory at IQ4 ~17 GB ~13 GB
Best for hard reasoning / single-thread workloads high-throughput / agents / streaming chat

Use 31B for quality-per-token, 26B-A4B for tokens-per-second.

Why BatiAI?

BatiAI Third-party (unsloth, etc.)
Source Quantized directly from official Google weights Often re-quantized from other GGUFs
Compatibility โœ… Verified on Ollama 0.20+ โŒ Known issues with Ollama 0.20+
Tested on Real Mac mini M4 + MacBook Pro M4 Max Often untested
Tool calling โœ… Verified with BatiFlow's 57 tool functions Often broken
Korean โœ… Validated Not tested
Multimodal โœ… Vision mmproj available (this repo) Often missing
Signing general.author: BatiAI for provenance Varies

About BatiFlow

flow.bati.ai

BatiFlow is a macOS-native AI desktop automation app โ€” just 5 MB, built with Swift.

  • Free & Unlimited โ€” On-device AI via Ollama, no API costs
  • 100 % Private โ€” All data stays on your Mac
  • Ultra Lightweight โ€” Native macOS app, only 5 MB
  • 57 built-in tools โ€” calendar, notes, reminders, files, email, browser, messaging, and more

Related models in the BatiAI Gemma 4 lineup

Model Modalities Min RAM Repo
Gemma 4 E2B-it text + image + audio 8 GB batiai/Gemma-4-E2B-it-GGUF
Gemma 4 E4B-it text + image + audio 8 GB batiai/Gemma-4-E4B-it-GGUF
Gemma 4 26B-A4B-it text + image / video (MoE) 24 GB batiai/Gemma-4-26B-A4B-it-GGUF
Gemma 4 31B-it text + image / video (dense) 24 GB this repo

Technical Details

  • Original Model: google/gemma-4-31B-it
  • Architecture: Gemma 4 dense (31 B parameters, all active per token)
  • Modalities: Text (primary) + Image / Video via opt-in mmproj. Audio not supported (use E2B / E4B for audio)
  • Context Window: 128 K tokens
  • License: Gemma
  • Quantized with: llama.cpp
  • Quantized by: BatiAI
  • GGUF metadata: general.author: BatiAI, general.url: https://flow.bati.ai

License

Mirrors the upstream Gemma license. Commercial use permitted per Google's Gemma terms.

BatiAI's quantization pipeline is provided under MIT.

Downloads last month
347
GGUF
Model size
31B params
Architecture
gemma4
Hardware compatibility
Log In to add your hardware

3-bit

4-bit

6-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for batiai/gemma-4-31B-it-GGUF

Quantized
(312)
this model

Collection including batiai/gemma-4-31B-it-GGUF