unsloth

Guides LLM fine-tuning with Unsloth using LoRA, QLoRA, and GRPO reinforcement learning.

14|5|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/MLT-OSS/hermes-agent-go --skill unsloth-mlt-oss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unsloth
Source: https://github.com/MLT-OSS/hermes-agent-go/tree/main/skills/mlops/training/unsloth
Command: npx skills add https://github.com/MLT-OSS/hermes-agent-go --skill unsloth-mlt-oss

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires unsloth, torch, transformers, trl, datasets, peft, and includes references (resource) components.

What problem does it solve? Fine-tuning large language models typically demands expensive GPUs and complex configuration. This Skill provides expert guidance for using Unsloth to train models 2-5x faster with 50-80% less memory, making fine-tuning accessible on consumer hardware and free Colab notebooks. ## Core Features & Use Cases - Memory-Efficient Fine-Tuning: Guidance on LoRA and QLoRA configuration, VRAM requirements by model size, and hyperparameter selection for Llama, Qwen, Gemma, Mistral, and Phi models. - Reinforcement Learning Training: Instructions for GRPO, GSPO, DPO, ORPO, and KTO training to build reasoning models with reduced VRAM consumption. - Model Export & Deployment: Steps for saving fine-tuned models to GGUF format and deploying via Ollama, llama.cpp, vLLM, or SGLang. - Use Case: Fine-tune a Llama 3.1 8B model on a custom dataset using a free Colab notebook with 4-bit QLoRA, then export it to GGUF and run it locally in Ollama. ## Quick Start Ask the agent to show you how to fine-tune a Llama model on your dataset using Unsloth with QLoRA on a single GPU.

Frequently Asked Questions about unsloth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fine-tune a Llama model with Unsloth?

Install Unsloth with pip install unsloth, load a model using FastLanguageModel.from_pretrained with 4-bit quantization, attach LoRA adapters, and train with the TRL SFTTrainer on your dataset. Free Colab notebooks are available for Llama, Qwen, Gemma, and other models.

What is the difference between LoRA and QLoRA fine-tuning?

LoRA fine-tunes small adapter matrices in 16-bit precision while freezing the base model. QLoRA additionally quantizes base weights to 4-bit, drastically reducing memory. Unsloth recommends starting with QLoRA since its dynamic 4-bit quants have negligible accuracy loss.

How much VRAM do I need for Unsloth fine-tuning?

QLoRA 4-bit training needs about 5 GB for 7B models, 6 GB for 8B, and 41 GB for 70B models. LoRA 16-bit requires roughly 19 GB for 7B and 164 GB for 70B. Reducing batch size to 1-3 helps avoid out-of-memory errors.

Does Unsloth support AMD GPUs and Windows?

Yes, Unsloth supports AMD and Intel GPUs in addition to NVIDIA GPUs with CUDA capability 7.0 or higher. It runs on Linux and Windows, with Windows installation available natively or through WSL, plus an official Docker image.

How do I run a fine-tuned model in Ollama after training?

Save the fine-tuned model to GGUF format using Unsloth's built-in export, which merges LoRA adapters into 16-bit weights before quantization. The resulting GGUF file can be loaded directly into Ollama, llama.cpp, Open WebUI, or vLLM.

Can Unsloth train reasoning models with reinforcement learning?

Yes, Unsloth supports GRPO, GSPO, DPO, ORPO, and KTO reinforcement learning with up to 80% less VRAM than other libraries. It includes notebooks for training reasoning models like DeepSeek-R1 style models and vision-language RL.