Skip to main content

Professional Enterprise Pipeline for Unsloth LLM Finetuning

Project description


🚀 LLM Finetuning with Unsloth + LoRA + TRL

Fast, lightweight, and scalable finetuning for open-source LLMs

17638338761695712928855779246747

FINE-TUNING AND INFERENCE NOTEBOOKS:

Open in Colab

Open in Colab

HuggingFace Model


📌 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 ModelRunner and ModelFactory for training and inference.
  • 🛡️ Hardware Resilience: Internal HardwareManager for 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.

  1. Open a new Colab Notebook.

  2. 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
    
  3. 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-attn for memory efficiency on long sequences

📜 License

MIT


🔗 Credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unsloth_finetuning-0.2.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unsloth_finetuning-0.2.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

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

Hashes for unsloth_finetuning-0.2.0.tar.gz
Algorithm Hash digest
SHA256 70b49dc2bdff007115f13f4a093f2c28b65cd86a5fc7efa727816cad7241718f
MD5 4075ab5716dd79dba60bcaed206063a5
BLAKE2b-256 c8aa1e978eaf4678a9281522cca8f6dc3006a3e2dca4591e359625406d0c317b

See more details on using hashes here.

Provenance

The following attestation bundles were made for unsloth_finetuning-0.2.0.tar.gz:

Publisher: publish.yml on Sriramdayal/Unsloth-LLM-finetuningv1

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file unsloth_finetuning-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for unsloth_finetuning-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e0386aafd6126edf46ba9dcb611208c091679b1bae5aace6963683eec4f991f
MD5 3b629dac550ec6c077f9dfe9a45a6629
BLAKE2b-256 3ae40c809319c072b12af0db365d5c5fc93ab4ad24108222fde95a38345d43c5

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page