Metadata-Version: 2.4
Name: git-gen-utils
Version: 0.0.1
Summary: Generate git commit message using fine-tuned LLM
Project-URL: Documentation, https://github.com/CyrusCKF/git-gen#readme
Project-URL: Issues, https://github.com/CyrusCKF/git-gen/issues
Project-URL: Source, https://github.com/CyrusCKF/git-gen
Author-email: Cheung Ka Fai <cyrus.cheungkf@gmail.com>, m19990328@gmail.com
License-Expression: MIT
License-File: LICENSE.txt
Keywords: LLM,git
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Requires-Dist: click>=8.1.8
Requires-Dist: huggingface-hub>=0.30.2
Requires-Dist: llama-cpp-python>=0.3.8
Requires-Dist: rich>=14.0.0
Description-Content-Type: text/markdown

# git-gen

[![PyPI - Version](https://img.shields.io/pypi/v/git-gen.svg)](https://pypi.org/project/git-gen)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/git-gen.svg)](https://pypi.org/project/git-gen)

Generate git commit message with a local LLM, which has been fine-tuned on 300K high-quality Python commits and is able to analyze the purposes of the changes

## Installation

Required Python 3.10+  
To install this package, run:

```shell
pip install git-gen
```

## Uses

To generate git commit message in current working directory, run:

```shell
git-gen
```

Generate with custom config:

```shell
git-gen --temperature 0.2 --top_k 50 --top_p 0.7
```

To get all command options, run:

```shell
git-gen -h
```

which should output

```plaintext
Usage:  [OPTIONS]

Options:
  --path PATH                 Path to the project, which should contain a '.git' folder. Default to current working directory.
  --max_tokens INTEGER RANGE  The maximum numbers of tokens to generate.  [default: 1024; x>=1]
  --temperature FLOAT RANGE   Control the overall probabilities of the generation. Prefer lower temperature for higher accuracy and higher temperature for
                              more varied outputs.  [default: 0.7; x>0]
  --top_k INTEGER RANGE       Limit the number of vocabs to consider.  [default: 20; x>=1]
  --top_p FLOAT RANGE         Limit the set of vocabs by cumulative probability.  [default: 0.8; 0<x<=1]
  -h, --help                  Show this message and exit.
```

## FAQ

There are a lot of similar projects. Why would I use this?

> A good commit message should reflect the purpose of the changes made concisely. Most LLMs failed to do that at zero-shot learning. This project aims to generate messages that focus on the "why"  instead of "what", by using a fine-tuned model on 300K high-quality Python commits.
>
> Moreover, it only uses local LLM. You code is safe from the internet.

## License

`git-gen` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.

## Notes

### Build and push project

```shell
python -m pip install --upgrade build
python -m build
python -m pip install --upgrade twine
python -m twine upload --repository pypi dist/* --verbose
```
