Pick a depth. Each prompt opens in your AI pre-loaded with the lesson. Click a row to preview the prompt.
Fine-tuning has costs that don't show up until you're committed: building and cleaning a dataset (usually the biggest cost), GPU time for training, an eval harness to prove it worked, and the ongoing burden of hosting and re-training as the world changes. The benefit has to clear that bar — and it often does, especially when a fine-tuned small model replaces an expensive large hosted one at a fraction of the per-token cost. This task makes the trade-off quantitative so you decide with numbers, not vibes: when does the upfront cost pay back, and how fast?
The demo is a simple break-even calculator: it compares the all-in cost of a fine-tuning project (data + training + hosting) against staying on a hosted API, and reports how many requests it takes to pay back.
def breakeven(hosted_cost_per_1k_req, self_hosted_cost_per_1k_req,
one_time_finetune_cost):
savings_per_1k = hosted_cost_per_1k_req - self_hosted_cost_per_1k_req
if savings_per_1k <= 0:
return "Self-hosting is not cheaper per request -- fine-tune only for behavior, not cost"
req_to_breakeven = (one_time_finetune_cost / savings_per_1k) * 1000
return f"Break even after ~{req_to_breakeven:,.0f} requests"
# Hosted big model: $15 / 1k requests. Self-hosted fine-tuned small model: $2 / 1k.
# One-time project cost (data + a few Colab/cloud GPU hours + your time): $400.
print(breakeven(hosted_cost_per_1k_req=15, self_hosted_cost_per_1k_req=2,
one_time_finetune_cost=400))python3 main.py