You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-foundry/openai/includes/fine-tuning-rest.md
+56-9Lines changed: 56 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,7 @@ For large data files, we recommend that you import from an Azure Blob store. Lar
100
100
### Upload training data
101
101
102
102
```bash
103
-
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/files?api-version=2024-10-21 \
103
+
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/v1/files \
104
104
-H "Content-Type: multipart/form-data" \
105
105
-H "api-key: $AZURE_OPENAI_API_KEY" \
106
106
-F "purpose=fine-tune" \
@@ -110,7 +110,7 @@ curl -X POST $AZURE_OPENAI_ENDPOINT/openai/files?api-version=2024-10-21 \
110
110
### Upload validation data
111
111
112
112
```bash
113
-
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/files?api-version=2024-10-21 \
113
+
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/v1/files \
114
114
-H "Content-Type: multipart/form-data" \
115
115
-H "api-key: $AZURE_OPENAI_API_KEY" \
116
116
-F "purpose=fine-tune" \
@@ -124,7 +124,7 @@ After you uploaded your training and validation files, you're ready to start the
124
124
In this example we are also passing the seed parameter. The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but can differ in rare cases. If a seed is not specified, one will be generated for you.
125
125
126
126
```bash
127
-
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/fine_tuning/jobs?api-version=2024-10-21 \
127
+
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/v1/fine_tuning/jobs \
128
128
-H "Content-Type: application/json" \
129
129
-H "api-key: $AZURE_OPENAI_API_KEY" \
130
130
-d '{
@@ -151,7 +151,7 @@ The current supported hyperparameters for fine-tuning are:
151
151
After you start a fine-tune job, it can take some time to complete. Your job might be queued behind other jobs in the system. Training your model can take minutes or hours depending on the model and dataset size. The following example uses the REST API to check the status of your fine-tuning job. The example retrieves information about your job by using the job ID returned from the previous example:
152
152
153
153
```bash
154
-
curl -X GET $AZURE_OPENAI_ENDPOINT/openai/fine_tuning/jobs/<YOUR-JOB-ID>?api-version=2024-10-21 \
154
+
curl -X GET $AZURE_OPENAI_ENDPOINT/openai/v1/fine_tuning/jobs/<YOUR-JOB-ID> \
155
155
-H "api-key: $AZURE_OPENAI_API_KEY"
156
156
```
157
157
@@ -180,19 +180,66 @@ curl -X POST $AZURE_OPENAI_ENDPOINT/openai/v1/fine_tuning/jobs/{fine_tuning_job_
180
180
To examine the individual fine-tuning events that were generated during training:
181
181
182
182
```bash
183
-
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/fine_tuning/jobs/{fine_tuning_job_id}/events?api-version=2024-10-21 \
183
+
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/events \
184
184
-H "Content-Type: application/json" \
185
185
-H "api-key: $AZURE_OPENAI_API_KEY"
186
186
```
187
187
188
+
### Copy model (preview)
189
+
190
+
You can now copy a fine-tuned checkpointed model from one region to another, across different subscriptions but within the same tenant. The process uses dedicated APIs to ensure efficient and secure transfers. This feature is currently available only with the API and not through the Foundry portal.
191
+
Once the model is copied from region A to region B, you can continually fine-tune the model in region B and deploy the model from this location.
192
+
193
+
> [!NOTE]
194
+
> Deletion of the model checkpoint in the source region will not cause the model to be deleted in the destination region. To delete the model in both regions once it has been copied, the model must be deleted separately in each region.
195
+
196
+
**Pre-requisites**
197
+
198
+
- Destination resource/account should have at least one fine-tuning job.
199
+
- Destination resource/account should not disable public network access. (At least while sending copying request).
200
+
- You can only copy to the destination account, if the account initiating the copy has sufficient permissions to access the destination account.
201
+
202
+
**Permissions configuration**
203
+
204
+
1. Create a [user-assigned managed identity](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities?pivots=identity-mi-methods-azp).
205
+
2. Give Cognitive Services OpenAI contributor role to your user-assigned managed identity on your destination resource/account.
206
+
3.[Assign the user-assigned managed identity](/entra/identity/managed-identities-azure-resources/how-to-assign-access-azure-resource?pivots=identity-mi-access-portal#use-azure-rbac-to-assign-a-managed-identity-access-to-another-resource-using-the-azure-portal) to your source resource account.
Since this is a long running operation, check the status of the Fine-tuned model copy by providing the checkpoint ID of the source account used in the POST call.
When each training epoch completes a checkpoint is generated. A checkpoint is a fully functional version of a model which can both be deployed and used as the target model for subsequent fine-tuning jobs. Checkpoints can be particularly useful, as they may provide snapshots prior to overfitting. When a fine-tuning job completes you will have the three most recent versions of the model available to deploy. The final epoch will be represented by your fine-tuned model, the previous two epochs will be available as checkpoints.
191
238
192
239
You can run the list checkpoints command to retrieve the list of checkpoints associated with an individual fine-tuning job:
193
240
194
241
```bash
195
-
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints?api-version=2024-10-21 \
242
+
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/v1/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints \
196
243
-H "Content-Type: application/json" \
197
244
-H "api-key: $AZURE_OPENAI_API_KEY"
198
245
```
@@ -204,12 +251,12 @@ Azure OpenAI attaches a result file named _results.csv_ to each fine-tune job af
204
251
The following Python example uses the REST API to retrieve the file ID of the first result file attached to the fine-tuning job for your customized model, and then downloads the file to your working directory for analysis.
205
252
206
253
```bash
207
-
curl -X GET "$AZURE_OPENAI_ENDPOINT/openai/fine_tuning/jobs/<JOB_ID>?api-version=2023-12-01-preview" \
254
+
curl -X GET "$AZURE_OPENAI_ENDPOINT/openai/v1/fine_tuning/jobs/<JOB_ID>" \
208
255
-H "api-key: $AZURE_OPENAI_API_KEY")
209
256
```
210
257
211
258
```bash
212
-
curl -X GET "$AZURE_OPENAI_ENDPOINT/openai/files/<RESULT_FILE_ID>/content?api-version=2023-12-01-preview" \
259
+
curl -X GET "$AZURE_OPENAI_ENDPOINT/openai/v1/files/<RESULT_FILE_ID>/content" \
@@ -274,7 +321,7 @@ Once you have created a fine-tuned model, you might want to continue to refine t
274
321
To perform fine-tuning on a model that you have previously fine-tuned, you would use the same process as described in [create a customized model](#create-a-customized-model) but instead of specifying the name of a generic base model you would specify your already fine-tuned model's ID. The fine-tuned model ID looks like `gpt-4.1-2025-04-14.ft-5fd1918ee65d4cd38a5dcf6835066ed7`
275
322
276
323
```bash
277
-
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/fine_tuning/jobs?api-version=2023-12-01-preview \
324
+
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/v1/fine_tuning/jobs \
0 commit comments