Skip to content

Commit 0c38809

Browse files
Merge pull request #262824 from mrbullwinkle/mrb_01_09_2024_keyword_quotes
[Azure OpenAI] GitHub Issue
2 parents 68db497 + 23fde10 commit 0c38809

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

articles/ai-services/openai/how-to/switching-endpoints.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ We recommend using environment variables. If you haven't done this before our [P
3434
from openai import OpenAI
3535

3636
client = OpenAI(
37-
api_key=os.environ['OPENAI_API_KEY']
37+
api_key=os.environ["OPENAI_API_KEY"]
3838
)
3939

4040

@@ -74,7 +74,7 @@ client = AzureOpenAI(
7474
from openai import OpenAI
7575

7676
client = OpenAI(
77-
api_key=os.environ['OPENAI_API_KEY']
77+
api_key=os.environ["OPENAI_API_KEY"]
7878
)
7979

8080

@@ -111,7 +111,10 @@ client = AzureOpenAI(
111111

112112
## Keyword argument for model
113113

114-
OpenAI uses the `model` keyword argument to specify what model to use. Azure OpenAI has the concept of unique model [deployments](create-resource.md?pivots=web-portal#deploy-a-model). When using Azure OpenAI `model` should refer to the underling deployment name you chose when you deployed the model.
114+
OpenAI uses the `model` keyword argument to specify what model to use. Azure OpenAI has the concept of unique model [deployments](create-resource.md?pivots=web-portal#deploy-a-model). When using Azure OpenAI `model` should refer to the underlying deployment name you chose when you deployed the model.
115+
116+
> [!IMPORTANT]
117+
> When you access the model via the API in Azure OpenAI you will need to refer to the deployment name rather than the underlying model name in API calls. This is one of the [key differences](../how-to/switching-endpoints.md) between OpenAI and Azure OpenAI. OpenAI only requires the model name, Azure OpenAI always requires deployment name, even when using the model parameter. In our docs we often have examples where deployment names are represented as identical to model names to help indicate which model works with a particular API endpoint. Ultimately your deployment names can follow whatever naming convention is best for your use case.
115118
116119
<table>
117120
<tr>
@@ -122,7 +125,7 @@ OpenAI uses the `model` keyword argument to specify what model to use. Azure Ope
122125

123126
```python
124127
completion = client.completions.create(
125-
model='gpt-3.5-turbo-instruct',
128+
model="gpt-3.5-turbo-instruct",
126129
prompt="<prompt>")
127130
)
128131

@@ -142,7 +145,7 @@ embedding = client.embeddings.create(
142145

143146
```python
144147
completion = client.completions.create(
145-
model=gpt-35-turbo-instruct, # This must match the custom deployment name you chose for your model.
148+
model="gpt-35-turbo-instruct", # This must match the custom deployment name you chose for your model.
146149
prompt=<"prompt">
147150
)
148151

articles/ai-services/openai/includes/create-resource-cli.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ az cognitiveservices account deployment create \
9595
--sku-name "Standard"
9696
```
9797

98+
> [!IMPORTANT]
99+
> When you access the model via the API you will need to refer to the deployment name rather than the underlying model name in API calls. This is one of the [key differences](../how-to/switching-endpoints.md) between OpenAI and Azure OpenAI. OpenAI only requires the model name, Azure OpenAI always requires deployment name, even when using the model parameter. In our docs we often have examples where deployment names are represented as identical to model names to help indicate which model works with a particular API endpoint. Ultimately your deployment names can follow whatever naming convention is best for your use case.
100+
98101
## Delete a model from your resource
99102

100103
You can delete any model deployed from your resource with the [az cognitiveservices account deployment delete](/cli/azure/cognitiveservices/account/deployment?view=azure-cli-latest&preserve-view=true#az-cognitiveservices-account-deployment-delete) command. In the following example, you delete a model named _MyModel_. When you try the example, update the code to use your values for the resource group, resource, and deployed model.

articles/ai-services/openai/includes/create-resource-portal.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,25 +100,28 @@ To deploy a model, follow these steps:
100100

101101
1. Sign in to [Azure OpenAI Studio](https://oai.azure.com).
102102

103-
1. Choose the subscription and the Azure OpenAI resource to work with, and select **Use resource**.
103+
2. Choose the subscription and the Azure OpenAI resource to work with, and select **Use resource**.
104104

105-
1. Under **Management** select **Deployments**.
105+
3. Under **Management** select **Deployments**.
106106

107-
1. Select **Create new deployment** and configure the following fields:
107+
4. Select **Create new deployment** and configure the following fields:
108108

109109
| Field | Description |
110110
|---|---|
111111
| **Select a model** | Model availability varies by region. For a list of available models per region, see [Model summary table and region availability](../concepts/models.md#model-summary-table-and-region-availability). |
112112
| **Deployment name** | Choose a name carefully. The deployment name is used in your code to call the model by using the client libraries and the REST APIs. |
113113
| **Advanced options** (Optional) | You can set optional advanced settings, as needed for your resource. <br> - For the **Content Filter**, assign a content filter to your deployment.<br> - For the **Tokens per Minute Rate Limit**, adjust the Tokens per Minute (TPM) to set the effective rate limit for your deployment. You can modify this value at any time by using the [**Quotas**](../how-to/quota.md) menu. |
114114

115-
1. Select a model from the dropdown list.
115+
5. Select a model from the dropdown list.
116116

117-
1. Enter a deployment name to help you identify the model.
117+
6. Enter a deployment name to identify the model.
118118

119-
1. For your first deployment, leave the **Advanced options** set to the defaults.
119+
> [!IMPORTANT]
120+
> When you access the model via the API you will need to refer to the deployment name rather than the underlying model name in API calls. This is one of the [key differences](../how-to/switching-endpoints.md) between OpenAI and Azure OpenAI. OpenAI only requires the model name, Azure OpenAI always requires deployment name, even when using the model parameter. In our docs we often have examples where deployment names are represented as identical to model names to help indicate which model works with a particular API endpoint. Ultimately your deployment names can follow whatever naming convention is best for your use case.
120121
121-
1. Select **Create**.
122+
7. For your first deployment, leave the **Advanced options** set to the defaults.
123+
124+
8. Select **Create**.
122125

123126
The deployments table shows a new entry that corresponds to your newly created model.
124127

articles/ai-services/openai/includes/create-resource-powershell.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ $sku = New-Object -TypeName "Microsoft.Azure.Management.CognitiveServices.Models
9090
New-AzCognitiveServicesAccountDeployment -ResourceGroupName OAIResourceGroup -AccountName MyOpenAIResource -Name MyModel -Properties $properties -Sku $sku
9191
```
9292

93+
> [!IMPORTANT]
94+
> When you access the model via the API you will need to refer to the deployment name rather than the underlying model name in API calls. This is one of the [key differences](../how-to/switching-endpoints.md) between OpenAI and Azure OpenAI. OpenAI only requires the model name, Azure OpenAI always requires deployment name, even when using the model parameter. In our docs we often have examples where deployment names are represented as identical to model names to help indicate which model works with a particular API endpoint. Ultimately your deployment names can follow whatever naming convention is best for your use case.
95+
9396
## Delete a model from your resource
9497

9598
You can delete any model deployed from your resource with the [Remove-AzCognitiveServicesAccountDeployment](/powershell/module/az.cognitiveservices/remove-azcognitiveservicesaccountdeployment) command. In the following example, you delete a model named _MyModel_. When you try the example, update the code to use your values for the resource group, resource, and deployed model.

0 commit comments

Comments
 (0)