Skip to main content

A brief description of your project.

Project description

Commit Pilot

Table of Contents

Description

Commit Pilot is a command-line tool that uses Large Language Models (LLMs) to automatically generate git commit messages from your staged changes. It streamlines the commit process by providing well-formatted, context-aware messages, which you can then accept, edit, or regenerate on the fly.

Features

  • AI-Powered Commit Messages: Automatically generates descriptive commit messages from your code diffs.
  • Interactive Workflow: Allows you to accept, edit, regenerate, or change models before committing.
  • Multiple Backends: Supports both Ollama and VLLM for running local LLMs.
  • Configurable Models: Easily configure which model to use and its generation parameters.
  • Automatic Server Management: Can automatically start and stop the vLLM server to manage resources.

Installation

Prerequisites

  • Python 3.10
  • Git
  • Docker and Docker Compose (for the Ollama backend)

1. Backend Setup

You must have a model backend running. Choose one of the following:

Ollama Backend

  1. Start the Server: Use Docker Compose to launch the Ollama server.
    docker-compose up -d
    
  2. Pull Models: docker-compose will automatically execute pull_ollama_model.sh to download the default models.

VLLM Backend

For the VLLM backend, you must manually download model weights from Hugging Face. The application will automatically start and stop the VLLM server as needed.

  • where to put the model weights:
    • You can put the model weights in ./src/commit_pilot/model_weights/
    • Or specify a different path in ~/.config/commit_pilot/job.conf under the key vllm_model_weights_root_dir.
      • You can create this config file by copying src/commit_pilot/conf/job.conf to ~/.config/commit_pilot/job.conf and modifying it as needed.

(For more details on backend setup, see the README in src/commit_pilot/conf/)

2. Install the Package

Clone the repository and use pip to install the package in editable mode.

git clone <repository-url>
cd commit_pilot
pip install -e .

Usage

Once installed, simply run the commit-pilot command in your git repository after staging your changes (git add .).

commit-pilot

This will start an interactive session where the tool generates a commit message and prompts you for action:

  • (y)es: Accept the message and commit.
  • (n)o: Abort the commit.
  • (s)how: Show the staged diff and the generated message again.
  • (r)egenerate: Generate a new commit message.
  • (m)odel: Change the LLM used for generation.
  • (e)dit: Manually edit the commit message in your default text editor.

Configuration

The behavior of Commit Pilot is controlled by two configuration files located in src/commit_pilot/conf/:

  • job.conf: Defines runtime settings, such as the currently active model, server timeouts, and resource limits (e.g., GPU utilization for VLLM).
  • model.conf: Acts as a catalog for all available models, defining their connection details, backend type (Ollama, VLLM, or third-party), and default generation parameters.

For detailed information, please refer to the Readme.md inside the src/commit_pilot/conf/ directory.

License

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

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

commit_bot-1.0.1rc1.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

commit_bot-1.0.1rc1-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file commit_bot-1.0.1rc1.tar.gz.

File metadata

  • Download URL: commit_bot-1.0.1rc1.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for commit_bot-1.0.1rc1.tar.gz
Algorithm Hash digest
SHA256 0064da0ca5b95af9f4b39bf284b272fd0b7e4eeca4a262f753478b596fe4d2a8
MD5 a0a16db1837034cbd64b05e275651b92
BLAKE2b-256 c50dd14885e3a51ef7d12b10c3a768ea8acfab2c151e8eb9ddb598d4f875d918

See more details on using hashes here.

File details

Details for the file commit_bot-1.0.1rc1-py3-none-any.whl.

File metadata

  • Download URL: commit_bot-1.0.1rc1-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for commit_bot-1.0.1rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 036417f066f9ff6aa5394214df1b4a7a76dbab8e34b652b4b9b4966122abdf31
MD5 b300fcf1351892eaaf1586827a18db37
BLAKE2b-256 88a5b426130b396e55fbc78caa07268ac5c196b1bb07cf6a045f805cfe29ad98

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