smart-commit-0.5b-v0.1

A fine-tune of Qwen/Qwen2.5-Coder-0.5B-Instruct that writes git commit messages in the repository's style, for smart-commit, a CLI that runs a small model locally (Intel NPU, GPU or CPU). Version 0.1: the first published model, while the training recipe still changes.

It is trained on smart-commit's own prompt, byte for byte: a system prompt with the rules (subject of at most 72 columns, imperative mood, Conventional Commits when the repository uses them) and a user prompt with the changed files, the compacted diff and up to 5 recent subjects of the repository. Other prompts are untested.

Files

File What SHA-256
model.safetensors (+ config and tokenizer) merged weights, bf16 bb95863256956bd51e106042ea03e5f5b8d28a42dd1df53ba52289dfd15afef3
smart-commit-0.5b-v0.1-q4_k_m.gguf Q4_K_M for llama.cpp, 398 MB 83b9acfc91e67cba1a2b669a0afe59ddc1b3ce5909617355b88d3a2ff6e66c11

Use with smart-commit

hf download LucasBRT/smart-commit-0.5b-v0.1 smart-commit-0.5b-v0.1-q4_k_m.gguf --local-dir ~/models
SMART_COMMIT_GGUF=~/models/smart-commit-0.5b-v0.1-q4_k_m.gguf smart-commit

It runs on smart-commit's llama.cpp devices (CPU and Vulkan GPUs). For the OpenVINO devices (Intel NPU and GPU), the safetensors can be exported with smart-commit's export scripts; that export is not validated yet for this model.

Evaluation

eval-v1: 500 commits from the test split of CommitChronicle (repositories never seen in training), 250 following Conventional Commits and 250 free-form; eval-short: 197 commits from young repositories (1–5 earlier subjects). Greedy decoding, smart-commit at db389c2, Vulkan, with its retry and file-list fallback.

Model type_match scope_known first_try fallback word_f1 word_f1 (free) fallback (young repos)
Qwen2.5-Coder-0.5B-Instruct, upstream Q4_K_M 0.168 0.756 0.392 0.400 0.133 0.101 0.345
same, re-quantized like this model (control) 0.236 0.880 0.424 0.512 0.153 0.098 0.386
smart-commit-0.5b-v0.1 0.640 0.856 0.980 0.012 0.342 0.233 0.091
  • type_match: same Conventional type as the real commit. The base model answers fix to most changes; answering fix always would score 0.41.
  • scope_known: no scope, or one the repository already used.
  • first_try: the first reply was usable; fallback: no reply was, and smart-commit wrote the message from the file list.
  • word_f1: word overlap with the real subject, a rough proxy for content.

All the numbers, the learning curve behind the choice of 40k examples and the method are in training/HYPOTHESES.md (H3). For reference, 324 s for the 500 commits of eval-v1 on an Intel Arc iGPU (Core Ultra 5 225H), retries included. See also smart-commit-1.5b-v0.1: the 1.5B version writes closer to the real messages and falls back less on young repositories.

Training

  • Data: 39,985 commits from the train split of CommitChronicle (revision 5fd076e), each with at least 10 earlier subjects of its repository; prompts built by smart-commit itself, the real subject as the target (examples file sha256 7495c85514a53985…).
  • Method: LoRA r=16, alpha=32, dropout 0.05 on all linear layers, lr 2e-4 cosine, warmup 3%, batch 4 × 4, 1 epoch, seed 0, loss on the reply only; 4-bit NF4 base with fp16 compute (QLoRA) on a Kaggle Tesla T4, 147 minutes. torch 2.11.0, transformers 5.20.1, peft 0.21.2.
  • Export: merged into the bf16 base and quantized to Q4_K_M with llama.cpp b11381 (training/export_gguf.py --merged).

Training on a GPU is not bit-for-bit reproducible; generation is (greedy). The recipe, the data selection and the scripts are in training/.

Limitations

  • English messages only (the training data is English).
  • Young repositories: with fewer than 10 earlier commits it sometimes repeats or paraphrases one of them, or the reply is unusable and smart-commit falls back to the file list (0.091 of eval-short).
  • It can invent details the diff does not show (a version, a file's purpose), and it does not know when the staged changes are several commits.
  • Trained on prompts without smart-commit's map of where each scope is used, added later; with that map in the prompt it was not re-evaluated on eval-v1.

Licence and attribution

The weights are released under Apache-2.0, like the base model. CommitChronicle (JetBrains Research) has no single licence: it gathers commits from repositories under MIT, Apache-2.0 and BSD-3-Clause, and asks that uses follow their terms, attribution included. The dataset records the repository and licence of every commit (repo and license fields), which is the provenance of the training data.

Downloads last month
-
Safetensors
Model size
0.5B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for LucasBRT/smart-commit-0.5b-v0.1

Adapter
(85)
this model

Dataset used to train LucasBRT/smart-commit-0.5b-v0.1