diffron 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- diffron-0.1.0/CHANGELOG.md +120 -0
- diffron-0.1.0/LICENSE +21 -0
- diffron-0.1.0/MANIFEST.in +19 -0
- diffron-0.1.0/PKG-INFO +373 -0
- diffron-0.1.0/README.md +330 -0
- diffron-0.1.0/diffron/__init__.py +26 -0
- diffron-0.1.0/diffron/__init__.pyi +28 -0
- diffron-0.1.0/diffron/cli.py +347 -0
- diffron-0.1.0/diffron/cli.pyi +30 -0
- diffron-0.1.0/diffron/client.py +175 -0
- diffron-0.1.0/diffron/client.pyi +80 -0
- diffron-0.1.0/diffron/commit_gen.py +151 -0
- diffron-0.1.0/diffron/commit_gen.pyi +41 -0
- diffron-0.1.0/diffron/git_hooks.py +292 -0
- diffron-0.1.0/diffron/git_hooks.pyi +52 -0
- diffron-0.1.0/diffron/lemonade.py +192 -0
- diffron-0.1.0/diffron/lemonade.pyi +66 -0
- diffron-0.1.0/diffron/pr_gen.py +224 -0
- diffron-0.1.0/diffron/pr_gen.pyi +56 -0
- diffron-0.1.0/diffron/py.typed +0 -0
- diffron-0.1.0/diffron/utils.py +236 -0
- diffron-0.1.0/diffron/utils.pyi +58 -0
- diffron-0.1.0/diffron.egg-info/PKG-INFO +373 -0
- diffron-0.1.0/diffron.egg-info/SOURCES.txt +41 -0
- diffron-0.1.0/diffron.egg-info/dependency_links.txt +1 -0
- diffron-0.1.0/diffron.egg-info/entry_points.txt +5 -0
- diffron-0.1.0/diffron.egg-info/requires.txt +12 -0
- diffron-0.1.0/diffron.egg-info/top_level.txt +5 -0
- diffron-0.1.0/docs/HOOKS.md +442 -0
- diffron-0.1.0/docs/PLAN.md +378 -0
- diffron-0.1.0/docs/PYPI_RELEASE.md +487 -0
- diffron-0.1.0/docs/SETUP.md +524 -0
- diffron-0.1.0/docs/USAGE.md +515 -0
- diffron-0.1.0/hooks/aipr.py +96 -0
- diffron-0.1.0/pyproject.toml +80 -0
- diffron-0.1.0/requirements.txt +2 -0
- diffron-0.1.0/setup.cfg +4 -0
- diffron-0.1.0/setup.py +64 -0
- diffron-0.1.0/tests/test_commit_gen.py +155 -0
- diffron-0.1.0/tests/test_git_hooks.py +162 -0
- diffron-0.1.0/tests/test_lemonade.py +117 -0
- diffron-0.1.0/tests/test_pr_gen.py +152 -0
- diffron-0.1.0/tests/test_utils.py +223 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Diffron will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## [Unreleased]
|
|
11
|
+
|
|
12
|
+
### Planned
|
|
13
|
+
- Pre-commit hook for linting suggestions
|
|
14
|
+
- Custom model selection per repository
|
|
15
|
+
- Multi-language commit message support
|
|
16
|
+
- Integration with GitHub CLI for auto PR creation
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## [0.1.0] - 2026-03-28
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
#### Core Features
|
|
25
|
+
- **Lemonade Integration**
|
|
26
|
+
- Auto-detection of Lemonade server via `LEMONADE_SERVER_URL` environment variable
|
|
27
|
+
- Fallback port scanning (8020, 8000, 8001, 8080, etc.)
|
|
28
|
+
- Support for custom model configuration via `DIFFRON_MODEL`
|
|
29
|
+
- Default model: `qwen2.5-it-3b-FLM`
|
|
30
|
+
- Uses `lemonade-python-sdk` for API communication
|
|
31
|
+
|
|
32
|
+
- **Git Hooks**
|
|
33
|
+
- `prepare-commit-msg` hook for automatic commit message generation
|
|
34
|
+
- Global installation (`~/.diffron-hooks`)
|
|
35
|
+
- Per-repository installation (`.git/hooks/`)
|
|
36
|
+
- Windows-compatible shell wrapper for GitHub Desktop 3.5.5+
|
|
37
|
+
- Smart skip logic for merges, rebases, and amend commits
|
|
38
|
+
- Silent failure when Lemonade is unavailable (doesn't block commits)
|
|
39
|
+
|
|
40
|
+
- **Commit Message Generation**
|
|
41
|
+
- Conventional Commits format enforcement
|
|
42
|
+
- Configurable diff size limit (default: 4000 characters)
|
|
43
|
+
- Temperature control for response creativity
|
|
44
|
+
- Automatic cleanup of quotes and markdown in responses
|
|
45
|
+
|
|
46
|
+
- **PR Description Generation**
|
|
47
|
+
- Branch diff analysis
|
|
48
|
+
- Commit log summarization
|
|
49
|
+
- TITLE + DESCRIPTION format output
|
|
50
|
+
- GitHub CLI integration for auto PR creation
|
|
51
|
+
|
|
52
|
+
- **Python API**
|
|
53
|
+
- `DiffronClient` class for unified interface
|
|
54
|
+
- `LemonadeClient` for direct Lemonade API access
|
|
55
|
+
- `generate_commit_message()` function
|
|
56
|
+
- `generate_pr_description()` function
|
|
57
|
+
- `install_hooks()` / `uninstall_hooks()` functions
|
|
58
|
+
- `is_hooks_installed()` verification
|
|
59
|
+
|
|
60
|
+
- **CLI Commands**
|
|
61
|
+
- `diffron-install-hooks` - Install Git hooks
|
|
62
|
+
- `diffron-uninstall-hooks` - Remove Git hooks
|
|
63
|
+
- `diffron-pr` - Generate PR description
|
|
64
|
+
- `diffron-status` - Check Lemonade and hooks status
|
|
65
|
+
|
|
66
|
+
#### Documentation
|
|
67
|
+
- `README.md` - Project overview and quick start
|
|
68
|
+
- `docs/SETUP.md` - Complete Windows installation guide
|
|
69
|
+
- `docs/HOOKS.md` - Git hooks architecture documentation
|
|
70
|
+
- `docs/USAGE.md` - Detailed usage examples
|
|
71
|
+
- `docs/PLAN.md` - Project roadmap and architecture
|
|
72
|
+
- `docs/PYPI_RELEASE.md` - PyPI release checklist
|
|
73
|
+
|
|
74
|
+
#### Testing
|
|
75
|
+
- Unit tests for `lemonade.py`
|
|
76
|
+
- Unit tests for `commit_gen.py`
|
|
77
|
+
- Unit tests for `pr_gen.py`
|
|
78
|
+
- Unit tests for `git_hooks.py`
|
|
79
|
+
- Unit tests for `utils.py`
|
|
80
|
+
|
|
81
|
+
#### Developer Experience
|
|
82
|
+
- Type hints throughout codebase (`.pyi` stub files)
|
|
83
|
+
- `pyproject.toml` configuration
|
|
84
|
+
- `pytest` test suite
|
|
85
|
+
- `black` and `isort` configuration
|
|
86
|
+
- `mypy` type checking configuration
|
|
87
|
+
|
|
88
|
+
### Technical Details
|
|
89
|
+
|
|
90
|
+
#### Dependencies
|
|
91
|
+
- `openai>=1.0.0` - Lemonade API client
|
|
92
|
+
- `psutil>=5.9.0` - Port scanning
|
|
93
|
+
|
|
94
|
+
#### Supported Platforms
|
|
95
|
+
- Windows 10/11 (primary target)
|
|
96
|
+
- GitHub Desktop 3.5.5+ (hooks support)
|
|
97
|
+
- Python 3.9, 3.10, 3.11, 3.12
|
|
98
|
+
|
|
99
|
+
#### Architecture
|
|
100
|
+
- Modular package structure
|
|
101
|
+
- Separation of concerns (lemonade, hooks, commit_gen, pr_gen)
|
|
102
|
+
- Environment variable configuration
|
|
103
|
+
- Graceful error handling
|
|
104
|
+
|
|
105
|
+
### Known Issues
|
|
106
|
+
- Model auto-detection via API not supported by Lemonade (uses default)
|
|
107
|
+
- Requires `LEMONADE_SERVER_URL` environment variable for reliable detection
|
|
108
|
+
- Global hooks require Git configuration (`core.hooksPath`)
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Version History
|
|
113
|
+
|
|
114
|
+
| Version | Date | Status |
|
|
115
|
+
|---------|------|--------|
|
|
116
|
+
| 0.1.0 | 2026-03-28 | Initial Release |
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
*Last updated: 2026-03-28*
|
diffron-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Diffron Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
include LICENSE
|
|
2
|
+
include README.md
|
|
3
|
+
include CHANGELOG.md
|
|
4
|
+
include requirements.txt
|
|
5
|
+
include pyproject.toml
|
|
6
|
+
|
|
7
|
+
recursive-include diffron *.py *.pyi py.typed
|
|
8
|
+
recursive-include docs *.md
|
|
9
|
+
recursive-include hooks *.py
|
|
10
|
+
|
|
11
|
+
exclude tests
|
|
12
|
+
exclude hooks/prepare-commit-msg
|
|
13
|
+
exclude hooks/prepare-commit-msg-global.py
|
|
14
|
+
exclude hooks/prepare-commit-msg.py
|
|
15
|
+
exclude *.bat
|
|
16
|
+
exclude *.code-workspace
|
|
17
|
+
exclude sync-*.txt
|
|
18
|
+
exclude .gitignore
|
|
19
|
+
exclude .sorana
|
diffron-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: diffron
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Git commit message and PR description generator using Lemonade
|
|
5
|
+
Home-page: https://github.com/diffron/diffron
|
|
6
|
+
Author: Diffron Contributors
|
|
7
|
+
Author-email: Diffron Contributors <diffron@example.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/diffron/diffron
|
|
10
|
+
Project-URL: Documentation, https://github.com/diffron/diffron/docs
|
|
11
|
+
Project-URL: Repository, https://github.com/diffron/diffron
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
17
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
18
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
26
|
+
Requires-Python: >=3.9
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Requires-Dist: openai>=1.0.0
|
|
30
|
+
Requires-Dist: psutil>=5.9.0
|
|
31
|
+
Provides-Extra: git
|
|
32
|
+
Requires-Dist: gitpython>=3.1.0; extra == "git"
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
36
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
37
|
+
Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
38
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
39
|
+
Dynamic: author
|
|
40
|
+
Dynamic: home-page
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
Dynamic: requires-python
|
|
43
|
+
|
|
44
|
+
# Diffron
|
|
45
|
+
|
|
46
|
+
Git commit message and PR description generator using AMD Lemonade via lemonade-python-sdk.
|
|
47
|
+
|
|
48
|
+
**This is a demo project showcasing the lemonade-python-sdk - submitted to the AMD Lemonade Developer Challenge 2026.**
|
|
49
|
+
|
|
50
|
+

|
|
51
|
+

|
|
52
|
+

|
|
53
|
+

|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Features
|
|
58
|
+
|
|
59
|
+
- 🤖 **Auto Commit Messages** - Generates Conventional Commits format messages from your staged changes
|
|
60
|
+
- 📝 **PR Descriptions** - Creates detailed PR titles and descriptions from branch diffs
|
|
61
|
+
- 🔌 **Lemonade Integration** - Works with your local Lemonade LLM server (no cloud required)
|
|
62
|
+
- 🪟 **Windows Ready** - Fully compatible with GitHub Desktop 3.5.5+ hooks support
|
|
63
|
+
- ⚡ **Auto-Detection** - Automatically finds your running Lemonade instance
|
|
64
|
+
- 🎯 **Model Flexible** - Use any Lemonade-compatible model (default: qwen2.5-it-3b-FLM)
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Quick Start
|
|
69
|
+
|
|
70
|
+
### 1. Install AMD Lemonade Server
|
|
71
|
+
|
|
72
|
+
**Lemonade is AMD's local LLM server for Ryzen AI PCs.**
|
|
73
|
+
|
|
74
|
+
1. Download the installer from [AMD Lemonade Releases](https://github.com/AMD-AI-Software/lemonade/releases)
|
|
75
|
+
2. Run `Lemonade_Server_Installer.exe`
|
|
76
|
+
3. Launch Lemonade Server from the desktop shortcut
|
|
77
|
+
4. Download a model via the Lemonade UI (e.g., `qwen2.5-it-3b-FLM`)
|
|
78
|
+
|
|
79
|
+
📚 **Documentation:** [AMD Ryzen AI - Lemonade Setup](https://ryzenai.docs.amd.com/en/latest/llm/server_interface.html)
|
|
80
|
+
|
|
81
|
+
### 2. Install lemonade-python-sdk
|
|
82
|
+
|
|
83
|
+
**Our Python SDK for AMD Lemonade API:**
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pip install lemonade-sdk
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
🔗 **Source:** [github.com/Tetramatrix/lemonade-python-sdk](https://github.com/Tetramatrix/lemonade-python-sdk)
|
|
90
|
+
|
|
91
|
+
### 3. Configure Environment
|
|
92
|
+
|
|
93
|
+
**Set Lemonade Server URL (Permanent):**
|
|
94
|
+
1. System Properties → Environment Variables
|
|
95
|
+
2. New User Variable:
|
|
96
|
+
- Name: `LEMONADE_SERVER_URL`
|
|
97
|
+
- Value: `http://localhost:8020`
|
|
98
|
+
|
|
99
|
+
**Or Temporary (current session):**
|
|
100
|
+
```cmd
|
|
101
|
+
set LEMONADE_SERVER_URL=http://localhost:8020
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 4. Install Diffron
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
pip install diffron
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 5. Install Git Hooks
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
python -c "from diffron.git_hooks import install_hooks; install_hooks(global_install=True)"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 6. Test It
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Make a change
|
|
120
|
+
echo "test" > test.txt
|
|
121
|
+
git add test.txt
|
|
122
|
+
|
|
123
|
+
# Commit - hooks generate the message automatically!
|
|
124
|
+
git commit -m "anything"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Expected output:
|
|
128
|
+
```
|
|
129
|
+
[master abc123] feat: add test.txt file
|
|
130
|
+
1 file changed, 1 insertion(+)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Installation
|
|
136
|
+
|
|
137
|
+
### Requirements
|
|
138
|
+
|
|
139
|
+
| Software | Version | Purpose |
|
|
140
|
+
|----------|---------|---------|
|
|
141
|
+
| Python | 3.9+ | Runtime |
|
|
142
|
+
| Git | 2.0+ | Version control |
|
|
143
|
+
| GitHub Desktop | 3.5.5+ | Git GUI (Windows) |
|
|
144
|
+
| lemonade-sdk | Latest | AMD Lemonade API client |
|
|
145
|
+
| Lemonade | Latest | Local LLM server |
|
|
146
|
+
|
|
147
|
+
### Full Installation Guide
|
|
148
|
+
|
|
149
|
+
See [docs/SETUP.md](docs/SETUP.md) for detailed Windows-specific instructions.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Usage
|
|
154
|
+
|
|
155
|
+
### CLI Commands
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Install hooks globally
|
|
159
|
+
python -c "from diffron.git_hooks import install_hooks; install_hooks(global_install=True)"
|
|
160
|
+
|
|
161
|
+
# Generate PR description
|
|
162
|
+
python -c "from diffron import generate_pr_description; pr = generate_pr_description(); print(pr.format_output())"
|
|
163
|
+
|
|
164
|
+
# Check status
|
|
165
|
+
python -c "from diffron import is_lemonade_running, is_hooks_installed; print('Lemonade:', is_lemonade_running()); print('Hooks:', is_hooks_installed(check_global=True))"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Python API
|
|
169
|
+
|
|
170
|
+
```python
|
|
171
|
+
from diffron import DiffronClient
|
|
172
|
+
|
|
173
|
+
# Create client
|
|
174
|
+
client = DiffronClient()
|
|
175
|
+
|
|
176
|
+
# Generate commit message
|
|
177
|
+
msg = client.generate_commit_message()
|
|
178
|
+
print(msg) # "feat: add user authentication"
|
|
179
|
+
|
|
180
|
+
# Generate PR description
|
|
181
|
+
pr = client.generate_pr_description(branch="feature/my-feature")
|
|
182
|
+
print(f"TITLE: {pr.title}")
|
|
183
|
+
print(f"DESCRIPTION: {pr.description}")
|
|
184
|
+
|
|
185
|
+
# Install hooks
|
|
186
|
+
client.install_hooks(global_install=True)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### GitHub Desktop Workflow
|
|
190
|
+
|
|
191
|
+
1. Make changes to your files
|
|
192
|
+
2. Open GitHub Desktop
|
|
193
|
+
3. Enter any commit message (e.g., "auto")
|
|
194
|
+
4. Click "Commit to main"
|
|
195
|
+
5. **Diffron replaces** your message with AI-generated message
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Configuration
|
|
200
|
+
|
|
201
|
+
### Environment Variables
|
|
202
|
+
|
|
203
|
+
| Variable | Default | Description |
|
|
204
|
+
|----------|---------|-------------|
|
|
205
|
+
| `LEMONADE_SERVER_URL` | `http://localhost:8020` | Lemonade server URL |
|
|
206
|
+
| `DIFFRON_MODEL` | `qwen2.5-it-3b-FLM` | Model name to use |
|
|
207
|
+
| `DIFFRON_MAX_DIFF_CHARS` | `4000` | Max diff characters |
|
|
208
|
+
|
|
209
|
+
### Change Model
|
|
210
|
+
|
|
211
|
+
```cmd
|
|
212
|
+
# System-wide
|
|
213
|
+
setx DIFFRON_MODEL "qwen2.5-coder-7b"
|
|
214
|
+
|
|
215
|
+
# Current session
|
|
216
|
+
set DIFFRON_MODEL=qwen2.5-coder-7b
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Python API
|
|
220
|
+
|
|
221
|
+
```python
|
|
222
|
+
from diffron import DiffronClient
|
|
223
|
+
|
|
224
|
+
# Use different model
|
|
225
|
+
client = DiffronClient(model="your-model-name")
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Documentation
|
|
231
|
+
|
|
232
|
+
| Document | Description |
|
|
233
|
+
|----------|-------------|
|
|
234
|
+
| [SETUP.md](docs/SETUP.md) | Complete installation guide for Windows |
|
|
235
|
+
| [HOOKS.md](docs/HOOKS.md) | Git hooks architecture and internals |
|
|
236
|
+
| [USAGE.md](docs/USAGE.md) | Detailed usage examples |
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Related Projects
|
|
241
|
+
|
|
242
|
+
### Tetramatrix Projects
|
|
243
|
+
|
|
244
|
+
| Project | Description |
|
|
245
|
+
|---------|-------------|
|
|
246
|
+
| **lemonade-python-sdk** | 🍋 **AMD Lemonade Challenge Submission** - Python SDK for AMD Lemonade API |
|
|
247
|
+
| **Diffron** | Demo project showcasing lemonade-python-sdk (this repo) |
|
|
248
|
+
| **Aicono** | AI Assistant (Desktop App) |
|
|
249
|
+
| **TabNeuron** | Browser Connector / Memory |
|
|
250
|
+
| **Sorana** | Advanced AI Interface |
|
|
251
|
+
| **RyzenPilot** | Hardware Optimization |
|
|
252
|
+
|
|
253
|
+
**Note:** Lemonade is AMD's local LLM server for Ryzen AI PCs. Diffron uses `lemonade-python-sdk` to communicate with Lemonade's API.
|
|
254
|
+
|
|
255
|
+
🏆 **AMD Lemonade Developer Challenge 2026:** This project demonstrates the capabilities of lemonade-python-sdk as a real-world application built on AMD Lemonade.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## How It Works
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
┌─────────────────────────────────────────────────────────┐
|
|
263
|
+
│ 1. User makes changes and runs: git commit │
|
|
264
|
+
└─────────────────────────────────────────────────────────┘
|
|
265
|
+
↓
|
|
266
|
+
┌─────────────────────────────────────────────────────────┐
|
|
267
|
+
│ 2. Git hook executes prepare-commit-msg │
|
|
268
|
+
│ - Location: C:/Users/Name/.diffron-hooks/ │
|
|
269
|
+
└─────────────────────────────────────────────────────────┘
|
|
270
|
+
↓
|
|
271
|
+
┌─────────────────────────────────────────────────────────┐
|
|
272
|
+
│ 3. Hook reads staged diff: git diff --cached │
|
|
273
|
+
└─────────────────────────────────────────────────────────┘
|
|
274
|
+
↓
|
|
275
|
+
┌─────────────────────────────────────────────────────────┐
|
|
276
|
+
│ 4. Hook calls Lemonade API │
|
|
277
|
+
│ - URL: http://localhost:8020/api/v1 │
|
|
278
|
+
│ - Model: qwen2.5-it-3b-FLM │
|
|
279
|
+
└─────────────────────────────────────────────────────────┘
|
|
280
|
+
↓
|
|
281
|
+
┌─────────────────────────────────────────────────────────┐
|
|
282
|
+
│ 5. AI generates Conventional Commit message │
|
|
283
|
+
│ - "feat: add user authentication module" │
|
|
284
|
+
└─────────────────────────────────────────────────────────┘
|
|
285
|
+
↓
|
|
286
|
+
┌─────────────────────────────────────────────────────────┐
|
|
287
|
+
│ 6. Git opens editor with generated message │
|
|
288
|
+
│ - User can review/modify before saving │
|
|
289
|
+
└─────────────────────────────────────────────────────────┘
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## Troubleshooting
|
|
295
|
+
|
|
296
|
+
### Lemonade Not Detected
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
# Start Lemonade
|
|
300
|
+
lemonade serve qwen2.5-it-3b-FLM
|
|
301
|
+
|
|
302
|
+
# Verify URL
|
|
303
|
+
echo %LEMONADE_SERVER_URL%
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Hooks Not Working
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
# Check GitHub Desktop version (must be 3.5.5+)
|
|
310
|
+
# Help → About
|
|
311
|
+
|
|
312
|
+
# Verify hooks path
|
|
313
|
+
git config --global core.hooksPath
|
|
314
|
+
|
|
315
|
+
# Reinstall hooks
|
|
316
|
+
python -c "from diffron.git_hooks import install_hooks; install_hooks(global_install=True)"
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Model Not Found (404)
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
# Download model
|
|
323
|
+
lemonade pull qwen2.5-it-3b-FLM
|
|
324
|
+
|
|
325
|
+
# Verify model name
|
|
326
|
+
set DIFFRON_MODEL=qwen2.5-it-3b-FLM
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
See [docs/SETUP.md](docs/SETUP.md) for complete troubleshooting guide.
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## License
|
|
334
|
+
|
|
335
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## Contributing
|
|
340
|
+
|
|
341
|
+
Contributions welcome! This is an open source project.
|
|
342
|
+
|
|
343
|
+
1. Fork the repository
|
|
344
|
+
2. Create a feature branch
|
|
345
|
+
3. Make your changes
|
|
346
|
+
4. Run tests
|
|
347
|
+
5. Submit a pull request
|
|
348
|
+
|
|
349
|
+
### Development Setup
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
git clone https://github.com/diffron/diffron.git
|
|
353
|
+
cd diffron
|
|
354
|
+
pip install -e ".[dev]"
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Run Tests
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
pytest tests/
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
## Acknowledgments
|
|
366
|
+
|
|
367
|
+
- **Lemonade** - Local LLM server by the Lemonade team
|
|
368
|
+
- **GitHub Desktop** - Git GUI with hooks support (3.5.5+)
|
|
369
|
+
- **Conventional Commits** - Commit message format specification
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
*Version: 0.1.0 | Last updated: 2026-03-28*
|