โ† Back to NumStack

Fine-Tuning ROI Calculator

Should you fine-tune, use prompt engineering, or build a RAG pipeline? Get a data-driven answer with break-even analysis.

Your Setup

5K examples
100 examples100K examples

How many labelled training examples you have

100K req/mo
1K req/mo10.0M req/mo

Total API requests per month

500 tokens
100 tokens4K tokens

Input + output tokens combined per request

How this calculator works

This calculator prices three different approaches to the same problem side by side: fine-tuning a model on your own examples, prompt engineering (few-shot instructions with a general-purpose model), and RAG (retrieval-augmented generation, injecting relevant documents at request time). Each approach has a different cost shape โ€” fine-tuning has an upfront training cost but cheaper inference afterward, RAG has setup and ongoing infrastructure cost, and prompting has no setup cost but typically needs more tokens per request to reach the same quality.

Training cost is estimated from your dataset size and the current per-token training rate shown in the calculator; fine-tuned inference then runs on a shorter, more efficient prompt. RAG cost includes a one-time setup fee, a monthly vector database hosting cost, and embedding costs for your corpus, plus slightly larger prompts to hold retrieved context. Prompting cost uses full-length prompts with no offsetting savings. The calculator then computes the break-even point in months for fine-tuning versus each alternative, and recommends the approach that fits your volume, dataset size, and quality priority.

Break-even (months)

breakEvenMonths = (oneTimeCostA โˆ’ oneTimeCostB) รท (monthlyCostB โˆ’ monthlyCostA)

(only meaningful when the ongoing monthly cost of A is lower than B)

How to use it

  1. 1.Enter how many training examples you have (or would need to collect) for fine-tuning.
  2. 2.Enter your expected monthly request volume and average tokens per request.
  3. 3.Pick the base model you'd fine-tune or prompt against.
  4. 4.Set your quality priority โ€” it changes how much extra context prompting and RAG need to hit the same bar as a fine-tuned model.
  5. 5.Compare the three monthly costs, the break-even timeline, and the recommendation with its stated reasoning.

Common mistakes

Frequently asked questions

When does fine-tuning save more money than prompt engineering?โ–พ

Typically at high request volume and with a large enough training dataset (roughly 1,000+ examples) that the upfront training cost gets amortized quickly through lower per-request inference cost. The calculator's break-even figure tells you the exact crossover point for your numbers.

What is RAG and how does its cost compare to fine-tuning?โ–พ

RAG retrieves relevant documents and injects them into the prompt at request time instead of baking knowledge into the model weights. It has a lower one-time setup cost than fine-tuning but adds ongoing monthly cost for vector database hosting and keeping embeddings current.

How is the break-even point calculated?โ–พ

Break-even is the one-time cost difference between two approaches divided by the difference in their monthly running cost โ€” in other words, how many months it takes for a higher upfront cost to be paid back by lower ongoing cost. The calculator computes this automatically from your inputs.

How much does fine-tuning actually cost?โ–พ

It depends on your dataset size, average tokens per example, and the base model's current training rate โ€” all shown in the calculator using up-to-date pricing rather than a fixed number, since training rates vary by provider and model.

Is fine-tuning worth it for a small dataset?โ–พ

Usually not. With fewer than about 500 training examples, fine-tuning tends to overfit to those examples rather than generalize. RAG or careful prompt engineering typically produces better results at that scale.

Does the recommendation account for output quality, not just cost?โ–พ

Partly โ€” the calculator factors in a quality priority setting that affects how much extra context prompting and RAG need, and fine-tuning is favored for high-quality, high-volume domain-specific tasks. But real quality differences depend on your specific data and task, so validate with a small test before committing budget.