Skip to content

Getting Started with lgtmaybe

This tutorial walks you through your first review using ollama — a fully local model that costs nothing and needs no API keys. By the end you will have reviewed a branch and seen the findings in your terminal, with no GitHub token and no pull request required.

What you need

  • Python 3.12 or later
  • ollama running locally
  • A local git repository with some changes on a branch to review

Step 1 — Install lgtmaybe

pip install lgtmaybe

Verify the install:

lgtmaybe --version

Step 2 — Start ollama and pull a model

ollama serve          # starts the local server on http://localhost:11434
ollama pull qwen3.6:27b    # or any model you prefer

Leave ollama serve running in a separate terminal.

Step 3 — Review your changes

From inside a git repo, on a branch with some changes, run:

lgtmaybe review \
  --provider ollama \
  --model qwen3.6:27b \
  --api-base http://localhost:11434

lgtmaybe diffs your current branch against the default branch, sends the changed lines to your local qwen3.6:27b instance, and prints the findings to your terminal:

src/app.py:2  [MEDIUM] Import order
  sys should be sorted before os

1 finding · model qwen3.6:27b

To review only your uncommitted edits, add --working; to diff against a different base, pass --base main.

Step 4 — Change the output format

--format controls what review prints. --json (shorthand for --format json) emits a JSON array ready to pipe into other tooling:

lgtmaybe review --provider ollama --model qwen3.6:27b \
  --api-base http://localhost:11434 --json

--format agent instead prints the findings as correction instructions an AI coding agent can read and apply, for a local review-and-fix loop — see Fix findings with an AI agent.

Step 5 — Post reviews on real pull requests

The CLI reviews local changes. To run lgtmaybe on actual pull requests — inline comments and a summary posted back to GitHub — add the GitHub Action to your repo. See Use as a GitHub Action.

What happened under the hood

lgtmaybe ran its pipeline over your local diff:

  1. fetch — read the diff from your local repo with git diff
  2. compress — stripped generated files, binaries, and lockfiles
  3. prompt — built a structured prompt asking for JSON output
  4. parse — validated the model's JSON against the ReviewFinding schema
  5. render — printed the findings (the Action posts them to the PR instead)

Next steps