feat: allow azure openai to pass custom uri#920
feat: allow azure openai to pass custom uri#920umuthopeyildirim wants to merge 1 commit intoPortkey-AI:mainfrom umuthopeyildirim:feat-allow-azure-openai-to-pass-custom-uri
Conversation
Hey @umuthopeyildirim, DeepSeek-R1 (or any other models) are already supported as a part of the |
|
Hey @VisargD Yes I'm aware of Azure AI Inference but subdomains still don't match + Azure is now deploying DeepSeek-R1 under |
|
Hey @umuthopeyildirim I think you could add the same check in the azure-ai provider itself like @VisargD mentioned I've noticed documentation for this provider is missing, tagging @b4s36t4 who wrote the |
|
Hey, @umuthopeyildirim. Thanks for pointing out the issue and the PR. Although the solution you've proposed is good but I don't think this is applicable for I will create a new PR pointing with your changes, but it's gonna be provider for The problem you've faced to integrated Deepseek with azure is not a real problem, the endpoint azure giving is of provider gateway/src/providers/azure-ai-inference/api.ts Lines 16 to 18 in f35fddf https://learn.microsoft.com/en-us/azure/ai-foundry/model-inference/concepts/endpoints?tabs=rest A bit more about the problem that relates to Please share your thoughts if I seem diverted from the problem or so. |
|
Hey, @umuthopeyildirim. So sorry for taking this long, but we finally made the change. We've recently released update to our platform specifically for Azure AI Inference which is now re-named to Azure Foundry. Considering we've landed this feature what you've started, I will be closing this PR. Please do check it out, do let me know if you face any issue. thanks!. |
|
Thanks for the PR! Closing it based on the latest comments. Please let us know if you face any issues. |

Title:
feat: allow azure openai to pass custom uri
Description: (optional)
This pull request introduces support for a custom Azure URI for OpenAI requests. The following changes have been made:
Header Handling:
Updated constructConfigFromRequestHeaders to extract the azureCustomUri from the incoming request headers. This enables the passing of a custom URI from the client.
Provider Configuration:
Modified AzureOpenAIAPIConfig in src/providers/azure-openai/api.ts to use the azureCustomUri when constructing the base URL for API requests.
Updated the endpoint resolution logic so that if a custom URI is provided, the URL structure is adapted accordingly (e.g., DeepSeek-R1 on Azure uses {resourceName}.services.ai.azure.com/models).
Type Definitions:
Extended the Options interface in src/types/requestBody.ts to include the azureCustomUri field.
Motivation: (optional)
This enhancement is necessary to support scenarios where a non-standard Azure endpoint is required (such as DeepSeek-R1). By allowing users to pass a custom URI, we provide greater flexibility and ensure compatibility with alternative endpoint configurations.
Related Issues: (optional)