TutorialModels & inference
How to run Gemma 4 locally on Windows and Mac: sizes, downloads and commands
Pick a Gemma 4 size that fits your PC or Mac, check the published download sizes, and see how to run Gemma 4 locally with Ollama, LM Studio or llama.cpp.

Illustration generated with ChatGPT
The quickest answer to how to run Gemma 4 locally: install Ollama on Windows or macOS and enter ollama run gemma4. Ollama's library points that name at the E4B size, which its tag list shows at 6.6GB to 9.5GB. With more memory to spare, gemma4:12b is the next size up, and Google estimates its 4-bit weights at about 6.7 GB.
Every size, tag, file size and command here comes from Google's Gemma documentation and model cards, the Ollama library, and the LM Studio and llama.cpp docs, all read on 2026-11-12. Nothing was run or timed for this article, so it contains no speed figures.
Which Gemma 4 size should you start with?
Google's Gemma 4 model overview (opens in a new tab) publishes approximate memory needed to load each size. This decision table pairs the 4-bit (Q4_0) column of that table with the matching Ollama tag.
| Gemma 4 size | Ollama tag | Google's Q4_0 memory estimate | Start here if |
|---|---|---|---|
| E2B | gemma4:e2b | 2.9 GB | Memory is tight. LM Studio tells owners of 8GB Macs to stick to smaller models. |
| E4B | gemma4:e4b | 4.5 GB | You want what a plain ollama run gemma4 pulls. |
| 12B | gemma4:12b | 6.7 GB | You have more than that free and want the 256K context window. |
| 26B A4B | gemma4:26b | 14.4 GB | You have that much free. All 26 billion parameters load, though only 4 billion are active per token. |
| 31B | gemma4:31b | 17.5 GB | You want the largest dense model. |
Read Google's numbers as a floor. The overview says they cover the static weights plus 20% loading overhead, and leave out the context window. Memory use grows with the number of tokens in the prompt and the response.
Gemma 4 sizes and what each accepts as input
Gemma 4 comes in five sizes. The model card on Hugging Face describes them this way:
| Size | Parameters | Context length | Input on the model card |
|---|---|---|---|
| E2B | 2.3B effective (5.1B with embeddings) | 128K tokens | Text, image, audio |
| E4B | 4.5B effective (8B with embeddings) | 128K tokens | Text, image, audio |
| 12B Unified | 11.95B | 256K tokens | Text, image, audio |
| 26B A4B (Mixture-of-Experts) | 25.2B total, 3.8B active | 256K tokens | Text, image |
| 31B Dense | 30.7B | 256K tokens | Text, image |
All five generate text only. The card caps audio input at 30 seconds, and video is handled as frames, up to 60 seconds at one frame per second.
What a runner exposes can be narrower than the model card. Ollama's tag table lists "Text, Image" as input for every gemma4 tag. LM Studio's Gemma 4 page lists tool use, vision input and reasoning. For image prompts, see the HuiaHub guide to running a vision language model locally with Ollama and llama.cpp.
Two dating notes. Google's Ollama integration page, last updated 2026-04-02, still names four sizes and omits 12B, whose Hugging Face repository was created on 2026-05-23. The Gemma pages on ai.google.dev also carry a banner that calls them deprecated and points to gemma.ai.
Gemma 4 download sizes by variant and quantization
The Ollama tags page for gemma4 (opens in a new tab) listed 51 tags on 2026-11-12. The short tags show a size range, and the explicit tags show one size each. The 26B explicit tags use the prefix 26b-a4b, for example gemma4:26b-a4b-it-qat.
| Size | Short tag | Short tag size | -it-qat | -it-q4_K_M | -it-q8_0 | -it-bf16 |
|---|---|---|---|---|---|---|
| E2B | gemma4:e2b | 4.6GB to 7.5GB | 4.3GB | 4.6GB | 6.0GB | 10GB |
| E4B | gemma4:e4b (also gemma4:latest) | 6.6GB to 9.5GB | 6.1GB | 6.6GB | 9.0GB | 16GB |
| 12B | gemma4:12b | 7.7GB to 8.0GB | 7.2GB | 8.0GB | 13GB | 24GB |
| 26B A4B | gemma4:26b | 16GB to 19GB | 16GB | 18GB | 28GB | 52GB |
| 31B | gemma4:31b | 19GB to 20GB | 19GB | 20GB | 34GB | 63GB |
Source: ollama.com/library/gemma4/tags, read 2026-11-12. The same page lists tags labeled MLX for each size, such as gemma4:12b-mlx at 7.7GB.
Google publishes its own quantization-aware training (QAT) GGUF files on Hugging Face. Each repository holds one model file and one multimodal projector (mmproj) file. Sizes below are the byte counts from the Hugging Face file listing, converted at 1 GB = 1,000,000,000 bytes.
| Repository | Model file | Model size | mmproj size | LM Studio catalog entry and size |
|---|---|---|---|---|
google/gemma-4-E2B-it-qat-q4_0-gguf | gemma-4-E2B_q4_0-it.gguf | 3.35 GB | 0.99 GB | google/gemma-4-e2b, 4.20 GB |
google/gemma-4-E4B-it-qat-q4_0-gguf | gemma-4-E4B_q4_0-it.gguf | 5.15 GB | 0.99 GB | google/gemma-4-e4b, 5.90 GB |
google/gemma-4-12B-it-qat-q4_0-gguf | gemma-4-12b-it-qat-q4_0.gguf | 6.98 GB | 0.18 GB | google/gemma-4-12b, 7.40 GB |
google/gemma-4-26B-A4B-it-qat-q4_0-gguf | gemma-4-26B_q4_0-it.gguf | 14.44 GB | 1.19 GB | google/gemma-4-26b-a4b, 15.60 GB |
google/gemma-4-31B-it-qat-q4_0-gguf | gemma-4-31B_q4_0-it.gguf | 17.65 GB | 1.20 GB | google/gemma-4-31b, 19.00 GB |
Sources: the Hugging Face file listings for each repository, such as google/gemma-4-12B-it-qat-q4_0-gguf (opens in a new tab), and lmstudio.ai/models/gemma-4, both read 2026-11-12. For comparison, the full-precision model.safetensors in google/gemma-4-12B-it is 23.92 GB.
What Ollama, LM Studio and llama.cpp say they need
The runner docs opened for this article state platform requirements. LM Studio adds per-model memory figures on its model pages.
| Runner | Windows | macOS |
|---|---|---|
| Ollama | Windows 10 22H2 or newer, Home or Pro. NVIDIA driver 551.61 or newer for NVIDIA cards. At least 4GB of disk space for the install, before models. | macOS Sonoma (v14) or newer. Apple M series with CPU and GPU support, or x86 with CPU only. |
| LM Studio | x64 and ARM (Snapdragon X Elite). AVX2 required on x64. At least 16GB of RAM and 4GB of dedicated VRAM recommended. | Apple Silicon and macOS 14.0 or newer. 16GB+ RAM recommended. Intel Macs are not supported. |
| llama.cpp | Winget package. CUDA and Vulkan backends. | Homebrew package. Apple Silicon through Metal. |
The LM Studio column comes from its system requirements page (opens in a new tab). LM Studio's Gemma 4 page says the smallest Gemma 4 needs at least 4 GB of RAM and the largest may need up to 19 GB. Its google/gemma-4-12b page lists a minimum system memory of 7 GB.
Ollama picks a default context length from available VRAM: 4k under 24 GiB, 32k from 24 to 48 GiB, and 256k at 48 GiB or more. Its docs say a larger context length increases the memory a model needs.
How to run Gemma 4 locally with Ollama on Windows and Mac
1. Install Ollama
Download the installer from ollama.com/download. On Windows, OllamaSetup.exe installs into your home directory and does not need Administrator rights. On macOS, mount ollama.dmg and drag the app into Applications. Then confirm the command line works:
ollama --version
The GitHub API showed Ollama v0.40.16, published 2026-11-09, as the latest release.
2. Pull and run a Gemma 4 tag
Google's Ollama guide downloads the default variant, lists it, then starts a chat. The commands are the same in PowerShell and in the macOS Terminal.
ollama pull gemma4
ollama list
ollama run gemma4
Models are named <model_name>:<tag>. To choose a size or an exact quantization, add the tag from the tables above:
ollama run gemma4:12b
ollama run gemma4:12b-it-qat
Ollama's vision docs pass an image path on the same line:
ollama run gemma4 ./image.png what is in this image?
3. Check where the model loaded
Run ollama ps while the model is loaded. The PROCESSOR column reads 100% GPU, 100% CPU, or a split such as 48%/52% CPU/GPU, which means part of the model sits in system memory.
ollama ps
Ollama also serves an API at http://localhost:11434. The HuiaHub guide on running a local LLM with Ollama and calling it from your code covers that side.
Run Gemma 4 with LM Studio
Google's LM Studio guide uses the in-app downloader. Open LM Studio, press Ctrl + Shift + M on a PC or Cmd + Shift + M on a Mac, and search for "Gemma". LM Studio suggests a variant suited to your hardware. Click Download, then load the model in a new chat.
LM Studio's catalog names the five sizes google/gemma-4-e2b, google/gemma-4-e4b, google/gemma-4-12b, google/gemma-4-26b-a4b and google/gemma-4-31b, each with a -qat twin. The 12B entry draws on GGUF files and on MLX builds at 4, 5, 6 and 8 bits. Its "Enable Thinking" field defaults to true.
The lms command line ships with LM Studio, and the app must have run once before lms works. The docs describe lms get as searching for and downloading models, and their example is lms get llama-3.1-8b. For Gemma 4, look for the catalog names above.
lms get <model name>
lms ls
lms load --estimate-only <model_key>
lms load <model_key>
lms chat
lms ls shows the model key. lms load --estimate-only prints a memory estimate and exits without loading the model. lms get --gguf and lms get --mlx filter search results by format, and lms server start turns on the local API server.
Run Gemma 4 with llama.cpp from a GGUF file
The llama.cpp repository (opens in a new tab) documents prebuilt packages for both systems.
# Windows
winget install llama.cpp
# macOS
brew install llama.cpp
Google's overview names {model-name}-qat-q4_0-gguf as the download for llama.cpp and LM Studio. The -hf flag takes a Hugging Face repository in the form <user>/<model>[:quant]:
llama-server -hf google/gemma-4-12B-it-qat-q4_0-gguf
According to the llama.cpp server README, -hf looks for a Q4_K_M file first and falls back to the first file in the repository. The mmproj file downloads automatically when one is available, and --no-mmproj turns that off.
For files already on disk, point -m at the model and --mmproj at the projector:
llama-server -m gemma-4-12b-it-qat-q4_0.gguf --mmproj mmproj-gemma-4-12b-it-qat-q4_0.gguf
By default the server listens on 127.0.0.1:9931 and serves a web UI at the same address. The -c flag sets the context size, and its default of 0 loads the size from the model. llama-cli accepts the same -hf flag for a terminal chat. The README's quick start now writes these two tools as llama serve and llama cli.
The llama.cpp multimodal doc lists its own ggml-org GGUF repositories for Gemma 4 E2B, E4B, 26B-A4B and 31B. For a side-by-side view of the three runners, see llama.cpp vs Ollama vs LM Studio.
Gemma 4 license and terms of use
The Hugging Face cards for google/gemma-4-12B-it and its QAT GGUF repository declare the license as Apache 2.0. They link to Google's Gemma 4 license page (opens in a new tab), which carries the Apache License 2.0 text. The Hugging Face API reports both repositories as not gated.
Earlier Gemma versions used the Gemma Terms of Use. That page now says its terms apply to the models in its appendix and sends readers to the Gemma 4 license for Gemma 4. Google's overview says Gemma models come with open weights and permit responsible commercial use.
The runners have separate licenses. The GitHub API lists Ollama and llama.cpp as MIT, and LM Studio's docs say the lms tool is MIT licensed.
Common problems the docs describe
ollamais not recognized. Google's guide says to make sure the Ollama executable is on your operating system path.- Progress bars show as squares on Windows 10. Ollama uses Unicode characters for progress, and older terminal fonts may not render them. Change the terminal font.
- The system drive fills up. Set the
OLLAMA_MODELSenvironment variable to another folder, then quit Ollama from the tray and relaunch it. The defaults areC:\Users\%username%\.ollama\modelson Windows and~/.ollama/modelson macOS. - An AMD Radeon RX 6000 card is not used through ROCm. Ollama's Windows page says some of these cards do not expose ROCm v7, and that Vulkan is enabled by default as the fallback.
- You need logs. On Windows, run
explorer %LOCALAPPDATA%\Ollamaand openserver.log. On macOS, read~/.ollama/logs/server.log. - Thinking tags appear with thinking off. The model card says the 12B, 26B A4B and 31B models still emit an empty thought block when thinking is disabled.
- llama.cpp cannot download behind a corporate proxy. The server README says to export
HTTP_PROXYandHTTPS_PROXYbefore commands that download models.
Frequently asked questions
Can Gemma 4 run on a laptop without a dedicated GPU?
Google's Ollama guide says llama.cpp and Ollama can run versions of Gemma on a laptop or other small device without a GPU. Ollama's macOS page lists x86 Macs as CPU only. None of these sources publishes speeds for CPU use, so measure on your own hardware.
What is the difference between the `-it-qat` and `-it-q4_K_M` Ollama tags?
QAT stands for quantization-aware training. Google's overview says QAT simulates quantization during training so the model learns to compensate for the lost precision, where post-training quantization compresses a model after training. On the Ollama tags page the 12B QAT tag is 7.2GB and the 12B Q4_K_M tag is 8.0GB.
Do prompts leave the machine when Gemma 4 runs in Ollama?
Ollama's FAQ says Ollama runs locally and that Ollama does not see prompts or data from local runs. The `gemma4:cloud` and `gemma4:31b-cloud` tags are cloud-hosted models, and the FAQ describes different handling for those. Setting `OLLAMA_NO_CLOUD=1` disables Ollama's cloud features.
Can LM Studio run Gemma 4 offline?
LM Studio's system requirements page says the app can operate entirely offline once you have model files. Download the Gemma 4 variant first, while connected.
What are the Gemma 4 "assistant" and MTP files?
Google's overview says every Gemma 4 size includes a dedicated draft model for speculative decoding, which it calls multi-token prediction. On Hugging Face these are the repositories ending in `-assistant`. The Ollama tags page lists MTP tags such as `gemma4:26b-a4b-it-mtp-q4_K_M` at 19GB.
Sources
- 1.Gemma 4 モデルの概要 | Google AI for DevelopersOfficial docsPrimaryai.google.dev
- 2.Run Gemma with Ollama | Google AI for DevelopersOfficial docsPrimaryai.google.dev
- 3.gemma4Official docsPrimaryollama.com
- 4.Tags · gemma4Official docsPrimaryollama.com
- 5.google/gemma-4-12B-it · Hugging FaceOfficial docsPrimaryhuggingface.co
- 6.google/gemma-4-12B-it-qat-q4_0-gguf · Hugging FaceOfficial docsPrimaryhuggingface.co
- 7.Windows - OllamaOfficial docsPrimarydocs.ollama.com
- 8.macOS - OllamaOfficial docsPrimarydocs.ollama.com
- 9.System Requirements | LM StudioWeblmstudio.ai
- 10.GitHub - ggml-org/llama.cpp: LLM inference in C/C++ · GitHubRepositoryPrimarygithub.com
- 11.ai.google.dev/gemma/docs/coreWeb
- 12.huggingface.co/api/models/google/gemma-4-12B-it-qat-q4_0-gguf/tree/mainRepositoryPrimary
- 13.huggingface.co/api/models/google/gemma-4-E2B-it-qat-q4_0-gguf/tree/mainRepositoryPrimary
- 14.huggingface.co/api/models/google/gemma-4-E4B-it-qat-q4_0-gguf/tree/mainRepositoryPrimary
- 15.huggingface.co/api/models/google/gemma-4-26B-A4B-it-qat-q4_0-gguf/tree/mainRepositoryPrimary
- 16.huggingface.co/api/models/google/gemma-4-31B-it-qat-q4_0-gguf/tree/mainRepositoryPrimary
- 17.huggingface.co/api/models/google/gemma-4-12B-it/tree/mainRepositoryPrimary
- 18.ai.google.dev/gemma/docs/gemma_4_licenseWeb
- 19.ai.google.dev/gemma/termsWeb
- 20.docs.ollama.com/windows.mdOfficial docsPrimary
- 21.docs.ollama.com/macos.mdOfficial docsPrimary
- 22.docs.ollama.com/context-length.mdOfficial docsPrimary
- 23.docs.ollama.com/faq.mdOfficial docsPrimary
- 24.docs.ollama.com/capabilities/vision.mdOfficial docsPrimary
- 25.lmstudio.ai/models/gemma-4Web
- 26.lmstudio.ai/models/google/gemma-4-12bWeb
- 27.ai.google.dev/gemma/docs/integrations/lmstudioWeb
- 28.lmstudio.ai/docs/cliWeb
- 29.lmstudio.ai/docs/cli/local-models/getWeb
- 30.lmstudio.ai/docs/cli/local-models/loadWeb
Spotted an error? See our corrections policy.
Enjoyed this? Get the weekly brief.
New guides, Project & Tool of the Week and the AI developments that matter. One email, no spam.
Read next
TutorialModels & inferenceHow to run Qwen locally: Qwen3.8-27B on Windows and Mac, with download sizes
How to run Qwen locally: check which Qwen3.8 download fits your Windows PC or Mac, then start it with Ollama, LM Studio or llama.cpp.
9 min read
- ComparisonModels & inference
Ollama vs vLLM: which one to run your open models with
Ollama vs vLLM compared on model formats, hardware, OpenAI-compatible APIs, batching, install and licenses, so you can pick the right one.
7 min read
NewsModels & inferenceIs Gemini 4 Carbon really the top model? What independent tests show
Google calls Gemini 4 Carbon its strongest model. Independent benchmarks and first reviews show where it leads, where it trails and what it costs.
4 min read



