Skip to main content

Week 7 — Finetuning & Publishing

This week covers two crucial skills for the AI engineer: finetuning models for domain-specific tasks and publishing code as reusable Python packages. You'll learn when finetuning makes sense (vs. RAG or prompting), how to use QLoRA for efficient training, and how to package and publish your work.

Pages

#PageDescription
1Finetuning StrategyWhen to finetune vs RAG vs prompting
2Gemma FinetuningQLoRA with Unsloth (with code)
3HuggingFace EcosystemDatasets, Transformers, PEFT, TRL
4Python Packagingpyproject.toml, src layout, versioning
5PyPI Publishinguv build, uv publish, GitHub Actions release
6DPO FinetuningPreference optimization for alignment
7uv tools / uvxShip and run CLIs cleanly

Key Concepts

  • Finetuning: Adapting a pretrained model to a specific task or domain
  • QLoRA: Quantized Low-Rank Adaptation — train with minimal GPU memory
  • Python Packaging: Structuring and distributing reusable code
  • Continuous Publishing: Automated release pipelines via GitHub Actions

Prerequisites

  • Understanding of LLM fundamentals (Week 3)
  • Python project structure basics
  • GitHub familiarity (Week 1)
Lab Connection

Lab 3 — Gemma4 Finetuning walks you through the complete finetuning pipeline. Start it after completing page 2.