Skip to content

Commit b7a521d

Browse files
authored
Merge pull request #2764 from MicrosoftDocs/main
2/6/2025 11:00 AM IST Publish
2 parents ea9b000 + 02fac48 commit b7a521d

File tree

15 files changed

+173
-39
lines changed

15 files changed

+173
-39
lines changed

articles/ai-foundry/model-inference/concepts/models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ DeepSeek family of models include DeepSeek-R1, which excels at reasoning tasks u
9797

9898
| Model | Type | Tier | Capabilities |
9999
| ------ | ---- | --- | ------------ |
100-
| [DeekSeek-R1](https://ai.azure.com/explore/models/deepseek-r1/version/1/registry/azureml-deepseek) | chat-completion | Global standard | - **Input:** text (16,384 tokens) <br /> - **Output:** (163,840 tokens) <br /> - **Languages:** `en` and `zh` <br /> - **Tool calling:** No <br /> - **Response formats:** Text (with reasoning content). |
100+
| [DeekSeek-R1](https://ai.azure.com/explore/models/deepseek-r1/version/1/registry/azureml-deepseek) | chat-completion <br /> [(with reasoning content)](../how-to/use-chat-reasoning.md) | Global standard | - **Input:** text (16,384 tokens) <br /> - **Output:** (163,840 tokens) <br /> - **Languages:** `en` and `zh` <br /> - **Tool calling:** No <br /> - **Response formats:** Text. |
101101

102102
See [this model collection in Azure AI Foundry portal](https://ai.azure.com/explore/models?&selectedCollection=deepseek).
103103

articles/ai-foundry/model-inference/includes/use-chat-reasoning/java.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To complete this tutorial, you need:
2727
<dependency>
2828
<groupId>com.azure</groupId>
2929
<artifactId>azure-ai-inference</artifactId>
30-
<version>1.0.0-beta.1</version>
30+
<version>1.0.0-beta.2</version>
3131
</dependency>
3232
```
3333

@@ -65,7 +65,6 @@ First, create the client to consume the model. The following code uses an endpoi
6565
ChatCompletionsClient client = new ChatCompletionsClient(
6666
new URI("https://<resource>.services.ai.azure.com/models"),
6767
new AzureKeyCredential(System.getProperty("AZURE_INFERENCE_CREDENTIAL")),
68-
"${variants-sample}"
6968
```
7069

7170
> [!TIP]
@@ -76,8 +75,7 @@ If you have configured the resource to with **Microsoft Entra ID** support, you
7675
```java
7776
client = new ChatCompletionsClient(
7877
new URI("https://<resource>.services.ai.azure.com/models"),
79-
new DefaultAzureCredentialBuilder().build(),
80-
"${variants-sample}"
78+
new DefaultAzureCredentialBuilder().build()
8179
);
8280
```
8381
@@ -87,6 +85,7 @@ The following example shows how you can create a basic chat request to the model
8785
8886
```java
8987
ChatCompletionsOptions requestOptions = new ChatCompletionsOptions()
88+
.setModel("DeepSeek-R1")
9089
.setMessages(Arrays.asList(
9190
new ChatRequestUserMessage("How many languages are in the world?")
9291
));
@@ -167,6 +166,7 @@ You can _stream_ the content to get it as it's being generated. Streaming conten
167166

168167
```java
169168
ChatCompletionsOptions requestOptions = new ChatCompletionsOptions()
169+
.setModel("DeepSeek-R1")
170170
.setMessages(Arrays.asList(
171171
new ChatRequestUserMessage("How many languages are in the world? Write an essay about it.")
172172
))

articles/ai-foundry/model-inference/includes/use-chat-reasoning/javascript.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ import { AzureKeyCredential } from "@azure/core-auth";
3838

3939
const client = new ModelClient(
4040
process.env.AZURE_INFERENCE_ENDPOINT,
41-
new AzureKeyCredential(process.env.AZURE_INFERENCE_CREDENTIAL),
42-
"deepseek-r1"
41+
new AzureKeyCredential(process.env.AZURE_INFERENCE_CREDENTIAL)
4342
);
4443
```
4544

@@ -58,7 +57,6 @@ const clientOptions = { credentials: { "https://cognitiveservices.azure.com" } }
5857
const client = new ModelClient(
5958
"https://<resource>.services.ai.azure.com/models",
6059
new DefaultAzureCredential(),
61-
"deepseek-r1",
6260
clientOptions,
6361
);
6462
```
@@ -74,6 +72,7 @@ var messages = [
7472

7573
var response = await client.path("/chat/completions").post({
7674
body: {
75+
model: "DeepSeek-R1",
7776
messages: messages,
7877
}
7978
});
@@ -163,6 +162,7 @@ var messages = [
163162

164163
var response = await client.path("/chat/completions").post({
165164
body: {
165+
model: "DeepSeek-R1",
166166
messages: messages,
167167
}
168168
}).asNodeStream();
@@ -229,6 +229,7 @@ try {
229229
];
230230

231231
var response = await client.path("/chat/completions").post({
232+
model: "DeepSeek-R1",
232233
body: {
233234
messages: messages,
234235
}

articles/ai-foundry/model-inference/includes/use-embeddings/rest.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Create an embedding request to see the output of the model.
5050

5151
```json
5252
{
53+
"model": "text-embedding-3-small",
5354
"input": [
5455
"The ultimate answer to the question of life"
5556
]
@@ -93,6 +94,7 @@ It can be useful to compute embeddings in input batches. The parameter `inputs`
9394

9495
```json
9596
{
97+
"model": "text-embedding-3-small",
9698
"input": [
9799
"The ultimate answer to the question of life",
98100
"The largest planet in our solar system is Jupiter"
@@ -150,6 +152,7 @@ You can specify the number of dimensions for the embeddings. The following examp
150152

151153
```json
152154
{
155+
"model": "text-embedding-3-small",
153156
"input": [
154157
"The ultimate answer to the question of life"
155158
],
@@ -161,23 +164,25 @@ You can specify the number of dimensions for the embeddings. The following examp
161164

162165
Some models can generate multiple embeddings for the same input depending on how you plan to use them. This capability allows you to retrieve more accurate embeddings for RAG patterns.
163166

164-
The following example shows how to create embeddings that are used to create an embedding for a document that will be stored in a vector database:
167+
The following example shows how to create embeddings that are used to create an embedding for a document that will be stored in a vector database. Since `text-embedding-3-small` doesn't support this capability, we are using an embedding model from Cohere in the following example:
165168

166169

167170
```json
168171
{
172+
"model": "cohere-embed-v3-english",
169173
"input": [
170174
"The answer to the ultimate question of life, the universe, and everything is 42"
171175
],
172176
"input_type": "document"
173177
}
174178
```
175179

176-
When you work on a query to retrieve such a document, you can use the following code snippet to create the embeddings for the query and maximize the retrieval performance.
180+
When you work on a query to retrieve such a document, you can use the following code snippet to create the embeddings for the query and maximize the retrieval performance. Since `text-embedding-3-small` doesn't support this capability, we are using an embedding model from Cohere in the following example:
177181

178182

179183
```json
180184
{
185+
"model": "cohere-embed-v3-english",
181186
"input": [
182187
"What's the ultimate meaning of life?"
183188
],

articles/ai-foundry/model-inference/includes/use-image-embeddings/rest.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ To use embedding models in your application, you need:
3333
To use the text embeddings, use the route `/images/embeddings` appended to your base URL along with your credential indicated in `api-key`. `Authorization` header is also supported with the format `Bearer <key>`.
3434

3535
```http
36-
POST https://<resource>.services.ai.azure.com/models/images/embeddings
36+
POST https://<resource>.services.ai.azure.com/models/images/embeddings?api-version=2024-05-01-preview
3737
Content-Type: application/json
3838
api-key: <key>
3939
```
4040

4141
If you configured the resource with **Microsoft Entra ID** support, pass you token in the `Authorization` header:
4242

4343
```http
44-
POST https://<resource>.services.ai.azure.com/models/images/embeddings
44+
POST https://<resource>.services.ai.azure.com/models/images/embeddings?api-version=2024-05-01-preview
4545
Content-Type: application/json
4646
Authorization: Bearer <token>
4747
```
@@ -52,7 +52,7 @@ To create image embeddings, you need to pass the image data as part of your requ
5252

5353
```json
5454
{
55-
"model": "${varients-sample}",
55+
"model": "Cohere-embed-v3-english",
5656
"input": [
5757
{
5858
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUh..."
@@ -103,7 +103,7 @@ Some models can generate embeddings from images and text pairs. In this case, yo
103103

104104
```json
105105
{
106-
"model": "${varients-sample}",
106+
"model": "Cohere-embed-v3-english",
107107
"input": [
108108
{
109109
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUh...",
@@ -122,7 +122,7 @@ The following example shows how to create embeddings that are used to create an
122122

123123
```json
124124
{
125-
"model": "${varients-sample}",
125+
"model": "Cohere-embed-v3-english",
126126
"input": [
127127
{
128128
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUh..."
@@ -137,7 +137,7 @@ When you work on a query to retrieve such a document, you can use the following
137137

138138
```json
139139
{
140-
"model": "${varients-sample}",
140+
"model": "Cohere-embed-v3-english",
141141
"input": [
142142
{
143143
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUh..."
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
title: Troubleshoot latency issues with Document Intelligence API
3+
titleSuffix: Azure AI services
4+
description: Learn troubleshooting tips, remedial solutions, and best practices for addressing Document Intelligence latency issues.
5+
author: laujan
6+
manager: nitinme
7+
ms.service: azure-ai-document-intelligence
8+
ms.topic: troubleshooting
9+
ms.date: 02/05/2025
10+
ms.author: lajanuar
11+
---
12+
13+
# Troubleshooting latency issues in Azure AI Document Intelligence
14+
15+
This article presents troubleshooting tips, remedial solutions, and best practices to address Document Intelligence latency issues. Latency refers to the duration an API server takes to handle and process an incoming request before delivering the response to the client. The time required to analyze a document varies based on its size (such as the number of pages) and the content on each page.
16+
17+
Document Intelligence operates as a multitenant service, ensuring that latency for similar documents is comparable, though not always identical. Variability in latency and performance is an inherent characteristic of any microservice-based, stateless, asynchronous service, especially when processing images and large documents on a large scale. Despite continuous efforts to increase hardware capacity and enhance scalability, some latency issues can still arise during runtime.
18+
19+
> [!NOTE]
20+
>
21+
> * Azure AI services don't provide a Service Level Agreement (SLA) for latency.
22+
> * The Document Intelligence API offers asynchronous functionality, allowing you to access results up to 24 hours after sending your request to our backend.
23+
> * Use the request ID provided by the POST operation to retrieve these results. If you encounter issues during your standard polling sequence, save the request ID and try again later before considering a retry. For further assistance, refer to our [service page](../service-limits.md#detailed-description-quota-adjustment-and-best-practices).
24+
25+
## Set your latency baseline
26+
27+
To evaluate latency, you should first establish baseline metrics for your specific scenario. These metrics give you the expected end-to-end and server latency within the context of your application environment. Once you have these baseline metrics, it becomes easier to distinguish between expected and unexpected conditions.
28+
29+
## Check Azure region status
30+
31+
When you're experiencing latency issues, the first step is to check [Azure status](https://azure.status.microsoft/status) for any current outages or issues that might impact your services.
32+
33+
* All active events are listed under the `Current Impact` tab.
34+
35+
* You can also check your resource in the host region. Go to Geography → Products And Services → AI + Machine Learning → Azure AI Document Intelligence and check the status for your region:
36+
37+
:::image type="content" source="../media/latency/azure-status.png" alt-text="Screenshot of the Microsoft Azure status page." lightbox="../media/latency/azure-status.png":::
38+
39+
## Check file size
40+
41+
Monitor the size of files you send via the request API. Processing larger files in parallel can result in increased processing times. Normalize your metric by measuring latency per page. If you observe sustained periods (exceeding one hour) where latency per page consistently surpasses 15 seconds, consider addressing the issue.
42+
43+
## Check Azure Blob storage latency
44+
45+
The size of a request affects latency in Azure Storage operations. Larger operations take more time to complete due to the increased volume of data transferred over the network and processed by Azure Storage.
46+
47+
Azure Storage provides two latency metrics for block blobs in the Azure portal:
48+
49+
* End-to-end (E2E) latency measures the interval from when Azure Storage receives the first packet of the request until Azure Storage receives a client acknowledgment on the last packet of the response.
50+
51+
* Server latency measures the interval from when Azure Storage receives the last packet of the request until the first packet of the response is returned from Azure Storage.
52+
53+
To view latency metrics, navigate to your storage resource in the Azure portal:
54+
55+
* On the left navigation window, select **Insights** from the **Monitoring** drop-down menu.
56+
57+
* The insights tab opens a window that includes a chart showing both `E2E` and `Server` latency metrics:
58+
59+
:::image type="content" source="../media/latency/azure-storage.png" alt-text="Screenshot of Azure Storage latency metrics in the Azure portal.":::
60+
61+
62+
For more information, *see* [Latency in Blob storage](/azure/storage/blobs/storage-blobs-latency).
63+
64+
65+
## Check monitoring metrics for your resource
66+
67+
Azure portal monitors offer insights into your applications to enhance their performance and availability. There are several tools that you can use to monitor your app's performance in the Azure portal:
68+
69+
1. On the **Overview** page, select **Monitoring**, select the time period, and review the **Request latency** metrics on page.
70+
71+
:::image type="content" source="../media/latency/azure-portal-monitoring.png" alt-text="Screenshot of Azure usage monitoring metrics in the Azure portal.":::
72+
73+
1. On the left navigation window, select **Metrics** from the **Monitoring** drop-down menu.
74+
75+
* In the main window, select ➕**Add metric**.
76+
77+
* Keep the **Scope** and **Metric Namespace** fields unchanged. Add the **Latency** parameter to the **Metric** field and adjust the **Aggregation** field as needed.
78+
79+
:::image type="content" source="../media/latency/azure-portal-monitoring-metrics.png" alt-text="Screenshot of add your own metrics setting in the Azure portal.":::
80+
81+
## Set a latency alert in the Azure portal
82+
83+
Alerts assist you in identifying and resolving issues by providing proactive notifications when Azure Monitor data suggests a potential issue. An alert rule keeps an eye on your data and notifies you when set criteria are met on your specified resource. You can set up an alert in the Azure portal as follows:
84+
85+
1. On the left navigation window, select **Alerts** from the **Monitoring** drop-down menu.
86+
87+
1. Select the **Create alert rule** button.
88+
89+
1. In the new window that opens, select **Latency** from the **Select a signal** drop-down menu.
90+
91+
:::image type="content" source="../media/latency/azure-portal-create-alert.png" alt-text="Screenshot of the create an alert rule page in the Azure portal.":::
92+
93+
1. Configure the alert by completing the fields on the page.
94+
95+
1. After you complete the configuration, select **Review ➕ create**
96+
97+
98+
### Contact us
99+
100+
If you're unable to resolve long latency issue, [email us](mailto:[email protected]) with the following information:
101+
102+
* Model Name
103+
104+
* Version
105+
106+
* Subscription ID
107+
108+
* Resource ID
109+
110+
* Timestamp and issue description
111+
112+
* Request IDs of the concerning operations (if possible)
113+
114+
* Logs
115+
116+
* Sample files
117+
118+
* JSON file (output/analyze results)
119+
120+
* Training set (if it's a training issue related to custom neural models)
121+
122+
123+
For more assistance, you can also or use the feedback widget at the bottom of any Microsoft Learn page.
126 KB
Loading
127 KB
Loading
166 KB
Loading
91.4 KB
Loading

0 commit comments

Comments
 (0)