For folks who have the same issue, you need to deploy the embedding model as well, by default, llamaindex uses text-embedding-ada-002
How to fix the error using Azure OpenAI model endpoints and the LlamaIndex python package on my local computer?
I am receiving the following error running GPTSimpleVectorIndex(documents, llm_predictor=llm_predictor)
and looking for a way to fix it on my local computer.
InvalidRequestError: 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.
load_dotenv()
openai.api_type = "azure"
openai.api_version = "2022-12-01"
openai.api_base = os.getenv('OPENAI_API_BASE')
openai.api_key = os.getenv("OPENAI_API_KEY")
deployment_name='text-davinci-003'
llm = AzureOpenAI(deployment_name=deployment_name)
llm_predictor = LLMPredictor(llm=llm)
documents = SimpleDirectoryReader('data').load_data()
index = GPTSimpleVectorIndex(documents, llm_predictor=llm_predictor)
Note that I am uploading the following packages:
import os
import openai
from dotenv import load_dotenv
from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader, LLMPredictor
from langchain.llms import AzureOpenAI
from langchain.embeddings import OpenAIEmbeddings
5 answers
Sort by: Most helpful
-
-
Helena Deus 5 Reputation points
2023-05-10T18:16:16.2766667+00:00 Same problem. Has anyone figured this out?
-
YutongTie-MSFT 51,721 Reputation points
2023-03-21T22:37:17.8366667+00:00 Hello @Kyle Z
Thanks for reaching out to us, I have read your code sample, I felt like there is something wrong about your code part - deployment_name='text-davinci-003'
Are you sure 'text-davinci-003' is your deployment name? This name will correspond to the custom name you chose for your deployment when you deployed a model, not the model you are using. Please confirm this part.
If you are sure about the name and your deployment has been there for more than one hour but you still get the error, please let us know, we can help you to raise a support ticket for this issue to check what's wrong with your deployment. Please let us know if you have no support plan in this situation, we are happy to help you enable a free ticket for this case.
I hope this helps.
Regards,
Yutong
-Please kindly accept the answer and vote for 'Yes' if you feel helpful to support the community, thanks a lot.
-
Sai Likhitha Yannakula 0 Reputation points
2023-03-28T15:49:36.9066667+00:00 i am also using the same code and i have given the deployment name as text2 its been more than 4 hrs i am still facing the issue as below
openai.error.InvalidRequestError: 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.
-
Eddie Yong 0 Reputation points
2023-10-03T11:59:08.57+00:00 I recently had the same error and managed to get a response from support.
https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/switching-endpoints
where the description of deployment_id is very vague, and I misunderstood it and made the mistake of putting the model name in the deployment_id. You need to put the deployment name of your own deployment in the deployment_id, not the model name, for it to work correctly. This is where OpenAI's API differs from the Azure OpenAI API, and it's not clearly explained, so it seems like an easy mistake to make. I've given feedback to customer support to clarify this part, and hopefully other developers won't make the same mistake and go through the same pain as me :)