Back to directory

LLM Customization and Fine-Tuning: Adaptation, Distillation, and Alignment

The companion code repository for a Manning book on adapting open-weights language models, covering prompting and RAG, LoRA and QLoRA, full supervised fine-tuning, distillation and DPO/RLHF alignment on a single GPU.

LLM Customization and Fine-Tuning: Adaptation, Distillation, and Alignment

This repository holds the runnable code, data and examples for a Manning Early Access book on LLM customization and fine-tuning, organized by chapter. It is a hands-on playbook for turning a general-purpose open-weights LLM into a focused, cheaper, privately hosted system for a specific domain, and for keeping it reliable in production.

The book and its code walk through prompting, parameter-efficient fine-tuning, full supervised fine-tuning, distillation and preference optimization, then an operational layer for drift and safety monitoring in production. The worked example takes a small open model through LoRA, full SFT, distillation and DPO alignment on a single GPU, measuring cost and quality at each step; the first LoRA fine-tune runs in under 10 minutes on a 12 GB GPU or on Apple Silicon.

Readers without a training GPU can pull the trained models from Hugging Face and run inference or evaluation on any machine instead.

More in Models

See all 405
  • mini-AGI

    github.com

    A continual learning language model that trains from scratch on a single 8 GB VRAM GPU, assembling its own architecture and adapting its size to the hardware and data available rather than shipping as a fixed pretrained model.

  • An open-source contrastive-embedding pipeline that maps technical CVE vulnerability descriptions to formal cybersecurity compliance controls in NIST SP 800-53 and CMMC, published with its model generation, fine-tuning and evaluation code.

  • peekaboolean

    github.com

    A small vision-language model, fine-tuned with LoRA on a 500-million-parameter backbone, that answers typed multiple-choice, ordinal-score and yes/no questions about an image with calibrated probabilities, in about 400 milliseconds on a laptop.