victordibia / llmx

An API for Chat Fine-Tuned Large Language Models (llm)
MIT License
72 stars 27 forks source link

Error processing file: 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. : Can anyone provide one single working example for Azure OpenAI ? #15

Closed younes-io closed 6 months ago

younes-io commented 8 months ago

I've been trying to set up a working example of Azure OpenAI but in vain...

I think the documentation about this LLM provider should be very clear and not just dealt with in a sentence.. it's not about just setting up the env vars.. I've been trying to work around it for almost one hour now, but I don't know how to set the model, etc. I think it's really poorly documented.

Could anyone help please ?

MODEL_NAME=demo-llm
AZURE_OPENAI_BASE=https://******************.openai.azure.com/
AZURE_OPENAI_API_KEY=*********************
AZURE_OPENAI_API_TYPE=azure
AZURE_OPENAI_API_VERSION=2023-07-01-preview

I tried this:


provider = sanitize_provider("azureopenai")

text_gen = OpenAITextGenerator(
                # provider="azureopenai",
               api_type="azure",
               api_base=os.environ["AZURE_OPENAI_BASE"],
               api_key=os.environ["AZURE_OPENAI_API_KEY"],
               api_version="2023-07-01-preview",
               models =[os.environ["MODEL_NAME"]],
                provider=provider,
)

and this

text_gen = llm(provider="azureopenai",
               api_type="azure",
               api_base=os.environ["AZURE_OPENAI_BASE"],
               api_key=os.environ["AZURE_OPENAI_API_KEY"],
               api_version="2023-07-01-preview",
               model =os.environ["MODEL_NAME"],
               ) # for azure openai

I get Error processing file: 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.

younes-io commented 8 months ago

It's weird that OpenAITextGenerator doesn't take the deployment_name property which is necessary to call Azure OpenAI :/

himanshu-nakrani commented 6 months ago

I am Stuck at same error for a while, @younes-io have you found any solution?

younes-io commented 6 months ago

@himanshu-nakrani : what are you trying to do exactly ?

himanshu-nakrani commented 6 months ago

@younes-io I got rid of this error by passing my model's "deploment name" in "model" parameter.

younes-io commented 6 months ago

@himanshu-nakrani : I bypassed it too but I ended up abandoning llmx because it doesn't yet support some features for OpenAI models unfortunately..