[PR #4317] [MERGED] API request delay for Generic OpenAI embedding engine #4587

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

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4317
Author: @chaserhkj
Created: 8/20/2025
Status: Merged
Merged: 9/17/2025
Merged by: @timothycarambat

Base: masterHead: generic-openai-embedding-delay


📝 Commits (4)

  • f45ee96 Add ENV to configure api request delay for generic open ai embedding engine
  • d19048c yarn lint formatting
  • 9039843 refactor
  • b7d888b Merge branch 'master' into generic-openai-embedding-delay

📊 Changes

3 files changed (+57 additions, -50 deletions)

View changed files

📝 docker/.env.example (+1 -0)
📝 server/.env.example (+1 -0)
📝 server/utils/EmbeddingEngines/genericOpenAi/index.js (+55 -50)

📄 Description

Pull Request Type

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

Relevant Issues

resolves #3570

What is in this change?

This PR adds a new configurable environment variable to add a small delay for dispatching each API request calls when using the generic OpenAI embedding engine.

This is meant to be used together with GENERIC_OPEN_AI_EMBEDDING_MAX_CONCURRENT_CHUNKS=1 and is mostly relevant to the use of local LLM backends like llama.cpp, where their API server implementation is naive and will just reject API requests with a 429 error if the underlying worker is busy.

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

I am skipping documentation for now since there is no change to front end UI, but I could add it to this PR if requested.


🔄 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/4317 **Author:** [@chaserhkj](https://github.com/chaserhkj) **Created:** 8/20/2025 **Status:** ✅ Merged **Merged:** 9/17/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `generic-openai-embedding-delay` --- ### 📝 Commits (4) - [`f45ee96`](https://github.com/Mintplex-Labs/anything-llm/commit/f45ee9692efe44122784c5946c3f257951f7acce) Add ENV to configure api request delay for generic open ai embedding engine - [`d19048c`](https://github.com/Mintplex-Labs/anything-llm/commit/d19048ce875ff010afd5156d547c69e11ebee691) yarn lint formatting - [`9039843`](https://github.com/Mintplex-Labs/anything-llm/commit/90398433a8404eb9a50361f3de35c4069ffaf8e1) refactor - [`b7d888b`](https://github.com/Mintplex-Labs/anything-llm/commit/b7d888b2917d33676ce644cd50ad0f173e024b8d) Merge branch 'master' into generic-openai-embedding-delay ### 📊 Changes **3 files changed** (+57 additions, -50 deletions) <details> <summary>View changed files</summary> 📝 `docker/.env.example` (+1 -0) 📝 `server/.env.example` (+1 -0) 📝 `server/utils/EmbeddingEngines/genericOpenAi/index.js` (+55 -50) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #3570 ### What is in this change? This PR adds a new configurable environment variable to add a small delay for dispatching each API request calls when using the generic OpenAI embedding engine. This is meant to be used together with `GENERIC_OPEN_AI_EMBEDDING_MAX_CONCURRENT_CHUNKS=1` and is mostly relevant to the use of local LLM backends like `llama.cpp`, where their API server implementation is naive and will just reject API requests with a 429 error if the underlying worker is busy. ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [ ] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally I am skipping documentation for now since there is no change to front end UI, but I could add it to this PR if requested. --- <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:08 -05:00
yindo closed this issue 2026-02-22 18:36:08 -05:00
yindo changed title from [PR #4317] API request delay for Generic OpenAI embedding engine to [PR #4317] [MERGED] API request delay for Generic OpenAI embedding engine 2026-06-05 15:19:19 -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#4587