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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for llm_commit_generator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a62b9b3c7a32dd8ef69a9832cbfac83fff37dcd1513734c167b7a23cf152fd1
MD5 293ec12e6f4d7c7668f03ce271ef4373
BLAKE2b-256 b0d51de0cfa4229c192eb5b9a2a61985fd0c666250d44e39df02b55ac9d77db1

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