Azure / terraform-azurerm-openai

Terraform module for deploying Azure OpenAI Service.
MIT License
44 stars 33 forks source link

Unable to create a GPT-4o deployment #90

Closed cffranco94 closed 3 months ago

cffranco94 commented 3 months ago

Is there an existing issue for this?

Greenfield/Brownfield provisioning

greenfield

Terraform Version

1.8.0

Module Version

v0.1.3

AzureRM Provider Version

3.113.0

Affected Resource(s)/Data Source(s)

azurerm_cognitive_deployment

Terraform Configuration Files

module "openai" {
  source              = "Azure/openai/azurerm"
  resource_group_name = azurerm_resource_group.rg.name
  location            = "Switzerland North"
  private_endpoint = {
    "pe_endpoint" = {
      private_dns_entry_enabled       = true
      dns_zone_virtual_network_link   = "dns_zone_link_openai"
      is_manual_connection            = false
      name                            = "openai_pe"
      private_service_connection_name = "openai_pe_connection"
      subnet_name                     = azurerm_subnet.subnet.name
      vnet_name                       = azurerm_virtual_network.vnet.name
      vnet_rg_name                    = azurerm_resource_group.rg.name
    }
  }
  deployment = {
    "chat_3_model" = {
      name          = "gpt-35-turbo"
      model_format  = "OpenAI"
      model_name    = "gpt-35-turbo"
      model_version = "0613"
      scale_type    = "Standard"
      capacity      = 120
    },
    "chat_4_model" = {
      name          = "gpt-4o"
      model_format  = "OpenAI"
      model_name    = "gpt-4o"
      model_version = "2024-05-13"
      scale_type    = "Standard"
      capacity      = 10
    },
    "embedding_model" = {
      name          = "text-embedding-ada-002"
      model_format  = "OpenAI"
      model_name    = "text-embedding-ada-002"
      model_version = "2"
      scale_type    = "Standard"
      capacity      = 120
    },
  }
  depends_on = [
    azurerm_resource_group.rg
  ]
}

tfvars variables values

resource "azurerm_resource_group" "rg" {
  location = var.resource_group_location
  name     = "RG-Name"
}

Debug Output/Panic Output

"InvalidResourceProperties: The specified scale type 'Standard' of account deployment is not supported by the model 'gpt-4o'."

I also tried to use "Global-Standard" but without any luck.

Expected Behaviour

OpenAI resource should be created with gpt4o model deployed

Actual Behaviour

OpenAI resource is created, but only with gpt3-turbo and embeddings

Steps to Reproduce

No response

Important Factoids

No response

References

No response

zioproto commented 3 months ago

Related to https://github.com/hashicorp/terraform-provider-azurerm/issues/26681

zioproto commented 3 months ago

Duplicated of https://github.com/Azure/terraform-azurerm-openai/issues/87

cffranco94 commented 3 months ago

Hello @zioproto,

I commented on #87 before opening a new one because I notice that the #87 was closed. I didn't saw that the problem was just the region. Changed to swedencentral and it worked.

Thank you

zioproto commented 3 months ago

@cffranco94

I get a different error:

 Deployment Name: "gpt-4o"): performing CreateOrUpdate: unexpected status 400 (400 Bad Request) with error: InvalidResourceProperties: The specified SKU 'Standard' for model 'gpt-4o 2024-05-13' is not supported in this region 'switzerlandnorth'.

If you want to use Switzerland North you need to set the scale type to GlobalStandard

Please without -, the correct string is GlobalStandard.

cffranco94 commented 3 months ago

@zioproto , thank you , it worked!