-
Notifications
You must be signed in to change notification settings - Fork 315
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
[docs] How to host a azure open ai using docker #1159
Comments
Thank you for the report. I think this makes sense. There is a little bit on using Azure with OpenAI here: https://www.guardrailsai.com/docs/how_to_guides/using_llms#azure-openai That should cover the extra environment variables that one needs to set to use things with Azure. Additionally, for Docker deployments, there's this set of docs: https://www.guardrailsai.com/docs/how_to_guides/hosting_with_docker I'm not sure if that will fully answer the questions you have, but it's perhaps a starting point while we figure out how to make the documentation clearer. |
Given the exisiting documentation: The below API only works for standard open ai; what would be the procedure to revise below code so it will work with azure open ai? from openai import OpenAI client = OpenAI( response = client.chat.completions.create( print(response.choices[0].message.content) |
Assuming your Azure environment variables are set according to the linked documentation, it should only be a matter of
|
Yes, this works with guard() but does not work when using as a server: Any idea on how to modify this link, assume up on docker creation the env has "AZURE_API_KEY", "AZURE_API_BASE", and AZURE_API_VERSION" |
Aha! I think I see the difficulty. It's worth trying
I'll update this comment again if I can verify that this works. EDIT: For reference, I'm running over Microsoft's Azure OpenAI Service here: https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models?tabs=python-secure%2Cglobal-standard%2Cstandard-chat-completions |
Using 'http://127.0.0.1:8000/guards/gibberish_guard/openai/v1' will simply return the return the URL is not found in this setting. I'm also trying to follow your guide for cloud environment setting, but the documentation is outdated: This command is no longer available: guardrails create --template hub:template://guardrails/chatbot The json file cannot be installed either:
|
Would it be possible to see a copy/paste of your config.py file (with the auth token redacted)? It should really be only a matter of those env variables. I can look into the issue with --template, but I think that might be worth separating out as a different issue. |
I'm encountering the same issue when attempting to use Azure OpenAI models. However, the standard OpenAI models are functioning properly. |
My access to Azure has strangely disappeared, but I haven't lost site of this issue. I was seeing the "can't connect" matter with the OpenAI client, even outside of Guardrails. I posted a comment on their help thread: https://learn.microsoft.com/en-us/answers/questions/1315650/unable-to-log-into-azure-ai-studio-after-approved When I get my access back I'll set up a local repro and be able to check everything in mroe depth. |
Description
This document aims to guide users on deploying Azure OpenAI Service within a Docker container. The current documentation lacks a comprehensive, step-by-step guide for setting up Azure OpenAI in a Dockerized environment, including authentication, configuration, and deployment processes.
Current documentation
Currently, there is limited or no specific guidance on hosting Azure OpenAI using Docker in the Azure OpenAI Service documentation.
Suggested changes
Add a dedicated section or guide that covers:
Prerequisites
Dockerfile Configuration
Environment Variables
Sample Docker Compose File
docker-compose.yml
file example to demonstrate how to set up multi-container applications if additional services are needed.Running the Container
Testing and Verification
Security Best Practices
.env
files, and avoiding hardcoding credentials.Additional context
Adding this section will help users deploy Azure OpenAI Service using Docker more efficiently and securely, improving accessibility for development and production deployments. Screenshots or command line examples would be beneficial for each step.
Checklist
The text was updated successfully, but these errors were encountered: