hpware commit-message model ยท 223M

Experimental fine-tune of Salesforce/codet5-base to suggest commit messages in hpware's casual style from a code diff and historical project context. Prepared for hpware with OpenAI Codex, using the Colab CLI on a Tesla T4, on 2026-11-29.

This is a 222,882,048-parameter encoder-decoder model, not a chat assistant. It sometimes describes concrete code changes and sometimes produces vague messages. Review every suggestion before committing.

Input and output

The encoder receives a repository name, project context, and actual code diff. The decoder generates one commit message. Project context includes README/package metadata and root file entries from the relevant commit's revision; selected examples also include surrounding source excerpts. Training uses post-commit project snapshots paired with the diff describing the change.

The shared prompt.py reserves about 450 tokenizer tokens for project context and 1,100 for the diff. Oversized inputs retain beginning/end excerpts. Targets are original commit messages capped at 112 tokens, including tokenizer special tokens. The model does not see the entire repository.

Usage

Download the repository, including infer.py and prompt.py:

uv run --with huggingface-hub hf download yuanhau/commit-message --local-dir ./hpware-commit-model

git -C /path/to/project diff --cached > /tmp/staged.diff
uv run --with 'transformers==4.57.1' --with torch \
  ./hpware-commit-model/infer.py ./hpware-commit-model /tmp/staged.diff \
  --repo your-project --repo-path /path/to/project

The inference script reads local README/package metadata and a staged source excerpt, then prints a suggestion. It does not create a commit. AutoTokenizer and AutoModelForSeq2SeqLM can also load this repository normally; use the matching prompt construction for useful inputs.

Data and filtering

  • 930 retained examples across 62 public hpware GitHub repositories.
  • 813 training examples and 117 held-out examples.
  • Includes 50 manually shortlisted 2026 commits: 40 training and 10 held out.
  • Older candidates were examined without the earlier random-1,000 sampling limit. Large changes were excerpted instead of rejected wholesale.
  • Explicit AI attribution, list-style messages, bot/merge/root commits, boilerplate, ambiguous generated-looking templates, uninformative messages, credential-pattern patches, lockfiles, and binary changes were filtered.
  • Exact target-message and patch identities are disjoint across the final partitions. Prior held-out identities remain reserved when eligible; additional older and 2026 examples are held out.
  • All retained examples have historical project/root context; 839 include README content and 194 include an additional source excerpt.

The author said commits before 2026 were mostly his. That date guidance and manual style screening do not establish human authorship of every unmarked message. AI-generated code/documentation or unmarked AI-written messages may remain. The filter applies to this fine-tuning dataset, not the base model's original pretraining data.

The raw training dataset, code patches, and full commit inventory are not distributed in this model repository. Local audit files were retained for the owner. The evaluation files include a small set of public source-commit identifiers and reference/generated messages.

Training

Full supervised fine-tuning with original commit messages as decoder targets; no generated or rewritten target messages were added.

Setting Value
Base Salesforce/codet5-base
Parameters 222,882,048
Optimizer AdamW, learning rate 5e-5, weight decay 0.01
Batch / accumulation 1 / 16
Epochs 3; epoch 3 selected by held-out loss
Precision FP16 training with FP32 overflow fallback; FP16 checkpoint
Hardware Tesla T4 on Google Colab
Libraries PyTorch 2.14.1+cu130, Transformers 4.57.1
Input / target tokens per pass 930,708 / 12,377

Source scripts are included. The original local training JSONL files are required to replay training.

Evaluation

Held-out original-message token loss, within this tokenizer/setup:

Checkpoint Loss
Base 9.9460
Epoch 1 4.1286
Epoch 2 3.9716
Epoch 3 3.9599

FP32 assessment scored 3.9599 with correct context and 4.5280 with shuffled code/project context. This indicates some sensitivity to paired context; it does not establish factual accuracy.

A small held-out sample included:

Repository/change Generated message
log: added deletion actions Add delete post action
go_http_service: added websocket message handling Add sendMSG function to websocket server
log: account/tag changes Fix some stuff.
anonqa: logout link changes yeah this works now

The first two descriptions were checked against the actual added code. The latter two illustrate weak specificity. No aggregate accuracy or style score was established. Similar code and related changes can occur across repositories even after exact deduplication; repository-wide generalization has not been demonstrated.

Standalone inference against the exported checkpoint passed. See metrics.json, assessment.json, and RESULTS.md for details. A preceding general-text Pythia experiment collapsed to a generic message and was superseded by this code-focused model.

Limitations

Outputs can be vague, inaccurate, repetitive, or stylistically unlike hpware. Excerpts can omit the important part of a large change. Some original reference messages are themselves vague or describe a broken state, which limits the supervision available for accurate summaries. This model is an experiment and should not autonomously create or publish commits.

Attribution and license

Fine-tuned from Salesforce/codet5-base, whose Hub metadata lists Apache-2.0. The original CodeT5 repository distributes its code and model documentation under BSD-3-Clause; its notice is retained in UPSTREAM_LICENSE_BSD.txt. See LICENSE and NOTICE for attribution and upstream notices. No license to the underlying GitHub source-code dataset is granted by this model repository.

CodeT5: Yue Wang, Weishi Wang, Shafiq Joty, and Steven C. H. Hoi, CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation (2021), paper, upstream repository.

GGUF downloads

FP16, Q8_0, Q4_K_M, Q2_K, and Q1_0 conversions are available at yuanhau/commit-messages-gguf. They require encoder-decoder-aware execution; the GGUF repository includes a tested token-ID runner and exact tokenizer adapter. Q1_0 is experimental and generated immediate EOS/empty text in the held-out test. See that model card for compatibility and validation details.

Downloads last month
-
Safetensors
Model size
0.2B params
Tensor type
F16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for yuanhau/commit-messages

Finetuned
(114)
this model
Quantizations
1 model

Paper for yuanhau/commit-messages