Running Gemma 4 Locally with Ollama on Your PC

AI-generated summary of reporting by Analytics Vidhya Gen AI Blog. Read the original for the full story.

Why it matters

The tutorial is only actionable for hobbyists running small local models; the author's own testing shows local Gemma 4 couldn't fix code and cloud fallback was needed.

Read this as

This is a tutorial about running Google's Gemma 4, a free-to-download AI model, on a personal computer using a tool called Ollama. Smaller versions need just 8GB of memory while bigger ones need 16-24GB of video memory. The author builds a document question-answering app but admits the local models couldn't fix code errors, and finishing required the cloud-hosted Gemma 4 31B version.

A hands-on walkthrough of installing Google's open-weight Gemma 4 via Ollama on a PC, covering hardware requirements from 8GB RAM (E2B/E4B) to 24GB VRAM (31B). The headline lesson is negative: local open models remain impractical for real coding work. The author's agentic coding session with Claude Code CLI broke repeatedly on Gemma 4 26B, and only the free cloud-hosted gemma4:31b completed the project, in about seven minutes. Privacy and cost savings stay theoretical for serious workloads.

Guide to running Gemma 4 variants through Ollama: E2B/E4B ('effective parameter' edge models, 8GB+ RAM), 26B A4B using Mixture-of-Experts with ~16GB VRAM, and 31B dense requiring 24GB+ VRAM. The build uses Claude Code CLI pointed at Ollama, LangChain document loaders, OllamaEmbeddings, ChromaDB and RAG queries via localhost:11434/v1. The 26B model failed to fix runtime errors across several iterations; switching to gemma4:31b-cloud resolved all code in ~7 minutes.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Gemma 4 Ollama Claude Code CLI ChromaDB LangChain Apple Silicon

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading