Lab 13 of 17 · By Michael Stout
In this lab
Use Copy beside a command to copy it exactly.
Install Ollama and run Gemma 4 (31B)
Lab 1 put a 7-billion-parameter security-tuned model on your own machine. Gemma 4's 31B model is Google's newest general-purpose open model — roughly four times the parameters, real agentic and reasoning capability, and noticeably heavier hardware needs. This lab gets it running and gives you a feel for where “runs fine” turns into “needs a better machine.”
Bigger isn't just slower — it's a different capability class
Gemma 4's 31B model is a dense, general-purpose model — not fine-tuned for security work the way Lab 1's DeepHat was. Google built it for multi-step reasoning and agentic workflows: native function-calling, structured JSON output, and a 256K token context window, with vision built in as well as text. Running it locally means all of that stays on your machine, at the cost of real hardware headroom that a 7B model never asked for.
If you completed Lab 1, Ollama is already installed — skip straight to Part 2. This lab is the same workflow run against a genuinely bigger model, which is exactly the point.
What you'll need
Windows 10, version 22H2 or later, or Windows 11 — 64-bit.
At least 24 GB free. The model itself is a 20 GB download (Q4_K_M quantized).
32 GB system RAM is a safe minimum for a model this size running on CPU alone. A GPU with 16 GB or more of VRAM will make it noticeably faster, but isn't required.
30–60 minutes, most of it the download — this file is close to 40% larger than Lab 1's.
Skip this if you did Lab 1
- Download and install it. Go to
ollama.com/download/windows, downloadOllamaSetup.exe, and run it — allow the permissions prompt and follow it to completion. Full walkthrough in Lab 1 if you need it. - Confirm it's running. Open PowerShell and run:
ollama --version
Watch what a bigger model actually costs
- Pull the model:This is a 20 GB download — leave it running. It'll take noticeably longer than Lab 1's model.
ollama pull gemma4:31b
- Start a session:The first reply is slower while the model loads into memory.
ollama run gemma4:31b
- Watch it work. While it's replying, open Task Manager (or run
ollama psin a second PowerShell window) and watch memory use climb. This is the hardware cost Part 1's “before you start” warned about, made visible. - Exit when done: type
/bye.
Play to its actual strengths
| Try | What it's testing |
|---|---|
| A multi-step logic puzzle | Ask it to reason through something with several dependent steps and show its work — this is what Google built the 31B model for. |
| Forced structured output | “Return this as JSON with fields name, severity, recommendation.” Structured output is a named design goal, worth checking it actually holds the format. |
| A tool-calling scenario | Describe two or three made-up tools and a task, and ask which tool it would call and with what arguments — the agentic use case behind function-calling support. |
| A long paste | Drop in several pages of text and ask a question that requires connecting the start to the end — a real test of the 256K context window, not just a claimed number. |
A bigger, newer model is not a more honest one. Gemma 4 can still state something confidently and incorrectly — the same verification discipline from Lab 1 still applies here.
Expect fans, heat, and a sluggish machine for anything else you run at the same time on modest hardware. Close what you don't need before a session.
Sources. Ollama, gemma4:31b model page and pull command, ollama.com/library/gemma4:31b. Google, Gemma 4 announcement, blog.google/innovation-and-ai/technology/developers-tools/gemma-4. Gemma 4 is licensed under Apache 2.0. Download size, benchmarks, and licensing terms are current as of September 2026 and worth re-checking before teaching this lab live.