coding_tools is a local AI git commit message generator that writes conventional commits from diffs for developers.
It uses a fine-tuned Gemma 3 (1B) language model running locally through llama.cpp with CUDA/GPU acceleration. Monitor one or many Git repositories and request an AI-written commit message with a hotkey; no API key is required.
Topics: git · commit-message-generator · conventional-commits · gemma · fine-tuning · llama-cpp · gguf · local-llm · cuda · ai-developer-tools · python
- Local AI Git Commit Message Generator Features
- Installation
- Local AI Git Commit Message Generator Usage Examples
- Configuration
- Troubleshooting and FAQ
- Contributing
After installing Conda and the local llama.cpp server, inspect the CLI options:
conda create --name ct python=3.12.8 -y
conda activate ct
python3 main.py --helpThe program accepts one or more Git repository paths and sends their diffs to the local server when the configured hotkey is pressed.
- Purpose: Automated generation of git commit messages based on code diff analysis
- AI Model: Fine-tuned Gemma 3 (1B parameters) specialized for code change classification
This tool uses a fine-tuned Gemma 3 model to automatically analyze git diffs and generate appropriate commit messages following conventional commit standards. The system monitors git repositories in real-time and provides AI-generated commit message suggestions when triggered.
For additional standalone automation utilities, see the related
scripts collection.
- Real-time git repository monitoring
- AI-powered diff analysis and commit message generation
- Multi-repository support
- Conventional commit format compliance (feat:, fix:, docs:, etc.)
- Monitors specified git repositories for changes
- When triggered (via hotkey), analyzes current git diff using AI
- Generates appropriate commit message based on code changes
This guide explains how to set up your environment to run optimized inference with llama.cpp. Follow these steps:
Make sure you have Conda installed (via Anaconda or Miniconda). Create a new environment named ct with Python version 3.12.8:
conda create --name ct python=3.12.8
conda activate ct- Install CUDA Toolkit 12.8 (or newer) from the official NVIDIA website.
- Verify that your NVIDIA GPU (for example, an RTX 4090 with compute capability 8.9 Get the value from here, remove dot and insert it to the -DCMAKE_CUDA_ARCHITECTURES parameter) is supported.
- Open a Windows Command Prompt.
- Configure and build llama.cpp by running the following commands:
cmake -B build -DGGML_CUDA=ON -DCMAKE_CUDA_COMPILER="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\bin\nvcc.exe" -DCMAKE_CUDA_ARCHITECTURES="89" && cmake --build build --config Release- Download the Gemma 3 1B Model:
- Visit unsloth/gemma-3-1b-it-GGUF
- Download the Q4_K_M quantized model file (ending with .gguf extension)
- This quantization level provides a good balance between model size and inference quality
- Open a new Command Prompt.
- Set the CUDA_VISIBLE_DEVICES environment variable and start the server with your model by running:
set CUDA_VISIBLE_DEVICES=-0 && ..\llama.cpp\build\bin\Release\llama-server --model ..\models\gemma-3-1b-it-Q4_K_M.gguf --n-gpu-layers 420(set up a high gpu layers number to increase the models inference speed)
- The server will start and display information about the model and inference settings.
- Connect to the server using HTTP requests to localhost on the default port.
- Other useful parameters:
--ctx-size: Context window size (default: 2048)--batch-size: Batch size for prompt processing--threads: Number of CPU threads to use--stream: Enable streaming mode
You can monitor a single Git repository:
python main.py /path/to/repoThe program now supports monitoring multiple Git repositories simultaneously:
python main.py /path/to/repo1 /path/to/repo2 /path/to/repo3When monitoring multiple repositories:
- The program processes each repository individually when you press the hotkey
- Diff content for each repository is saved to separate files (output_repo-name.txt)
- LLM responses and commits will be labeled with the repository name
- Invalid repositories will be skipped with a warning
Additional command-line options:
python main.py /path/to/repo [options]
Options:
--server-url URL URL of the llama server (default: http://localhost:8080)
--hotkey KEY Hotkey combination to trigger LLM feedback (default: alt+q)
--temperature TEMP Temperature parameter for text generation (default: 0.7)
--max-tokens TOKENS Maximum number of tokens to generate (default: 512)
--context-length LENGTH Context length for the model (default: 2048)The default server URL, hotkey, temperature, maximum output tokens, and context
length are defined in data/model_config.py and can be overridden with the
matching command-line options. Repository paths are positional arguments, and
multiple paths enable multi-repository monitoring.
It proposes conventional Git commit messages from the current diff using a locally hosted Gemma model. It does not commit changes automatically unless the configured keyboard action requests that behavior.
No. The documented setup points to a local llama.cpp server and does not require an API key. Keep the model server and monitored repositories on the same trusted machine.
Yes. Pass multiple repository paths after main.py; each valid repository is
validated and monitored independently, with labeled outputs for each path.
CUDA is the documented acceleration path for the fine-tuned GGUF model. A CPU build of llama.cpp may work if configured separately, but this repository does not claim equivalent performance or provide a CPU setup guide.
The default is http://localhost:8080, matching the README's llama-server
example. Use --server-url URL when the local server listens elsewhere.
Keep the local/offline behavior explicit, document new command-line flags, and test single- and multi-repository argument handling before opening a pull request. Never commit model files, credentials, or generated output.
Released under the MIT License.