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-services/openai/how-to/batch.md
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure OpenAI
4
4
description: Learn how to use global batch with Azure OpenAI Service
5
5
manager: nitinme
6
6
ms.service: azure-ai-openai
7
-
ms.custom:
7
+
ms.custom: references_regions
8
8
ms.topic: how-to
9
9
ms.date: 10/14/2024
10
10
author: mrbullwinkle
@@ -67,7 +67,7 @@ Refer to the [models page](../concepts/models.md) for the most up-to-date inform
67
67
68
68
### API support
69
69
70
-
API support was first added with `2024-07-01-preview`.
70
+
API support was first added with `2024-07-01-preview`. Use `2024-10-01-preview` to take advantage of the latest features.
71
71
72
72
### Not supported
73
73
@@ -90,9 +90,7 @@ In the Studio UI the deployment type will appear as `Global-Batch`.
90
90
:::image type="content" source="../media/how-to/global-batch/global-batch.png" alt-text="Screenshot that shows the model deployment dialog in Azure OpenAI Studio with Global-Batch deployment type highlighted." lightbox="../media/how-to/global-batch/global-batch.png":::
91
91
92
92
> [!TIP]
93
-
> Each line of your input file for batch processing has a `model` attribute that requires a global batch **deployment name**. For a given input file, all names must be the same deployment name. This is different from OpenAI where the concept of model deployments does not exist.
94
-
>
95
-
> For the best performance we recommend submitting large files for batch processing, rather than a large number of small files with only a few lines in each file.
93
+
> We recommend enabling **dynamic quota** for all global batch model deployments to help avoid job failures due to insufficient enqueued token quota. Dynamic quota allows your deployment to opportunistically take advantage of more quota when extra capacity is available. When dynamic quota is set to off, your deployment will only be able to process requests up to the enqueued token limit that was defined when you created the deployment.
96
94
97
95
::: zone pivot="programming-language-ai-studio"
98
96
@@ -161,6 +159,15 @@ Yes. Similar to other deployment types, you can create content filters and assoc
161
159
162
160
Yes, from the quota page in the Studio UI. Default quota allocation can be found in the [quota and limits article](../quotas-limits.md#global-batch-quota).
163
161
162
+
### How do I tell how many tokens my batch request contains, and how many tokens are available as quota?
163
+
164
+
The `2024-10-01-preview` REST API adds two new response headers:
165
+
166
+
*`deployment-enqueued-tokens` - A approximate token count for your jsonl file calculated immediately after the batch request is submitted. This value represents an estimate based on the number of characters and is not the true token count.
167
+
*`deployment-maximum-enqueued-tokens` The total available enqueued tokens available for this global batch model deployment.
168
+
169
+
These response headers are only available when making a POST request to begin batch processing of a file with the REST API. The language specific client libraries do not currently return these new response headers.
170
+
164
171
### What happens if the API doesn't complete my request within the 24 hour time frame?
165
172
166
173
We aim to process these requests within 24 hours; we don't expire the jobs that take longer. You can cancel the job anytime. When you cancel the job, any remaining work is cancelled and any already completed work is returned. You'll be charged for any completed work.
@@ -236,4 +243,4 @@ When a job failure occurs, you'll find details about the failure in the `errors`
236
243
## See also
237
244
238
245
* Learn more about Azure OpenAI [deployment types](./deployment-types.md)
239
-
* Learn more about Azure OpenAI [quotas and limits](../quotas-limits.md)
246
+
* Learn more about Azure OpenAI [quotas and limits](../quotas-limits.md)
Copy file name to clipboardExpand all lines: articles/ai-services/openai/includes/batch/batch-python.md
+236-2Lines changed: 236 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Azure OpenAI model global batch Python
5
5
manager: nitinme
6
6
ms.service: azure-ai-openai
7
7
ms.topic: include
8
-
ms.date: 07/22/2024
8
+
ms.date: 10/15/2024
9
9
---
10
10
11
11
## Prerequisites
@@ -63,6 +63,8 @@ The `custom_id` is required to allow you to identify which individual batch requ
63
63
64
64
> [!IMPORTANT]
65
65
> The `model` attribute must be set to match the name of the Global Batch deployment you wish to target for inference responses. The **same Global Batch model deployment name must be present on each line of the batch file.** If you want to target a different deployment you must do so in a separate batch file/job.
66
+
>
67
+
> For the best performance we recommend submitting large files for batch processing, rather than a large number of small files with only a few lines in each file.
66
68
67
69
### Create input file
68
70
@@ -74,13 +76,42 @@ Once your input file is prepared, you first need to upload the file to then be a
@@ -367,3 +400,204 @@ List all batch jobs for a particular Azure OpenAI resource.
367
400
```python
368
401
client.batches.list()
369
402
```
403
+
404
+
### List batch (Preview)
405
+
406
+
Use the REST API to list all batch jobs with additional sorting/filtering options.
407
+
408
+
In the examples below we are providing the `generate_time_filter` function to make constructing the filter easier. If you don't wish to use this function the format of the filter string would look like `created_at gt 1728773533 and created_at lt 1729032733 and status eq 'Completed'`.
0 commit comments