This repository is a hands on lab for learning practical fine tuning workflows with Unsloth.
You can use it to learn:
- Dataset validation and conversion
- LoRA and QLoRA training flow
- Evaluation and experiment tracking
- GGUF export planning
- Ollama packaging planning
- Local HTML dashboard reporting
- Changelog: CHANGELOG.md
- Completed upgrades: completed-upgrades.md
- Future upgrades: future-upgrades.md
- Windows setup: docs/windows-setup.md
- First run checklist: docs/first-run.md
- CLI reference: docs/cli-reference.md
- Troubleshooting: docs/troubleshooting.md
This lab is built for beginners and intermediate users.
If you are new, start with dry run commands first. Dry runs validate your setup and config without loading models.
- LoRA: Fine tuning by training small adapter layers instead of all model weights.
- QLoRA: LoRA workflow with quantized model loading, commonly 4 bit.
- GGUF: Local model file format used by many local inference tools.
- Ollama: Local runtime for running model packages on your machine.
Minimum requirements:
- PowerShell or Bash shell
- Python 3.11+
- Internet access for package install
Optional for full training:
- NVIDIA CUDA GPU
- ML extras from this project
From repo root, run:
cd "C:\Users\mick0\OneDrive\Documents\Code & Dev\GitHub\learn-unsloth-lab"
py -3.11 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e .Optional ML dependencies for real model training:
python -m pip install -e .[ml]Developer and test tools:
python -m pip install -e .[dev]From repo root, run:
cd /path/to/learn-unsloth-lab
python3.11 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .Optional ML dependencies for real model training:
python -m pip install -e .[ml]Developer and test tools:
python -m pip install -e .[dev]From repo root, run:
cd /path/to/learn-unsloth-lab
python3.11 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .Optional ML dependencies for real model training:
python -m pip install -e .[ml]Developer and test tools:
python -m pip install -e .[dev]Run these checks:
python -m pytest
python -m ruff check .
python -m learn_unsloth_lab --helpExpected result:
- Tests pass
- Ruff reports no lint errors
- CLI help prints command list
Copy and run this sequence in order:
python -m learn_unsloth_lab dataset validate datasets\finance-instructions.jsonl
python -m learn_unsloth_lab dataset convert datasets\alpaca-sample.json experiments\alpaca-normalized.jsonl
python -m learn_unsloth_lab train configs\example-training.yaml --dry-run
python -m learn_unsloth_lab evaluate datasets\finance-lab\eval-prompts.jsonl --output experiments\finance-evaluation
python -m learn_unsloth_lab export gguf configs\finance-export.yaml --dry-run
python -m learn_unsloth_lab ollama create configs\ollama.yaml --dry-run
python -m learn_unsloth_lab reports
python -m learn_unsloth_lab dashboardThen open:
experiments/dashboard/index.html
Use this before every training run.
python -m learn_unsloth_lab dataset validate datasets\finance-instructions.jsonlThis command checks structure and returns JSON output with validity details.
Supported input styles include Alpaca, ChatML, and ShareGPT.
python -m learn_unsloth_lab dataset convert datasets\sharegpt-sample.json experiments\sharegpt-normalized.jsonlOutput is normalized chat style JSONL with messages.
Dry run is the safest first step and works offline.
python -m learn_unsloth_lab train configs\finance-lora.yaml --dry-runDry run validates config and writes planning artifacts without model loading.
Evaluation compares responses and reports metrics such as latency, length, adherence, and similarity.
python -m learn_unsloth_lab evaluate datasets\finance-lab\eval-prompts.jsonl --output experiments\finance-evaluationUse dry run first.
python -m learn_unsloth_lab export gguf configs\finance-export.yaml --dry-runSupported quantization planning modes include f16, q8_0, q4_k_m, and q5_k_m.
python -m learn_unsloth_lab ollama create configs\ollama.yaml --dry-runThis creates a Modelfile plan and command guidance.
List experiment runs:
python -m learn_unsloth_lab experiments listShow one run:
python -m learn_unsloth_lab experiments show <run_id>Generate summary reports:
python -m learn_unsloth_lab reportspython -m learn_unsloth_lab dashboardOpen experiments/dashboard/index.html in your browser.
dataset validatedataset converttrainevaluateexport ggufollama createexperiments listexperiments showreportsdashboard
src/learn_unsloth_lab: CLI and core implementationconfigs: Ready to use YAML configsdatasets: Sample datasets and finance lab promptsdocs: Topic guides for setup, training, export, evaluation, and morenotebooks: Guided learning notebooksexperiments: Local generated outputs and reportsexports: Local generated export artifactstests: Offline test coveragescripts: Utility scripts
Suggested order:
- docs/windows-setup.md
- docs/first-run.md
- docs/dataset-guide.md
- docs/training-guide.md
- docs/evaluation-guide.md
- docs/export-guide.md
- docs/ollama-guide.md
- docs/dashboard.md
- docs/testing.md
Hands on practice:
If a command fails:
- Confirm virtual environment is active.
- Run
python -m learn_unsloth_lab --help. - Re run
python -m pip install -e .. - Validate config path and dataset path.
- Review docs/troubleshooting.md.
- This project keeps generated artifacts in
experimentsandexports. - Repository defaults are designed for offline safe learning workflows.
- Dry run commands are recommended before any real training or export.
MIT. See LICENSE.