Email the Author

You can use this page to email Daniel Voigt Godoy about A Hands-On Guide to Fine-Tuning Large Language Models with PyTorch and Hugging Face.

Please include an email address so the author can respond to your query

This message will be sent to Daniel Voigt Godoy

This site is protected by reCAPTCHA and the Google  Privacy Policy and  Terms of Service apply.

About the Book

Are you ready to fine-tune your own LLMs?

This book is a practical guide to fine-tuning Large Language Models (LLMs), combining high-level concepts with step-by-step instructions to train these powerful models for your specific use cases.

Who Is This Book For?

This is an intermediate-level resource—positioned between building a large language model from scratch and deploying an LLM in production—designed for practitioners with some prior experience in deep learning.

If terms like Transformers, attention mechanisms, Adam optimizer, tokens, embeddings, or GPUs sound familiar, you’re in the right place. Familiarity with Hugging Face and PyTorch is assumed. If you're new to these concepts, consider starting with a beginner-friendly introduction to deep learning with PyTorch before diving in.

What You’ll Learn:

  • Load quantized models using BitsAndBytes.
  • Configure Low-Rank Adapters (LoRA) using Hugging Face's PEFT.
  • Format datasets effectively using chat templates and formatting functions.
  • Fine-tune LLMs on consumer-grade GPUs using techniques such as gradient checkpointing and accumulation.
  • Deploy LLMs locally in the GGUF format using Llama.cpp and Ollama.
  • Troubleshoot common error messages and exceptions to keep your fine-tuning process on track.

This book doesn’t just skim the surface; it zooms in on the critical adjustments and configuration—those all-important "knobs"—that make or break the fine-tuning process.

By the end, you’ll have the skills and confidence to fine-tune LLMs for your own real-world applications. Whether you’re looking to enhance existing models or tailor them to niche tasks, this book is your essential companion.


About the Author

Daniel Voigt Godoy’s avatar Daniel Voigt Godoy

@dvgodoy

Daniel has been teaching machine learning and distributed computing technologies at Data Science Retreat, the longest-running Berlin-based bootcamp, for more than three years, helping more than 150 students advance their careers.

He writes regularly for Towards Data Science. His blog post "Understanding PyTorch with an example: a step-by-step tutorial" reached more than 220,000 views since it was published.

The positive feedback from the readers resulted in an invitation to speak at the Open Data Science Conference (ODSC) Europe in 2019. It also motivated him to write the book "Deep Learning with PyTorch Step-by-Step", which covers a broader range of topics.

Daniel is also the main contributor of two python packages: HandySpark and DeepReplay.

His professional background includes 20 years of experience working for companies in several industries: banking, government, fintech, retail and mobility.

Logo white 96 67 2x

Publish Early, Publish Often

  • Path
  • There are many paths, but the one you're on right now on Leanpub is:
  • Finetuning › Email Author › New
    • READERS
    • Newsletters
    • Weekly Sale
    • Monthly Sale
    • Store
    • Home
    • Redeem a Token
    • Search
    • Support
    • Leanpub FAQ
    • Leanpub Author FAQ
    • Search our Help Center
    • How to Contact Us
    • FRONTMATTER PODCAST
    • Featured Episode
    • Episode List
    • MEMBERSHIPS
    • Reader Memberships
    • Department Reader Memberships
    • Author Memberships
    • Your Membership
    • COMPANY
    • About
    • About Leanpub
    • Blog
    • Contact
    • Press
    • Essays
    • AI Services
    • Imagine a world...
    • Manifesto
    • More
    • Partner Program
    • Causes
    • Accessibility
    • AUTHORS
    • Write and Publish on Leanpub
    • Create a Book
    • Create a Bundle
    • Create a Course
    • Create a Track
    • Testimonials
    • Why Leanpub
    • Services
    • TranslateAI
    • TranslateWord
    • TranslateEPUB
    • PublishWord
    • Publish on Amazon
    • CourseAI
    • GlobalAuthor
    • Marketing Packages
    • IndexAI
    • Author Newsletter
    • The Leanpub Author Update
    • Author Support
    • Author Help Center
    • Leanpub Authors Forum
    • The Leanpub Manual
    • Supported Languages
    • The LFM Manual
    • Markua Manual
    • API Docs
    • Organizations
    • Learn More
    • Sign Up
    • LEGAL
    • Terms of Service
    • Copyright Policy
    • Privacy Policy
    • Refund Policy

*   *   *

Leanpub is copyright © 2010-2025 Ruboss Technology Corp.
All rights reserved.

This site is protected by reCAPTCHA
and the Google  Privacy Policy and  Terms of Service apply.

Leanpub requires cookies in order to provide you the best experience. Dismiss