Skip to main content

No project description provided

Project description

Project logo

LLM Commit Generator

This blueprint guides you to easily generate AI-powered git commit messages based on your code changes. It uses local LLMs via Jan AI or Ollama to analyze git diffs and suggest concise, relevant commit messages.

📘 To explore this project further and discover other Blueprints, visit the Blueprints Hub.

👉 📖 For more detailed guidance on using this project, please visit our Docs here

Built with

  • Python 3.10+
  • Jan AI for a user-friendly local AI experience
  • Open-source LLMs via Ollama as an alternative
  • fzf for terminal UI

Quick-start

  1. Make sure you have Git, Python 3.10+, and pip installed

  2. Install the package:

    pip install llm-commit-generator
    
  3. Choose one of the following local inference options:

    Option 1: Jan AI (Default)

    • Install Jan AI and download a model (like Llama 3.1) through its interface
    • Start the Jan AI application and ensure it's running

    Option 2: Ollama

    • Install Ollama and pull a model:
    ollama pull llama3.1
    
  4. After adding your changes to your git repo, run:

    lcm
    

    For Ollama, use:

    lcm --ollama
    

How it Works

  1. The tool extracts your git diff (staged changes, or unstaged if no staged changes)
  2. Sends the diff to an AI model with a prompt to generate concise commit messages
  3. Presents you with message suggestions in a terminal UI using fzf
  4. After selecting a message, commits your changes with the selected message

Pre-requisites

  • System requirements:

    • OS: Windows, macOS, or Linux
    • Python 3.10 or higher
    • Git
    • fzf (for terminal UI)
    • Jan AI or Ollama for local inference
  • Dependencies:

    • Dependencies listed in pyproject.toml

Troubleshooting

  • If you get fzf: command not found, install fzf: fzf installation guide
  • For Jan AI issues, ensure the Jan AI application is running
  • For Ollama issues, ensure the Ollama service is running and your model is pulled

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

Contributing

Contributions are welcome! To get started, you can check out the CONTRIBUTING.md file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_commit_generator-0.1.3.tar.gz (283.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_commit_generator-0.1.3-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file llm_commit_generator-0.1.3.tar.gz.

File metadata

  • Download URL: llm_commit_generator-0.1.3.tar.gz
  • Upload date:
  • Size: 283.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for llm_commit_generator-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d12102e47812228b0e6e91a212fc0eb4f4cea86f54ade2069219b17dfc988df2
MD5 79a30470a6b02c07dbc914b672876de7
BLAKE2b-256 50affbf78831141e30ce9cf0af76a00907aab98d32c3371aa2695199d41145b7

See more details on using hashes here.

File details

Details for the file llm_commit_generator-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_commit_generator-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4f95cb07c70728844a8d4d785a609f8b766fb30b7662d577beeb1bbb10a12d08
MD5 76b8142d9cb731bff7ef42252a9ba781
BLAKE2b-256 91e437f155eec62d28bf5c878073d64fa00bca031c380cb1bd6d22a049a5c899

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page