Text Generation
MLX
Safetensors
English
qwen2
git
commit-generator
conventional-commits
code
apple-silicon
conversational
Eval Results (legacy)
4-bit precision
Instructions to use KarRak007/qwen2.5-3b-git-ai-commit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use KarRak007/qwen2.5-3b-git-ai-commit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("KarRak007/qwen2.5-3b-git-ai-commit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use KarRak007/qwen2.5-3b-git-ai-commit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "KarRak007/qwen2.5-3b-git-ai-commit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "KarRak007/qwen2.5-3b-git-ai-commit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use KarRak007/qwen2.5-3b-git-ai-commit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "KarRak007/qwen2.5-3b-git-ai-commit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "KarRak007/qwen2.5-3b-git-ai-commit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KarRak007/qwen2.5-3b-git-ai-commit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use KarRak007/qwen2.5-3b-git-ai-commit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "KarRak007/qwen2.5-3b-git-ai-commit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default KarRak007/qwen2.5-3b-git-ai-commit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use KarRak007/qwen2.5-3b-git-ai-commit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "KarRak007/qwen2.5-3b-git-ai-commit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "KarRak007/qwen2.5-3b-git-ai-commit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Qwen 2.5 3B Git AI Commit
Qwen 2.5 3B Git AI Commit is a domain-adapted language model fine-tuned specifically to convert staged unified Git diffs (git diff --staged) into standardized Conventional Commit titles and structured PR summaries without conversational preamble.
It is quantized to 4-bit group-wise INT4 precision and optimized for native local execution on Apple Silicon via Apple's MLX framework.
📊 Model Details
Model Description
- Developed by: Kartik Raktate (KarRak007)
- Shared by: Kartik Raktate (KarRak007)
- Model type: Causal Language Model (LoRA Fine-tuned / 4-bit Quantized)
- Language(s) (NLP): English, Source Code Diffs (Unified Diff Format)
- License:
qwen-research - Fine-tuned from model:
mlx-community/Qwen2.5-3B-Instruct-4bit
Model Sources
- Repository:
KarRak007/qwen2.5-3b-git-ai-commit - Framework: Apple MLX Framework
💡 Uses
Direct Use
- Analyzing staged code changes (
git diff --staged) and auto-generating clean Conventional Commit headers (feat:,fix:,refactor:,docs:, etc.). - Producing concise, bulleted summaries of file modifications for pull requests.
- Enabling local, privacy-conscious execution when source code must not be transmitted to external cloud APIs.
Downstream Use
- Integration into custom CLI developer tools (
git-ai). - Local Git hooks (
prepare-commit-msg) to pre-fill commit messages in terminal editors. - Local CI/CD pipelines and automated PR generation scripts running on Apple Silicon nodes.
Out-of-Scope Use
- General-purpose chat, open-domain question answering, or general reasoning tasks.
- Parsing non-diff text files or unstructured plain-text documents.
- Execution on non-Apple Silicon environments without standard PyTorch/Transformers adapters.
⚡ How to Get Started with the Model
1. Installation
Install the required MLX language model library:
pip install mlx-lm
2. Python Inference Script
The following script loads the model directly from Hugging Face, processes a sample Git diff, and generates a Conventional Commit message with a PR summary.
from mlx_lm import load, generate
# Load directly from Hugging Face Hub
model, tokenizer = load("KarRak007/qwen2.5-3b-git-ai-commit")
# Sample unified Git diff
sample_diff = """
--- a/src/auth.py
+++ b/src/auth.py
@@ -10,3 +10,5 @@ def verify_jwt(token: str):
+ if not token:
+ raise ValueError("Token cannot be empty")
"""
# Construct ChatML prompt
prompt = (
f"<|im_start|>system\nYou are a Git commit generator. "
f"Analyze the git diff and output a Conventional Commit title "
f"followed by a bulleted PR summary.<|im_end|>\n"
f"<|im_start|>user\n{sample_diff}<|im_end|>\n"
f"<|im_start|>assistant\n"
)
# Generate commit message
output = generate(
model,
tokenizer,
prompt=prompt,
max_tokens=200,
verbose=False
)
print(output.strip())
## 📈 Training Details
### Training Procedure
#### a. Preprocessing
Loss masking was applied to prompt tokens (system and user diff inputs) so gradient backpropagation concentrated specifically on predicting the completion tokens (assistant commit outputs).
#### b. Training Hyperparameters
1. **Training Method:** Parameter-Efficient Fine-Tuning (PEFT) via LoRA
2. **LoRA Target Layers:** 16 projection layers (`q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj`)
3. **Trainable Parameters:** ~6.65M (~0.21% of 3B base parameters)
4. **Quantization Scheme:** 4-bit Group-Wise INT4
5. **Speeds, Sizes, Times:**
- **Peak VRAM Memory:** 1.97 GB
- **Inference Speed:** ~15 tokens/sec
6. **Fused Weight Checkpoint Size:** 1.74 GB (`model.safetensors`)
🧪 Evaluation & Results
| Stage | Metric Value |
|---|---:|
| Initial Loss | 2.73 |
| Final Training Loss | 0.804 |
| Validation Loss | 0.453 |
⚙️ Model Examination
Weight fusion was performed post-training using Apple MLX tools to fold LoRA adapter matrices directly into base model weights ($W_{fused} = W_{base} + \Delta W$). This eliminated dual-matrix computation latency during inference.
🌐 Environmental Impact
Hardware Type: Apple Silicon M-series (Unified Memory Architecture)
Cloud Provider: None (Trained and evaluated 100% locally)
Carbon Footprint: Minimal due to low-power edge execution on Apple Silicon (<20W peak draw).
👤 Author & Contact
Developer: Kartik Raktate (KarRak007 on Hugging Face)
- Downloads last month
- 57
Model size
3B params
Tensor type
U32
·
F16 ·
Hardware compatibility
Log In to add your hardware
4-bit
Model tree for KarRak007/qwen2.5-3b-git-ai-commit
Base model
Qwen/Qwen2.5-3B Finetuned
mlx-community/Qwen2.5-3B-Instruct-4bitEvaluation results
- Validation Lossself-reported0.453