Skip to content

himaenshuu/llm-fine-tuning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ LLM Fine-Tuning with Unsloth + Hugging Face

Fine-tune large language models (LLMs) like Mistral or LLaMA efficiently on custom instruction datasets using Unsloth, Hugging Face Transformers, and export to GGUF for fast inference via llama.cpp.

Python

Status

License


πŸ“Œ Project Summary

This project demonstrates how to fine-tune an LLM on a custom instruction-based dataset using:

  • 🧠 Unsloth for memory-efficient fine-tuning
  • πŸ”§ TRL’s SFTTrainer from Hugging Face for supervised training
  • πŸ’Ύ GGUF Export for inference-ready deployment (supports llama.cpp, llamafile, etc.)
  • πŸ“Š Optional W&B tracking for experiment visualization

🧱 Tech Stack

Component Tool/Library
Model Mistral / LLaMA
Trainer TRL's SFTTrainer
Optimization AdamW (8-bit), LR Schedulers
Quantization 8-bit / 4-bit via GGUF
Logging Weights & Biases (optional)
Hardware Target Colab / Kaggle GPU

βœ… Features

  • πŸ”§ Fine-tunes Mistral or LLaMA models with minimal VRAM requirements
  • 🧠 Supports instruction tuning for domain-specific and structured tasks
  • ⚑ Trains with 8-bit optimizer using bitsandbytes for faster and lighter execution
  • πŸ“¦ Exports the final model in GGUF format compatible with llama.cpp, llamafile, etc.
  • 🎯 Runs on Kaggle, Google Colab, or custom local GPU environments
  • πŸ“Š Optional Weights & Biases (W&B) logging for real-time experiment tracking

πŸ§ͺ Training Configuration

Hyperparameter Value
Epochs 2–3
Batch Size 2 (with accumulation = 8)
Max Steps 100
Learning Rate 2e-4
Optimizer AdamW (8-bit)
Precision fp16 / bf16
Quantization GGUF export (8-bit)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published