Skip to main content
Some organizations require all software to run without any external network access — no outbound API calls, no container registry pulls, no telemetry. MergeWatch supports this by using a local LLM via Ollama as an embedded sidecar container.

Overview

This guide covers preparing container images and model weights on a connected machine, transferring them to an air-gapped environment, and running MergeWatch with Ollama for fully offline code reviews.
Review quality with local models is lower than with external API providers like Anthropic or OpenAI. Local models (e.g. Qwen 2.5 Coder 7B) work well for straightforward code reviews but may miss subtle issues that larger models catch. Test thoroughly before relying on air-gapped reviews for critical repositories.

Prerequisites

1

Connected machine (for preparation)

You need a machine with internet access to download container images and model weights before transferring them to the air-gapped environment.
2

Air-gapped machine

The target machine needs Docker and Docker Compose installed (these can be installed from offline packages).
3

Transfer medium

A USB drive, external disk, or internal file transfer mechanism with at least 15 GB of free space (container images + model weights).
4

Gather your GitHub App credentials

In an air-gapped environment, your GitHub Enterprise Server instance must be reachable from the MergeWatch host on the internal network. Configure GITHUB_API_URL to point to your GHE instance.

Prepare images on a connected machine

1

Pull the required container images

2

Pull the Ollama model

Download the model weights using the Ollama CLI or container:
qwen2.5-coder:7b provides a good balance of quality and resource usage for code review. For servers with more RAM and GPU, consider qwen2.5-coder:14b or qwen2.5-coder:32b.
3

Save images to tar files

4

Export the Ollama model volume

5

Copy files to transfer medium

Copy these four files to your USB drive or transfer medium:
  • mergewatch.tar
  • ollama.tar
  • postgres.tar
  • ollama-models.tar.gz

Deploy on the air-gapped machine

1

Load the container images

2

Restore the Ollama model volume

3

Create the docker-compose.yml

4

Create the .env file

5

Start all services

Verify all three containers are running:
6

Verify Ollama is serving the model

Set up Postgres

Postgres runs as a container in the docker-compose stack above. Data is persisted to the pgdata Docker volume.
If your air-gapped environment has an existing PostgreSQL instance, remove the postgres service from docker-compose.yml and set DATABASE_URL in your .env file to the existing database connection string.

Configure the webhook URL

Set the webhook URL on your GitHub Enterprise Server App to the MergeWatch host followed by /webhook:
You still need a TLS-terminated reverse proxy (nginx or Caddy) in front of port 3000 if your GitHub Enterprise Server requires HTTPS webhooks. See the VPS / Bare Metal guide for reverse proxy configuration.

Next steps

Configure review behavior

Tune sensitivity, ignored paths, and review focus areas.

Environment variables

Full list of supported environment variables.

VPS / Bare Metal guide

Reverse proxy and TLS setup for self-hosted servers.

Troubleshooting

Common issues and how to fix them.