How do I resolve error DeploymentNotFound for Azure OpenAI Python API call?

Amin, Ishmael 10 Reputation points
2023-03-13T18:59:43.4333333+00:00

I'm running the code from my desktop and connecting to Azure OpenAI Service.
 The Deployment exists in Azure associated with Deployment "gpt-35-turbo". 

<Response [404]>
{
    "error": {
        "code": "DeploymentNotFound",
        "message": "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."
    }
}
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,158 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Chris Hoder - MSFT 96 Reputation points Microsoft Employee
    2023-03-15T08:55:06.4233333+00:00

    Hi -- can you share a bit more code on how you are calling the API. This is likely either (1) the deployment name in your code doesn't match a deployment in the resource or (2) the deployment was not yet complete.

    1 person found this answer helpful.

  2. Ahmad MK 0 Reputation points
    2023-04-02T02:02:18.49+00:00

    I am getting the same error with this code:

    deployment_name = "Summarization"
    
    # Create LLM via Azure OpenAI Service
    llm = AzureOpenAI(deployment_name=deployment_name)
    llm_predictor = LLMPredictor(llm=llm)
    embedding_llm = LangchainEmbedding(OpenAIEmbeddings())
    
    # Define prompt helper
    max_input_size = 3000
    num_output = 256
    chunk_size_limit = 1000 # token window size per document
    max_chunk_overlap = 20 # overlap for each token fragment
    prompt_helper = PromptHelper(max_input_size=max_input_size, num_output=num_output, max_chunk_overlap=max_chunk_overlap, chunk_size_limit=chunk_size_limit)
    
    # Read txt files from data directory
    documents = SimpleDirectoryReader('data').load_data()
    index = GPTSimpleVectorIndex(documents, llm_predictor=llm_predictor, embed_model=embedding_llm, prompt_helper=prompt_helper)