You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-1Lines changed: 45 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ A lightweight CLI tool that analyzes your staged changes and generates professio
12
12
13
13
## Features
14
14
15
+
-**Hybrid Intelligence** - Merges deterministic heuristic algorithms with deep semantic understanding via Local LLMs
16
+
-**Local AI Integration (Ollama)** - Seamlessly integrates with Ollama to generate context-rich commit messages offline
15
17
-**Intelligent Analysis** - Analyzes git status and diff to understand your changes using advanced pattern detection
16
18
-**Conventional Commits** - Follows the Conventional Commits specification for standardized messages
17
19
-**Configuration Hierarchy** - Local (`.gitmit.json`) → Global (`~/.gitmit.json`) → Default (Embedded) config support
@@ -30,10 +32,46 @@ A lightweight CLI tool that analyzes your staged changes and generates professio
30
32
-**Pattern Detection** - Detects error handling, tests, API changes, database operations, and more
31
33
-**Multiple Commit Types** - Supports feat, fix, refactor, chore, test, docs, style, perf, ci, build, security, and more
32
34
-**Zero Configuration** - Works out of the box with sensible defaults
33
-
-**Offline First** - Complete offline operation, no AI or external dependencies required
35
+
-**Hybrid Offline Approach** - Operates completely locally; chooses between heuristic rules or local AI
34
36
-**History Tracking** - Learns from your commit history to avoid repetitive suggestions
35
37
36
38
39
+
## Hybrid Intelligence: Local AI via Ollama
40
+
41
+
Gitmit evolves from a rule-based utility into a **Hybrid Intelligence** tool by integrating with **Ollama**. This allows you to use powerful local LLMs (like Qwen2.5-Coder) to generate highly descriptive and contextually accurate commit messages without sacrificing privacy or performance.
42
+
43
+
### Prerequisites
44
+
45
+
1.**Install Ollama**: Download from [ollama.com](https://ollama.com)
46
+
2.**Pull the Model**:
47
+
```bash
48
+
ollama pull qwen2.5-coder:3b
49
+
```
50
+
51
+
### Enabling the AI Engine
52
+
53
+
To switch from the default heuristic engine to the AI engine, update your `.gitmit.json`:
54
+
55
+
```json
56
+
{
57
+
"engine": "ollama",
58
+
"ollama": {
59
+
"model": "qwen2.5-coder:3b",
60
+
"url": "http://localhost:11434",
61
+
"temperature": 0.2
62
+
}
63
+
}
64
+
```
65
+
66
+
### How the Hybrid Pipeline Works
67
+
68
+
Gitmit uses a tiered approach to ensure you always get a high-quality suggestion:
69
+
70
+
1. **Refined Context Engineering**: Instead of piping raw diffs, Gitmit extracts structured metadata (modified files, symbols, change ratios, project type) and feeds it into a strict system prompt.
71
+
2. **Local LLM Processing**: Ollama processes the context using your specified model to generate a precise Conventional Commit message.
72
+
3. **Deterministic Fallback**: If the Ollama daemon is unreachable, the model is missing, or the output is malformatted, Gitmit **instantly falls back** to the Phase 1 Heuristic engine. Your workflow remains uninterrupted.
73
+
74
+
37
75
## Installation
38
76
39
77
### From Releases
@@ -237,6 +275,12 @@ Gitmit uses intelligent offline algorithms to analyze your changes:
237
275
- Special case detection
238
276
- Diversity algorithms for variations
239
277
278
+
11. **Local AI Generation (Optional)** - When enabled:
279
+
- Serializes extracted context into a structured LLM prompt
280
+
- Dispatches generation requests to local Ollama daemon
281
+
- Validates AI output against Conventional Commit standards
282
+
- Provides deterministic fallback to heuristic engine on error
283
+
240
284
## Commit Types
241
285
242
286
Gitmit supports the following commit types (automatically detected):
0 commit comments