Professional Enterprise Pipeline for Unsloth LLM Finetuning
Project description
🚀 LLM Finetuning with Unsloth + LoRA + TRL
Fast, lightweight, and scalable finetuning for open-source LLMs
FINE-TUNING AND INFERENCE NOTEBOOKS:
📌 Overview
This repo provides a Professional Enterprise Pipeline for finetuning HuggingFace models using:
- ⚡ Unsloth-optimized kernels (2× faster, 70% less VRAM)
- 🏗️ Modular Core Architecture: Unified
ModelRunnerandModelFactoryfor training and inference. - 🛡️ Hardware Resilience: Internal
HardwareManagerfor pre-flight memory and compatibility checks. - 🎯 Dynamic Dataset Support: Automatic format detection (Alpaca, ChatML, ShareGPT).
- 🔄 Flexible Deployment: CLI, No-Code GUI, and a clean Python API.
🚀 Quick Start: Usage Modes
This repository supports two primary modes of operation.(create a virtualenv: if using uv)
uv run or uv before_all_commands
1. Requirements
- Python 3.10+ (Required for modern Torch/Transformers compatibility)
- CUDA 12.1+ (For GPU-accelerated training)
2. Installation
Standard Installation:
pip install .
GPU-Accelerated Installation (Local): Installs with full local CUDA stack to avoid system-wide dependency issues.
pip install .[gpu] --extra-index-url https://download.pytorch.org/whl/cu121
or
pip install -r requirements-gpu.txt
2. Mode 1: Headless CLI (Automation)
The CLI is designed for automated training pipelines and reproducible runs.
Basic Usage (via entry point):
unsloth-cli --model_name_or_path "unsloth/mistral-7b-bnb-4bit" --dataset_name "imdb"
Basic Usage (via script):
python src/cli.py --model_name_or_path "unsloth/mistral-7b-bnb-4bit" --dataset_name "imdb"
Using a Config File:
unsloth-cli configs/example.yaml
📖 Read the Full CLI Manual for detailed reference, including dry runs and all argument options.
3. Mode 2: No-Code Studio (Interactive)-[Beta]
Launch the Gradio-based web interface for an interactive fine-tuning experience.
python scripts/app.py
Open your browser at http://localhost:7860
☁️ Run on Google Colab
You can easily run this project on Google Colab by cloning the repository.
-
Open a new Colab Notebook.
-
Run the following in a code cell to clone and install:
!git clone https://github.com/Sriramdayal/Unsloth-LLM-finetuningv1.git %cd Unsloth-LLM-finetuningv1 !pip install -r requirements.txt
-
Run Training (CLI Mode):
!python src/cli.py --model_name_or_path "unsloth/mistral-7b-bnb-4bit" --dataset_name "imdb"
📘 Python API Guide
For detailed instructions on using this repository as a Python library (including DataProcessor, configuration, and custom training loops), please refer to the dedicated documentation:
👉 Read the Python API Documentation
⏱ Training Time (Estimates)
| GPU | Small dataset (50k) | Large dataset (500k–800k) |
|---|---|---|
| A100 | 20–40 min | 5–7 hours |
| RTX 4090 | 1–2 hrs | 18–22 hrs |
| 3090 / 4070Ti | 1.5–3 hrs | 28–34 hrs |
| Tesla T4 | 4–6 hrs | 55–70 hrs |
Training time scales linearly with dataset size and LoRA rank.
⭐ Notes & Tips
- Reduce dataset size if needed:
train_ds = train_ds.shuffle(seed=42).select(range(100_000))
- LoRA rank 64 is high quality; use 16–32 for faster training
- Enable
flash-attnfor memory efficiency on long sequences
📜 License
MIT
🔗 Credits
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unsloth_finetuning-0.2.0.tar.gz.
File metadata
- Download URL: unsloth_finetuning-0.2.0.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70b49dc2bdff007115f13f4a093f2c28b65cd86a5fc7efa727816cad7241718f
|
|
| MD5 |
4075ab5716dd79dba60bcaed206063a5
|
|
| BLAKE2b-256 |
c8aa1e978eaf4678a9281522cca8f6dc3006a3e2dca4591e359625406d0c317b
|
Provenance
The following attestation bundles were made for unsloth_finetuning-0.2.0.tar.gz:
Publisher:
publish.yml on Sriramdayal/Unsloth-LLM-finetuningv1
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unsloth_finetuning-0.2.0.tar.gz -
Subject digest:
70b49dc2bdff007115f13f4a093f2c28b65cd86a5fc7efa727816cad7241718f - Sigstore transparency entry: 941722044
- Sigstore integration time:
-
Permalink:
Sriramdayal/Unsloth-LLM-finetuningv1@4f562321a80f928f9c5c3255b8eac80ecb1a3823 -
Branch / Tag:
refs/tags/V1.3 - Owner: https://github.com/Sriramdayal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4f562321a80f928f9c5c3255b8eac80ecb1a3823 -
Trigger Event:
release
-
Statement type:
File details
Details for the file unsloth_finetuning-0.2.0-py3-none-any.whl.
File metadata
- Download URL: unsloth_finetuning-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e0386aafd6126edf46ba9dcb611208c091679b1bae5aace6963683eec4f991f
|
|
| MD5 |
3b629dac550ec6c077f9dfe9a45a6629
|
|
| BLAKE2b-256 |
3ae40c809319c072b12af0db365d5c5fc93ab4ad24108222fde95a38345d43c5
|
Provenance
The following attestation bundles were made for unsloth_finetuning-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on Sriramdayal/Unsloth-LLM-finetuningv1
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unsloth_finetuning-0.2.0-py3-none-any.whl -
Subject digest:
8e0386aafd6126edf46ba9dcb611208c091679b1bae5aace6963683eec4f991f - Sigstore transparency entry: 941722053
- Sigstore integration time:
-
Permalink:
Sriramdayal/Unsloth-LLM-finetuningv1@4f562321a80f928f9c5c3255b8eac80ecb1a3823 -
Branch / Tag:
refs/tags/V1.3 - Owner: https://github.com/Sriramdayal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4f562321a80f928f9c5c3255b8eac80ecb1a3823 -
Trigger Event:
release
-
Statement type: