void icon indicating copy to clipboard operation
void copied to clipboard

Azure support

Open andrewpareles opened this issue 9 months ago • 17 comments

Someone in our Discord says Azure endpoints through OAI-Compat don't work, but routing through LiteLLM does work with the same exact endpoints. Need to look into this, it might just require adding Azure as its own endpoint to make sure everything is right.

andrewpareles avatar Apr 02 '25 04:04 andrewpareles

Azure endpoints are not configureable thus the support is broken.

cevatkerim avatar May 06 '25 14:05 cevatkerim

XXXXXX.services.ai.azure.com/api/models/chat/completions??api-version=2024-12-01-preview/chat/completions failed, reason: getaddrinfo ENOTFOUND XXXXXX.services.ai.azure.com",

cevatkerim avatar May 07 '25 18:05 cevatkerim

I'm getting this error as well and it makes the Azure OpenAI option unusable.

XXXXXX.services.ai.azure.com/api/models/chat/completions??api-version=2024-12-01-preview/chat/completions failed, reason: getaddrinfo ENOTFOUND XXXXXX.services.ai.azure.com",

davidmcgregor avatar May 13 '25 01:05 davidmcgregor

Sorry for the trouble, guys! I just updated Void, can you try again with the latest version (1.99.30031)? I think this change might fix it.

andrewpareles avatar May 13 '25 03:05 andrewpareles

@andrewpareles I'm still getting the following error:

Full Error:
{
  "cause": {
    "message": "request to https://<my-resource-name>.services.ai.azure.com/api/models/chat/completions?api-version=2025-05-01/chat/completions failed, reason: getaddrinfo ENOTFOUND <my-resource-name>.services.ai.azure.com",
    "type": "system",
    "errno": "ENOTFOUND",
    "code": "ENOTFOUND"
  }
}

It looks like the URL is still getting /chat/completions appended incorrectly.

davidmcgregor avatar May 13 '25 04:05 davidmcgregor

I note this documentation from the openai node library: https://github.com/openai/openai-node?tab=readme-ov-file#microsoft-azure-openai

Their documentation uses the DefaultCredential, but I believe you can use an AzureKeyCredential instead to use the API key.

davidmcgregor avatar May 13 '25 04:05 davidmcgregor

We were trying to do things uniformly with new OpenAI(), but we should definitely just use that syntax. Thanks for the reference. If anyone wants to beat me to implementing this, it's a good first issue!

andrewpareles avatar May 13 '25 05:05 andrewpareles

Initial progress at #577, can anyone checkout and test (or review the change)?

andrewpareles avatar May 14 '25 03:05 andrewpareles

Initial progress at #577, can anyone checkout and test (or review the change)?

I just updated Void and checked, now there is a different error from before:

Error: Must provide one of the baseURL or endpoint arguments, or the AZURE_OPENAI_ENDPOINT environment variable

yuvalsmart avatar May 14 '25 06:05 yuvalsmart

Thanks a lot for checking, will fix soon...

andrewpareles avatar May 14 '25 06:05 andrewpareles

Initial progress at #577, can anyone checkout and test (or review the change)?

I just updated Void and checked, now there is a different error from before:

Error: Must provide one of the baseURL or endpoint arguments, or the AZURE_OPENAI_ENDPOINT environment variable

+1 -- all examples from Azure seem to have endpoint, deployment, apiVersion, and apiKey in the options. It works when I hardcode those 4 values into the AzureOpenAI constructor.

Deployment (the model) being required here would be an unfortunate break in the standardization of the providers. When you leave it out you get 404 Resource not Found (even if you specify the modelName as the deployment in the completions.create({ ... }).

zpg6 avatar May 15 '25 04:05 zpg6

I also use LibreChat - A really great open source. In its configuration I also use Azure credentials with the same input as in Void: instanceName, version & apiKey - And it works perfectly.

Maybe in their code there is an elegant solution for Azure (I don't know JS).

yuvalsmart avatar May 15 '25 05:05 yuvalsmart

I also use LibreChat - A really great open source. In its configuration I also use Azure credentials with the same input as in Void: instanceName, version & apiKey - And it works perfectly.

Maybe in their code there is an elegant solution for Azure (I don't know JS).

https://github.com/danny-avila/LibreChat/blob/main/api/utils/azureUtils.js

If I'm reading this correctly, they replace the deployment with the model you're querying at time of LLM call.

zpg6 avatar May 15 '25 11:05 zpg6

@yuvalsmart - can you give my PR #595 a test see if it works for you?

zpg6 avatar May 15 '25 15:05 zpg6

@yuvalsmart - can you give my PR #595 a test see if it works for you?

@zpg6 Sorry, I don't know how to test it without updating Void and there is no new update available.

yuvalsmart avatar May 16 '25 07:05 yuvalsmart

Will just push this soon and ask people if it works!

andrewpareles avatar May 16 '25 09:05 andrewpareles

It works well now! I tested it with Azure o4-mini & gpt-4.1.

yuvalsmart avatar May 17 '25 05:05 yuvalsmart