[PR #5281] [MERGED] feat: add optional API key support for Lemonade provider #5389

Closed
opened 2026-06-05 15:21:12 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/5281
Author: @angelplusultra
Created: 3/27/2026
Status: Merged
Merged: 3/30/2026
Merged by: @timothycarambat

Base: masterHead: 5118-feat-add-api-key-param-for-lemonade-provider


📝 Commits (10+)

  • 8309f17 add API key param to Lemonade LLM Provider and Embedding Provider
  • 8f9a2eb Merge branch 'master' into 5118-feat-add-api-key-param-for-lemonade-provider
  • 14a71c3 add LEMONADE_LLM_API_KEY to .env.example
  • ce20570 add api key to aibitat provider
  • 9dc716c fix api key from being sent to frontend
  • c1c519b fix tooltip id
  • 4c011d6 add null fallback for apiKey
  • b132ae0 remove console log
  • d18733f add missing api keys
  • 9136c17 Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into 5118-feat-add-api-key-param-for-lemonade-provider

📊 Changes

10 files changed (+94 additions, -10 deletions)

View changed files

📝 frontend/src/components/EmbeddingSelection/LemonadeOptions/index.jsx (+25 -0)
📝 frontend/src/components/LLMSelection/LemonadeOptions/index.jsx (+37 -0)
📝 server/.env.example (+2 -1)
📝 server/endpoints/utils/lemonadeUtilsEndpoints.js (+6 -0)
📝 server/models/systemSettings.js (+1 -0)
📝 server/utils/AiProviders/lemonade/index.js (+16 -6)
📝 server/utils/EmbeddingEngines/lemonade/index.js (+1 -1)
📝 server/utils/agents/aibitat/providers/ai-provider.js (+1 -1)
📝 server/utils/agents/aibitat/providers/lemonade.js (+1 -1)
📝 server/utils/helpers/updateENV.js (+4 -0)

📄 Description

Pull Request Type

  • feat (New feature)
  • 🐛 fix (Bug fix)
  • ♻️ refactor (Code refactoring without changing behavior)
  • 💄 style (UI style changes)
  • 🔨 chore (Build, CI, maintenance)
  • 📝 docs (Documentation updates)

Relevant Issues

resolves #5118

Description

Adds an optional API key parameter to the Lemonade provider across all three usage contexts: LLM, Embedding, and Agent. This allows users running a Lemonade server with authentication enabled to configure their API key from the UI.

Changes:

  • Added LEMONADE_LLM_API_KEY env var and wired it into the OpenAI client for the LLM provider, Embedding provider, and Agent provider
  • Added conditional Authorization: Bearer header to Lemonade utility endpoints (model listing, download, delete)
  • Added API key input field to both the LLM and Embedding settings UIs with the standard asterisk-masked defaultValue pattern (key is never sent to the frontend)
  • Added key mapping in updateENV.js and system settings exposure as a boolean flag

Visuals (if applicable)

Additional Information

The API key is shared across LLM, Embedding, and Agent contexts since they all connect to the same Lemonade server instance. The env var uses the LEMONADE_LLM_ prefix to stay consistent with existing Lemonade env vars.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated (if applicable)
  • 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/5281 **Author:** [@angelplusultra](https://github.com/angelplusultra) **Created:** 3/27/2026 **Status:** ✅ Merged **Merged:** 3/30/2026 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `5118-feat-add-api-key-param-for-lemonade-provider` --- ### 📝 Commits (10+) - [`8309f17`](https://github.com/Mintplex-Labs/anything-llm/commit/8309f17a00c9b9de567553b5d1c7932c4418f6cb) add API key param to Lemonade LLM Provider and Embedding Provider - [`8f9a2eb`](https://github.com/Mintplex-Labs/anything-llm/commit/8f9a2eb01ea468636671a386c6e86b0118cbf725) Merge branch 'master' into 5118-feat-add-api-key-param-for-lemonade-provider - [`14a71c3`](https://github.com/Mintplex-Labs/anything-llm/commit/14a71c3ac104b6ba85f9901f386108c035c9bba2) add LEMONADE_LLM_API_KEY to .env.example - [`ce20570`](https://github.com/Mintplex-Labs/anything-llm/commit/ce2057049c741ad7eef376f4b6fc3a89c1af1178) add api key to aibitat provider - [`9dc716c`](https://github.com/Mintplex-Labs/anything-llm/commit/9dc716caa131e154e7a0691fd7c4c89ba7b9117c) fix api key from being sent to frontend - [`c1c519b`](https://github.com/Mintplex-Labs/anything-llm/commit/c1c519b72c29409fde4e8507019ccc574b1b33d6) fix tooltip id - [`4c011d6`](https://github.com/Mintplex-Labs/anything-llm/commit/4c011d6615132e4849257c2dc7d1bd1b9e9d0b05) add null fallback for `apiKey` - [`b132ae0`](https://github.com/Mintplex-Labs/anything-llm/commit/b132ae0b4de7167fda28b3c90d8df0e21e044a35) remove console log - [`d18733f`](https://github.com/Mintplex-Labs/anything-llm/commit/d18733f1ce3269e7de78837431bdd6fd9f959f27) add missing api keys - [`9136c17`](https://github.com/Mintplex-Labs/anything-llm/commit/9136c17b43a1e6bf8a61de67587576949b760b13) Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into 5118-feat-add-api-key-param-for-lemonade-provider ### 📊 Changes **10 files changed** (+94 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/EmbeddingSelection/LemonadeOptions/index.jsx` (+25 -0) 📝 `frontend/src/components/LLMSelection/LemonadeOptions/index.jsx` (+37 -0) 📝 `server/.env.example` (+2 -1) 📝 `server/endpoints/utils/lemonadeUtilsEndpoints.js` (+6 -0) 📝 `server/models/systemSettings.js` (+1 -0) 📝 `server/utils/AiProviders/lemonade/index.js` (+16 -6) 📝 `server/utils/EmbeddingEngines/lemonade/index.js` (+1 -1) 📝 `server/utils/agents/aibitat/providers/ai-provider.js` (+1 -1) 📝 `server/utils/agents/aibitat/providers/lemonade.js` (+1 -1) 📝 `server/utils/helpers/updateENV.js` (+4 -0) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat (New feature) - [ ] 🐛 fix (Bug fix) - [ ] ♻️ refactor (Code refactoring without changing behavior) - [ ] 💄 style (UI style changes) - [ ] 🔨 chore (Build, CI, maintenance) - [ ] 📝 docs (Documentation updates) ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #5118 ### Description Adds an optional API key parameter to the Lemonade provider across all three usage contexts: LLM, Embedding, and Agent. This allows users running a Lemonade server with authentication enabled to configure their API key from the UI. **Changes:** - Added `LEMONADE_LLM_API_KEY` env var and wired it into the OpenAI client for the LLM provider, Embedding provider, and Agent provider - Added conditional `Authorization: Bearer` header to Lemonade utility endpoints (model listing, download, delete) - Added API key input field to both the LLM and Embedding settings UIs with the standard asterisk-masked `defaultValue` pattern (key is never sent to the frontend) - Added key mapping in `updateENV.js` and system settings exposure as a boolean flag ### Visuals (if applicable) <!-- Add screenshots or screen recordings to demonstrate the changes, especially for UI updates. --> ### Additional Information The API key is shared across LLM, Embedding, and Agent contexts since they all connect to the same Lemonade server instance. The env var uses the `LEMONADE_LLM_` prefix to stay consistent with existing Lemonade env vars. ### 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 (if applicable) - [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-06-05 15:21:12 -04:00
yindo closed this issue 2026-06-05 15:21:12 -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#5389