Describe the bug
The project currently requires the AZURE_URL environment variable in the format like https://{azure-resource-url}/openai/deployments/{deploy-name}, which enforces the inclusion of the deployment name.
However, according to the Azure OpenAI documentation [1] and [2], it's not possible to send requests to different models using a URL that specifies the deployment name. The relationship between deployment names and models are 1-to-1 (i.e. models are specified with the deployment name). This is different from the OpenAI API, where the model is specified in the request body.
For instance, consider having two models, gpt-3.5 and gpt-4 from the Azure OpenAI service. They would each have distinct URLs, such as https://{azure-resource-url}/openai/deployments/gpt35 and https://{azure-resource-url}/openai/deployments/gpt4. In the current project implementation, switching between models is accomplished by altering the model field within the request body. However, this approach is not compatible with the Azure OpenAI service, where the deployment name portion of the URL needs to be changed instead.
Relevent Discussions
#3206 (comment)
#3206 (comment)
#3260
Expected behavior
A potential solution is to include a model name to deployment name mapper in the environment variables. For reference, see https://github.com/stulzq/azure-openai-proxy.
Describe the bug
The project currently requires the
AZURE_URLenvironment variable in the format likehttps://{azure-resource-url}/openai/deployments/{deploy-name}, which enforces the inclusion of the deployment name.However, according to the Azure OpenAI documentation [1] and [2], it's not possible to send requests to different models using a URL that specifies the deployment name. The relationship between deployment names and models are 1-to-1 (i.e. models are specified with the deployment name). This is different from the OpenAI API, where the model is specified in the request body.
For instance, consider having two models, gpt-3.5 and gpt-4 from the Azure OpenAI service. They would each have distinct URLs, such as
https://{azure-resource-url}/openai/deployments/gpt35andhttps://{azure-resource-url}/openai/deployments/gpt4. In the current project implementation, switching between models is accomplished by altering themodelfield within the request body. However, this approach is not compatible with the Azure OpenAI service, where the deployment name portion of the URL needs to be changed instead.Relevent Discussions
#3206 (comment)
#3206 (comment)
#3260
Expected behavior
A potential solution is to include a model name to deployment name mapper in the environment variables. For reference, see https://github.com/stulzq/azure-openai-proxy.