unsloth
БесплатноБез исполняемых скриптовНе проверенUnsloth fine-tunes open LLMs such as Llama, Qwen and Gemma with LoRA or QLoRA about twice as fast and with far less GPU memory than a stock Hugging Face…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Unsloth — Fast LoRA and QLoRA Fine-Tuning for Open LLMs
Overview
Unsloth is an open-source training library (plus a desktop app and web UI called Unsloth Studio) that patches Hugging Face Transformers, PEFT and TRL with hand-written Triton kernels. The same LoRA or QLoRA run needs noticeably less VRAM and finishes faster, which is what makes an 8B model trainable on a 16 GB card or a free Colab T4. There are two code entry points:
- Python API (the Apache-2.0 core library):
FastLanguageModel.from_pretrainedloads a model (4-bit by default),FastLanguageModel.get_peft_modelattaches LoRA adapters, and a normal TRLSFTTrainerruns the training. unslothCLI (runs the Studio training backend, AGPL-3.0):unsloth trainruns the same training from flags or a YAML file, andunsloth exportturns a checkpoint into merged weights, GGUF or a LoRA adapter.
After training, Unsloth saves in the formats people deploy: GGUF files (plus an Ollama Modelfile when it knows the chat template), merged 16-bit weights for vllm serve, or a small LoRA adapter.
Absolute minimum VRAM from the Unsloth requirements page: 8B QLoRA about 6 GB, 14B about 8.5 GB, 70B about 41 GB; 16-bit LoRA needs roughly three to four times more.
Instructions
Installation
Install into a fresh virtual environment. uv picks the right PyTorch build for the installed CUDA driver. The bare unsloth package covers only the Python API; the unsloth train/export/list-checkpoints commands import the Studio backend (FastAPI, uvicorn, gguf and more), which comes with the studio extra:
uv venv unsloth_env --python 3.13
source unsloth_env/bin/activate
uv pip install "unsloth[studio]" --torch-backend=auto # CLI + Python API
# uv pip install unsloth vllm --torch-backend=auto # Python API + vLLM serving only
Check the install with a command that loads the backend (--help alone passes even when backend packages are missing):
unsloth --version
unsloth list-checkpoints # fresh install: "No checkpoints found."; missing extra: "needs fastapi"
The unsloth[studio] extra above already includes the Studio web UI (unsloth studio). The desktop app has a separate installer described at https://unsloth.ai/docs; an agent does not need it.
Gated or private models need a Hugging Face token. Create a read token at https://huggingface.co/settings/tokens (a write token if you will push models) and export it as HF_TOKEN; both the CLI and the save/push functions read it.
Prepare the dataset
unsloth train detects three layouts in a JSONL file or Hub dataset:
- chatml: a
messages(orconversations) column holding{"role": ..., "content": ...}turns - sharegpt: the same column with
{"from": ..., "value": ...}turns - alpaca:
instruction, optionalinput, andoutputcolumns
One chatml line looks like this:
{"messages": [{"role": "system", "content": "You are the support assistant for Northwind Freight."}, {"role": "user", "content": "My pallet shows 'held at customs' since Monday. What do I do?"}, {"role": "assistant", "content": "Customs holds usually mean a missing commercial invoice. Upload it under Shipments > Documents and the broker re-files within 24 hours."}]}
A few hundred to a few thousand clean examples are typical for style and domain adaptation. Quality matters more than volume.
Train from the CLI
--output-dir is a run name inside Unsloth's own outputs folder, not a path in the current directory: outputs/support-llama32 lands in ~/.unsloth/studio/outputs/support-llama32 (or $UNSLOTH_STUDIO_HOME/outputs/...; export UNSLOTH_STUDIO_HOME="$PWD/.unsloth" to keep runs in the project). A leading outputs/ is stripped, and an absolute path outside that folder is rejected. The dry run still echoes the name as typed. Preview with --dry-run, then drop the flag to train:
unsloth train \
--model unsloth/Llama-3.2-3B-Instruct \
--local-dataset data/tickets.jsonl \
--format-type chatml \
--train-on-completions \
--lora-r 16 --lora-alpha 16 \
--num-epochs 2 \
--output-dir outputs/support-llama32 \
--dry-run
Defaults shown by the dry run: LoRA training, load_in_4bit: true, learning rate 2e-4, batch size 2, gradient accumulation 4, max_seq_length 2048, all seven attention and MLP projections targeted. Keep long runs reproducible in a YAML file (flags on the command line override it):
model: unsloth/Qwen3-8B
data:
local_dataset:
- data/tickets.jsonl
format_type: chatml
training:
max_seq_length: 4096
num_epochs: 2
learning_rate: 0.0002
output_dir: outputs/support-qwen3
train_on_completions: true
lora:
lora_r: 16
lora_alpha: 16
unsloth train -c support-lora.yaml
unsloth list-checkpoints # absolute path and loss of every run and checkpoint
--enable-wandb with WANDB_API_KEY in the environment sends metrics to Weights & Biases; --enable-tensorboard wr
Установить unsloth в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл unsloth?
Unsloth fine-tunes open LLMs such as Llama, Qwen and Gemma with LoRA or QLoRA about twice as fast and with far less GPU memory than a stock Hugging Face setup, then exports the result to GGUF for Ollama and llama.cpp or to merged weights for vLLM. Use it when someone wants to train a model on their own data on a single GPU, a Colab notebook or a workstation. Trigger phrases: "fine-tune Llama on my data", "QLoRA on a 16 GB GPU", "train Qwen with Unsloth", "export my fine-tune to GGUF", "make an Ollama model from my dataset", "unsloth train", "FastLanguageModel".
Как установить скилл unsloth?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл unsloth запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic