-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Enhancement: Implement Support for Cloudflare's AI Gateway for Azure endpoint #1266
Comments
I believe you can already use it for the OpenAI endpoint as a reverse proxy. You can also look into LiteLLM as a reverse proxy service that supports this |
Thank you for quick response. It should work with openai, but doesn't work with azure openai, because I cannot specify the url, because it is constructed out of INSTANCE_NAME DEPLOYMENT_NAME and API_VERSION. What I expected is native support for cf's AI gateway for azure endpoints. I will explore LiteLLM, but looks like another thing that needs to be deployed alongside the librechat., which seems to be a bit overkill just for this simple use case. Anyways, thank you again. |
@ajkost I understand better now. I think I can implement passing a custom url which should cover this use case and others. |
@danny-avila along the same lines, we use Azure API Management as a gateway to multiple Azure OpenAI deployments. Is the current thought to just allow a custom domain + path in its entirety instead of attempting to piece it together? Right now we have a modified version of
Where |
Yes as another option. Shouldn't be too hard but need to make sure it plays nice with other configs. |
@danny-avila any movement on this particular ask? I wonder if the title should be changed to better reflect the general need rather than just for cloudflare. |
I would like to get it done soon as it wouldn't be a big update. It is not a big ask and I think it's crucial for use of Azure |
This is on my slate for today finally! Sorry it took so long. |
no prob at all, tyt |
Docs will be updated with the following after #1596 is merged Using a Specified Base URL with AzureThe base URL for Azure OpenAI API requests can be dynamically configured. This is useful for proxying services such as Cloudflare AI Gateway, or if you wish to explicitly override the baseURL handling of the app. LibreChat will use the In the application's environment configuration, the base URL is set like this: # .env file
AZURE_OPENAI_BASEURL=https://example.azure-api.net/${INSTANCE_NAME}/${DEPLOYMENT_NAME}
# OR
AZURE_OPENAI_BASEURL=https://${INSTANCE_NAME}.openai.azure.com/openai/deployments/${DEPLOYMENT_NAME}
# Cloudflare example
AZURE_OPENAI_BASEURL=https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY/azure-openai/${INSTANCE_NAME}/${DEPLOYMENT_NAME} The application replaces You can also omit the placeholders completely and simply construct the baseURL with your credentials: # .env file
AZURE_OPENAI_BASEURL=https://instance-1.openai.azure.com/openai/deployments/deployment-1
# Cloudflare example
AZURE_OPENAI_BASEURL=https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY/azure-openai/instance-1/deployment-1 Setting these values will override all of the application's internal handling of the instance and deployment names and use your specified base URL. Notes:
|
Works like a charm 💪 I've tested
and everything is working as expected. For the record, I use the Thank you again for your hard work; it is greatly appreciated! Keep up the great work. I can't wait for the RAG support. |
Awesome glad to hear that! I do know that azure setup is somewhat cumbersome but this is why #1390 is on the roadmap. I would like to offer more dynamic configuration where you can set even different deployments/instances per model, as some are region locked. |
Contact Details
No response
What features would you like to see added?
I propose integrating support for Cloudflare's AI Gateway, specifically for Azure OpenAI deployments, into LibreChat. Thank you
More details
key features:
Which components are impacted by your request?
Endpoints
Pictures
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: