Skip to content

Commit d135d64

Browse files
Merge pull request #3167 from msakande/phi4-mini-only
Phi4 mini only
2 parents 5ab9fd5 + 0154b59 commit d135d64

File tree

3 files changed

+98
-30
lines changed

3 files changed

+98
-30
lines changed

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

Lines changed: 96 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-foundry
66
manager: scottpolly
77
ms.topic: how-to
8-
ms.date: 01/09/2025
8+
ms.date: 02/25/2025
99
ms.reviewer: v-vkonjarla
1010
reviewer: VindyaKonjarla
1111
ms.author: mopeakande
@@ -27,18 +27,35 @@ 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-instruct](#tab/phi-4-mini-instruct)
33+
34+
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.
35+
36+
The Phi-4-mini-instruct model comes in the following variant with a 128K token length.
37+
38+
39+
The following models are available:
40+
41+
* [Phi-4-mini-instruct](https://aka.ms/azureai/landing/Phi-4-mini-instruct)
42+
43+
44+
# [Phi-4](#tab/phi-4)
45+
3046
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.
3147

3248
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.
49+
The Phi-4 model comes in the following variant with a 16K token length.
3350

34-
The Phi-4 models come in the following variants with a 16K tokens length.
3551

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

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

4156

57+
---
58+
4259
## Prerequisites
4360

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

140157
```console
141-
Model name: Phi-4
158+
Model name: Phi-4-mini-instruct
142159
Model type: chat-completions
143160
Model provider name: Microsoft
144161
```
@@ -159,7 +176,7 @@ response = client.complete(
159176
```
160177

161178
> [!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.
179+
> 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.
163180
164181
The response is as follows, where you can see the model's usage statistics:
165182

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

176193
```console
177194
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
195+
Model: Phi-4-mini-instruct
179196
Usage:
180197
Prompt tokens: 19
181198
Total tokens: 91
@@ -322,18 +339,35 @@ except HttpResponseError as ex:
322339

323340
## Phi-4 family chat models
324341

342+
The Phi-4 family chat models include the following models:
343+
344+
# [Phi-4-mini-instruct](#tab/phi-4-mini-instruct)
345+
346+
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.
347+
348+
The Phi-4-mini-instruct model comes in the following variant with a 128K token length.
349+
350+
351+
The following models are available:
352+
353+
* [Phi-4-mini-instruct](https://aka.ms/azureai/landing/Phi-4-mini-instruct)
354+
355+
356+
# [Phi-4](#tab/phi-4)
357+
325358
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.
326359

327360
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.
361+
The Phi-4 model comes in the following variant with a 16K token length.
328362

329-
The Phi-4 models come in the following variants with a 16K tokens length.
330363

331-
332-
You can learn more about the models in their respective model card:
364+
The following models are available:
333365

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

336368

369+
---
370+
337371
## Prerequisites
338372

339373
To use Phi-4 family chat models with Azure AI Foundry, you need the following prerequisites:
@@ -431,7 +465,7 @@ console.log("Model provider name: ", model_info.body.model_provider_name)
431465
```
432466

433467
```console
434-
Model name: Phi-4
468+
Model name: Phi-4-mini-instruct
435469
Model type: chat-completions
436470
Model provider name: Microsoft
437471
```
@@ -454,7 +488,7 @@ var response = await client.path("/chat/completions").post({
454488
```
455489

456490
> [!NOTE]
457-
> 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.
491+
> 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.
458492
459493
The response is as follows, where you can see the model's usage statistics:
460494

@@ -474,7 +508,7 @@ console.log("\tCompletion tokens:", response.body.usage.completion_tokens);
474508

475509
```console
476510
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.
477-
Model: Phi-4
511+
Model: Phi-4-mini-instruct
478512
Usage:
479513
Prompt tokens: 19
480514
Total tokens: 91
@@ -640,18 +674,35 @@ catch (error) {
640674
641675
## Phi-4 family chat models
642676
677+
The Phi-4 family chat models include the following models:
678+
679+
# [Phi-4-mini-instruct](#tab/phi-4-mini-instruct)
680+
681+
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.
682+
683+
The Phi-4-mini-instruct model comes in the following variant with a 128K token length.
684+
685+
686+
The following models are available:
687+
688+
* [Phi-4-mini-instruct](https://aka.ms/azureai/landing/Phi-4-mini-instruct)
689+
690+
691+
# [Phi-4](#tab/phi-4)
692+
643693
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.
644694
645695
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.
696+
The Phi-4 model comes in the following variant with a 16K token length.
646697
647-
The Phi-4 models come in the following variants with a 16K tokens length.
648698
649-
650-
You can learn more about the models in their respective model card:
699+
The following models are available:
651700
652701
* [Phi-4](https://aka.ms/azureai/landing/Phi-4)
653702
654703
704+
---
705+
655706
## Prerequisites
656707
657708
To use Phi-4 family chat models with Azure AI Foundry, you need the following prerequisites:
@@ -764,7 +815,7 @@ Console.WriteLine($"Model provider name: {modelInfo.Value.ModelProviderName}");
764815
```
765816
766817
```console
767-
Model name: Phi-4
818+
Model name: Phi-4-mini-instruct
768819
Model type: chat-completions
769820
Model provider name: Microsoft
770821
```
@@ -786,7 +837,7 @@ Response<ChatCompletions> response = client.Complete(requestOptions);
786837
```
787838
788839
> [!NOTE]
789-
> 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.
840+
> 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.
790841
791842
The response is as follows, where you can see the model's usage statistics:
792843

@@ -802,7 +853,7 @@ Console.WriteLine($"\tCompletion tokens: {response.Value.Usage.CompletionTokens}
802853

803854
```console
804855
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.
805-
Model: Phi-4
856+
Model: Phi-4-mini-instruct
806857
Usage:
807858
Prompt tokens: 19
808859
Total tokens: 91
@@ -970,18 +1021,35 @@ catch (RequestFailedException ex)
9701021

9711022
## Phi-4 family chat models
9721023

1024+
The Phi-4 family chat models include the following models:
1025+
1026+
# [Phi-4-mini-instruct](#tab/phi-4-mini-instruct)
1027+
1028+
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.
1029+
1030+
The Phi-4-mini-instruct model comes in the following variant with a 128K token length.
1031+
1032+
1033+
The following models are available:
1034+
1035+
* [Phi-4-mini-instruct](https://aka.ms/azureai/landing/Phi-4-mini-instruct)
1036+
1037+
1038+
# [Phi-4](#tab/phi-4)
1039+
9731040
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.
9741041

9751042
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.
1043+
The Phi-4 model comes in the following variant with a 16K token length.
9761044

977-
The Phi-4 models come in the following variants with a 16K tokens length.
9781045

979-
980-
You can learn more about the models in their respective model card:
1046+
The following models are available:
9811047

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

9841050

1051+
---
1052+
9851053
## Prerequisites
9861054

9871055
To use Phi-4 family chat models with Azure AI Foundry, you need the following prerequisites:
@@ -1045,7 +1113,7 @@ The response is as follows:
10451113

10461114
```json
10471115
{
1048-
"model_name": "Phi-4",
1116+
"model_name": "Phi-4-mini-instruct",
10491117
"model_type": "chat-completions",
10501118
"model_provider_name": "Microsoft"
10511119
}
@@ -1071,7 +1139,7 @@ The following example shows how you can create a basic chat completions request
10711139
```
10721140

10731141
> [!NOTE]
1074-
> 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.
1142+
> 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.
10751143

10761144
The response is as follows, where you can see the model's usage statistics:
10771145
@@ -1081,7 +1149,7 @@ The response is as follows, where you can see the model's usage statistics:
10811149
"id": "0a1234b5de6789f01gh2i345j6789klm",
10821150
"object": "chat.completion",
10831151
"created": 1718726686,
1084-
"model": "Phi-4",
1152+
"model": "Phi-4-mini-instruct",
10851153
"choices": [
10861154
{
10871155
"index": 0,
@@ -1138,7 +1206,7 @@ You can visualize how streaming generates content:
11381206
"id": "23b54589eba14564ad8a2e6978775a39",
11391207
"object": "chat.completion.chunk",
11401208
"created": 1718726371,
1141-
"model": "Phi-4",
1209+
"model": "Phi-4-mini-instruct",
11421210
"choices": [
11431211
{
11441212
"index": 0,
@@ -1161,7 +1229,7 @@ The last message in the stream has `finish_reason` set, indicating the reason fo
11611229
"id": "23b54589eba14564ad8a2e6978775a39",
11621230
"object": "chat.completion.chunk",
11631231
"created": 1718726371,
1164-
"model": "Phi-4",
1232+
"model": "Phi-4-mini-instruct",
11651233
"choices": [
11661234
{
11671235
"index": 0,
@@ -1212,7 +1280,7 @@ Explore other parameters that you can specify in the inference client. For a ful
12121280
"id": "0a1234b5de6789f01gh2i345j6789klm",
12131281
"object": "chat.completion",
12141282
"created": 1718726686,
1215-
"model": "Phi-4",
1283+
"model": "Phi-4-mini-instruct",
12161284
"choices": [
12171285
{
12181286
"index": 0,

articles/ai-studio/how-to/model-catalog-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Gretel | Not available | Gretel-Navigator
8484
Healthcare AI family Models | MedImageParse<BR> MedImageInsight<BR> CxrReportGen<BR> Virchow<BR> Virchow2<BR> Prism<BR> BiomedCLIP-PubMedBERT<BR> microsoft-llava-med-v1.5<BR> m42-health-llama3-med4<BR> biomistral-biomistral-7b<BR> microsoft-biogpt-large-pub<BR> microsoft-biomednlp-pub<BR> stanford-crfm-biomedlm<BR> medicalai-clinicalbert<BR> microsoft-biogpt<BR> microsoft-biogpt-large<BR> microsoft-biomednlp-pub<BR> | Not Available
8585
JAIS | Not available | jais-30b-chat
8686
Meta Llama family models | Llama-3.3-70B-Instruct<BR> Llama-3.2-3B-Instruct<BR> Llama-3.2-1B-Instruct<BR> Llama-3.2-1B<BR> Llama-3.2-90B-Vision-Instruct<BR> Llama-3.2-11B-Vision-Instruct<BR> Llama-3.1-8B-Instruct<BR> Llama-3.1-8B<BR> Llama-3.1-70B-Instruct<BR> Llama-3.1-70B<BR> Llama-3-8B-Instruct<BR> Llama-3-70B<BR> Llama-3-8B<BR> Llama-Guard-3-1B<BR> Llama-Guard-3-8B<BR> Llama-Guard-3-11B-Vision<BR> Llama-2-7b<BR> Llama-2-70b<BR> Llama-2-7b-chat<BR> Llama-2-13b-chat<BR> CodeLlama-7b-hf<BR> CodeLlama-7b-Instruct-hf<BR> CodeLlama-34b-hf<BR> CodeLlama-34b-Python-hf<BR> CodeLlama-34b-Instruct-hf<BR> CodeLlama-13b-Instruct-hf<BR> CodeLlama-13b-Python-hf<BR> Prompt-Guard-86M<BR> CodeLlama-70b-hf<BR> | Llama-3.3-70B-Instruct<BR> Llama-3.2-90B-Vision-Instruct<br> Llama-3.2-11B-Vision-Instruct<br> Llama-3.1-8B-Instruct<br> Llama-3.1-70B-Instruct<br> Llama-3.1-405B-Instruct<br> Llama-3-8B-Instruct<br> Llama-3-70B-Instruct<br> Llama-2-7b<br> Llama-2-7b-chat<br> Llama-2-70b<br> Llama-2-70b-chat<br> Llama-2-13b<br> Llama-2-13b-chat<br>
87-
Microsoft Phi family models | Phi-3-mini-4k-Instruct <br> Phi-3-mini-128k-Instruct <br> Phi-3-small-8k-Instruct <br> Phi-3-small-128k-Instruct <br> Phi-3-medium-4k-instruct <br> Phi-3-medium-128k-instruct <br> Phi-3-vision-128k-Instruct <br> Phi-3.5-mini-Instruct <br> Phi-3.5-vision-Instruct <br> Phi-3.5-MoE-Instruct <br> Phi-4| Phi-3-mini-4k-Instruct <br> Phi-3-mini-128k-Instruct <br> Phi-3-small-8k-Instruct <br> Phi-3-small-128k-Instruct <br> Phi-3-medium-4k-instruct <br> Phi-3-medium-128k-instruct <br> <br> Phi-3.5-mini-Instruct <br> Phi-3.5-vision-Instruct <br> Phi-3.5-MoE-Instruct <br> Phi-4
87+
Microsoft Phi family models | Phi-3-mini-4k-Instruct <br> Phi-3-mini-128k-Instruct <br> Phi-3-small-8k-Instruct <br> Phi-3-small-128k-Instruct <br> Phi-3-medium-4k-instruct <br> Phi-3-medium-128k-instruct <br> Phi-3-vision-128k-Instruct <br> Phi-3.5-mini-Instruct <br> Phi-3.5-vision-Instruct <br> Phi-3.5-MoE-Instruct <br> Phi-4 <br> Phi-4-mini-instruct | Phi-3-mini-4k-Instruct <br> Phi-3-mini-128k-Instruct <br> Phi-3-small-8k-Instruct <br> Phi-3-small-128k-Instruct <br> Phi-3-medium-4k-instruct <br> Phi-3-medium-128k-instruct <br> <br> Phi-3.5-mini-Instruct <br> Phi-3.5-vision-Instruct <br> Phi-3.5-MoE-Instruct <br> Phi-4 <br> Phi-4-mini-instruct
8888
Mistral family models | mistralai-Mixtral-8x22B-v0-1 <br> mistralai-Mixtral-8x22B-Instruct-v0-1 <br> mistral-community-Mixtral-8x22B-v0-1 <br> mistralai-Mixtral-8x7B-v01 <br> mistralai-Mistral-7B-Instruct-v0-2 <br> mistralai-Mistral-7B-v01 <br> mistralai-Mixtral-8x7B-Instruct-v01 <br> mistralai-Mistral-7B-Instruct-v01 | Mistral-large (2402) <br> Mistral-large (2407) <br> Mistral-small <br> Ministral-3B <br> Mistral-NeMo
8989
Nixtla | Not available | TimeGEN-1
9090

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Llama 3.1 405B Instruct | [Microsoft Managed countries/regions](/partner-center
6161

6262
| Model | Offer Availability Region | Hub/Project Region for Deployment | Hub/Project Region for Fine tuning |
6363
|---------|---------|---------|---------|
64-
Phi-4 | Not applicable | East US <br> East US 2 <br> North Central US <br> South Central US <br> Sweden Central <br> West US <br> West US 3 | Not available |
64+
Phi-4 <br> Phi-4-mini-instruct | Not applicable | East US <br> East US 2 <br> North Central US <br> South Central US <br> Sweden Central <br> West US <br> West US 3 | Not available |
6565
Phi-3.5-vision-Instruct | Not applicable | East US <br> East US 2 <br> North Central US <br> South Central US <br> Sweden Central <br> West US <br> West US 3 | Not available |
6666
Phi-3.5-MoE-Instruct | Not applicable | East US <br> East US 2 <br> North Central US <br> South Central US <br> Sweden Central <br> West US <br> West US 3 | East US 2 |
6767
Phi-3.5-Mini-Instruct | Not applicable | East US <br> East US 2 <br> North Central US <br> South Central US <br> Sweden Central <br> West US <br> West US 3 | East US 2 | East US 2 |

0 commit comments

Comments
 (0)