Locommit
Local commit messages
Locommit is a tiny Go binary for macOS and Linux. It reads your staged git diff and
generates a commit message using a Qwen3-0.6B
GGUF model, which it downloads on first startup and runs entirely on your machine when
we start the inference server.
$ locommit
✓ Summarizing staged diff (1842 chars)
⠋ Generating commit message
Response:
Add model server to avoid reloading weights per run
Commit with this message? [y/N] y
[main 3fa9c21] Add model server to avoid reloading weights per run
Architecture
Locommit is a Go binary with a thin client that reads the input of git commit -m
and sends it over a Unix socket to the model inference server started implicitly
by locommit serve.
The first run of the server downloads the GGUF artifact from HuggingFace and spins
up inference via llama-go. If the client can't reach or spawn the server, it loads the model
in-process instead, so the tool works even with no server running.
Each commit is processed separately. Locommit takes the staged diff (filenames and added/removed lines), via git diff --staged,
and processes for input into the model. Currently, we truncate if the context window is too large,
so it's meant for smaller, frequent, and focused commits.
We don't keep memory or state between commit batches, and the goal of the 0.6B model is to prioritize speed (recall) over precision, though we will tune that balance over time.
git diff --staged
│
▼
┌─────────────┐ Unix socket ┌──────────────┐
│ locommit │ ────────────────────▶ │ locommit │
│ (client) │ ◀──────────────────── │ serve │
└─────────────┘ commit message └──────┬───────┘
│ │ CGO
▼ ▼
git commit -m llama-go / llama.cpp
│ loads
▼
Qwen3 GGUF model
(user cache dir)
▲
HuggingFace download
Install
curl -fsSL https://locommit.com/install.sh | sh
The installer detects your platform, downloads the matching binary from the latest GitHub release, and verifies its SHA-256 checksum.
On first run, locommit downloads the ~600 MB model from HuggingFace into the user
cache dir: ~/.cache/locommit/ on Linux, ~/Library/Caches/locommit/ on macOS.
Uninstall
rm ~/.local/bin/locommit rm -r ~/.cache/locommit # Linux rm -r ~/Library/Caches/locommit # macOS
Build
Requirements: Go (see go.mod), a C toolchain, cmake, and libcurl headers
(apt install build-essential cmake libcurl4-openssl-dev on Debian/Ubuntu).
Locommit depends on llama-go via CGO, compiled as
a static library at ~/llama-go:
git clone --recurse-submodules https://github.com/tcpipuk/llama-go ~/llama-go make -C ~/llama-go libbinding.a # BUILD_TYPE=metal is used automatically on macOS make setup # point go.mod's replace directive at ~/llama-go, fetch deps make build # produce ./locommit make run # build + download the model (into ./Qwen3-0.6B-Q8_0.gguf) + run
Model inference server startup
On first run, locommit spawns a background server (locommit serve) that loads
the model into memory once. Later runs connect to it over a per-user Unix socket
instead of reloading the model.
locommit serve # run the server in the foreground (logs visible, Ctrl+C to stop) pkill -f "locommit serve" # stop the background process
Usage
Do some work in a commit, and then your usual workflow of git add -u. But instead of
git commit -m, run locommit instead.
git add -u # stage some changes locommit # generate a message, confirm with y, commit
Flags
There are a number of flags you can pass to get a better sense of what the tool is doing.
| Flag | Description |
|---|---|
locommit -info | Print model location and server status, then exit |
locommit --reasoning | Show the model's reasoning before the message (thinking models) |
locommit --diff | Print the processed diff sent to the model |
locommit --debug | Verbose llama.cpp logging |