Fine-tuning dataset token cost calculator

A 25,000-row dataset looks modest until three epochs turn it into 90 million billed training tokens. Size your dataset tokens, hosted fine-tuning bill, and self-hosted QLoRA GPU cost side by side.

Interactive calculator

Fine-Tuning PathTrain TokensEst. GPU HrsRun CostCost per 1M Tok

How to keep fine-tuning dataset costs low

  1. Deduplicate and filter noisy rows before training. Cutting 30% of low-signal examples trims training cost by 30% and usually improves held-out eval accuracy.
  2. Start with 2 to 3 epochs on a 5,000-row pilot slice. Watching validation loss on a small pilot catches overfitting before you pay for a 200K-row run.
  3. Pack short sequences together during QLoRA training. Sequence packing removes padding waste and can double effective tokens per second on H100 nodes.
  4. Compare hosted API fine-tuning against self-hosted QLoRA on total 12-month hosting cost, not just the training bill. Dedicated GPUs cost far more to keep warm than a one-off API run.

Common questions

How are billed fine-tuning tokens calculated?

Multiply your training rows (excluding the validation split) by average tokens per example, then multiply by the number of epochs. Twenty-five thousand rows at 1,200 tokens over 3 epochs equals 81 million training tokens after a 10% validation split.

Why is self-hosted QLoRA so much cheaper per training run than hosted APIs?

On an H100 SXM at $2.85/hr, a 32B QLoRA run processes roughly 18,000 tokens per second with sequence packing, putting raw compute cost under $0.05 per million tokens.

How many epochs do I need for supervised fine-tuning?

Most instruction and domain fine-tunes converge in 2 to 3 epochs. Pushing past 4 epochs on small datasets often hurts generalization and increases hallucination.

Should I include system prompts in every training example?

Yes, if your production prompts use that exact system message. Otherwise strip repeated boilerplate or keep it short so you aren't paying to train on the same 600-token header every row.

All calculations run 100% locally in your browser with zero external API calls. Model rates and hardware figures reflect published 2026 provider rate cards.