Skip to content

Commit

Permalink
Add gpt-35-turbo model deployment to v1 Bicep and Terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
crpietschmann committed Mar 15, 2024
1 parent 1a55d37 commit 37ed641
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
23 changes: 23 additions & 0 deletions IaC/Bicep/v1/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ param location string = resourceGroup().location

param azureOpenAISku string = 'S0'

param openai_deployment_name string = 'b59-gpt35-turbo'

var resourceTags = {
project: 'https://github.com/build5nines/AIChatUI'
}
Expand All @@ -26,3 +28,24 @@ resource azureopenai 'Microsoft.CognitiveServices/accounts@2023-10-01-preview' =
publicNetworkAccess: 'Enabled'
}
}

resource azureopenaideployment 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = {
name: openai_deployment_name
sku: {
capacity: 120
name: 'Standard'
}
parent: azureopenai
properties: {
model: {
format: 'OpenAI'
name: 'gpt-35-turbo'
version: '0613'
}
raiPolicyName: 'Microsoft.Default'
versionUpgradeOption: 'OnceCurrentVersionExpired'
scaleSettings: {
capacity: 120
}
}
}
34 changes: 33 additions & 1 deletion IaC/Terraform/v1/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,29 @@ terraform {
source = "hashicorp/azurerm"
version = "~>3"
}
azapi = {
source = "azure/azapi"
}
}
}

provider "azurerm" {
features {}
}

provider "azapi" {

}


locals {
resource_prefix = "b59-eus2-aichatui"
location = "eastus2"

openai_sku = "S0"

openai_deployment_name = "b59-gpt35-turbo"

resourceTags = {
project = "https://github.com/build5nines/AIChatUI"
}
Expand All @@ -36,4 +46,26 @@ resource azurerm_cognitive_account azureopenai {
kind = "OpenAI"
sku_name = local.openai_sku
tags = local.resourceTags
}
}

# https://learn.microsoft.com/en-us/azure/templates/microsoft.cognitiveservices/accounts/deployments?pivots=deployment-language-terraform
resource "azapi_resource" azureopenaideployment {
type = "Microsoft.CognitiveServices/accounts/deployments@2023-05-01"
name = local.openai_deployment_name
parent_id = azurerm_cognitive_account.azureopenai.id
body = jsonencode({
properties = {
model = {
format = "OpenAI"
name = "gpt-35-turbo"
version = "0613"
}
versionUpgradeOption = "OnceCurrentVersionExpired"
raiPolicyName = "Microsoft.Default"
}
sku = {
capacity = 120
name = "Standard"
}
})
}

0 comments on commit 37ed641

Please sign in to comment.