CommitAI — Local AI-Powered Git Assistant Using Gemma 4

This is a submission for the Gemma 4 Challenge: Build with Gemma 4

What I Built

As developers, we repeatedly write commit messages, maintain changelogs, and switch context during development. I wanted to build a lightweight developer tool t…


This content originally appeared on DEV Community and was authored by Yuva Kunaal

This is a submission for the Gemma 4 Challenge: Build with Gemma 4

What I Built

As developers, we repeatedly write commit messages, maintain changelogs, and switch context during development. I wanted to build a lightweight developer tool that could automate this workflow completely offline without relying on cloud APIs or external AI services.

So I built CommitAI — a local AI-powered Git assistant using Gemma 4 + Ollama.

The workflow is simple:

  • Read staged Git diff
  • Send it to a local Gemma 4 model
  • Generate a clean Conventional Commit message
  • Update changelog automatically
  • Execute the Git commit

I also added Git hook integration so the workflow becomes:

git add .
git commit

and the AI handles the rest.

The project is built entirely in Python and runs locally on my MacBook Air M2 (8GB RAM).

Features

  • AI-generated Conventional Commit messages
  • Automatic changelog generation
  • Git hook integration
  • Fully local/offline workflow
  • Rich CLI interface using the Rich library
  • No external APIs
  • Privacy-friendly local inference
  • Uses staged Git diffs as context

Demo

Demo Video

Code

CommitAI Repo

How I Used Gemma 4

I used the gemma4:e2b model through Ollama for all AI-powered functionality inside CommitAI.

I specifically chose the E2B model because:

  • it runs efficiently on local hardware
  • lightweight enough for my MacBook Air M2 with 8GB RAM
  • low-latency responses for CLI workflows
  • strong enough reasoning for summarizing Git diffs
  • ideal for privacy-focused offline tooling

Gemma 4 powers:

  • commit message generation
  • changelog summarization
  • Git workflow automation

Architecture

Git Diff
   ↓
CommitAI
   ↓
Ollama API
   ↓
Gemma 4 (E2B)
   ↓
AI-generated commit/changelog
   ↓
Git commit execution

Tech Stack

  • Python
  • Ollama
  • Gemma 4 (gemma4:e2b)
  • Rich
  • Git Hooks

Future Improvements

  • PR description generation
  • Multi-model support
  • Better diff summarization
  • VSCode extension
  • Team changelog modes
  • Interactive commit editing

One of my biggest goals with this project was proving that useful AI developer tooling can run fully locally without depending on cloud APIs.

Thanks for reading 🚀


This content originally appeared on DEV Community and was authored by Yuva Kunaal


Print Share Comment Cite Upload Translate Updates
APA

Yuva Kunaal | Sciencx (2026-05-08T20:56:09+00:00) CommitAI — Local AI-Powered Git Assistant Using Gemma 4. Retrieved from https://www.scien.cx/2026/05/08/commitai-local-ai-powered-git-assistant-using-gemma-4/

MLA
" » CommitAI — Local AI-Powered Git Assistant Using Gemma 4." Yuva Kunaal | Sciencx - Friday May 8, 2026, https://www.scien.cx/2026/05/08/commitai-local-ai-powered-git-assistant-using-gemma-4/
HARVARD
Yuva Kunaal | Sciencx Friday May 8, 2026 » CommitAI — Local AI-Powered Git Assistant Using Gemma 4., viewed ,<https://www.scien.cx/2026/05/08/commitai-local-ai-powered-git-assistant-using-gemma-4/>
VANCOUVER
Yuva Kunaal | Sciencx - » CommitAI — Local AI-Powered Git Assistant Using Gemma 4. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2026/05/08/commitai-local-ai-powered-git-assistant-using-gemma-4/
CHICAGO
" » CommitAI — Local AI-Powered Git Assistant Using Gemma 4." Yuva Kunaal | Sciencx - Accessed . https://www.scien.cx/2026/05/08/commitai-local-ai-powered-git-assistant-using-gemma-4/
IEEE
" » CommitAI — Local AI-Powered Git Assistant Using Gemma 4." Yuva Kunaal | Sciencx [Online]. Available: https://www.scien.cx/2026/05/08/commitai-local-ai-powered-git-assistant-using-gemma-4/. [Accessed: ]
rf:citation
» CommitAI — Local AI-Powered Git Assistant Using Gemma 4 | Yuva Kunaal | Sciencx | https://www.scien.cx/2026/05/08/commitai-local-ai-powered-git-assistant-using-gemma-4/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.