Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

Complete Guide to Running Gemma 4 Locally: From Mac/Linux Environment Setup to Japanese Inference

Table of contents · 6 items

What is Gemma 4? — The largest generational leap in open-model history

On April 2, 2026, Google released Gemma 4, the latest iteration in its Gemma series of open models. Maintaining the Apache 2.0 license with free commercial use and zero royalties, it delivers a massive leap in capability over the previous generation, Gemma 3.

Most notable are its multimodal capabilities spanning text, vision, and audio, alongside on-device inference running comfortably on laptops and smartphones. It has drawn widespread attention from developers and enterprise users as an attractive option for leveraging AI without cloud reliance.

Model lineup and performance

Gemma 4 provides four variations tailored to different requirements:

ModelParametersActive during inferenceContext lengthModalities
E2B5.1B2.3B128KText, image, audio
E4B8B4.5B128KText, image, audio
26B A4B(MoE)25.2B3.8B256KText, image
31B Dense30.7B30.7B256KText, image

The 26B A4B model, built on a Mixture of Experts (MoE) architecture, activates only around 15% (3.8B) of its parameters during inference. It achieves an astonishing level of efficiency, delivering 97% of the quality of a 31B dense model at one-eighth the computational cost.

Evolution of benchmark performance

The leap forward from the previous generation is dramatic.

BenchmarkGemma 3 27BGemma 4 31BImprovement margin
MMLU Pro67.6%85.2%+17.6pt
AIME 202620.8%89.2%+68.4pt
GPQA Diamond84.3%
LiveCodeBench v680.0%

A gain of over 68 points in mathematical reasoning (AIME) represents far more than a minor version bump—it is a true generational leap.

Running Gemma 4 locally

The core appeal of Gemma 4 is that you can run it right on your own machine. Here are three leading methods to get started:

Ollama (easiest method)

# インストール済みなら1コマンド
ollama pull gemma4
ollama run gemma4

Pre-quantized models download automatically, allowing you to start chatting immediately. The E2B model runs comfortably with approximately 4GB of RAM.

llama.cpp (when granular control is needed)

# macOS
brew install llama.cpp

# GGUF量子化モデルを直接指定して起動
llama-server -hf ggml-org/gemma-4-E2B-it-GGUF

Because it launches as an API server, other applications can easily interact with it over HTTP.

MLX (for Apple Silicon users)

pip install -U mlx-vlm

# 4bit量子化で約8GBメモリで動作
mlx_vlm.generate \
  --model google/gemma-4-E4B-it \
  --kv-bits 3.5 \
  --prompt "この画像を説明してください" \
  --image photo.jpg

Takes full advantage of unified memory on M1, M2, and M3 chips, with native multimodal (image input) support ready out of the box.

Business and development use cases

On-device AI agents

Optimized for NVIDIA RTX series GPUs, running local AI agents is now a practical reality. Because AI processing completes entirely without transmitting confidential data to the cloud, it is ideal for operations with strict data security mandates.

Multimodal document processing

Handling image recognition, OCR, chart comprehension, and text generation in a single model makes it possible to consolidate workflows—from processing invoices to summarizing meeting minutes—that previously required chaining multiple APIs.

Multilingual capabilities (140+ languages)

Globally deployed services no longer require provisioning separate models for each language. Japanese language processing quality has also improved substantially compared to the previous generation.

Mobile app integration

With Android AICore integration support, the barrier to embedding on-device AI in mobile apps has dropped significantly. The E2B model also supports WebGPU inference directly in web browsers.

Comparison with competing models

ItemGemma 4 26BLlama 3.3 70BPhi-4 14B
Active parameters during inference3.8B70B14B
MultimodalText, imageText onlyText, image
Context length256K128K16K
LicenseApache 2.0Llama CommunityMIT
Audio supportE2B/E4B onlyNot supportedNot supported

In terms of parameter efficiency, Gemma 4's MoE models are in a class of their own. Operating with just 3.8B active parameters, they achieve MMLU Pro scores on par with 70B-class models.

Conclusion

Gemma 4 is a milestone release proving just how capable open models have become. In particular, the parameter efficiency unlocked by its MoE architecture significantly lowers the barrier to local deployment.

  • For a quick trial: Experience it with a single command: ollama run gemma4
  • For production use: Deploy as an API server using llama.cpp and integrate with existing systems
  • On Apple Silicon: Leverage MLX to run multimodal workloads, including image processing, entirely on your machine

For developers facing cloud API costs, latency, or privacy hurdles, Gemma 4 is a compelling alternative.

If you are interested in putting AI to work in your operations, please also explore our ChatGPT Business Application Guide and Google Workspace Gemini AI Implementation Guide.

Share this articleXFacebook
Rui Teruya

Former corporate league baseball player and founder of an IT venture. Founded the company with the drive to ride the fast-moving waves of the world and deliver truly valuable services to society.

Turn this article's theme into your company's next step

Thinking together, starting from the work you entrust to AI.

We organize your current operations and data to define the scope entrusted to AI, what humans should review, and how to run trials.

  • Target operations
  • Data to use
  • How to verify effectiveness
Consult on AI adoption for your business

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles by email