git-ai-commit-sft

A LoRA adapter fine-tuned on Qwen2.5-Coder-7B-Instruct-4bit to generate Chinese Conventional Commits commit messages from git diffs.

Built for git-ai-commit, an IntelliJ plugin that uses LLMs to generate commit messages.

Model

Training Data

548 high-quality commit messages from two real-world repositories (one Java backend, one Go microservice), filtered to Chinese-only Conventional Commits format. Each training sample pairs a git diff (processed through the plugin's exact runtime pipeline — GitDiffFilter + PromptBuilder) with the corresponding human-written commit message.

Evaluation

Metric Before After
Conventional Commits rate 96% 100%
Chinese rate 100% 100%
Single-line rate 100% 100%
Mean similarity to reference 0.339 0.546
Mean output length 51 chars 27 chars

Usage

# Install mlx-lm
pip install mlx-lm

# Download and load
python -m mlx_lm.generate \
  --model mlx-community/Qwen2.5-Coder-7B-Instruct-4bit \
  --adapter-path yisuiban/git-ai-commit-sft \
  --prompt "你是一位资深工程师,擅长根据 git diff 生成一句中文提交信息。..."

From Python:

from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler

model, tokenizer = load(
    "mlx-community/Qwen2.5-Coder-7B-Instruct-4bit",
    adapter_path="yisuiban/git-ai-commit-sft"
)

prompt = tokenizer.apply_chat_template(
    [{"role": "user", "content": "你的提示词..."}],
    tokenize=False, add_generation_prompt=True
)
response = generate(model, tokenizer, prompt=prompt, max_tokens=64,
                    sampler=make_sampler(temp=0.0))

For Ollama deployment, see the training repository for the full Modelfile and export pipeline.

Training Details

  • Hardware: Apple M1 Max (64GB unified memory)
  • Framework: MLX LoRA (mlx-lm 0.31.3)
  • Optimizer: Adam, learning rate 1e-5
  • Batch: 1 × gradient accumulation 8 (effective batch 8)
  • Steps: 250 (~4 epochs over 473 training samples)
  • Max sequence length: 4096 tokens
  • Training time: ~20 minutes on M1 Max
Downloads last month

-

Downloads are not tracked for this model. How to track
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for yisuiban/git-ai-commit-sft

Base model

Qwen/Qwen2.5-7B
Adapter
(3)
this model