AI providers

OpenAI, Anthropic, Ollama or fully offline: set up your keys.

gitmit supports four providers:

ProviderNeedsData leaves your machineDefault model
openaiOPENAI_API_KEYYes, after the secret scangpt-5-mini
anthropicANTHROPIC_API_KEYYes, after the secret scanclaude-opus-5-5
ollamaOllama running locallyNo (unless OLLAMA_HOST points to another machine)llama3.2
rulesNothingNoNo model; template messages

Adding an API key

Put keys in your personal gitmit file, which lives outside every repository so it can never be committed by accident:

SystemFile
macOS and Linux~/.config/gitmit/.env (or $XDG_CONFIG_HOME/gitmit/.env)
Windows%APPDATA%\gitmit\.env
mkdir -p ~/.config/gitmit
echo 'OPENAI_API_KEY=sk-...' >> ~/.config/gitmit/.env

The file can hold any of these:

OPENAI_API_KEY=
OPENAI_MODEL=           # optional, default gpt-5-mini
ANTHROPIC_API_KEY=
ANTHROPIC_MODEL=        # optional, default claude-opus-5-5
OLLAMA_HOST=            # optional, default http://localhost:11434
OLLAMA_MODEL=           # optional, default llama3.2

Environment variables with the same names work too, and take priority over the file.

Which provider is used

  1. --provider on the command line, if given.
  2. provider in your gitmit config, if set.
  3. Otherwise, the first provider with a key: OpenAI, then Anthropic.
  4. Otherwise, the offline rules provider.

Run gitmit config at any time to see which provider and model will be used.

Using Ollama (local models)

ollama pull llama3.2
gitmit --provider ollama

Or set "provider": "ollama" in your config. Nothing leaves your machine, so no secret scan is needed. If OLLAMA_HOST points to another machine, gitmit treats it as remote and scans first.