Skip to content

Commit edd5f57

Browse files
committed
add tabs for phi4-mini and phi4-mini-MM
1 parent 94adb0e commit edd5f57

File tree

3 files changed

+146
-30
lines changed

3 files changed

+146
-30
lines changed

articles/ai-studio/how-to/deploy-models-phi-4.md

Lines changed: 144 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to use Phi-4 family chat models with Azure AI Foundry.
55
ms.service: azure-ai-studio
66
manager: scottpolly
77
ms.topic: how-to
8-
ms.date: 01/09/2025
8+
ms.date: 01/23/2025
99
ms.reviewer: v-vkonjarla
1010
reviewer: VindyaKonjarla
1111
ms.author: mopeakande
@@ -27,18 +27,47 @@ The Phi-4 family of small language models (SLMs) is a collection of instruction-
2727

2828
## Phi-4 family chat models
2929

30+
The Phi-4 family chat models include the following models:
31+
32+
# [Phi-4-Mini-MM-Instruct](#tab/phi-4-mini-mm-instruct)
33+
34+
Phi-4-Mini-MM-Instruct is a lightweight open multimodal foundation model that leverages the language, vision, and speech research and datasets used for Phi-3.5 and 4.0 models. The model processes text, image, and audio inputs, and generates text outputs. The model underwent an enhancement process, incorporating both supervised fine-tuning, and direct preference optimization to support precise instruction adherence and safety measures.
35+
36+
The Phi-4-Mini-MM model comes in the following variant with a 128K token length.
37+
38+
39+
The following models are available:
40+
41+
* [Phi-4-Mini-MM-Instruct](https://aka.ms/azureai/landing/Phi-4-Mini-MM-Instruct)
42+
43+
44+
# [Phi-4-Mini-Instruct](#tab/phi-4-mini-instruct)
45+
46+
Phi-4-Mini-Instruct is a lightweight open model built upon synthetic data and filtered publicly available websites - with a focus on high-quality, reasoning dense data. The model belongs to the Phi-4 model family and supports 128K token context length. The model underwent an enhancement process, incorporating both supervised fine-tuning and direct preference optimization to support precise instruction adherence and robust safety measures.
47+
48+
The Phi-4-Mini model comes in the following variant with a 128K token length.
49+
50+
51+
The following models are available:
52+
53+
* [Phi-4-Mini-Instruct](https://aka.ms/azureai/landing/Phi-4-Mini-Instruct)
54+
55+
56+
# [Phi-4](#tab/phi-4)
57+
3058
Phi-4 is a state-of-the-art open model built upon a blend of synthetic datasets, data from filtered public domain websites, and acquired academic books and Q&A datasets. The goal of this approach was to ensure that small capable models were trained with data focused on high quality and advanced reasoning.
3159

3260
Phi-4 underwent a rigorous enhancement and alignment process, incorporating both supervised fine-tuning and direct preference optimization to ensure precise instruction adherence and robust safety measures.
33-
34-
The Phi-4 models come in the following variants with a 16K tokens length.
61+
The Phi-4 model comes in the following variant with a 16K token length.
3562

3663

37-
You can learn more about the models in their respective model card:
64+
The following models are available:
3865

3966
* [Phi-4](https://aka.ms/azureai/landing/Phi-4)
4067

4168

69+
---
70+
4271
## Prerequisites
4372

4473
To use Phi-4 family chat models with Azure AI Foundry, you need the following prerequisites:
@@ -138,7 +167,7 @@ print("Model provider name:", model_info.model_provider_name)
138167
```
139168

140169
```console
141-
Model name: Phi-4
170+
Model name: Phi-4-Mini-MM-Instruct
142171
Model type: chat-completions
143172
Model provider name: Microsoft
144173
```
@@ -159,7 +188,7 @@ response = client.complete(
159188
```
160189

161190
> [!NOTE]
162-
> Phi-4 don't support system messages (`role="system"`). When you use the Azure AI model inference API, system messages are translated to user messages, which is the closest capability available. This translation is offered for convenience, but it's important for you to verify that the model is following the instructions in the system message with the right level of confidence.
191+
> Phi-4-Mini-MM-Instruct, Phi-4-Mini-Instruct, and Phi-4 don't support system messages (`role="system"`). When you use the Azure AI model inference API, system messages are translated to user messages, which is the closest capability available. This translation is offered for convenience, but it's important for you to verify that the model is following the instructions in the system message with the right level of confidence.
163192
164193
The response is as follows, where you can see the model's usage statistics:
165194

@@ -175,7 +204,7 @@ print("\tCompletion tokens:", response.usage.completion_tokens)
175204

176205
```console
177206
Response: As of now, it's estimated that there are about 7,000 languages spoken around the world. However, this number can vary as some languages become extinct and new ones develop. It's also important to note that the number of speakers can greatly vary between languages, with some having millions of speakers and others only a few hundred.
178-
Model: Phi-4
207+
Model: Phi-4-Mini-MM-Instruct
179208
Usage:
180209
Prompt tokens: 19
181210
Total tokens: 91
@@ -325,18 +354,47 @@ except HttpResponseError as ex:
325354

326355
## Phi-4 family chat models
327356

357+
The Phi-4 family chat models include the following models:
358+
359+
# [Phi-4-Mini-MM-Instruct](#tab/phi-4-mini-mm-instruct)
360+
361+
Phi-4-Mini-MM-Instruct is a lightweight open multimodal foundation model that leverages the language, vision, and speech research and datasets used for Phi-3.5 and 4.0 models. The model processes text, image, and audio inputs, and generates text outputs. The model underwent an enhancement process, incorporating both supervised fine-tuning, and direct preference optimization to support precise instruction adherence and safety measures.
362+
363+
The Phi-4-Mini-MM model comes in the following variant with a 128K token length.
364+
365+
366+
The following models are available:
367+
368+
* [Phi-4-Mini-MM-Instruct](https://aka.ms/azureai/landing/Phi-4-Mini-MM-Instruct)
369+
370+
371+
# [Phi-4-Mini-Instruct](#tab/phi-4-mini-instruct)
372+
373+
Phi-4-Mini-Instruct is a lightweight open model built upon synthetic data and filtered publicly available websites - with a focus on high-quality, reasoning dense data. The model belongs to the Phi-4 model family and supports 128K token context length. The model underwent an enhancement process, incorporating both supervised fine-tuning and direct preference optimization to support precise instruction adherence and robust safety measures.
374+
375+
The Phi-4-Mini model comes in the following variant with a 128K token length.
376+
377+
378+
The following models are available:
379+
380+
* [Phi-4-Mini-Instruct](https://aka.ms/azureai/landing/Phi-4-Mini-Instruct)
381+
382+
383+
# [Phi-4](#tab/phi-4)
384+
328385
Phi-4 is a state-of-the-art open model built upon a blend of synthetic datasets, data from filtered public domain websites, and acquired academic books and Q&A datasets. The goal of this approach was to ensure that small capable models were trained with data focused on high quality and advanced reasoning.
329386

330387
Phi-4 underwent a rigorous enhancement and alignment process, incorporating both supervised fine-tuning and direct preference optimization to ensure precise instruction adherence and robust safety measures.
331-
332-
The Phi-4 models come in the following variants with a 16K tokens length.
388+
The Phi-4 model comes in the following variant with a 16K token length.
333389

334390

335-
You can learn more about the models in their respective model card:
391+
The following models are available:
336392

337393
* [Phi-4](https://aka.ms/azureai/landing/Phi-4)
338394

339395

396+
---
397+
340398
## Prerequisites
341399

342400
To use Phi-4 family chat models with Azure AI Foundry, you need the following prerequisites:
@@ -434,7 +492,7 @@ console.log("Model provider name: ", model_info.body.model_provider_name)
434492
```
435493

436494
```console
437-
Model name: Phi-4
495+
Model name: Phi-4-Mini-MM-Instruct
438496
Model type: chat-completions
439497
Model provider name: Microsoft
440498
```
@@ -457,7 +515,7 @@ var response = await client.path("/chat/completions").post({
457515
```
458516

459517
> [!NOTE]
460-
> Phi-4 don't support system messages (`role="system"`). When you use the Azure AI model inference API, system messages are translated to user messages, which is the closest capability available. This translation is offered for convenience, but it's important for you to verify that the model is following the instructions in the system message with the right level of confidence.
518+
> Phi-4-Mini-MM-Instruct, Phi-4-Mini-Instruct, and Phi-4 don't support system messages (`role="system"`). When you use the Azure AI model inference API, system messages are translated to user messages, which is the closest capability available. This translation is offered for convenience, but it's important for you to verify that the model is following the instructions in the system message with the right level of confidence.
461519
462520
The response is as follows, where you can see the model's usage statistics:
463521

@@ -477,7 +535,7 @@ console.log("\tCompletion tokens:", response.body.usage.completion_tokens);
477535

478536
```console
479537
Response: As of now, it's estimated that there are about 7,000 languages spoken around the world. However, this number can vary as some languages become extinct and new ones develop. It's also important to note that the number of speakers can greatly vary between languages, with some having millions of speakers and others only a few hundred.
480-
Model: Phi-4
538+
Model: Phi-4-Mini-MM-Instruct
481539
Usage:
482540
Prompt tokens: 19
483541
Total tokens: 91
@@ -646,18 +704,47 @@ catch (error) {
646704
647705
## Phi-4 family chat models
648706
707+
The Phi-4 family chat models include the following models:
708+
709+
# [Phi-4-Mini-MM-Instruct](#tab/phi-4-mini-mm-instruct)
710+
711+
Phi-4-Mini-MM-Instruct is a lightweight open multimodal foundation model that leverages the language, vision, and speech research and datasets used for Phi-3.5 and 4.0 models. The model processes text, image, and audio inputs, and generates text outputs. The model underwent an enhancement process, incorporating both supervised fine-tuning, and direct preference optimization to support precise instruction adherence and safety measures.
712+
713+
The Phi-4-Mini-MM model comes in the following variant with a 128K token length.
714+
715+
716+
The following models are available:
717+
718+
* [Phi-4-Mini-MM-Instruct](https://aka.ms/azureai/landing/Phi-4-Mini-MM-Instruct)
719+
720+
721+
# [Phi-4-Mini-Instruct](#tab/phi-4-mini-instruct)
722+
723+
Phi-4-Mini-Instruct is a lightweight open model built upon synthetic data and filtered publicly available websites - with a focus on high-quality, reasoning dense data. The model belongs to the Phi-4 model family and supports 128K token context length. The model underwent an enhancement process, incorporating both supervised fine-tuning and direct preference optimization to support precise instruction adherence and robust safety measures.
724+
725+
The Phi-4-Mini model comes in the following variant with a 128K token length.
726+
727+
728+
The following models are available:
729+
730+
* [Phi-4-Mini-Instruct](https://aka.ms/azureai/landing/Phi-4-Mini-Instruct)
731+
732+
733+
# [Phi-4](#tab/phi-4)
734+
649735
Phi-4 is a state-of-the-art open model built upon a blend of synthetic datasets, data from filtered public domain websites, and acquired academic books and Q&A datasets. The goal of this approach was to ensure that small capable models were trained with data focused on high quality and advanced reasoning.
650736
651737
Phi-4 underwent a rigorous enhancement and alignment process, incorporating both supervised fine-tuning and direct preference optimization to ensure precise instruction adherence and robust safety measures.
652-
653-
The Phi-4 models come in the following variants with a 16K tokens length.
738+
The Phi-4 model comes in the following variant with a 16K token length.
654739
655740
656-
You can learn more about the models in their respective model card:
741+
The following models are available:
657742
658743
* [Phi-4](https://aka.ms/azureai/landing/Phi-4)
659744
660745
746+
---
747+
661748
## Prerequisites
662749
663750
To use Phi-4 family chat models with Azure AI Foundry, you need the following prerequisites:
@@ -770,7 +857,7 @@ Console.WriteLine($"Model provider name: {modelInfo.Value.ModelProviderName}");
770857
```
771858
772859
```console
773-
Model name: Phi-4
860+
Model name: Phi-4-Mini-MM-Instruct
774861
Model type: chat-completions
775862
Model provider name: Microsoft
776863
```
@@ -792,7 +879,7 @@ Response<ChatCompletions> response = client.Complete(requestOptions);
792879
```
793880
794881
> [!NOTE]
795-
> Phi-4 don't support system messages (`role="system"`). When you use the Azure AI model inference API, system messages are translated to user messages, which is the closest capability available. This translation is offered for convenience, but it's important for you to verify that the model is following the instructions in the system message with the right level of confidence.
882+
> Phi-4-Mini-MM-Instruct, Phi-4-Mini-Instruct, and Phi-4 don't support system messages (`role="system"`). When you use the Azure AI model inference API, system messages are translated to user messages, which is the closest capability available. This translation is offered for convenience, but it's important for you to verify that the model is following the instructions in the system message with the right level of confidence.
796883
797884
The response is as follows, where you can see the model's usage statistics:
798885

@@ -808,7 +895,7 @@ Console.WriteLine($"\tCompletion tokens: {response.Value.Usage.CompletionTokens}
808895

809896
```console
810897
Response: As of now, it's estimated that there are about 7,000 languages spoken around the world. However, this number can vary as some languages become extinct and new ones develop. It's also important to note that the number of speakers can greatly vary between languages, with some having millions of speakers and others only a few hundred.
811-
Model: Phi-4
898+
Model: Phi-4-Mini-MM-Instruct
812899
Usage:
813900
Prompt tokens: 19
814901
Total tokens: 91
@@ -979,18 +1066,47 @@ catch (RequestFailedException ex)
9791066

9801067
## Phi-4 family chat models
9811068

1069+
The Phi-4 family chat models include the following models:
1070+
1071+
# [Phi-4-Mini-MM-Instruct](#tab/phi-4-mini-mm-instruct)
1072+
1073+
Phi-4-Mini-MM-Instruct is a lightweight open multimodal foundation model that leverages the language, vision, and speech research and datasets used for Phi-3.5 and 4.0 models. The model processes text, image, and audio inputs, and generates text outputs. The model underwent an enhancement process, incorporating both supervised fine-tuning, and direct preference optimization to support precise instruction adherence and safety measures.
1074+
1075+
The Phi-4-Mini-MM model comes in the following variant with a 128K token length.
1076+
1077+
1078+
The following models are available:
1079+
1080+
* [Phi-4-Mini-MM-Instruct](https://aka.ms/azureai/landing/Phi-4-Mini-MM-Instruct)
1081+
1082+
1083+
# [Phi-4-Mini-Instruct](#tab/phi-4-mini-instruct)
1084+
1085+
Phi-4-Mini-Instruct is a lightweight open model built upon synthetic data and filtered publicly available websites - with a focus on high-quality, reasoning dense data. The model belongs to the Phi-4 model family and supports 128K token context length. The model underwent an enhancement process, incorporating both supervised fine-tuning and direct preference optimization to support precise instruction adherence and robust safety measures.
1086+
1087+
The Phi-4-Mini model comes in the following variant with a 128K token length.
1088+
1089+
1090+
The following models are available:
1091+
1092+
* [Phi-4-Mini-Instruct](https://aka.ms/azureai/landing/Phi-4-Mini-Instruct)
1093+
1094+
1095+
# [Phi-4](#tab/phi-4)
1096+
9821097
Phi-4 is a state-of-the-art open model built upon a blend of synthetic datasets, data from filtered public domain websites, and acquired academic books and Q&A datasets. The goal of this approach was to ensure that small capable models were trained with data focused on high quality and advanced reasoning.
9831098

9841099
Phi-4 underwent a rigorous enhancement and alignment process, incorporating both supervised fine-tuning and direct preference optimization to ensure precise instruction adherence and robust safety measures.
985-
986-
The Phi-4 models come in the following variants with a 16K tokens length.
1100+
The Phi-4 model comes in the following variant with a 16K token length.
9871101

9881102

989-
You can learn more about the models in their respective model card:
1103+
The following models are available:
9901104

9911105
* [Phi-4](https://aka.ms/azureai/landing/Phi-4)
9921106

9931107

1108+
---
1109+
9941110
## Prerequisites
9951111

9961112
To use Phi-4 family chat models with Azure AI Foundry, you need the following prerequisites:
@@ -1054,7 +1170,7 @@ The response is as follows:
10541170

10551171
```json
10561172
{
1057-
"model_name": "Phi-4",
1173+
"model_name": "Phi-4-Mini-MM-Instruct",
10581174
"model_type": "chat-completions",
10591175
"model_provider_name": "Microsoft"
10601176
}
@@ -1080,7 +1196,7 @@ The following example shows how you can create a basic chat completions request
10801196
```
10811197

10821198
> [!NOTE]
1083-
> Phi-4 don't support system messages (`role="system"`). When you use the Azure AI model inference API, system messages are translated to user messages, which is the closest capability available. This translation is offered for convenience, but it's important for you to verify that the model is following the instructions in the system message with the right level of confidence.
1199+
> Phi-4-Mini-MM-Instruct, Phi-4-Mini-Instruct, and Phi-4 don't support system messages (`role="system"`). When you use the Azure AI model inference API, system messages are translated to user messages, which is the closest capability available. This translation is offered for convenience, but it's important for you to verify that the model is following the instructions in the system message with the right level of confidence.
10841200

10851201
The response is as follows, where you can see the model's usage statistics:
10861202
@@ -1090,7 +1206,7 @@ The response is as follows, where you can see the model's usage statistics:
10901206
"id": "0a1234b5de6789f01gh2i345j6789klm",
10911207
"object": "chat.completion",
10921208
"created": 1718726686,
1093-
"model": "Phi-4",
1209+
"model": "Phi-4-Mini-MM-Instruct",
10941210
"choices": [
10951211
{
10961212
"index": 0,
@@ -1147,7 +1263,7 @@ You can visualize how streaming generates content:
11471263
"id": "23b54589eba14564ad8a2e6978775a39",
11481264
"object": "chat.completion.chunk",
11491265
"created": 1718726371,
1150-
"model": "Phi-4",
1266+
"model": "Phi-4-Mini-MM-Instruct",
11511267
"choices": [
11521268
{
11531269
"index": 0,
@@ -1170,7 +1286,7 @@ The last message in the stream has `finish_reason` set, indicating the reason fo
11701286
"id": "23b54589eba14564ad8a2e6978775a39",
11711287
"object": "chat.completion.chunk",
11721288
"created": 1718726371,
1173-
"model": "Phi-4",
1289+
"model": "Phi-4-Mini-MM-Instruct",
11741290
"choices": [
11751291
{
11761292
"index": 0,
@@ -1221,7 +1337,7 @@ Explore other parameters that you can specify in the inference client. For a ful
12211337
"id": "0a1234b5de6789f01gh2i345j6789klm",
12221338
"object": "chat.completion",
12231339
"created": 1718726686,
1224-
"model": "Phi-4",
1340+
"model": "Phi-4-Mini-MM-Instruct",
12251341
"choices": [
12261342
{
12271343
"index": 0,

0 commit comments

Comments
 (0)