Lesson 3 of 5·12 min read

Fine-Tuning in Practice

Theory is nice — but how does fine-tuning actually work? Here we show the three most common approaches: managed (OpenAI/Anthropic), open source with LoRA/QLoRA, and when each approach fits.

Path 1: Managed Fine-Tuning (OpenAI)

The easiest entry point — no own GPU needed.

# 1. Prepare data (JSONL)
openai tools fine_tunes.prepare_data -f training_data.jsonl

# 2. Start fine-tuning
openai api fine_tuning.jobs.create \
  -t training_data.jsonl \
  -m gpt-4o-mini-2025-09-01 \
  --suffix "my-usecase"

# 3. Check status
openai api fine_tuning.jobs.list

# 4. Use finished model
openai api chat.completions.create \
  -m ft:gpt-4o-mini-2025-09-01:org:my-usecase:abc123 \
  -g user "Write a product text for..."

Cost (approx.): $8/1M training tokens, $3/1M inference tokens Duration: 30 min – 2 hours (depending on data size) Limitation: Only OpenAI models, no access to weights

Path 2: Anthropic Fine-Tuning

Since 2025, Anthropic offers fine-tuning for Claude models.

  • API-based, similar to OpenAI
  • Focus on safety and Constitutional AI
  • Higher costs but strong baseline models
  • Ideal when Claude is already your main LLM

Path 3: Open Source with LoRA / QLoRA

For full control — on your own hardware or cloud GPUs.

What is LoRA?

Low-Rank Adaptation doesn't train all model parameters, just small additional matrices. This drastically reduces GPU requirements.

MethodGPU RAMTraining TimeQuality
Full Fine-Tuning80+ GBHours–days✅ Maximum
LoRA16–24 GB30–60 min✅ Very good
QLoRA8–12 GB30–60 min✅ Good

QLoRA — LoRA + Quantization

QLoRA loads the base model in 4-bit and trains LoRA adapters in 16-bit. Result: Fine-tuning a 70B model on a single A100 GPU.

Popular Open-Source Models for Fine-Tuning

ModelParametersStrengths
Llama 3.18B / 70B / 405BAll-rounder, Meta license
Mistral Large123BStrong for EU languages
Qwen 2.57B / 72BCode + multilingual
Gemma 29B / 27BCompact, Google-optimized

Tool Stack

Unsloth / Hugging Face TRL → Training
Weights & Biases / MLflow → Experiment tracking
vLLM / TGI → Inference server

Decision Guide

CriterionManaged (OpenAI)Open Source (LoRA)
Setup5 minutes2–4 hours
Cost per training$10–100$5–50 (cloud GPU)
ControlLowFull
Data privacyData at OpenAIData with you
Model ownershipNoYes

Practical tip: Start with managed fine-tuning (OpenAI/Anthropic) for proof of concept. If it works and data privacy or costs become an issue, migrate to open source with QLoRA.