How to run a local coding agent with Gemma 4 and Pi

I've been playing around with running coding agents fully locally. The setup I landed on is: LM Studio + Pi agent + Gemma 4 26B A4B (Q4_K_M) Gemma 4 running in LM Studio, connected to Pi as the terminal agent. It works surprisingly well, and this post walks through how to set it up. Here's what we'll cover: Install LM Studio Download Gemma 4 Start a local server Configure context size Install Pi…