How to delete a fine-tune model (via api)?

Hi
I’m building a small tool to help me manage files and fine-tunes. I just noticed there doesn’t seem to be an API endpoint to delete fine-tune models.
Am I missing something? The command line openai tool seems to be able to do it

Hi! An API for model deletion exists (you’re right, it’s what the CLI calls), but we haven’t added documentation to the site yet – sorry, coming soon!

The API is:

DELETE https://api.openai.com/v1/models/<MODEL>

or in python:

openai.Model.delete(model_name)
5 Likes

thanks Rachel, I see that the “models” endpoint is missing from the docs. I added that and now it’s working fine :slight_smile:

1 Like

Delete endpoint is working fine but engines are still appearing on GET /v1/fine-tunes endpoint with status succeeded. At this point, it is impossible to understand which engines are available.

If you call delete endpoint again you will get a 404. I think delete endpoint is working but there is a bug at fine-tunes endpoint or I am missing something.

Hi!
I had the same question but no, its ok like it is. Fine tunes is different from engines. Think like this: a fine-tune is a process that runs and finishes, producing a new engine as a result. Even if you delete the engine, the fine-tune record will remain, which it should. To know which engines are available you should use the engines end-point, not the fine-tunes endpoint.

Hi Nunodonato, I’m look for this, do you mind telling me how to gain access to that page?

there’s no page, you can only access that via API

Hello, When I use “openai.Model.delete(model_name)”, I found the model was deleted successful, but when I use “openai.FuneTune.list()” to check, the model still there.
Is there a way to delete all resource of the model in the result of “openai.FuneTune.list()”?

I think it takes time for all the user data to sync.

How long has it been since you deleted ?

:slight_smile:

It is about 24 hours. There is still no change.

Please use the retrieve API method using the fine-tune ID and post the results back here.

:slight_smile:

you are confusing things. Fine-tune process is one thing, models are another. You are deleting a fine-tuned model, but the fine-tuned process is still on the records. Its kind of historical data of what was done, with which file, etc.

The result is:

Finetune retrieve status: failed
Checking other finetune jobs in the subscription.
[‘curie:ft-personal-2023-03-01-07-26-01’, ‘babbage:ft-personal:grg-model-001-2023-03-01-12-17-24’, None, None, None, None, None]

So I can not delete these historical data?

I don’t think so, at least the docs don’t list an endpoint for that.

I have no an idea.
And I found all my finetune jobs were always failed, confusing.

This often happens when the JSONL training file is not validated and incorrectly JSONL formatted.

HTH

:slight_smile:

Thanks, you are right, now I get success:
Status: pending
Status: pending
Status: pending
Status: pending
Status: pending
Status: running
Status: succeeded

1 Like

Welcome!

Send Bitcoin (Joking)

:slight_smile:

Thanks a lot.
One more question, is there a rule of making training data? can you show me a sample?