Skip to content
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

Enhance flexibility by supporting deployment_id for Azure OpenAI model switching #448

Closed
ZhenhangTung opened this issue Mar 29, 2024 · 1 comment

Comments

@ZhenhangTung
Copy link

Is your feature request related to a problem? Please describe.
Currently, the Azure OpenAI SDK requires setting a full deployment URI, which makes switching models for different tasks cumbersome and affects cost efficiency, especially when using more expensive models like ChatGPT-4 only for complex tasks.

Describe the solution you'd like
I suggest allowing deployment_id specification when initializing a new client, similar to other SDKs. This would enable easy model switching, improving flexibility and cost management.

Describe alternatives you've considered
An alternative is overwriting the uri_base during client setup, but it's less convenient than simply changing a deployment_id.

Additional context
This feature is important for applications that need different models for efficiency and cost-effectiveness, and for developers experimenting with multiple models.

I am very keen on seeing this feature implemented and am willing to offer my help and support in making it happen. If needed, I can contribute to development, testing, or documentation.

@ZhenhangTung ZhenhangTung changed the title Enhance Flexibility by Supporting deployment_id for Azure OpenAI Model Switching Enhance flexibility by supporting deployment_id for Azure OpenAI model switching Mar 29, 2024
@washu
Copy link

washu commented Jul 26, 2024

you can monkeypath this easily
module OpenAI
class Client
def self.azure_deployment(model_name,is_azure)
# I use encrypted credentials store to fetch the correct uri base
uri_base = ... lookup your base id
OpenAI::Client.new(uri_base: isAzure ? uri_base + "openai/deployments/#{model_name}" : nil)
end
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants