Formula: LLM Fine-Tuning Cost Calculator
- Inputs: All units, rates, and allowances are entered by the user.
Rounding: Displayed values are rounded for readability; package and item quantities round upward.
Separate one-time training spend from monthly inference.
Rounding: Displayed values are rounded for readability; package and item quantities round upward.
Because it includes the training job, which you pay once. The total adds that one-time charge to a single month of inference. From the second month, if you do not retrain, only the inference share repeats. On the default inputs that means the training line of $750.00 drops away and the input and output charges carry on.
Yes. With epochs at zero the training line reads $0.00 and the answer equals the inference workload alone, which is a quick way to get your recurring monthly figure. Setting the training rate or training tokens to zero does the same thing. Just remember to put the real epoch count back before you quote the first-month figure to anyone.
Yes, if you send it with every request. Providers bill every token in the request, so a long fixed system prompt is multiplied by your request count. Work out average tokens per request, including instructions, few-shot examples and any retrieved context, then multiply by the number of requests you expect in a month and enter that total.
Run the training file through the provider's tokenizer and add up the tokens across every example. If you only have a sample, tokenize a few hundred representative examples, take the average per example and multiply by the number of examples. Include both the prompt and the completion parts, since training normally bills the whole example.
Convert it before you type it in. This field expects a price per million tokens, so multiply a per-thousand price by a thousand. The same applies to the two inference rate fields. A wrong unit does not produce an error message, just a total that is off by a factor of a thousand, so it is worth checking twice. Copy the unit label from the pricing page next to each rate in your notes.
Because an epoch is one complete pass over the training data, and training settings almost always take whole numbers. The field accepts 0 for an inference-only figure, or any whole number from 1 up. If a job stopped early partway through a pass and you were billed for the tokens processed, work out the billed tokens yourself and adjust the per-epoch figure instead.
If you expect them, yes. Jobs that are cancelled partway may still be billed for the tokens already processed, depending on the provider. Many projects need more than one attempt after the data is cleaned. You can raise the epoch count to cover several runs, or run the calculator once per job and add the training lines together.
Because the two parts are independent in the formula. Training cost depends on dataset tokens, epochs and the training rate. Inference cost depends only on the monthly input and output volumes and their rates. A bigger dataset makes the training job dearer but does not change the price of each request to the finished model. Shorter prompts are what lower that price.
No. It has no field for a fixed hosting or deployment charge. Some providers charge to keep a customised model available, often by the hour, whether or not it receives traffic. If yours does, add that fee to the recurring side of your budget yourself. It can be large compared with token charges for a model with light use.
Only loosely. The training line assumes a price per million tokens, while self-hosted training costs GPU hours. You could work out a per-token equivalent from a past run, dividing the compute bill by tokens processed, and enter that. For serving the model afterwards, a GPU-hour based estimate fits better than per-token usage rates.
This calculator adds a one-time cost to a recurring one and shows you the sum. That is useful, and it is also the first thing to read carefully. The default answer, a first-month model cost of $930.00, is made of $750.00 for the training job and the rest for one month of using the tuned model.
The training part comes from 10,000,000 training tokens per epoch, run for 3 epochs, at 25 per million tokens. Thirty million billed tokens at 25 per million gives the $750.00. The inference part comes from 100,000,000 input tokens at 1 per million, which is $100, plus 20,000,000 output tokens at 4 per million, which is $80.
Month two looks nothing like month one. If you do not retrain, only the inference share recurs, so the second month on the default inputs costs the $100 of input plus the $80 of output and nothing else. Anyone who builds a budget by multiplying $930.00 by twelve has counted the training job twelve times.
So treat the headline as the cash you need in the month you launch. Then read the interpretation line, which splits training from inference, and carry only the inference figure forward into your monthly plan.
The Training Tokens field asks for tokens per epoch. An epoch is one full pass over your training set, so this is the token count of the whole dataset once, including every prompt and every completion in it.
Most people know their dataset in examples or in megabytes, not tokens. The honest way to get the token count is to run your actual training file through the tokenizer the provider uses and add up the result. Guessing from word counts works for a rough first pass, but tokenizers split text differently, and code, tables and non-English text often produce more tokens per word than plain English prose.
Check how the provider counts. Some bill every token in each example, prompt and answer alike. Some describe their charge in terms of tokens in the training file multiplied by epochs. A few have minimum charges per job. Read the fine-tuning section of the pricing page and the documentation for the training job itself, because the billing rule is sometimes explained there rather than next to the rate.
If your files include a separate validation set, find out whether those tokens are billed too. When they are, add them to the per-epoch figure or the estimate will come in low.
Epochs is a plain multiplier. Every extra pass bills the full dataset again, so the training cost moves in equal steps. On the default inputs each epoch is a third of $750.00, and four epochs take the training line to an even thousand dollars.
Setting epochs to 1 cuts training to a third of the default and leaves inference untouched. That is the cheapest possible run, but fewer passes are not automatically better or worse for quality. Some datasets learn what they need in one pass; others need more. The calculator cannot tell you which, only what each choice costs.
If the provider picks the number of epochs for you automatically, look at the finished job's report or the documentation to see what it chose, then enter that number. Using a default of 3 when the service actually ran more will understate the bill.
Also budget for reruns. Fine-tuning is rarely a single job. A first attempt reveals bad examples, the data gets cleaned and the job runs again. If you expect two attempts before you are happy, either double the epoch count here or run the calculator twice and add the training lines by hand.
The Training Rate field wants a price per million training tokens. Pricing pages usually list fine-tuning in its own table, separate from ordinary usage, and the training price and the price of using the tuned model are normally different numbers. Make sure you copy the training figure into this field and the usage figures into the two inference fields.
Watch the unit. Some pages quote per million tokens, some per thousand. A rate quoted per thousand has to be multiplied by a thousand before it goes in here. Getting that wrong produces an answer a thousand times too small, which is easy to miss because the result still looks like a reasonable number.
Some services do not bill training by tokens at all. They charge by the hour of compute the job used, or by a flat fee per job. This calculator cannot model that directly. You can still use it by working out an equivalent per-million-token rate from a past job, but the honest route is to cost training separately and use this page only for the inference side.
Note the currency setting too. Display Currency changes the symbol, not the rates, so the numbers you type must already be in that currency.
After training you pay to use the model, and the calculator splits that into input tokens and output tokens because providers almost always price them differently. On the default, output is four times the price of input, which is why 20,000,000 output tokens cost $80 while five times as many input tokens cost $100.
A tuned model is often billed at a different rate from the base model it was built on. Do not copy the base model's usage price out of habit. Look for the rate that applies to models you have customised, which is sometimes in the same fine-tuning table and sometimes on a separate line.
The volume figures deserve as much care as the rates. Input tokens are everything you send: system prompt, instructions, retrieved context and the user's message. Output tokens are what comes back. One of the common reasons to fine-tune is to shorten prompts, because behaviour you used to spell out in a long system prompt is now built into the model. If that is your plan, enter the shorter prompt length you expect, not today's.
Tripling both monthly volumes on the default inputs triples the inference share while the training line stays at $750.00, which shows how quickly a busy model makes the training job look small.
The lower preset drops the dataset to 6,000,000 tokens per epoch. Training falls to $450.00 and the first month to $630.00. The higher preset raises it to 15,000,000 tokens and training climbs to $1,125.00, with a first month of $1,305.00.
In both cases the inference share does not move, because dataset size has no effect on what each request costs later. That is the useful lesson in the presets. Trimming duplicates or weak examples from a training set saves money once. Trimming tokens from every request saves money every month.
If you are deciding how much data to prepare, run a few sizes and watch the training line. The cost scales in a straight line with tokens, so there is no discount for a bigger set and no penalty beyond the extra tokens.
A practical use for this page is comparing a fine-tuned model against keeping a base model with a long prompt. The calculator does not do the comparison for you, but it gives you the pieces.
Run it once with your expected tuned-model rates and the shorter prompts. Note the inference share. Then work out what the base model would cost each month at its own rates with the longer prompts, using the same token arithmetic: input tokens divided by a million times the input rate, plus output tokens divided by a million times the output rate.
The difference between those two monthly figures is what tuning saves or costs you each month. Divide the training line by that monthly saving and you get the number of months before the training job pays for itself. If tuned usage is priced higher than base usage and the prompt savings are small, there may be no saving at all, and the case for tuning has to rest on quality rather than cost.
Remember that you may retrain when your data or the base model changes. A training job that pays back over many months may never pay back if you expect to redo it every quarter.
The formula covers training tokens and usage tokens. Some providers add charges that are not in either. A tuned model may need to be hosted, with an hourly or monthly fee whether or not anyone calls it. Some services charge for storing the trained weights or the uploaded training files. Evaluation runs, where you test the new model against a held-out set, are ordinary usage and cost money too.
There is also the cost of preparing data, which is usually people's time rather than a line on the invoice, and often the largest part of a fine-tuning project. The calculator says nothing about it.
If your provider has a hosting fee, add it to the monthly side of your budget by hand. Leaving it out can turn a project that looks cheap on this page into one that costs more than the training ever did.