-
Notifications
You must be signed in to change notification settings - Fork 60k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Unable to switch between models when using Azure OpenAI service 使用 Azure 时无法切换模型 #3331
Comments
项目要求在 参见 Azure 文档 [1] [2] |
The project requires providing a URL containing See Azure documentation [1] [2] |
yeah I agreed anyways |
update this another issue need external handling complex (k8s aka kubernetes) I guess for azure deployment |
I don't see why we need Kubernetes here. Could you elaborate a bit? I think the key for this issue is to support the way of specifying models when using Azure endpoints, which is different from the OpenAI API. In my opinion, the simplest way is to supply a deployment-name to model map in the config, and the service would use the deployment-name that corresponds to the user specified model, concat it into the endpoint url, and make request to the Azure service. |
you need to build it as own for a external managing multipe complex api for azure |
This might be a more complicated way to tackle the problem. Yes there could be multiple deployments created in the Azure service that corresponds to the same type of model, but for the sake of simplicity, on the project level, supporting a one-to-one relationship between deployment-name and model is sufficient for most people.
|
must refactor in this one to made it support multipe only for azure |
I think you can consider the project cf-openai-azure-proxy, which uses cloudflare to convert azure openai to the API that applies to openai, and it also supports multi-model switching, which is how I deployed this site and it works fine! |
现在已经支持切换(需要结合CUSTOM_MODELS配置deploy_name) |
Switching is now supported (deploy_name needs to be configured in conjunction with CUSTOM_MODELS) |
Describe the bug
The project currently requires the
AZURE_URL
environment 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/gpt35
andhttps://{azure-resource-url}/openai/deployments/gpt4
. In the current project implementation, switching between models is accomplished by altering themodel
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.
The text was updated successfully, but these errors were encountered: