AI providers
OpenAI, Anthropic, Ollama or fully offline: set up your keys.
gitmit supports four providers:
| Provider | Needs | Data leaves your machine | Default model |
|---|---|---|---|
openai | OPENAI_API_KEY | Yes, after the secret scan | gpt-5-mini |
anthropic | ANTHROPIC_API_KEY | Yes, after the secret scan | claude-opus-5-5 |
ollama | Ollama running locally | No (unless OLLAMA_HOST points to another machine) | llama3.2 |
rules | Nothing | No | No 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:
| System | File |
|---|---|
| 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
--provideron the command line, if given.providerin your gitmit config, if set.- Otherwise, the first provider with a key: OpenAI, then Anthropic.
- Otherwise, the offline
rulesprovider.
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.