Skip to content

fix: Updates to change the Azure OpenAI model from gpt-35-turbo to gpt-4o #1665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ AZURE_SEARCH_DATASOURCE_NAME=
# Azure OpenAI for generating the answer and computing the embedding of the documents
AZURE_OPENAI_RESOURCE=
AZURE_OPENAI_API_KEY=
AZURE_OPENAI_MODEL=gpt-35-turbo
AZURE_OPENAI_MODEL_NAME=gpt-35-turbo
AZURE_OPENAI_MODEL=gpt-4o
AZURE_OPENAI_MODEL_NAME=gpt-4o
AZURE_OPENAI_EMBEDDING_MODEL=text-embedding-ada-002
AZURE_OPENAI_TEMPERATURE=0
AZURE_OPENAI_TOP_P=1.0
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ Select either "PostgreSQL" or "Cosmos DB":

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

**Note**: The default configuration deploys an OpenAI Model "gpt-35-turbo" with version 0613. However, not all
locations support this version. If you're deploying to a location that doesn't support version 0613, you'll need to
**Note**: The default configuration deploys an OpenAI Model "gpt-4o" with version 2024-05-13. However, not all
locations support this version. If you're deploying to a location that doesn't support version 2024-05-13, you'll need to
switch to a lower version. To find out which versions are supported in different regions, visit the
[GPT-35 Turbo Model Availability](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-35-turbo-model-availability) page.
[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.

### Testing the deployment
1. Navigate to the admin site, where you can upload documents. It will be located at:
Expand Down
4 changes: 2 additions & 2 deletions code/backend/batch/utilities/helpers/env_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ def __load_config(self, **kwargs) -> None:
else:
# Otherwise, fallback to individual environment variables
self.AZURE_OPENAI_MODEL = os.getenv(
"AZURE_OPENAI_MODEL", "gpt-35-turbo-16k"
"AZURE_OPENAI_MODEL", "gpt-4o"
)
self.AZURE_OPENAI_MODEL_NAME = os.getenv(
"AZURE_OPENAI_MODEL_NAME", "gpt-35-turbo-16k"
"AZURE_OPENAI_MODEL_NAME", "gpt-4o"
)

self.AZURE_OPENAI_VISION_MODEL = os.getenv("AZURE_OPENAI_VISION_MODEL", "gpt-4")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def completions_mocking(httpserver: HTTPServer, app_config: AppConfig):
"id": "chatcmpl-6v7mkQj980V1yBec6ETrKPRqFjNw9",
"object": "chat.completion",
"created": 1679072642,
"model": "gpt-35-turbo",
"model": "gpt-4o",
"usage": {
"prompt_tokens": 40,
"completion_tokens": 50,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def completions_mocking(httpserver: HTTPServer, app_config: AppConfig):
"id": "chatcmpl-6v7mkQj980V1yBec6ETrKPRqFjNw9",
"object": "chat.completion",
"created": 1679072642,
"model": "gpt-35-turbo",
"model": "gpt-4o",
"usage": {
"prompt_tokens": 40,
"completion_tokens": 50,
Expand Down Expand Up @@ -132,7 +132,7 @@ def test_post_responds_successfully_when_not_filtered(
"id": "chatcmpl-6v7mkQj980V1yBec6ETrKPRqFjNw9",
"object": "chat.completion",
"created": 1679072642,
"model": "gpt-35-turbo",
"model": "gpt-4o",
"usage": {
"prompt_tokens": 40,
"completion_tokens": 50,
Expand Down Expand Up @@ -193,7 +193,7 @@ def test_post_responds_successfully_when_filtered(
"id": "chatcmpl-6v7mkQj980V1yBec6ETrKPRqFjNw9",
"object": "chat.completion",
"created": 1679072642,
"model": "gpt-35-turbo",
"model": "gpt-4o",
"usage": {
"prompt_tokens": 40,
"completion_tokens": 50,
Expand Down Expand Up @@ -254,7 +254,7 @@ def test_post_makes_correct_call_to_openai_from_post_prompt_tool(
"id": "chatcmpl-6v7mkQj980V1yBec6ETrKPRqFjNw9",
"object": "chat.completion",
"created": 1679072642,
"model": "gpt-35-turbo",
"model": "gpt-4o",
"usage": {
"prompt_tokens": 40,
"completion_tokens": 50,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def completions_mocking(httpserver: HTTPServer, app_config: AppConfig):
"id": "chatcmpl-6v7mkQj980V1yBec6ETrKPRqFjNw9",
"object": "chat.completion",
"created": 1679072642,
"model": "gpt-35-turbo",
"model": "gpt-4o",
"usage": {
"prompt_tokens": 40,
"completion_tokens": 50,
Expand Down
4 changes: 2 additions & 2 deletions docs/LOCAL_DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ Execute the above [shell command](#L81) to run the function locally. You may nee
|AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION ||Whether to use [Integrated Vectorization](https://learn.microsoft.com/en-us/azure/search/vector-search-integrated-vectorization)|
|AZURE_OPENAI_RESOURCE||the name of your Azure OpenAI resource|
|AZURE_OPENAI_MODEL||The name of your model deployment|
|AZURE_OPENAI_MODEL_NAME|gpt-35-turbo|The name of the model|
|AZURE_OPENAI_MODEL_VERSION|0613|The version of the model to use|
|AZURE_OPENAI_MODEL_NAME|gpt-4o|The name of the model|
|AZURE_OPENAI_MODEL_VERSION|2024-05-13|The version of the model to use|
|AZURE_OPENAI_API_KEY||One of the API keys of your Azure OpenAI resource|
|AZURE_OPENAI_EMBEDDING_MODEL|text-embedding-ada-002|The name of your Azure OpenAI embeddings model deployment|
|AZURE_OPENAI_EMBEDDING_MODEL_NAME|text-embedding-ada-002|The name of the embeddings model (can be found in Azure AI Studio)|
Expand Down
2 changes: 1 addition & 1 deletion docs/TEAMS_LOCAL_DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Or use the [Azure Functions VS Code extension](https://marketplace.visualstudio.
|AZURE_SEARCH_FILTER||Filter to apply to search queries.|
|AZURE_OPENAI_RESOURCE||the name of your Azure OpenAI resource|
|AZURE_OPENAI_MODEL||The name of your model deployment|
|AZURE_OPENAI_MODEL_NAME|gpt-35-turbo|The name of the model|
|AZURE_OPENAI_MODEL_NAME|gpt-4o|The name of the model|
|AZURE_OPENAI_API_KEY||One of the API keys of your Azure OpenAI resource|
|AZURE_OPENAI_EMBEDDING_MODEL|text-embedding-ada-002|The name of you Azure OpenAI embeddings model deployment|
|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.|
Expand Down
6 changes: 3 additions & 3 deletions docs/model_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ This document outlines the necessary steps and configurations required for setti

### LLM
- `AZURE_OPENAI_MODEL`: The Azure OpenAI Model Deployment Name
- example: `my-gpt-35-turbo-16k`
- example: `my-gpt-4o`
- `AZURE_OPENAI_MODEL_NAME`: The Azure OpenAI Model Name
- example: `gpt-35-turbo-16k`
- example: `gpt-4o`
- `AZURE_OPENAI_MODEL_VERSION`: The Azure OpenAI Model Version
- example: `0613`
- example: `2024-05-13`
- `AZURE_OPENAI_MODEL_CAPACITY`: The Tokens per Minute Rate Limit (thousands)
- example: `30`

Expand Down
6 changes: 3 additions & 3 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ param azureOpenAIResourceName string = 'openai-${resourceToken}'
param azureOpenAISkuName string = 'S0'

@description('Azure OpenAI Model Deployment Name')
param azureOpenAIModel string = 'gpt-35-turbo-16k'
param azureOpenAIModel string = 'gpt-4o'

@description('Azure OpenAI Model Name')
param azureOpenAIModelName string = 'gpt-35-turbo-16k'
param azureOpenAIModelName string = 'gpt-4o'

@description('Azure OpenAI Model Version')
param azureOpenAIModelVersion string = '0613'
param azureOpenAIModelVersion string = '2024-05-13'

@description('Azure OpenAI Model Capacity - See here for more info https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/quota')
param azureOpenAIModelCapacity int = 30
Expand Down
6 changes: 3 additions & 3 deletions infra/main.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ param azureSearchOffsetColumn = readEnvironmentVariable('AZURE_SEARCH_OFFSET_COL

// OpenAI parameters
param azureOpenAIApiVersion = readEnvironmentVariable('AZURE_OPENAI_API_VERSION', '2024-02-01')
param azureOpenAIModel = readEnvironmentVariable('AZURE_OPENAI_MODEL', 'gpt-35-turbo-16k')
param azureOpenAIModelName = readEnvironmentVariable('AZURE_OPENAI_MODEL_NAME', 'gpt-35-turbo-16k')
param azureOpenAIModelVersion = readEnvironmentVariable('AZURE_OPENAI_MODEL_VERSION', '0613')
param azureOpenAIModel = readEnvironmentVariable('AZURE_OPENAI_MODEL', 'gpt-4o')
param azureOpenAIModelName = readEnvironmentVariable('AZURE_OPENAI_MODEL_NAME', 'gpt-4o')
param azureOpenAIModelVersion = readEnvironmentVariable('AZURE_OPENAI_MODEL_VERSION', '2024-05-13')
param azureOpenAIModelCapacity = int(readEnvironmentVariable('AZURE_OPENAI_MODEL_CAPACITY', '30'))
param useAdvancedImageProcessing = bool(readEnvironmentVariable('USE_ADVANCED_IMAGE_PROCESSING', 'false'))
param advancedImageProcessingMaxImages = int(readEnvironmentVariable('ADVANCED_IMAGE_PROCESSING_MAX_IMAGES', '1'))
Expand Down
Loading
Loading