mckaywrigley / chatbot-ui

AI chat for every model.
https://chatbotui.com
MIT License
27.99k stars 7.8k forks source link

Error message "The API deployment for this resource does not exist" when using Azure OpenAI Service #498

Closed jony4 closed 1 year ago

jony4 commented 1 year ago
The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.
jony4 commented 1 year ago

Actually, I have deployed the OpenAI model and service already.

jony4 commented 1 year ago

Perhaps this parameter was omitted.

reference -> https://github.com/sashabaranov/go-openai/blob/master/config.go#L60

gchust commented 1 year ago

I was facing the same error, I fixed it by setting the following environment var for azure

DEFAULT_MODEL | gpt-3.5-turbo | The default model to use on new conversations, for Azure use gpt-35-turbo

---gpt-3.5-trubo
+++gpt-35-turbo

Azure should use gpt-35-turbo

jony4 commented 1 year ago

no, this is deployment id is from here: https://learn.microsoft.com/zh-cn/azure/cognitive-services/openai/reference#completions which input by yourself

image

I just test with "gpt35", and no more error message. lol

jony4 commented 1 year ago

pr https://github.com/mckaywrigley/chatbot-ui/pull/499

gchust commented 1 year ago

no, this is deployment id is from here: https://learn.microsoft.com/zh-cn/azure/cognitive-services/openai/reference#completions which input by yourself

image

I just test with "gpt35", and no more error message. lol

You're right, I have renamed the deployment name same as the model name lol...

itbm commented 1 year ago

@jony4 @mckaywrigley PR #499 isn't required and adds complexity. The existing solution automatically translates gpt-35-turbo / gpt-4 / gpt-4-32k to your deployment name. See https://github.com/mckaywrigley/chatbot-ui/blob/main/pages/api/models.ts#L53.

If you opened the web UI before setting DEFAULT_MODEL=gpt-35-turbo it may have cached gpt-3.5-turbo in your conversations. Exporting your data, fixing the JSON file, clearing your cache and re-importing data will probably solve it (or just clear your cache if you don't want to keep conversations). The exported JSON should have:

// ...
  "model": {
    "id": "<deployment_name>",
    // ...
  },
// ...
jony4 commented 1 year ago

the /api/models api returns this response

[{"id":"gpt35","name":"GPT-3.5"}]

but seems the response's id field isn't used by index.ts#L34 correctly.

/openai/deployments/gpt35/chat/completions?api-version= will works.

vladiliescu commented 1 year ago

@jony4 I think you may want to shut that down, at the moment anyone can make calls to Azure OpenAI using your keys (so you will get billed for it).

Quetzalcohuatl commented 9 months ago

Removing the period from 3.5 fixed it on my end too. Thanks random github issue!