[PR #4744] [MERGED] Migrate Azure OpenAI Integration To v1 API | Enable Streaming for Reasoning Models in Azure OpenAI Basic Inference Provider #4741

Closed
opened 2026-02-22 18:36:26 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4744
Author: @angelplusultra
Created: 12/9/2025
Status: Merged
Merged: 12/10/2025
Merged by: @timothycarambat

Base: masterHead: 3340-azure-openai-version-refactor


📝 Commits (8)

  • c1b407b Refactor Azure OpenAI integration to use OpenAI SDK and the v1 API | Enable streaming for Azure Open AI basic inference provider
  • da55ca1 Add info tooltip to inform user about 'Model Type' form field
  • d6c339d Add 'model_type_tooltip' key to multiple language translations
  • 2a89659 Merge branch 'master' into 3340-azure-openai-version-refactor
  • bf6aacb Validate AZURE_OPENAI_ENDPOINT in provider construction
  • 8ac122d remove unused import, update error handler, rescope URL utils
  • fcf4aae Merge branch 'master' into 3340-azure-openai-version-refactor
  • 2fb3dc8 Merge branch 'master' into 3340-azure-openai-version-refactor

📊 Changes

25 files changed (+89 additions, -23 deletions)

View changed files

📝 frontend/src/components/LLMSelection/AzureAiOptions/index.jsx (+29 -3)
📝 frontend/src/locales/ar/common.js (+1 -0)
📝 frontend/src/locales/da/common.js (+1 -0)
📝 frontend/src/locales/de/common.js (+1 -0)
📝 frontend/src/locales/en/common.js (+2 -0)
📝 frontend/src/locales/es/common.js (+1 -0)
📝 frontend/src/locales/et/common.js (+1 -0)
📝 frontend/src/locales/fa/common.js (+1 -0)
📝 frontend/src/locales/fr/common.js (+1 -0)
📝 frontend/src/locales/he/common.js (+1 -0)
📝 frontend/src/locales/it/common.js (+1 -0)
📝 frontend/src/locales/ja/common.js (+1 -0)
📝 frontend/src/locales/ko/common.js (+1 -0)
📝 frontend/src/locales/lv/common.js (+1 -0)
📝 frontend/src/locales/nl/common.js (+1 -0)
📝 frontend/src/locales/pl/common.js (+1 -0)
📝 frontend/src/locales/pt_BR/common.js (+1 -0)
📝 frontend/src/locales/ro/common.js (+1 -0)
📝 frontend/src/locales/ru/common.js (+1 -0)
📝 frontend/src/locales/tr/common.js (+1 -0)

...and 5 more files

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #3340

What is in this change?

This PR includes the following updates:
1. Replaces the AzureOpenAI class with the OpenAI class.
2. Migrates our Azure OpenAI integration to the new v1 API. This resolves the issue where the older static API version (2024-12-01-preview) failed to expose reasoning models.
3. Removes a guard in the Azure OpenAI basic inference provider that previously prevented reasoning models from supporting streamable completions.
4. Adds a code comment in server/utils/AiProviders/azureOpenAi/index.js clarifying the purpose of the AZURE_OPENAI_MODEL_TYPE environment variable.
https://github.com/Mintplex-Labs/anything-llm/blob/da55ca1c8fd4cdd418f9f84303ef22781c03150c/server/utils/AiProviders/azureOpenAi/index.js#L23-L28
5. Adds a frontend tooltip in the Azure OpenAI LLM provider settings explaining the importance of the Model Type field.

image

Additional Information

Since we have no way to determine the underlying model behind a user’s Azure OpenAI deployment name, it is crucial that they set the AZURE_OPENAI_MODEL_TYPE environment variable to "reasoning". Without this, we may pass invalid parameters for reasoning models (e.g., temperature) into the completion request, resulting in chat errors.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/4744 **Author:** [@angelplusultra](https://github.com/angelplusultra) **Created:** 12/9/2025 **Status:** ✅ Merged **Merged:** 12/10/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `3340-azure-openai-version-refactor` --- ### 📝 Commits (8) - [`c1b407b`](https://github.com/Mintplex-Labs/anything-llm/commit/c1b407b81877d88527e199cd39355ef28b2b5350) Refactor Azure OpenAI integration to use OpenAI SDK and the v1 API | Enable streaming for Azure Open AI basic inference provider - [`da55ca1`](https://github.com/Mintplex-Labs/anything-llm/commit/da55ca1c8fd4cdd418f9f84303ef22781c03150c) Add info tooltip to inform user about 'Model Type' form field - [`d6c339d`](https://github.com/Mintplex-Labs/anything-llm/commit/d6c339d0a48ea885a91976ce86bfa6ad2e337164) Add 'model_type_tooltip' key to multiple language translations - [`2a89659`](https://github.com/Mintplex-Labs/anything-llm/commit/2a896595ea1524169c647a60ac0e82fd9f5bba71) Merge branch 'master' into 3340-azure-openai-version-refactor - [`bf6aacb`](https://github.com/Mintplex-Labs/anything-llm/commit/bf6aacbd4715954370e69cf001ba512baa7be921) Validate AZURE_OPENAI_ENDPOINT in provider construction - [`8ac122d`](https://github.com/Mintplex-Labs/anything-llm/commit/8ac122d033cf976c442270d033ccae3351e95c46) remove unused import, update error handler, rescope URL utils - [`fcf4aae`](https://github.com/Mintplex-Labs/anything-llm/commit/fcf4aae58b19b2327a1422709166e79f9d8fb7cf) Merge branch 'master' into 3340-azure-openai-version-refactor - [`2fb3dc8`](https://github.com/Mintplex-Labs/anything-llm/commit/2fb3dc8414d22806089b9f1d322baf27b2ad838a) Merge branch 'master' into 3340-azure-openai-version-refactor ### 📊 Changes **25 files changed** (+89 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/LLMSelection/AzureAiOptions/index.jsx` (+29 -3) 📝 `frontend/src/locales/ar/common.js` (+1 -0) 📝 `frontend/src/locales/da/common.js` (+1 -0) 📝 `frontend/src/locales/de/common.js` (+1 -0) 📝 `frontend/src/locales/en/common.js` (+2 -0) 📝 `frontend/src/locales/es/common.js` (+1 -0) 📝 `frontend/src/locales/et/common.js` (+1 -0) 📝 `frontend/src/locales/fa/common.js` (+1 -0) 📝 `frontend/src/locales/fr/common.js` (+1 -0) 📝 `frontend/src/locales/he/common.js` (+1 -0) 📝 `frontend/src/locales/it/common.js` (+1 -0) 📝 `frontend/src/locales/ja/common.js` (+1 -0) 📝 `frontend/src/locales/ko/common.js` (+1 -0) 📝 `frontend/src/locales/lv/common.js` (+1 -0) 📝 `frontend/src/locales/nl/common.js` (+1 -0) 📝 `frontend/src/locales/pl/common.js` (+1 -0) 📝 `frontend/src/locales/pt_BR/common.js` (+1 -0) 📝 `frontend/src/locales/ro/common.js` (+1 -0) 📝 `frontend/src/locales/ru/common.js` (+1 -0) 📝 `frontend/src/locales/tr/common.js` (+1 -0) _...and 5 more files_ </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [ ] ✨ feat - [ ] 🐛 fix - [x] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #3340 ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> This PR includes the following updates: 1. Replaces the `AzureOpenAI` class with the `OpenAI` class. 2. Migrates our Azure OpenAI integration to the new v1 API. This resolves the issue where the older static API version (`2024-12-01-preview`) failed to expose reasoning models. 3. Removes a guard in the Azure OpenAI basic inference provider that previously prevented reasoning models from supporting streamable completions. 4. Adds a code comment in `server/utils/AiProviders/azureOpenAi/index.js` clarifying the purpose of the `AZURE_OPENAI_MODEL_TYPE` environment variable. https://github.com/Mintplex-Labs/anything-llm/blob/da55ca1c8fd4cdd418f9f84303ef22781c03150c/server/utils/AiProviders/azureOpenAi/index.js#L23-L28 5. Adds a frontend tooltip in the Azure OpenAI LLM provider settings explaining the importance of the Model Type field. <img width="932" height="347" alt="image" src="https://github.com/user-attachments/assets/1a5c4720-e3b5-4d13-99ab-5dcabb116bf0" /> ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> Since we have no way to determine the underlying model behind a user’s Azure OpenAI deployment name, it is crucial that they set the `AZURE_OPENAI_MODEL_TYPE` environment variable to "reasoning". Without this, we may pass invalid parameters for reasoning models (e.g., `temperature`) into the completion request, resulting in chat errors. ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:26 -05:00
yindo closed this issue 2026-02-22 18:36:26 -05:00
yindo changed title from [PR #4744] Migrate Azure OpenAI Integration To v1 API | Enable Streaming for Reasoning Models in Azure OpenAI Basic Inference Provider to [PR #4744] [MERGED] Migrate Azure OpenAI Integration To v1 API | Enable Streaming for Reasoning Models in Azure OpenAI Basic Inference Provider 2026-06-05 15:20:08 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4741