Skip to content
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

Adding support for Azure OpenAI Deployment Types (Global Standard, Standard, Provisioned) #2014

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions .azdo/pipelines/azure-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ steps:
AZURE_OPENAI_CHATGPT_DEPLOYMENT: $(AZURE_OPENAI_CHATGPT_DEPLOYMENT)
AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY: $(AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY)
AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION: $(AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION)
AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKUNAME: $(AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKUNAME)
AZURE_OPENAI_EMB_MODEL_NAME: $(AZURE_OPENAI_EMB_MODEL_NAME)
AZURE_OPENAI_EMB_DEPLOYMENT: $(AZURE_OPENAI_EMB_DEPLOYMENT)
AZURE_OPENAI_EMB_DEPLOYMENT_CAPACITY: $(AZURE_OPENAI_EMB_DEPLOYMENT_CAPACITY)
AZURE_OPENAI_EMB_DEPLOYMENT_VERSION: $(AZURE_OPENAI_EMB_DEPLOYMENT_VERSION)
AZURE_OPENAI_EMB_DEPLOYMENT_SKUNAME: $(AZURE_OPENAI_EMB_DEPLOYMENT_SKUNAME)
AZURE_OPENAI_EMB_DIMENSIONS: $(AZURE_OPENAI_EMB_DIMENSIONS)
OPENAI_HOST: $(OPENAI_HOST)
OPENAI_API_KEY: $(OPENAI_API_KEY)
Expand Down
2 changes: 2 additions & 0 deletions azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ pipeline:
- AZURE_OPENAI_CHATGPT_DEPLOYMENT
- AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY
- AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION
- AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKUNAME
- AZURE_OPENAI_EMB_MODEL_NAME
- AZURE_OPENAI_EMB_DEPLOYMENT
- AZURE_OPENAI_EMB_DEPLOYMENT_CAPACITY
- AZURE_OPENAI_EMB_DEPLOYMENT_VERSION
- AZURE_OPENAI_EMB_DEPLOYMENT_SKUNAME
- AZURE_OPENAI_EMB_DIMENSIONS
- OPENAI_HOST
- OPENAI_API_KEY
Expand Down
15 changes: 14 additions & 1 deletion docs/deploy_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ Execute the following commands inside your terminal:
azd env set AZURE_OPENAI_CHATGPT_MODEL gpt-4o-mini
```

1. To set the Azure OpenAI deployment Sku name, run this command with the desired Sku name.

```bash
azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKUNAME GlobalStandard
```

1. To set the Azure OpenAI deployment capacity, run this command with the desired capacity.

```bash
Expand Down Expand Up @@ -96,6 +102,7 @@ Execute the following commands inside your terminal:
> * `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT chat` to set the name of your old GPT 3.5 deployment.
> * `azd env set AZURE_OPENAI_CHATGPT_MODEL gpt-35-turbo` to set the name of your old GPT 3.5 model.
> * `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY 30` to set the capacity of your old GPT 3.5 deployment.
> * `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKUNAME Standard` to set the Sku name back to Standard.
> * `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION 0613` to set the version number of your old GPT 3.5.
> * `azd up` to update the provisioned resources.
>
Expand Down Expand Up @@ -127,7 +134,13 @@ By default, the deployed Azure web app uses the `text-embedding-ada-002` embeddi
azd env set AZURE_OPENAI_EMB_DEPLOYMENT_VERSION 1
```

4. When prompted during `azd up`, make sure to select a region for the OpenAI resource group location that supports the text-embedding-3 models. There are [limited regions available](https://learn.microsoft.com/azure/ai-services/openai/concepts/models#embeddings-models).
4. Set the deployment Sku name to "GlobalStandard" :

```shell
azd env set AZURE_OPENAI_EMB_DEPLOYMENT_SKUNAME GlobalStandard
```

5. When prompted during `azd up`, make sure to select a region for the OpenAI resource group location that supports the text-embedding-3 models. There are [limited regions available](https://learn.microsoft.com/azure/ai-services/openai/concepts/models#embeddings-models).

If you have already deployed:

Expand Down
9 changes: 7 additions & 2 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,30 @@ param computerVisionSkuName string // Set in main.parameters.json
param chatGptModelName string = ''
param chatGptDeploymentName string = ''
param chatGptDeploymentVersion string = ''
param chatGptDeploymentSkuName string = ''
param chatGptDeploymentCapacity int = 0

var chatGpt = {
modelName: !empty(chatGptModelName)
? chatGptModelName
: startsWith(openAiHost, 'azure') ? 'gpt-35-turbo' : 'gpt-3.5-turbo'
deploymentName: !empty(chatGptDeploymentName) ? chatGptDeploymentName : 'chat'
deploymentVersion: !empty(chatGptDeploymentVersion) ? chatGptDeploymentVersion : '0613'
deploymentSkuName: !empty(chatGptDeploymentSkuName) ? chatGptDeploymentSkuName : 'Standard'
deploymentCapacity: chatGptDeploymentCapacity != 0 ? chatGptDeploymentCapacity : 30
}

param embeddingModelName string = ''
param embeddingDeploymentName string = ''
param embeddingDeploymentVersion string = ''
param embeddingDeploymentSkuName string = ''
param embeddingDeploymentCapacity int = 0
param embeddingDimensions int = 0
var embedding = {
modelName: !empty(embeddingModelName) ? embeddingModelName : 'text-embedding-ada-002'
deploymentName: !empty(embeddingDeploymentName) ? embeddingDeploymentName : 'embedding'
deploymentVersion: !empty(embeddingDeploymentVersion) ? embeddingDeploymentVersion : '2'
deploymentSkuName: !empty(embeddingDeploymentSkuName) ? embeddingDeploymentSkuName : 'Standard'
deploymentCapacity: embeddingDeploymentCapacity != 0 ? embeddingDeploymentCapacity : 30
dimensions: embeddingDimensions != 0 ? embeddingDimensions : 1536
}
Expand Down Expand Up @@ -450,7 +455,7 @@ var defaultOpenAiDeployments = [
version: chatGpt.deploymentVersion
}
sku: {
name: 'Standard'
name: chatGpt.deploymentSkuName
capacity: chatGpt.deploymentCapacity
}
}
Expand All @@ -462,7 +467,7 @@ var defaultOpenAiDeployments = [
version: embedding.deploymentVersion
}
sku: {
name: 'Standard'
name: embedding.deploymentSkuName
capacity: embedding.deploymentCapacity
}
}
Expand Down
6 changes: 6 additions & 0 deletions infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
"chatGptDeploymentVersion":{
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION}"
},
"chatGptDeploymentSkuName":{
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKUNAME}"
},
"chatGptDeploymentCapacity":{
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY}"
},
Expand All @@ -110,6 +113,9 @@
"embeddingDeploymentVersion":{
"value": "${AZURE_OPENAI_EMB_DEPLOYMENT_VERSION}"
},
"cembeddingDeploymentSkuName":{
"value": "${AZURE_OPENAI_EMB_DEPLOYMENT_SKUNAME}"
},
"embeddingDeploymentCapacity":{
"value": "${AZURE_OPENAI_EMB_DEPLOYMENT_CAPACITY}"
},
Expand Down
Loading