Skip to main content

AI Merge Request Summaries for Self-Hosted GitLab CE, Without Paying for Duo

GitLab Community Edition already sends webhooks and exposes a REST API. That turned out to be enough to add AI merge request summaries and release notes, so I built a small service that does it and released it as open source.

Updated 9 min readMarkdown
AI Merge Request Summaries for Self-Hosted GitLab CE, Without Paying for Duo

I run my own GitLab Community Edition server, which gets me most of GitLab for free. What it doesn't get me is the AI layer: GitLab Duo is a paid add-on. I didn't need most of what it does anyway. I wanted two things: a short summary on every merge request, so whoever reviews it (usually me) knows what they're looking at before reading the diff; and release notes that write themselves.

Neither needs deep integration. GitLab CE sends webhooks out and accepts REST API calls in, and that's enough for both. So I built a small service that sits between GitLab and an AI model, and I've released it under the MIT license. It's called Glint.

Most of my side projects live on that server, and most of the changes to them now come from Claude Code: it makes the change, pushes to a develop branch and opens a merge request to main. The faster AI-assisted coding got, the more merge requests needed a review, and on a team of one, every review was mine. Keeping up with all of them got hard, and Glint is what I built to help.

What It Does

Glint does two jobs.

Merge request summaries. When a merge request is opened or reopened, Glint fetches its details and diff, then posts a comment in three parts: a summary of what changed and why, the key changes, and review notes on anything that deserves a closer look.

That comment is real. It's from an early merge request that added Glint's own unit test suite, and the review notes are the part worth reading. They pointed out that flushing promises with setImmediate can be brittle, and that a test spy should be restored in a try/finally block so a failing assertion can't leak it into the tests that run after it. Both were fair, and both are the kind of thing I'd want a second reviewer to catch... which, on a solo project, is the reviewer I don't have.

Release notes. When I create a release in GitLab, Glint collects the commits and the diff since the previous release and writes the release description, grouped into new features, bug fixes, improvements, breaking changes and internal changes.

How It Works

The flow for a merge request is five steps:

  1. GitLab sends a webhook when the merge request is opened.
  2. Glint verifies the request came from your GitLab, then replies immediately (HTTP 202) so GitLab isn't kept waiting.
  3. In the background, it fetches the merge request details and diff from the GitLab API.
  4. It sends them to the AI model with a review prompt.
  5. It posts the answer as a comment on the merge request.

There's no database and no state. Remove Glint and nothing is left behind except the comments it wrote. It's a single small Node.js service (Node 22, Express 5, TypeScript).

Your Code Doesn't Have to Leave Your Network

A lot of people self-host GitLab so their code stays on their own infrastructure, and an AI feature that sends every diff to a third party gives some of that back. So Glint lets you choose where the diff goes.

Anthropic's Claude is the default, and it costs a few cents per merge request. The other option is any server that speaks the OpenAI-compatible API, the protocol behind OpenAI's own API and local servers such as Ollama, LM Studio and vLLM. I've tested two providers end to end, Anthropic and Ollama; anything else is untested until someone reports back. Azure OpenAI isn't supported yet (issue #37, help wanted).

Pointing Glint at Ollama takes three lines:

AI_PROVIDER=openai-compatible
OPENAI_BASE_URL=http://localhost:11434/v1
OPENAI_MODEL=llama3.2

With a local model, the only traffic is between GitLab, Glint and Ollama, all on your own machines.

Model size matters, though. The smallest model I tried, llama3.2 1B, writes well-formatted summaries that are generic. Bigger local models do much better if you have the hardware. In The 2026 Homelab AI Stack: What's Worth Running, I argued that a local model earns its place on low-stakes automated work, and a merge request summary is that kind of work: useful when it's good, harmless when it's bland.

Running It

At a high level, the steps are:

  • Write a .env file with your GitLab URL, an access token, a webhook secret and a provider key.
  • Start the container.
  • Add a webhook to each GitLab project you want summarized.

Glint ships as a Docker image, ghcr.io/smith8ca/glint:latest, built for amd64 and arm64 (so a Raspberry Pi works). It runs as a non-root user with production dependencies only.

A minimal .env:

GITLAB_BASE_URL=https://gitlab.example.com
GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
WEBHOOK_SECRET=a-long-random-string
ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxx

Start it:

docker run -d --name glint -p 3000:3000 --env-file .env ghcr.io/smith8ca/glint:latest

Then, in the GitLab project, open Settings → Webhooks and add one:

  • URL: http://<your-host>:3000/webhook
  • Secret token: the value of WEBHOOK_SECRET
  • Triggers: merge request events and releases events

Open a merge request and the summary turns up as a comment. The wiki covers Docker Compose, reverse proxies, private certificate authorities and troubleshooting.

Running More Than One

Each Glint instance talks to one provider, and the webhook that calls it is set per project. Put those together and every project can use a different model. A second instance is the same docker run line with its own container name, host port and .env file; the project's webhook URL decides which instance it gets.

In my case, I run more than one. Projects with routine changes point at an instance backed by a local model, and the projects where a review needs more judgment point at one backed by Claude. In AI Spend Is Stalling; Architecture Should Notice, I called that the cheap tier at home: the routing decision gets made once per project instead of on every merge request. If you'd rather keep every diff on your own machines, one instance on Ollama is all you need.

Things I Paid Attention To

A service that holds a GitLab token and accepts requests from the network should be careful about both. These are the parts I spent time on.

Webhook authentication. Glint supports GitLab's HMAC signing tokens, which verify that the payload wasn't altered and reject replays. It also supports the older shared secret token header.

Private certificate authorities. If your GitLab uses a certificate from your own CA, you give Glint the CA file. You don't have to turn off TLS verification to make it work.

Secrets stay out of logs. A failed API call is logged as a one-line description, never with the headers that carry the token.

Structured logs. Logs are JSON, one object per line (via pino), with the level set by LOG_LEVEL, so they drop straight into whatever you already use to read logs.

Least privilege in the container. Non-root, production dependencies only, nothing extra in the image.

What It Doesn't Do Yet

I'd rather you hear the limitations from me than find them yourself. All of them are tracked as issues.

  • It summarizes on open and reopen only, not on every new push (issue #35).
  • Diffs are truncated at 20,000 characters by default (configurable with MAX_DIFF_CHARS), so a very large merge request is summarized from its first files.
  • There are no retries. If the model or GitLab has a temporary failure, that summary is lost (issue #34).
  • It can't skip draft merge requests or filter by label yet (issue #36, a good first issue).

The one that deserves more than a bullet is prompt injection. Merge request content goes to the model, so anyone who can open a merge request can try to steer the summary. Glint gives the model no tools and only posts text, so the worst case is a misleading comment, not an action. The agents in The Autonomous Agent Attack Surface got out through the one network path their sandbox allowed; Glint's model has no path to use. It reads text and returns text, and Glint decides what gets posted.

That still leaves the comment itself, so treat it as a starting point for review, not a verdict. It's the same line I drew in AI Agents in CI/CD: The Governance Gap: an AI's output is a proposal until a person accepts it.

How It Was Built

Much of Glint's code, tests and documentation was written with an AI coding assistant (Claude Code), then reviewed, tested and maintained by me. The README says so too.

The split was simple: Claude Code wrote most of the code and tests, and I decided what Glint should and shouldn't do, then read every merge request before it merged. I stepped in most on security, like verifying webhooks and keeping the token out of logs, and on saying no to features, starting with giving the model any tools. Once Glint could review merge requests, it reviewed its own, which is where the comment in the screenshot came from. If I started over, I'd write the limitations list first and hand it over with the first prompt.

The test suite is the part I'd point a skeptic to: 149 unit tests at about 99% line coverage, plus an end-to-end test that runs the full flow against a mock GitLab server and a real model.

Try It

The code is at github.com/Chuckworks-Engineering/Glint, with setup guides in the wiki and Discussions open for anything that isn't a bug.

I'd like to hear how it goes, particularly with a local model or a GitLab setup that differs from mine. If something breaks, an issue is the most useful thing you can send. If you'd like to contribute, issue #36 (skipping draft merge requests and filtering by label) is tagged as a good first issue, and Azure OpenAI support (#37) is open for anyone who uses it.

Glint does two small things. I built it because I wanted them, and I'm releasing it because I doubt I'm the only one.


Charles Smith is a solutions architect at a large financial institution. He also runs a self-hosted homelab stack: fewer constraints, same discipline. He writes about platform engineering, automation, and the gap between what technology enables and what organizations can actually ship.

About the author

  • As an Enterprise Architect and software engineer, I lead the design and implementation of cloud-based solutions that enable the digital transformation and modernization of the enterprise. With over 15 years of experience in information technology, I have a strong background in AWS cloud architecture, systems engineering, information security, automation, networking, and generative AI.

No comments yet. Be the first to comment.