Skip to content
ENExplore Calculators

Fine-tuning Cost Calculator

Estimate the total cost of fine-tuning an LLM on a custom training dataset.

About Fine-tuning Cost Calculator

Fine-tuning cost is estimated by first computing total training compute (FLOPs), then converting to time using cluster throughput, then to dollars using the GPU's hourly rate: time_hours = (tokens × epochs × 6 × params) / (gpu_tflops × 1e12 × utilization × 3600), and cost = time_hours × gpu_rate × gpu_count. The factor of 6 approximates combined forward (≈2×params FLOPs/token) and backward (≈4×params FLOPs/token) pass compute per training token, and a 40% utilization factor accounts for realistic overhead from data loading, gradient synchronization, and imperfect kernel efficiency in real training runs.

Formulas

Training time

time_hours = (tokens * epochs * 6 * params) / (gpu_tflops * 1e12 * utilization * gpu_count * 3600)

tokens
Total training tokens
epochs
Number of training epochs
params
Model parameter count
gpu_tflops
Peak TFLOPs per GPU
utilization
Sustained utilization fraction (0.4)
gpu_count
Number of GPUs

Total cost

cost = time_hours * gpu_rate * gpu_count

time_hours
Estimated training duration in hours
gpu_rate
Hourly cost per GPU
gpu_count
Number of GPUs

Worked example

With the default values below, Fine-tuning Cost Calculator returns Estimated Fine-Tuning Cost of $56.09. Change any input above and every figure here is recalculated in your browser.

Inputs used

Model Parametersaccepts 0.001–2,000 billion
7 billion
Training Tokensaccepts 1–1,000,000,000,000,000 tokens
100,000,000 tokens
Epochsaccepts 1–1,000 epochs
3 epochs
GPU Typeone of NVIDIA A100 (312 TFLOPs, $2.00/hr), NVIDIA H100 (989 TFLOPs, $3.50/hr), NVIDIA RTX 4090 (165 TFLOPs, $0.50/hr)
NVIDIA A100 (312 TFLOPs, $2.00/hr)
GPU Countaccepts 1–100,000 GPUs
4 GPUs

Results

Estimated Fine-Tuning Cost
$56.09
Estimated Training Time
7.01 hours
Total Training FLOPs
1.260 × 10¹⁹

Step by step

  1. 1Total training FLOPs: tokens × epochs × 6 × parameters= 1.260e+19 FLOPs
  2. 2Cluster throughput: GPU TFLOPs × 1e12 × utilization(40%) × GPU count= 4.992e+14 FLOPs/sec
  3. 3Training time: total FLOPs ÷ (throughput × 3600)= 7.01 hours
  4. 4Total cost: time × GPU rate × GPU count= $56.09

Assumptions and limits

  • The result is derived only from the 5 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 3 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Why use 40% utilization instead of the GPU's peak TFLOPs?

Real training workloads rarely sustain a GPU's advertised peak throughput due to communication overhead between GPUs, memory bandwidth limits, and non-compute time spent on data loading and checkpointing; 40% is a reasonable, commonly observed average for multi-GPU fine-tuning.

How does this differ from full pre-training cost?

The same FLOPs-based formula applies to both, but fine-tuning typically uses far fewer training tokens (millions to low billions) than pre-training from scratch (trillions), so fine-tuning costs are usually orders of magnitude lower.

Does this include data preparation or evaluation costs?

No, this estimates only the raw GPU compute time and cost for the training loop itself — data preprocessing, evaluation runs, and hyperparameter search are separate costs not included here.

Can I reduce fine-tuning cost with techniques like LoRA?

Yes — parameter-efficient fine-tuning methods like LoRA train a small fraction of additional parameters instead of the full model, dramatically reducing both compute (FLOPs) and memory requirements compared to full fine-tuning, though this calculator assumes full-parameter fine-tuning.

Fine-tuning Cost Calculator | Calcrivo