Skip to content

Commit 7f6f072

Browse files
committed
Merge branch 'main' into release-2025-openai-march-latest
2 parents 85f6c20 + 75d0349 commit 7f6f072

File tree

68 files changed

+970
-932
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+970
-932
lines changed

articles/ai-foundry/concepts/models-featured.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,7 @@ The Azure AI model catalog offers a large selection of models from a wide range
1919

2020
[!INCLUDE [models-preview](../includes/models-preview.md)]
2121

22-
To perform inferencing with the models, some models such as [Nixtla's TimeGEN-1](#nixtla) and [Cohere rerank](#cohere-rerank) require you to use custom APIs from the model providers. Others that belong to the following model types support inferencing using the [Azure AI model inference](../model-inference/overview.md):
23-
24-
- [Chat completion](../model-inference/how-to/use-chat-completions.md?context=/azure/ai-foundry/context/context)
25-
- [Chat completion (with reasoning content)](../model-inference/how-to/use-chat-reasoning.md?context=/azure/ai-foundry/context/context)
26-
- [Chat completion (with image and audio content)](../model-inference/how-to/use-chat-multi-modal.md?context=/azure/ai-foundry/context/context)
27-
- [Embeddings](../model-inference/how-to/use-embeddings.md?context=/azure/ai-foundry/context/context)
28-
- [Image embeddings](../model-inference/how-to/use-image-embeddings.md?context=/azure/ai-foundry/context/context)
29-
30-
You can find more details about individual models by reviewing their model cards in the [model catalog for Azure AI Foundry portal](https://ai.azure.com/explore/models).
22+
To perform inferencing with the models, some models such as [Nixtla's TimeGEN-1](#nixtla) and [Cohere rerank](#cohere-rerank) require you to use custom APIs from the model providers. Others support inferencing using the [Azure AI model inference](../model-inference/overview.md). You can find more details about individual models by reviewing their model cards in the [model catalog for Azure AI Foundry portal](https://ai.azure.com/explore/models).
3123

3224
:::image type="content" source="../media/models-featured/models-catalog.gif" alt-text="An animation showing Azure AI studio model catalog section and the models available." lightbox="../media/models-featured/models-catalog.gif":::
3325

articles/ai-foundry/includes/region-availability-maas.md

Lines changed: 28 additions & 28 deletions
Large diffs are not rendered by default.

articles/ai-foundry/model-inference/concepts/deployment-types.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ To learn more about deployment options for Azure OpenAI models see [Azure OpenAI
2929

3030
## Deployment types for Models-as-a-Service models
3131

32-
Models from third-party model providers with pay-as-you-go billing (collectively called Models-as-a-Service), makes models available in Azure AI model inference under **standard** deployments with a Global processing option (`Global-Standard`).
32+
Models with pay-as-you-go billing (collectively called Models-as-a-Service), makes models available in Azure AI model inference under **standard** deployments with a Global processing option (`Global-Standard`).
33+
34+
> [!TIP]
35+
> Models-as-a-Service offers regional deployment options under [Serverless API endpoints](../../../ai-studio/how-to/deploy-models-serverless.md) in Azure AI Foundry. However, those deployments can't be accessed using the Azure AI model inference endpoint in Azure AI Services and they need to be created within a project.
3336
3437
### Global-Standard
3538

3639
Global deployments leverage Azure's global infrastructure to dynamically route traffic to the data center with best availability for each request. Global standard provides the highest default quota and eliminates the need to load balance across multiple resources. Data stored at rest remains in the designated Azure geography, while data may be processed for inferencing in any Azure location. Learn more about [data residency](https://azure.microsoft.com/explore/global-infrastructure/data-residency/).
3740

38-
> [!NOTE]
39-
> Models-as-a-Service offers regional deployment options under [Serverless API endpoints](../../../ai-studio/how-to/deploy-models-serverless.md) in Azure AI Foundry. Prompts and outputs are processed within the geography specified during deployment. However, those deployments can't be accessed using the Azure AI model inference endpoint in Azure AI Services.
40-
4141
## Control deployment options
4242

4343
Administrators can control which model deployment types are available to their users by using Azure Policies. Learn more about [How to control AI model deployment with custom policies](../../../ai-studio/how-to/custom-policy-model-deployment.md).

articles/ai-foundry/model-inference/includes/use-chat-completions/csharp.md

Lines changed: 4 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: mopeakande
77
reviewer: santiagxf
88
ms.service: azure-ai-model-inference
99
ms.topic: how-to
10-
ms.date: 1/21/2025
10+
ms.date: 03/20/2025
1111
ms.author: mopeakande
1212
ms.reviewer: fasantia
1313
ms.custom: references_regions, tool_generated
@@ -26,7 +26,7 @@ To use chat completion models in your application, you need:
2626

2727
[!INCLUDE [how-to-prerequisites-csharp](../how-to-prerequisites-csharp.md)]
2828

29-
* A chat completions model deployment. If you don't have one read [Add and configure models to Azure AI services](../../how-to/create-model-deployments.md) to add a chat completions model to your resource.
29+
* A chat completions model deployment. If you don't have one, read [Add and configure models to Azure AI services](../../how-to/create-model-deployments.md) to add a chat completions model to your resource.
3030

3131
* This example uses `mistral-large-2407`.
3232

@@ -42,7 +42,7 @@ ChatCompletionsClient client = new ChatCompletionsClient(
4242
);
4343
```
4444

45-
If you have configured the resource to with **Microsoft Entra ID** support, you can use the following code snippet to create a client.
45+
If you've configured the resource with **Microsoft Entra ID** support, you can use the following code snippet to create a client.
4646

4747

4848
```csharp
@@ -181,7 +181,7 @@ response = client.Complete(requestOptions);
181181
Console.WriteLine($"Response: {response.Value.Content}");
182182
```
183183

184-
Some models don't support JSON output formatting. You can always prompt the model to generate JSON outputs. However, such outputs are not guaranteed to be valid JSON.
184+
Some models don't support JSON output formatting. You can always prompt the model to generate JSON outputs. However, such outputs aren't guaranteed to be valid JSON.
185185

186186
If you want to pass a parameter that isn't in the list of supported parameters, you can pass it to the underlying model using *extra parameters*. See [Pass extra parameters to the model](#pass-extra-parameters-to-the-model).
187187

@@ -400,69 +400,3 @@ catch (RequestFailedException ex)
400400

401401
> [!TIP]
402402
> To learn more about how you can configure and control Azure AI content safety settings, check the [Azure AI content safety documentation](https://aka.ms/azureaicontentsafety).
403-
404-
## Use chat completions with images
405-
406-
Some models can reason across text and images and generate text completions based on both kinds of input. In this section, you explore the capabilities of Some models for vision in a chat fashion:
407-
408-
> [!IMPORTANT]
409-
> Some models support only one image for each turn in the chat conversation and only the last image is retained in context. If you add multiple images, it results in an error.
410-
411-
To see this capability, download an image and encode the information as `base64` string. The resulting data should be inside of a [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs):
412-
413-
414-
```csharp
415-
string imageUrl = "https://news.microsoft.com/source/wp-content/uploads/2024/04/The-Phi-3-small-language-models-with-big-potential-1-1900x1069.jpg";
416-
string imageFormat = "jpeg";
417-
HttpClient httpClient = new HttpClient();
418-
httpClient.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0");
419-
byte[] imageBytes = httpClient.GetByteArrayAsync(imageUrl).Result;
420-
string imageBase64 = Convert.ToBase64String(imageBytes);
421-
string dataUrl = $"data:image/{imageFormat};base64,{imageBase64}";
422-
```
423-
424-
Visualize the image:
425-
426-
:::image type="content" source="../../../../ai-foundry/media/how-to/sdks/small-language-models-chart-example.jpg" alt-text="A chart displaying the relative capabilities between large language models and small language models." lightbox="../../../../ai-foundry/media/how-to/sdks/small-language-models-chart-example.jpg":::
427-
428-
Now, create a chat completion request with the image:
429-
430-
431-
```csharp
432-
ChatCompletionsOptions requestOptions = new ChatCompletionsOptions()
433-
{
434-
Messages = {
435-
new ChatRequestSystemMessage("You are an AI assistant that helps people find information."),
436-
new ChatRequestUserMessage([
437-
new ChatMessageTextContentItem("Which conclusion can be extracted from the following chart?"),
438-
new ChatMessageImageContentItem(new Uri(dataUrl))
439-
]),
440-
},
441-
MaxTokens=2048,
442-
Model = "phi-3.5-vision-instruct",
443-
};
444-
445-
var response = client.Complete(requestOptions);
446-
Console.WriteLine(response.Value.Content);
447-
```
448-
449-
The response is as follows, where you can see the model's usage statistics:
450-
451-
452-
```csharp
453-
Console.WriteLine($"{response.Value.Role}: {response.Value.Content}");
454-
Console.WriteLine($"Model: {response.Value.Model}");
455-
Console.WriteLine("Usage:");
456-
Console.WriteLine($"\tPrompt tokens: {response.Value.Usage.PromptTokens}");
457-
Console.WriteLine($"\tTotal tokens: {response.Value.Usage.TotalTokens}");
458-
Console.WriteLine($"\tCompletion tokens: {response.Value.Usage.CompletionTokens}");
459-
```
460-
461-
```console
462-
ASSISTANT: The chart illustrates that larger models tend to perform better in quality, as indicated by their size in billions of parameters. However, there are exceptions to this trend, such as Phi-3-medium and Phi-3-small, which outperform smaller models in quality. This suggests that while larger models generally have an advantage, there might be other factors at play that influence a model's performance.
463-
Model: phi-3.5-vision-instruct
464-
Usage:
465-
Prompt tokens: 2380
466-
Completion tokens: 126
467-
Total tokens: 2506
468-
```

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: mopeakande
77
reviewer: santiagxf
88
ms.service: azure-ai-model-inference
99
ms.topic: how-to
10-
ms.date: 1/21/2025
10+
ms.date: 03/20/2025
1111
ms.author: mopeakande
1212
ms.reviewer: fasantia
1313
ms.custom: references_regions, tool_generated
@@ -26,7 +26,7 @@ To use chat completion models in your application, you need:
2626

2727
[!INCLUDE [how-to-prerequisites-java](../how-to-prerequisites-java.md)]
2828

29-
* A chat completions model deployment. If you don't have one read [Add and configure models to Azure AI services](../../how-to/create-model-deployments.md) to add a chat completions model to your resource.
29+
* A chat completions model deployment. If you don't have one, read [Add and configure models to Azure AI services](../../how-to/create-model-deployments.md) to add a chat completions model to your resource.
3030

3131
* This example uses `mistral-large-2407`.
3232

@@ -41,7 +41,7 @@ ChatCompletionsClient client = new ChatCompletionsClientBuilder()
4141
.buildClient();
4242
```
4343

44-
If you have configured the resource to with **Microsoft Entra ID** support, you can use the following code snippet to create a client.
44+
If you've configured the resource with **Microsoft Entra ID** support, you can use the following code snippet to create a client.
4545

4646
```java
4747
TokenCredential defaultCredential = new DefaultAzureCredentialBuilder().build();
@@ -120,7 +120,7 @@ client.completeStream(new ChatCompletionsOptions(chatMessages))
120120
#### Explore more parameters supported by the inference client
121121

122122
Explore other parameters that you can specify in the inference client. For a full list of all the supported parameters and their corresponding documentation, see [Azure AI Model Inference API reference](https://aka.ms/azureai/modelinference).
123-
Some models don't support JSON output formatting. You can always prompt the model to generate JSON outputs. However, such outputs are not guaranteed to be valid JSON.
123+
Some models don't support JSON output formatting. You can always prompt the model to generate JSON outputs. However, such outputs aren't guaranteed to be valid JSON.
124124

125125
If you want to pass a parameter that isn't in the list of supported parameters, you can pass it to the underlying model using *extra parameters*. See [Pass extra parameters to the model](#pass-extra-parameters-to-the-model).
126126

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

Lines changed: 4 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: mopeakande
77
reviewer: santiagxf
88
ms.service: azure-ai-model-inference
99
ms.topic: how-to
10-
ms.date: 1/21/2025
10+
ms.date: 03/20/2025
1111
ms.author: mopeakande
1212
ms.reviewer: fasantia
1313
ms.custom: references_regions, tool_generated
@@ -26,7 +26,7 @@ To use chat completion models in your application, you need:
2626

2727
[!INCLUDE [how-to-prerequisites-javascript](../how-to-prerequisites-javascript.md)]
2828

29-
* A chat completions model deployment. If you don't have one read [Add and configure models to Azure AI services](../../how-to/create-model-deployments.md) to add a chat completions model to your resource.
29+
* A chat completions model deployment. If you don't have one, read [Add and configure models to Azure AI services](../../how-to/create-model-deployments.md) to add a chat completions model to your resource.
3030

3131
## Use chat completions
3232

@@ -44,7 +44,7 @@ const client = new ModelClient(
4444
);
4545
```
4646

47-
If you have configured the resource to with **Microsoft Entra ID** support, you can use the following code snippet to create a client.
47+
If you've configured the resource with **Microsoft Entra ID** support, you can use the following code snippet to create a client.
4848

4949

5050
```javascript
@@ -177,7 +177,7 @@ var response = await client.path("/chat/completions").post({
177177
});
178178
```
179179
180-
Some models don't support JSON output formatting. You can always prompt the model to generate JSON outputs. However, such outputs are not guaranteed to be valid JSON.
180+
Some models don't support JSON output formatting. You can always prompt the model to generate JSON outputs. However, such outputs aren't guaranteed to be valid JSON.
181181
182182
If you want to pass a parameter that isn't in the list of supported parameters, you can pass it to the underlying model using *extra parameters*. See [Pass extra parameters to the model](#pass-extra-parameters-to-the-model).
183183
@@ -388,82 +388,3 @@ catch (error) {
388388
> [!TIP]
389389
> To learn more about how you can configure and control Azure AI content safety settings, check the [Azure AI content safety documentation](https://aka.ms/azureaicontentsafety).
390390
391-
## Use chat completions with images
392-
393-
Some models can reason across text and images and generate text completions based on both kinds of input. In this section, you explore the capabilities of Some models for vision in a chat fashion:
394-
395-
> [!IMPORTANT]
396-
> Some models support only one image for each turn in the chat conversation and only the last image is retained in context. If you add multiple images, it results in an error.
397-
398-
To see this capability, download an image and encode the information as `base64` string. The resulting data should be inside of a [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs):
399-
400-
401-
```javascript
402-
const image_url = "https://news.microsoft.com/source/wp-content/uploads/2024/04/The-Phi-3-small-language-models-with-big-potential-1-1900x1069.jpg";
403-
const image_format = "jpeg";
404-
405-
const response = await fetch(image_url, { headers: { "User-Agent": "Mozilla/5.0" } });
406-
const image_data = await response.arrayBuffer();
407-
const image_data_base64 = Buffer.from(image_data).toString("base64");
408-
const data_url = `data:image/${image_format};base64,${image_data_base64}`;
409-
```
410-
411-
Visualize the image:
412-
413-
414-
```javascript
415-
const img = document.createElement("img");
416-
img.src = data_url;
417-
document.body.appendChild(img);
418-
```
419-
420-
:::image type="content" source="../../../../ai-foundry/media/how-to/sdks/small-language-models-chart-example.jpg" alt-text="A chart displaying the relative capabilities between large language models and small language models." lightbox="../../../../ai-foundry/media/how-to/sdks/small-language-models-chart-example.jpg":::
421-
422-
Now, create a chat completion request with the image:
423-
424-
425-
```javascript
426-
var messages = [
427-
{ role: "system", content: "You are a helpful assistant that can generate responses based on images." },
428-
{ role: "user", content:
429-
[
430-
{ type: "text", text: "Which conclusion can be extracted from the following chart?" },
431-
{ type: "image_url", image:
432-
{
433-
url: data_url
434-
}
435-
}
436-
]
437-
}
438-
];
439-
440-
var response = await client.path("/chat/completions").post({
441-
body: {
442-
messages: messages,
443-
temperature: 0,
444-
top_p: 1,
445-
max_tokens: 2048,
446-
}
447-
});
448-
```
449-
450-
The response is as follows, where you can see the model's usage statistics:
451-
452-
453-
```javascript
454-
console.log(response.body.choices[0].message.role + ": " + response.body.choices[0].message.content);
455-
console.log("Model:", response.body.model);
456-
console.log("Usage:");
457-
console.log("\tPrompt tokens:", response.body.usage.prompt_tokens);
458-
console.log("\tCompletion tokens:", response.body.usage.completion_tokens);
459-
console.log("\tTotal tokens:", response.body.usage.total_tokens);
460-
```
461-
462-
```console
463-
ASSISTANT: The chart illustrates that larger models tend to perform better in quality, as indicated by their size in billions of parameters. However, there are exceptions to this trend, such as Phi-3-medium and Phi-3-small, which outperform smaller models in quality. This suggests that while larger models generally have an advantage, there might be other factors at play that influence a model's performance.
464-
Model: mistral-large-2407
465-
Usage:
466-
Prompt tokens: 2380
467-
Completion tokens: 126
468-
Total tokens: 2506
469-
```

0 commit comments

Comments
 (0)