Skip to content

Create AOAI deployment with cogservices create API without passing in account (instead pass key + endpoint) #1738

@nanditamohan

Description

@nanditamohan

I want to create a AOAI model deployment using this API, since its the only one which supports deployment_name being set (OAI api does not support this: openai/openai-python#457):

I was suggested to do this:

from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient
client = CognitiveServicesManagementClient(credential=<credential>, subscription_id=<subscription_id>)

deployment = client.deployments.begin_create_or_update(
    resource_group_name="<resource_group_name>",
    account_name="<account_name>",
    deployment_name="<deployment_name>",
    deployment={
        "properties": {
          "model": {
            "format": "OpenAI",
            "name": "<model name>",
            "version": "<model version>"
          },
          "scaleSettings": {
            "scaleType": "Standard"
          }
        }
    }
)

However, what I'm building does not have access to the Cog Services account name and rg, sub - but only has the AzureML subscription, resourceGroup as well as AzureOpenAI account base, key, version and type. Is there a way to use this library to create a deployment with that information instead of account info?

Thanks for the help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions