Skip to content
mathbehind

AI Fine-Tuning Cost Calculator

Estimate the cost of fine-tuning an LLM from your dataset size and epochs, then add the monthly cost of running the tuned model.

Your numbers

Prices and fees in this tool are in US dollars.

tokens

Prompt and ideal answer together. In English, words × 1.33 is a fair estimate.

Passes over the dataset. Many providers default to 3 or choose automatically.

$

Example value only. Use your provider's current fine-tuning price for the base model you choose.

First attempts rarely ship. Budget for a few runs.

tokens
tokens
$

Example value. Tuned models often cost more per token than the base model.

$

Training cost (all runs)

$900.00

Monthly cost to run the tuned model

$600.00

Cost per training run
$300.00
Tokens trained per run
12,000,000
Dataset size
4,000,000 tokens
First-year total (training + 12 months)
$8,100.00
Cost per 1,000 requests
$6.00
The math behind it
  1. Tokens trained per run

    5,000 × 800 × 3 epochsequals12,000,000

  2. Cost per run

    12,000,000 × $25.00 ÷ 1Mequals$300.00

  3. Training cost

    $300.00 × 3 runsequals$900.00

  4. Running it per month

    (600 × $3.75 + 250 × $15.00) ÷ 1M × 100,000equals$600.00

Fine-tuning teaches an existing model your format, tone or task from examples. Providers charge for the tokens processed in training, multiplied by the number of epochs, and then charge per token to use the tuned model. The training bill is often smaller than people fear; the running cost and the number of experiments are where budgets slip.

How it works

Training tokens = examples × average tokens per example × epochs. 5,000 examples of 800 tokens is a 4-million-token dataset; three epochs means 12 million tokens are trained.

Training cost per run = trained tokens ÷ 1,000,000 × the price per million. Most projects need several runs to get the data and settings right, so the calculator multiplies by the number of runs you expect.

Running the tuned model is priced per request, like any API call: input tokens × input price plus output tokens × output price. Fine-tuned models are often priced higher than their base models, so compare this monthly figure with simply using a larger base model with a good prompt.

The default prices are examples to show the arithmetic, not quotes. Fine-tuning prices vary a lot between providers and base models, so enter current figures from the provider's pricing page.

A worked example

You fine-tune on 5,000 examples averaging 800 tokens for 3 epochs, which trains 12 million tokens per run. At $25 per million that's $300 per run, or $900 for three runs. Serving 100,000 requests a month at 600 input and 250 output tokens, with tuned prices of $3.75 and $15 per million, costs $600 a month, so the first year totals $8,100.

Questions people ask

How much does it cost to fine-tune an LLM?

Multiply your dataset's tokens by the number of epochs and the provider's training price per million tokens. Small datasets can cost a few dollars per run; large ones hundreds or more. Then add the cost of running the tuned model, which is usually the bigger number over a year.

How many training examples do I need?

Providers often suggest starting with a few dozen to a few hundred high-quality examples and adding more if results improve. Quality and consistency matter more than volume: 500 clean examples often beat 5,000 noisy ones.

What is an epoch in fine-tuning?

One full pass over the training data. Three epochs means each example is seen three times, and you pay for three times the dataset's tokens. Too many epochs can make the model memorise examples instead of learning the pattern.

Is fine-tuning cheaper than prompt engineering?

Sometimes. A tuned model can use a much shorter prompt, which cuts input tokens on every request. If your current prompt is long and your volume is high, those savings can outweigh the training cost and the higher per-token price.

Should I fine-tune or use RAG?

Fine-tuning changes how a model behaves: format, tone, a narrow task. Retrieval (RAG) gives it facts it didn't know. If the problem is missing or changing knowledge, use RAG. If it's style or consistency, fine-tuning fits.