-
Notifications
You must be signed in to change notification settings - Fork 8.1k
docs: improve Azure OpenAI integration documentation #8499
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
Conversation
- Add clear instructions for both API key and AD token authentication - Clarify required environment variables - Add troubleshooting section - Fix formatting and organization - Addresses issue OpenHands#8412
|
|
||
| When running OpenHands, you'll need to set the following environment variable using `-e` in the | ||
| [docker run command](../installation#running-openhands): | ||
| OpenHands supports two authentication methods for Azure OpenAI: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| OpenHands supports two authentication methods for Azure OpenAI: | |
| OpenHands supports the following authentication methods for Azure OpenAI: |
| [docker run command](../installation#running-openhands): | ||
| OpenHands supports two authentication methods for Azure OpenAI: | ||
|
|
||
| ### 1. API Key Authentication |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### 1. API Key Authentication | |
| ### API Key Authentication |
| ``` | ||
|
|
||
| Example: | ||
| ### 2. Azure AD Token Authentication |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### 2. Azure AD Token Authentication | |
| ### Azure AD Token Authentication |
| - `Custom Model` to azure/<deployment-name> | ||
| - `Base URL` to your Azure API Base URL (e.g. `https://example-endpoint.openai.azure.com`) | ||
| - `API Key` to your Azure API key | ||
| - `LLM Provider` to `Azure` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `LLM Provider` to `Azure` |
| ```bash | ||
| # Required | ||
| LLM_API_VERSION="<api-version>" # e.g. "2024-02-15-preview" | ||
| LLM_BASE_URL="<azure-endpoint>" # e.g. "https://your-resource.openai.azure.com/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If using the UI, you don't need to set:
LLM_BASE_URL
LLM_API_KEY
LLM_MODEL
because what you set in the settings in the UI will overwrite these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does the UI force a choice when these variables are set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question. Been like that since I remember and there's a big github issue on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see enyst already linked it below.
| -e LLM_BASE_URL="https://your-resource.openai.azure.com/" \ | ||
| -e LLM_API_KEY="your-api-key" \ | ||
| -e LLM_MODEL="azure/your-deployment-name" \ | ||
| docker.all-hands.dev/all-hands-ai/openhands:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above. LLM_BASE_URL, LLM_API_KEY, LLM_MODEL should not be needed.
Just replace docker.all-hands.dev/all-hands-ai/openhands:latest with ... to note that the rest of the docker command is the same as the original docker command to run OpenHands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what should happen instead is the UI should not force you to re-enter the config if these are set
another bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is this bug:
What happened here was that the UI was reading them only from local storage, not backend, a long time ago, and then we refactored that to read and write on the web server, but it still doesn't do it from the application configuration.
I think it might be better to document running with UI without these vars (that are overridden by the UI), and only document these vars when running CLI or headless, which read them and follow them.
| LLM_API_VERSION="<api-version>" # e.g. "2024-02-15-preview" | ||
| LLM_BASE_URL="<azure-endpoint>" # e.g. "https://your-resource.openai.azure.com/" | ||
| AZURE_AD_TOKEN="<your-ad-token>" # Your Azure AD access token | ||
| LLM_MODEL="azure/<deployment-name>" # e.g. "azure/gpt-4" where gpt-4 is your deployment name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above. LLM_BASE_URL and LLM_MODEL are not needed since they will be set in the UI
| -e LLM_BASE_URL="https://your-resource.openai.azure.com/" \ | ||
| -e AZURE_AD_TOKEN="your-ad-token" \ | ||
| -e LLM_MODEL="azure/your-deployment-name" \ | ||
| docker.all-hands.dev/all-hands-ai/openhands:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments as the above command
| - `Base URL` to your Azure API Base URL (e.g. `https://example-endpoint.openai.azure.com`) | ||
| - `API Key` to your Azure API key | ||
| - `LLM Provider` to `Azure` | ||
| - `Advanced` options: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `Advanced` options: |
pcuci
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not clear how to disable the UI modal when the LLM_* variables are set
would that be another variable somewhere to force env var pickup?
| ```bash | ||
| # Required | ||
| LLM_API_VERSION="<api-version>" # e.g. "2024-02-15-preview" | ||
| LLM_BASE_URL="<azure-endpoint>" # e.g. "https://your-resource.openai.azure.com/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does the UI force a choice when these variables are set?
| -e LLM_BASE_URL="https://your-resource.openai.azure.com/" \ | ||
| -e LLM_API_KEY="your-api-key" \ | ||
| -e LLM_MODEL="azure/your-deployment-name" \ | ||
| docker.all-hands.dev/all-hands-ai/openhands:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what should happen instead is the UI should not force you to re-enter the config if these are set
another bug?
|
This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
| # Required | ||
| LLM_API_VERSION="<api-version>" # e.g. "2024-02-15-preview" | ||
| LLM_BASE_URL="<azure-endpoint>" # e.g. "https://your-resource.openai.azure.com/" | ||
| AZURE_AD_TOKEN="<your-ad-token>" # Your Azure AD access token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation for the AD token use is welcome! I have some doubt here though, does this really work like this? I thought this token is refreshed periodically, in which case maybe it works when the user starts, but then it stops working.
I think litellm has AD token support. I’m just not sure that it works for us this way. Please feel free to correct me if wrong.
|
Hi there. This PR has been open for a while without addressing any of the comments. I'm going to close it. But feel free to let me know if I'm mistaken! And feel free to open a new PR once ready! Thank you. |
Description
This PR improves the Azure OpenAI integration documentation to address issue #8412. The documentation was unclear about environment variables and authentication methods, especially for Azure AD token authentication in headless mode.
Changes Made
Changelog Message
Added comprehensive documentation for Azure OpenAI integration, including both API key and AD token authentication methods, with clear examples and troubleshooting guide.
Type of Change
Testing Done
Related Issues
Fixes #8412 (#8412)
Additional Notes
The documentation now includes both authentication methods with clear examples, which should help users avoid confusion about which environment variables to use.