AI Provider Setup
Zgit supports multiple AI providers for commit messages, PR generation, and other smart features.
Supported Providers
Section titled “Supported Providers”| Provider | Models | Auth |
|---|---|---|
| OpenAI | GPT-4o, GPT-4o-mini, o1, o3 | Bearer token |
| Anthropic | Claude 3.5 Sonnet, Claude 3 Opus | x-api-key header |
| Gemini | Gemini 1.5 Pro, Gemini 1.5 Flash | API key (query param) |
| DeepSeek | DeepSeek-V2, DeepSeek-Coder | Bearer token |
| Groq | Llama 3, Mixtral, Gemma | Bearer token |
| OpenRouter | 200+ models via unified API | Bearer token |
| Ollama | Any local model | No auth (localhost) |
Adding a Provider
Section titled “Adding a Provider”- Open Settings → AI
- Click Add Provider
- Select the provider from the dropdown
- Enter your API key
- Choose a model (fetch dynamically or type manually)
- Toggle Set as Active
Encrypted Key Storage
Section titled “Encrypted Key Storage”API keys are encrypted with AES-256-GCM before being saved to disk.
- Encryption key auto-generated at
~/.config/zgit/.ai_key_encryption(0600permissions) - Plaintext keys never sent to the frontend
- UI shows only masked previews:
sk-...abcd - Keys persist per-provider; delete via Clear button
Dynamic Model Fetching
Section titled “Dynamic Model Fetching”Each provider’s available models can be fetched live:
| Provider | Endpoint |
|---|---|
| OpenAI | GET https://api.openai.com/v1/models |
| Groq | GET https://api.groq.com/openai/v1/models |
| OpenRouter | GET https://openrouter.ai/api/v1/models |
| Ollama | GET http://localhost:11434/api/tags |
Fetched models appear as clickable chips. Select one or type a custom model ID.
Configuration File
Section titled “Configuration File”Keys are stored in ~/.config/zgit/config.yaml under:
ai: active_provider: openai providers: openai: api_key: <encrypted> model: gpt-4o endpoint: https://api.openai.com/v1Use zgit config set-ai --provider openai --model gpt-4o from the CLI.