Skip to content

Commit f075a9b

Browse files
Harmanpreet-MicrosoftHarmanpreet Kaur
andauthored
chore: update default OpenAI model to gpt-4.1 across codebase and infra (#1822)
Co-authored-by: Harmanpreet Kaur <[email protected]>
1 parent b3fcae0 commit f075a9b

File tree

19 files changed

+222
-227
lines changed

19 files changed

+222
-227
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ Select either "PostgreSQL" or "Cosmos DB":
194194

195195
When Deployment is complete, follow steps in [Set Up Authentication in Azure App Service](./docs/azure_app_service_auth_setup.md) to add app authentication to your web app running on Azure App Service
196196

197-
**Note**: The default configuration deploys an OpenAI Model "gpt-4o" with version 2024-05-13. However, not all
197+
**Note**: The default configuration deploys an OpenAI Model "gpt-4.1" with version 2025-04-14. However, not all
198198
locations support this version. If you're deploying to a location that doesn't support version 2024-05-13, you'll need to
199199
switch to a lower version. To find out which versions are supported in different regions, visit the
200-
[GPT-4o Model Availability](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models?tabs=global-standard%2Cstandard-chat-completions#global-standard-model-availability) page.
200+
[GPT-4.1 Model Availability](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models?tabs=global-standard%2Cstandard-chat-completions#global-standard-model-availability) page.
201201

202202
### Testing the deployment
203203
1. Navigate to the admin site, where you can upload documents. It will be located at:

code/backend/batch/utilities/helpers/env_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ def __load_config(self, **kwargs) -> None:
174174
else:
175175
# Otherwise, fallback to individual environment variables
176176
self.AZURE_OPENAI_MODEL = os.getenv(
177-
"AZURE_OPENAI_MODEL", "gpt-4o"
177+
"AZURE_OPENAI_MODEL", "gpt-4.1"
178178
)
179179
self.AZURE_OPENAI_MODEL_NAME = os.getenv(
180-
"AZURE_OPENAI_MODEL_NAME", "gpt-4o"
180+
"AZURE_OPENAI_MODEL_NAME", "gpt-4.1"
181181
)
182182

183183
self.AZURE_OPENAI_VISION_MODEL = os.getenv("AZURE_OPENAI_VISION_MODEL", "gpt-4")

code/tests/functional/tests/backend_api/default/test_conversation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def completions_mocking(httpserver: HTTPServer, app_config: AppConfig):
6565
"id": "chatcmpl-6v7mkQj980V1yBec6ETrKPRqFjNw9",
6666
"object": "chat.completion",
6767
"created": 1679072642,
68-
"model": "gpt-4o",
68+
"model": "gpt-4.1",
6969
"usage": {
7070
"prompt_tokens": 40,
7171
"completion_tokens": 50,

code/tests/functional/tests/backend_api/default/test_post_prompt_tool.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def completions_mocking(httpserver: HTTPServer, app_config: AppConfig):
100100
"id": "chatcmpl-6v7mkQj980V1yBec6ETrKPRqFjNw9",
101101
"object": "chat.completion",
102102
"created": 1679072642,
103-
"model": "gpt-4o",
103+
"model": "gpt-4.1",
104104
"usage": {
105105
"prompt_tokens": 40,
106106
"completion_tokens": 50,
@@ -132,7 +132,7 @@ def test_post_responds_successfully_when_not_filtered(
132132
"id": "chatcmpl-6v7mkQj980V1yBec6ETrKPRqFjNw9",
133133
"object": "chat.completion",
134134
"created": 1679072642,
135-
"model": "gpt-4o",
135+
"model": "gpt-4.1",
136136
"usage": {
137137
"prompt_tokens": 40,
138138
"completion_tokens": 50,
@@ -193,7 +193,7 @@ def test_post_responds_successfully_when_filtered(
193193
"id": "chatcmpl-6v7mkQj980V1yBec6ETrKPRqFjNw9",
194194
"object": "chat.completion",
195195
"created": 1679072642,
196-
"model": "gpt-4o",
196+
"model": "gpt-4.1",
197197
"usage": {
198198
"prompt_tokens": 40,
199199
"completion_tokens": 50,
@@ -254,7 +254,7 @@ def test_post_makes_correct_call_to_openai_from_post_prompt_tool(
254254
"id": "chatcmpl-6v7mkQj980V1yBec6ETrKPRqFjNw9",
255255
"object": "chat.completion",
256256
"created": 1679072642,
257-
"model": "gpt-4o",
257+
"model": "gpt-4.1",
258258
"usage": {
259259
"prompt_tokens": 40,
260260
"completion_tokens": 50,

code/tests/functional/tests/backend_api/integrated_vectorization_custom_conversation/test_iv_question_answer_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def completions_mocking(httpserver: HTTPServer, app_config: AppConfig):
6363
"id": "chatcmpl-6v7mkQj980V1yBec6ETrKPRqFjNw9",
6464
"object": "chat.completion",
6565
"created": 1679072642,
66-
"model": "gpt-4o",
66+
"model": "gpt-4.1",
6767
"usage": {
6868
"prompt_tokens": 40,
6969
"completion_tokens": 50,

docs/LOCAL_DEPLOYMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ Execute the above [shell command](#L81) to run the function locally. You may nee
191191
|AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION ||Whether to use [Integrated Vectorization](https://learn.microsoft.com/en-us/azure/search/vector-search-integrated-vectorization)|
192192
|AZURE_OPENAI_RESOURCE||the name of your Azure OpenAI resource|
193193
|AZURE_OPENAI_MODEL||The name of your model deployment|
194-
|AZURE_OPENAI_MODEL_NAME|gpt-4o|The name of the model|
194+
|AZURE_OPENAI_MODEL_NAME|gpt-4.1|The name of the model|
195195
|AZURE_OPENAI_MODEL_VERSION|2024-05-13|The version of the model to use|
196196
|AZURE_OPENAI_API_KEY||One of the API keys of your Azure OpenAI resource|
197197
|AZURE_OPENAI_EMBEDDING_MODEL|text-embedding-ada-002|The name of your Azure OpenAI embeddings model deployment|

docs/TEAMS_LOCAL_DEPLOYMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Or use the [Azure Functions VS Code extension](https://marketplace.visualstudio.
6565
|AZURE_SEARCH_FILTER||Filter to apply to search queries.|
6666
|AZURE_OPENAI_RESOURCE||the name of your Azure OpenAI resource|
6767
|AZURE_OPENAI_MODEL||The name of your model deployment|
68-
|AZURE_OPENAI_MODEL_NAME|gpt-4o|The name of the model|
68+
|AZURE_OPENAI_MODEL_NAME|gpt-4.1|The name of the model|
6969
|AZURE_OPENAI_API_KEY||One of the API keys of your Azure OpenAI resource|
7070
|AZURE_OPENAI_EMBEDDING_MODEL|text-embedding-ada-002|The name of you Azure OpenAI embeddings model deployment|
7171
|AZURE_OPENAI_TEMPERATURE|0|What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. A value of 0 is recommended when using your data.|

docs/contract_assistance.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ The following is the Chat With Your Data infrastructure configuration that we su
1010
- **Azure Semantic Search**: Utilize Azure Semantic Search to efficiently index and search legal documents. This provides powerful search capabilities and integration with other Azure services.
1111
- **Azure Cognitive Search Top K 15**: Set the Top K parameter to 15 to retrieve the top 15 most relevant documents. This configuration helps in providing precise and relevant search results for user queries.
1212
- **Azure Search Integrated Vectorization**: Enable integrated vectorization in Azure Search to improve the semantic understanding and relevance of search results. This enhances the Contract Assistant's ability to provide contextually accurate answers.
13-
- **Azure OpenAI Model gpt-4o**: Leverage the Azure OpenAI model gpt-4o for advanced natural language processing capabilities. This model is well-suited for handling complex legal queries and providing detailed and contextually appropriate responses.
13+
- **Azure OpenAI Model gpt-4.1**: Leverage the Azure OpenAI model gpt-4.1 for advanced natural language processing capabilities. This model is well-suited for handling complex legal queries and providing detailed and contextually appropriate responses.
1414
- **Orchestration Strategy: Semantic Kernel**: Implement the Semantic Kernel orchestration strategy to effectively manage the integration and interaction between different components of the infrastructure. This strategy ensures seamless operation and optimal performance of the Contract Assistant.
15-
- **Conversation Flow Options**: Setting `CONVERSATION_FLOW` enables running advanced AI models like GPT-4o on your own enterprise data without needing to train or fine-tune models.
15+
- **Conversation Flow Options**: Setting `CONVERSATION_FLOW` enables running advanced AI models like GPT-4.1 on your own enterprise data without needing to train or fine-tune models.
1616

1717
By following these infrastructure configurations, you can enhance the efficiency, accuracy, and overall performance of the Chat With Your Data Contract Review and Summarization Assistant, ensuring it meets the high demands and expectations of professionals.
1818

@@ -22,8 +22,8 @@ To apply the suggested configurations in your deployment, update the following f
2222
- **Azure Semantic Search**: Set `AZURE_SEARCH_USE_SEMANTIC_SEARCH` to `true`
2323
- **Azure Cognitive Search Top K 15**: Set `AZURE_SEARCH_TOP_K` to `15`.
2424
- **Azure Search Integrated Vectorization**: Set `AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION` to `true`.
25-
- **Azure OpenAI Model**: Set `AZURE_OPENAI_MODEL` to `gpt-4o`.
26-
- **Azure OpenAI Model Name**: Set `AZURE_OPENAI_MODEL_NAME` to `gpt-4o`. (could be different based on the name of the Azure OpenAI model deployment)
25+
- **Azure OpenAI Model**: Set `AZURE_OPENAI_MODEL` to `gpt-4.1`.
26+
- **Azure OpenAI Model Name**: Set `AZURE_OPENAI_MODEL_NAME` to `gpt-4.1`. (could be different based on the name of the Azure OpenAI model deployment)
2727
- **Azure OpenAI Model Name Version**: Set `AZURE_OPENAI_MODEL_VERSION` to `2024-05-13`.
2828
- **Conversation Flow Options**: Set `CONVERSATION_FLOW` to `byod`
2929
- **Orchestration Strategy**: Set `ORCHESTRATION_STRATEGY` to `Semantic Kernel`.

docs/employee_assistance.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ The following is the Chat With Your Data infrastructure configuration that we su
1010
- **Azure Semantic Search**: Utilize Azure Semantic Search to efficiently index and search employee handbooks and corporate policy documents. This provides powerful search capabilities and integration with other Azure services.
1111
- **Azure Cognitive Search Top K 15**: Set the Top K parameter to 15 to retrieve the top 15 most relevant documents. This configuration helps in providing precise and relevant search results for user queries.
1212
- **Azure Search Integrated Vectorization**: Enable integrated vectorization in Azure Search to improve the semantic understanding and relevance of search results. This enhances the Contract Assistant's ability to provide contextually accurate answers.
13-
- **Azure OpenAI Model gpt-4o**: Leverage the Azure OpenAI model gpt-4o for advanced natural language processing capabilities. This model is well-suited for handling complex legal queries and providing detailed and contextually appropriate responses.
13+
- **Azure OpenAI Model gpt-4.1**: Leverage the Azure OpenAI model gpt-4.1 for advanced natural language processing capabilities. This model is well-suited for handling complex legal queries and providing detailed and contextually appropriate responses.
1414
- **Orchestration Strategy: Semantic Kernel**: Implement the Semantic Kernel orchestration strategy to effectively manage the integration and interaction between different components of the infrastructure. This strategy ensures seamless operation and optimal performance of the Employee Assistant.
15-
- **Conversation Flow Options**: Setting `CONVERSATION_FLOW` enables running advanced AI models like GPT-4o on your own enterprise data without needing to train or fine-tune models.
15+
- **Conversation Flow Options**: Setting `CONVERSATION_FLOW` enables running advanced AI models like GPT-4.1 on your own enterprise data without needing to train or fine-tune models.
1616

1717
By following these infrastructure configurations, you can enhance the efficiency, accuracy, and overall performance of the Chat With Your Data Employee Assistant, ensuring it meets the high demands and expectations of professionals.
1818

@@ -22,7 +22,7 @@ To apply the suggested configurations in your deployment, update the following f
2222
- **Azure Semantic Search**: Set `AZURE_SEARCH_USE_SEMANTIC_SEARCH` to `true`
2323
- **Azure Cognitive Search Top K 15**: Set `AZURE_SEARCH_TOP_K` to `15`.
2424
- **Azure Search Integrated Vectorization**: Set `AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION` to `true`.
25-
- **Azure OpenAI Model Info**: Set `AZURE_OPENAI_MODEL_INFO` to `{"model":"gpt-4o","modelName":"gpt-4o","modelVersion":"2024-05-13"}`.(model could be different based on the name of the Azure OpenAI model deployment).
25+
- **Azure OpenAI Model Info**: Set `AZURE_OPENAI_MODEL_INFO` to `{"model":"gpt-4.1","modelName":"gpt-4.1","modelVersion":"2025-04-14"}`.(model could be different based on the name of the Azure OpenAI model deployment).
2626
- **Conversation Flow Options**: Set `CONVERSATION_FLOW` to `byod`
2727
- **Orchestration Strategy**: Set `ORCHESTRATION_STRATEGY` to `Semantic Kernel`.
2828

docs/model_configuration.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ This document outlines the necessary steps and configurations required for setti
1515

1616
### LLM
1717
- `AZURE_OPENAI_MODEL`: The Azure OpenAI Model Deployment Name
18-
- example: `my-gpt-4o`
18+
- example: `my-gpt-4.1`
1919
- `AZURE_OPENAI_MODEL_NAME`: The Azure OpenAI Model Name
20-
- example: `gpt-4o`
20+
- example: `gpt-4.1`
2121
- `AZURE_OPENAI_MODEL_VERSION`: The Azure OpenAI Model Version
22-
- example: `2024-05-13`
22+
- example: `2025-04-14`
2323
- `AZURE_OPENAI_MODEL_CAPACITY`: The Tokens per Minute Rate Limit (thousands)
2424
- example: `30`
2525

@@ -62,12 +62,12 @@ This document outlines the necessary steps and configurations required for setti
6262
- To get the value of an environment variable, you can use the following command:
6363
- `azd env get <ENVIRONMENT_VARIABLE_NAME>`
6464

65-
## GPT-4o & Text-Embeddings-3-Large
66-
- The following environment variables are set for the GPT-4o and Text-Embeddings-3-Large models:
65+
## GPT-4.1 & Text-Embeddings-3-Large
66+
- The following environment variables are set for the GPT-4.1 and Text-Embeddings-3-Large models:
6767
- `AZURE_OPENAI_API_VERSION`: `2024-05-01-preview`
68-
- `AZURE_OPENAI_MODEL`: `my-gpt-4o`
69-
- `AZURE_OPENAI_MODEL_NAME`: `gpt-4o`
70-
- `AZURE_OPENAI_MODEL_VERSION`: `2024-05-13`
68+
- `AZURE_OPENAI_MODEL`: `my-gpt-4.1`
69+
- `AZURE_OPENAI_MODEL_NAME`: `gpt-4.1`
70+
- `AZURE_OPENAI_MODEL_VERSION`: `2025-04-14`
7171
- `AZURE_OPENAI_EMBEDDING_MODEL`: `my-text-embedding-3-large`
7272
- `AZURE_OPENAI_EMBEDDING_MODEL_NAME`: `text-embedding-3-large`
7373
- `AZURE_OPENAI_EMBEDDING_MODEL_VERSION`: `1`

0 commit comments

Comments
 (0)