HeadlinesBriefing favicon HeadlinesBriefing.com

Local AI Coding Agent with Gemma 4, Ollama, and Open Code

Towards Data Science •
×

Developers looking to keep code on premise can now stitch together a local AI coding agent using open‑source tools. The walkthrough shows how to install Ollama, pull Google’s new Gemma 4 model, and hook it into the open‑source Open Code interface. The result is a self‑contained agent that runs entirely on the developer’s laptop for debugging and automation tasks in development.

On a machine equipped with an Intel i7‑13800 H CPU, 32 GB RAM, and an NVIDIA RTX 2000 Ada GPU, the 9.6 GB 4‑bit quantized Gemma 4 E4B model loads in under a minute and supports a 128 K token window. Once warmed, prompts return in seconds, making the agent suitable for real‑time code generation and repository inspection within a local environment without sending code to the cloud.

Connecting Open Code to the local model involves creating a Modelfile that sets the context to 128K and an opencode.json that points to Ollama’s localhost endpoint. The agent can then read, write, and run scripts inside a repo, all while keeping data on disk. This setup eliminates third‑party dependencies and gives developers full control over their codebase for secure development at