Skip to content

Tetramatrix/diffron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Diffron

Git commit message and PR description generator using AMD Lemonade via lemonade-python-sdk.

Diffron is a production-ready reference implementation of the lemonade-python-sdk β€” submitted to the AMD Lemonade Developer Challenge 2026.

Version Python License Platform


Features

  • πŸ€– Auto Commit Messages - Generates Conventional Commits format messages from your staged changes
  • πŸ“ PR Descriptions - Creates detailed PR titles and descriptions from branch diffs
  • πŸ”Œ Lemonade Integration - Works with your local Lemonade LLM server (no cloud required)
  • πŸͺŸ Windows Ready - Fully compatible with GitHub Desktop 3.5.5+ hooks support
  • ⚑ Auto-Detection - Automatically finds your running Lemonade instance
  • 🎯 Model Flexible - Use any Lemonade-compatible model (default: qwen2.5-it-3b-FLM)

Quick Start

1. Install AMD Lemonade Server

Lemonade is AMD's local LLM server for Ryzen AI PCs.

  1. Download the installer from AMD Lemonade Releases
  2. Run Lemonade_Server_Installer.exe
  3. Launch Lemonade Server from the desktop shortcut
  4. Download a model via the Lemonade UI (e.g., qwen2.5-it-3b-FLM)

πŸ“š Documentation: AMD Ryzen AI - Lemonade Setup

2. Install lemonade-python-sdk

Our Python SDK for AMD Lemonade API:

pip install lemonade-sdk

πŸ”— Source: github.com/Tetramatrix/lemonade-python-sdk

3. Configure Environment

Set Lemonade Server URL (Permanent):

  1. System Properties β†’ Environment Variables
  2. New User Variable:
    • Name: LEMONADE_SERVER_URL
    • Value: http://localhost:8020

Or Temporary (current session):

set LEMONADE_SERVER_URL=http://localhost:8020

4. Install Diffron

pip install diffron

5. Install Git Hooks

python -c "from diffron.git_hooks import install_hooks; install_hooks(global_install=True)"

6. Test It

# Make a change
echo "test" > test.txt
git add test.txt

# Commit - hooks generate the message automatically!
git commit -m "anything"

Expected output:

[master abc123] feat: add test.txt file
 1 file changed, 1 insertion(+)

Installation

Requirements

Software Version Purpose
Python 3.9+ Runtime
Git 2.0+ Version control
GitHub Desktop 3.5.5+ Git GUI (Windows)
lemonade-sdk Latest AMD Lemonade API client
Lemonade Latest Local LLM server

Full Installation Guide

See docs/SETUP.md for detailed Windows-specific instructions.


Usage

CLI Commands

# Install hooks globally
python -c "from diffron.git_hooks import install_hooks; install_hooks(global_install=True)"

# Generate PR description
python -c "from diffron import generate_pr_description; pr = generate_pr_description(); print(pr.format_output())"

# Check status
python -c "from diffron import is_lemonade_running, is_hooks_installed; print('Lemonade:', is_lemonade_running()); print('Hooks:', is_hooks_installed(check_global=True))"

Python API

from diffron import DiffronClient

# Create client
client = DiffronClient()

# Generate commit message
msg = client.generate_commit_message()
print(msg)  # "feat: add user authentication"

# Generate PR description
pr = client.generate_pr_description(branch="feature/my-feature")
print(f"TITLE: {pr.title}")
print(f"DESCRIPTION: {pr.description}")

# Install hooks
client.install_hooks(global_install=True)

GitHub Desktop Workflow

  1. Make changes to your files
  2. Open GitHub Desktop
  3. Enter any commit message (e.g., "auto")
  4. Click "Commit to main"
  5. Diffron replaces your message with AI-generated message

Configuration

Environment Variables

Variable Default Description
LEMONADE_SERVER_URL http://localhost:8020 Lemonade server URL
DIFFRON_MODEL qwen2.5-it-3b-FLM Model name to use
DIFFRON_MAX_DIFF_CHARS 4000 Max diff characters

Change Model

# System-wide
setx DIFFRON_MODEL "qwen2.5-coder-7b"

# Current session
set DIFFRON_MODEL=qwen2.5-coder-7b

Python API

from diffron import DiffronClient

# Use different model
client = DiffronClient(model="your-model-name")

Documentation

Document Description
SETUP.md Complete installation guide for Windows
HOOKS.md Git hooks architecture and internals
USAGE.md Detailed usage examples

Related Projects

Tetramatrix Projects

Project Description
lemonade-python-sdk πŸ‹ AMD Lemonade Challenge Submission - Python SDK for AMD Lemonade API
Diffron Production-ready reference implementation using lemonade-python-sdk (this repo)
Aicono AI Assistant (Desktop App)
TabNeuron Browser Connector / Memory
Sorana Advanced AI Interface
RyzenZPilot Hardware Optimization

Note: Lemonade is AMD's local LLM server for Ryzen AI PCs. Diffron uses lemonade-python-sdk to communicate with Lemonade's API.

πŸ† AMD Lemonade Developer Challenge 2026: This project demonstrates the capabilities of lemonade-python-sdk as a real-world application built on AMD Lemonade.


How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 1. User makes changes and runs: git commit              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 2. Git hook executes prepare-commit-msg                 β”‚
β”‚    - Location: C:/Users/Name/.diffron-hooks/            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 3. Hook reads staged diff: git diff --cached            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 4. Hook calls Lemonade API                              β”‚
β”‚    - URL: http://localhost:8020/api/v1                  β”‚
β”‚    - Model: qwen2.5-it-3b-FLM                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 5. AI generates Conventional Commit message             β”‚
β”‚    - "feat: add user authentication module"             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 6. Git opens editor with generated message              β”‚
β”‚    - User can review/modify before saving               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Troubleshooting

Lemonade Not Detected

# Start Lemonade
lemonade serve qwen2.5-it-3b-FLM

# Verify URL
echo %LEMONADE_SERVER_URL%

Hooks Not Working

# Check GitHub Desktop version (must be 3.5.5+)
# Help β†’ About

# Verify hooks path
git config --global core.hooksPath

# Reinstall hooks
python -c "from diffron.git_hooks import install_hooks; install_hooks(global_install=True)"

Model Not Found (404)

# Download model
lemonade pull qwen2.5-it-3b-FLM

# Verify model name
set DIFFRON_MODEL=qwen2.5-it-3b-FLM

See docs/SETUP.md for complete troubleshooting guide.


License

MIT License - see LICENSE for details.


Contributing

Contributions welcome! This is an open source project.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests
  5. Submit a pull request

Development Setup

git clone https://github.com/diffron/diffron.git
cd diffron
pip install -e ".[dev]"

Run Tests

pytest tests/

Acknowledgments

  • Lemonade - Local LLM server by the Lemonade team
  • GitHub Desktop - Git GUI with hooks support (3.5.5+)
  • Conventional Commits - Commit message format specification

Version: 0.1.0 | Last updated: 2026-03-28

About

Diffron automatically generates commit messages and PR descriptions using your local Lemonade LLM server. It fits into the Tetramatrix ecosystem alongside Aicono, TabNeuron, Sorana, RyzenPilot and Lemonade-Python-SDK.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors