Gemma 4 with Ollama and OpenCode: local setup tutorial

Learn to install Gemma 4 through Ollama and connect it to OpenCode, with offline chat, image analysis and a single HTML landing page example.

Player not loading? Watch on YouTube

This tutorial covers Gemma 4 as a local LLM in Ollama, then connects it to OpenCode for coding and file access. The presenter uses a 2024 MacBook Pro while recording his screen and webcam. He focuses on the 4 billion parameter version, discusses a 31 billion parameter option, and describes the selected download as about 10 GB. These details describe his setup rather than establish minimum hardware requirements.

The installation starts with downloading Ollama and using its terminal pull command to fetch the model. The presenter recommends the latest tag and says the process is similar on a PC, though the demonstration uses macOS. After downloading, he disconnects the internet and asks Gemma 4 to explain photosynthesis, shorten its answer and identify a cat in an uploaded image.

For the coding assistant workflow, he installs OpenCode and uses Ollama's launch command to select Gemma 4. He then opens the desktop interface and requests a single HTML landing page selling dog supplements. He reports that code generation takes 2 minutes and 29 seconds, then asks OpenCode to save the output to a file.

The presenter says this example runs offline and is slower than his Claude Code comparison. He also acknowledges the basic page design and notes that he supplied little direction. His broader claims about model superiority, cost and unlimited use are commentary, not independent benchmark findings.