Skip to content

Conversation

krissetto
Copy link
Contributor

Proposal for supporting AzureOpenAI using the standard OpenAI provider

closes #112

@krissetto krissetto requested review from rumpl and dgageot September 5, 2025 15:34
@@ -102,6 +140,14 @@ func (c *Client) newGatewayClient(ctx context.Context) *openai.Client {
return openai.NewClientWithConfig(cfg)
}

// isAzureBaseURL returns true if the base URL points to Azure OpenAI
func isAzureBaseURL(u string) bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively to this, we could maybe use another provider_opts key such as azure: true

models:
  azure:
    provider: openai
    ...
    provider_opts:
        azure: true
        ...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could imagine that at some point Azure OpenAI would support custom domains. Then it would be useful to have the option key. Or maybe react on the azure_api_version? If that is set, it has to be Azure OpenAI and vice versa

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing a bit more, I now indeed got an endpoint that ends with .cognitiveservices.azure.com. That doesn't work with the currently proposed implementatoin

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

Successfully merging this pull request may close these issues.

[FEAT] - Support Azure OpenAI in addition to OpenAI
2 participants