Fine-Tuning Free Tokens Issue

Hi everyone,

I recently received an email from OpenAI stating that fine-tuning is free for 1M training tokens per day for GPT-4o and 2M training tokens per day for GPT-4o mini until September 23, 2024. However, when I created a fine-tune model, I noticed that I was still being charged, albeit at a low cost.

Has anyone else experienced this issue? According to the email, fine-tuning should be free until September 23, so I’m unsure why there are charges appearing. Any insights or clarification would be greatly appreciated!

I wanted to share some details from my recent fine-tuning run to better understand the situation:

  • Trained tokens: 5,370
  • Epochs: 10
  • Base model: gpt-4o-mini-2024-07-18

Here is the email I received from OpenAI:


Hi there,

Great news! Fine-tuning is now available to help you get higher performance at a lower cost for specific use cases.

Fine-tuning enables you to customize a model’s responses to fit your preferred structure or tone, or adapt it to follow complex domain-specific instructions.

From coding to creative writing, fine-tuning can have a large impact on model performance across a variety of domains: Cosine’s Genie achieves a SOTA score of 43.8% on the new SWE-bench Verified benchmark with a fine-tuned GPT-4o model. Distyl’s fine-tuned GPT-4o achieved a SOTA execution accuracy of 71.83% on the BIRD-SQL benchmark. Developers can already produce strong results for their applications with as little as a few dozen examples in their training data set. (See more details on their results in our blog post.)

Start by visiting the docs or head to the fine-tuning dashboard, click ‘create,’ and select ‘gpt-4o-2024-08-06’ or ‘gpt-4o-mini-2024-07-18’ from the base model drop-down. GPT-4o fine-tuning training costs $25 per million tokens, and inference is $3.75 per million input tokens and $15 per million output tokens. For GPT-4o mini, training cost is $3 per million tokens, and inference is $0.30 per million input tokens and $1.20 per million output tokens.

To help you get started, we’re also offering 1M training tokens per day for free for every organization through September 23 for GPT-4o fine-tuning and 2M training tokens per day for free for GPT-4o mini fine-tuning through September 23.

If you have questions, please reach out in the OpenAI developer forum.

Happy tuning!


I am also uploading a screenshot from their website for reference.

And I also find this on pricing page .

1 Like

Can you share the amount that you were charged?

2 Likes

Hi there!

I have in fact ran two tests just last weekend for verification and can confirm that only the overage is charged by OpenAI when fine-tuning gpt-4o-mini and gpt-4o.

Have you considered the impact of the number of epochs trained on the total amount of tokens?

1 Like

Thanks for the clarification! I appreciate the confirmation that only the overage is charged. I wanted to share some details from my recent fine-tuning run to better understand the situation:

  • Trained tokens: 5,370
  • Epochs: 10
  • Base model: gpt-4o-mini-2024-07-18

Considering these settings, I would have thought the total token usage would fall within the free daily limit, given that the number of trained tokens multiplied by the number of epochs would be around 53,700 tokens, which is still below the 2M daily free token limit for GPT-4o mini. However, I noticed a charge, even though it was a low cost.

Could the charges be related to any specific settings or configurations I might have missed? Any further insights would be really helpful!

Thanks!

Can you confirm that you did not test your model after it was fine-tuned? This might sound like a dumb question but it happened to me once in the context of gpt-4o-mini fine-tuning and then I mistook it for being charged for training.

Exact same thing is happening to me, I trained the model on the 20th. I got charged despite this email saying it was free. Then every day since i’m being charged for “fine tunning model” and I havent been doing that.

It sounds like you might be incurring charges for testing or using the fine-tuned model, rather than the training itself. Even though training might have been free, using or testing the fine-tuned model can still incur costs. I recommend checking your usage details to see if these charges are related to inference (using the model) rather than the training process.

1 Like

In my situation 1) the training wasnt free (Yes I’ve triple checked the model I trained)
2) I am already getting charged for using the model, and there’s a reoccuring training. I’ve checked all this

I am running into the same issue: I fine tuned two models (one on gpt4o and one on gpt4o-mini), and have seen fine-tuning costs show up on my usage page for both models without any testing. The fine-tuning cost for the gpt4o-mini model was $11.17, and this is the script I used:


def upload_file(client, input_file):
    print(f"Uploading file {input_file}")
    f = client.files.create(
        file=open(input_file, "rb"),
        purpose="fine-tune"
    )

    print(f"File uploaded {f.id}, {f.filename}")
    return f.id

def fine_tune(client, fileid):
    job = client.fine_tuning.jobs.create(
    training_file=fileid, 
    model="gpt-4o-mini-2024-07-18"
    )

    print(f"Job created {job.id}")
    return job.id


def monitor_job(client,jobid):
    # Retrieve the state of a fine-tune
    job = client.fine_tuning.jobs.retrieve(jobid)

    print(f"Job {jobid} state: {job.status}")

    while job.status != "succeeded":
        job = client.fine_tuning.jobs.retrieve(jobid)
        print(f"Job {jobid} state: {job.status}")
        if job.status == "failed":
            print(job.error)
        time.sleep(10)

    print(f"Job {jobid} state: {job.status}")

    print(f"Model name: {job.fine_tuned_model}")


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Fine-tune a GPT model using formatted issues")
    parser.add_argument("input_file", help="Input JSON file name (created by format_dataset.py)")
    args = parser.parse_args()

    client = OpenAI()

    fileid = upload_file(client, args.input_file)
    jobid = fine_tune(client, fileid)
    monitor_job(client, jobid)

Hi there @almavrog and welcome to the Community!

What was the number of tokens in your training file? What was the number of training epochs (based on your code, you did not specify it).

This is the official formulate for determining the total token for a given fine-tuning job, which in turn forms the basis for the charges.

(base training cost per 1M input tokens ÷ 1M) × number of tokens in the input file × number of epochs trained

Did that number exceed 2M in your case?

P.S.: If needed you can retrieve the fine-tuning job in order to obtain the number of epochs. See API Specs here.

1 Like