Teaching Small LLMs to Write Git Commits
Collection
Dataset + LoRA adapters for fine-tuning small LLMs to write Conventional Commits from a git diff. Part of a local, offline commit-message tool. β’ 7 items β’ Updated
Run Elib27/llama-3.2-1b-commit-msg-lora on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/Elib27/llama-3.2-1b-commit-msg-lora. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/Elib27/llama-3.2-1b-commit-msg-lora on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use Elib27/llama-3.2-1b-commit-msg-lora with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("unsloth/Llama-3.2-1B-Instruct")
model = PeftModel.from_pretrained(base_model, "Elib27/llama-3.2-1b-commit-msg-lora")LoRA adapter fine-tuned on top of meta-llama/Llama-3.2-1B-Instruct
to generate Conventional Commits messages from a git diff.
Part of a project to build a local, offline prepare-commit-msg git hook.
Full write-up: https://eliotbas.com/projects/commits-fine-tuning/
Training dataset: https://huggingface.co/datasets/Elib27/commits
See the article for full evaluation results (ROUGE-L, structural checks, LLM-as-judge) across all model sizes.
Base model
meta-llama/Llama-3.2-1B-Instruct