Skip to content

[Bug] Unable to switch between models when using Azure OpenAI service 使用 Azure 时无法切换模型 #3331

@KevenLi8888

Description

@KevenLi8888

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    plannedplanned feature, will support in the future

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions