From b677299e274c6bdda81206ae407b3674e2d2d644 Mon Sep 17 00:00:00 2001 From: Matthew Alan Gray Date: Thu, 1 Aug 2024 11:26:01 -0500 Subject: [PATCH] Consolidated OpenAI deployment information in a shared JSON and added side-by-side deployment support to QuickStart --- .../common/config/openAiDeploymentConfig.json | 177 ++++++++++++++++++ deploy/quick-start/infra/main.bicep | 28 +-- deploy/standard/infra/openai-rg.bicep | 156 +-------------- 3 files changed, 182 insertions(+), 179 deletions(-) create mode 100644 deploy/common/config/openAiDeploymentConfig.json diff --git a/deploy/common/config/openAiDeploymentConfig.json b/deploy/common/config/openAiDeploymentConfig.json new file mode 100644 index 0000000000..3876394bcb --- /dev/null +++ b/deploy/common/config/openAiDeploymentConfig.json @@ -0,0 +1,177 @@ +[ + { + "name": "completions", + "locations": [ + "eastus", + "eastus2", + "japaneast", + "northcentralus", + "switzerlandnorth" + ], + "raiPolicyName": "", + "model": { + "format": "OpenAI", + "name": "gpt-35-turbo", + "version": "0613" + }, + "sku": { + "capacity": 60, + "name": "Standard" + } + }, + { + "name": "completions", + "locations": [ + "austrailiaeast", + "canadaeast", + "francecentral", + "southindia", + "swedencentral", + "uksouth", + "westus" + ], + "raiPolicyName": "", + "model": { + "format": "OpenAI", + "name": "gpt-35-turbo", + "version": "1106" + }, + "sku": { + "capacity": 60, + "name": "Standard" + } + }, + { + "name": "completions", + "locations": [ + "austrailiaeast", + "canadaeast", + "francecentral", + "southindia", + "swedencentral", + "uksouth", + "westus" + ], + "raiPolicyName": "", + "model": { + "format": "OpenAI", + "name": "gpt-35-turbo", + "version": "1106" + }, + "sku": { + "capacity": 60, + "name": "Standard" + } + }, + { + "name": "completions4", + "locations": [ + "austrailiaeast", + "canadaeast", + "eastus2", + "francecentral", + "norwayeast", + "southindia", + "swedencentral", + "uksouth", + "westus" + ], + "raiPolicyName": "", + "model": { + "format": "OpenAI", + "name": "gpt-4", + "version": "1106-Preview" + }, + "sku": { + "capacity": 40, + "name": "Standard" + } + }, + { + "name": "completions4o", + "locations": [ + "eastus", + "eastus2", + "northcentralus", + "southcentralus", + "southindia", + "westus", + "westus3" + ], + "raiPolicyName": "", + "model": { + "format": "OpenAI", + "name": "gpt-4o", + "version": "2024-05-13" + }, + "sku": { + "capacity": 40, + "name": "Standard" + } + }, + { + "name": "embeddings", + "locations": [ + "austrailiaeast", + "canadaeast", + "eastus", + "eastus2", + "francecentral", + "japaneast", + "northcentralus", + "norwayeast", + "southcentralus", + "swedencentral", + "switzerlandnorth", + "uksouth", + "westeurope", + "westus" + ], + "raiPolicyName": "Microsoft.Default", + "model": { + "format": "OpenAI", + "name": "text-embedding-ada-002", + "version": "2" + }, + "sku": { + "capacity": 60, + "name": "Standard" + } + }, + { + "name": "embeddings-3-large", + "locations": [ + "canadaeast", + "eastus", + "eastus2" + ], + "raiPolicyName": "Microsoft.Default", + "model": { + "format": "OpenAI", + "name": "text-embedding-3-large", + "version": "" + }, + "sku": { + "capacity": 60, + "name": "Standard" + } + }, + { + "name": "embeddings-3-small", + "locations": [ + "canadaeast", + "eastus", + "eastus2" + ], + "raiPolicyName": "Microsoft.Default", + "model": { + "format": "OpenAI", + "name": "text-embedding-3-small", + "version": "" + }, + "sku": { + "capacity": 60, + "name": "Standard" + } + } +] \ No newline at end of file diff --git a/deploy/quick-start/infra/main.bicep b/deploy/quick-start/infra/main.bicep index 80d8839ca6..e83bbaad50 100644 --- a/deploy/quick-start/infra/main.bicep +++ b/deploy/quick-start/infra/main.bicep @@ -76,6 +76,9 @@ var openAiInstance = { subscriptionId: subscription().subscriptionId } +var deploymentConfigurations = loadJsonContent('../../common/config/openAiDeploymentConfig.json') +var deployments = filter(deploymentConfigurations, (d) => contains(d.locations, location)) + // Tags that should be applied to all resources. // // Note that 'azd-service-name' tags should be applied separately to service host resources. @@ -362,30 +365,7 @@ module openAi './shared/openai.bicep' = sku: 'S0' tags: tags - deployments: [ - { - name: 'completions' - sku: { - name: 'Standard' - capacity: 10 - } - model: { - name: 'gpt-35-turbo' - version: '0613' - } - } - { - name: 'embeddings' - sku: { - name: 'Standard' - capacity: 10 - } - model: { - name: 'text-embedding-ada-002' - version: '2' - } - } - ] + deployments: deployments } } diff --git a/deploy/standard/infra/openai-rg.bicep b/deploy/standard/infra/openai-rg.bicep index 441a992ec9..d86f5b602b 100644 --- a/deploy/standard/infra/openai-rg.bicep +++ b/deploy/standard/infra/openai-rg.bicep @@ -31,161 +31,7 @@ var openAiInstance = { subscriptionId: azureOpenAiSubId } -var deploymentConfigurations = [ - { - name: 'completions' - locations: [ - 'eastus' - 'eastus2' - 'japaneast' - 'northcentralus' - 'switzerlandnorth' - ] - raiPolicyName: '' - model: { - format: 'OpenAI' - name: 'gpt-35-turbo' - version: '0613' - } - sku: { - capacity: 60 - name: 'Standard' - } - } - { - name: 'completions' - locations: [ - 'austrailiaeast' - 'canadaeast' - 'francecentral' - 'southindia' - 'swedencentral' - 'uksouth' - 'westus' - ] - raiPolicyName: '' - model: { - format: 'OpenAI' - name: 'gpt-35-turbo' - version: '1106' - } - sku: { - capacity: 60 - name: 'Standard' - } - } - { - name: 'completions4' - locations: [ - 'austrailiaeast' - 'canadaeast' - 'eastus2' - 'francecentral' - 'norwayeast' - 'southindia' - 'swedencentral' - 'uksouth' - 'westus' - ] - raiPolicyName: '' - model: { - format: 'OpenAI' - name: 'gpt-4' - version: '1106-Preview' - } - sku: { - capacity: 40 - name: 'Standard' - } - } - { - name: 'completions4o' - locations: [ - 'eastus' - 'eastus2' - 'northcentralus' - 'southcentralus' - 'southindia' - 'westus' - 'westus3' - ] - raiPolicyName: '' - model: { - format: 'OpenAI' - name: 'gpt-4o' - version: '2024-05-13' - } - sku: { - capacity: 40 - name: 'Standard' - } - } - { - name: 'embeddings' - locations: [ - 'austrailiaeast' - 'canadaeast' - 'eastus' - 'eastus2' - 'francecentral' - 'japaneast' - 'northcentralus' - 'norwayeast' - 'southcentralus' - 'swedencentral' - 'switzerlandnorth' - 'uksouth' - 'westeurope' - 'westus' - ] - raiPolicyName: 'Microsoft.Default' - model: { - format: 'OpenAI' - name: 'text-embedding-ada-002' - version: '2' - } - sku: { - capacity: 60 - name: 'Standard' - } - } - { - name: 'embeddings-3-large' - locations: [ - 'canadaeast' - 'eastus' - 'eastus2' - ] - raiPolicyName: 'Microsoft.Default' - model: { - format: 'OpenAI' - name: 'text-embedding-3-large' - version: '' - } - sku: { - capacity: 60 - name: 'Standard' - } - } - { - name: 'embeddings-3-small' - locations: [ - 'canadaeast' - 'eastus' - 'eastus2' - ] - raiPolicyName: 'Microsoft.Default' - model: { - format: 'OpenAI' - name: 'text-embedding-3-small' - version: '' - } - sku: { - capacity: 60 - name: 'Standard' - } - } -] +var deploymentConfigurations = loadJsonContent('../../common/config/openAiDeploymentConfig.json') var tags = { Environment: environmentName