[GH-ISSUE #3327] [BUG]: embedding with OpenAI API, 429 Rate limit #2141

Closed
opened 2026-02-22 18:28:19 -05:00 by yindo · 2 comments
Owner

Originally created by @chourete on GitHub (Feb 23, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3327

How are you running AnythingLLM?

AnythingLLM Desktop app

What happened?

Hi Developer

I’m encountering an issue when uploading a large .txt file (29MB). The system returns the following error:

OpenAI Failed to embed: [failed_to_embed]: 429 Rate limit reached for text-embedding-3-small in organization org-XXXXX on tokens per min (TPM): Limit 1,000,000, Used 1,000,000, Requested 38,761. Please try again in 2.325s.

It seems that the embedding process is exceeding the rate limit. Should we implement a rate limit delay or batch processing to avoid hitting the TPM restriction?

Are there known steps to reproduce?

Embedding Provider, both

Image

OR

Image

Originally created by @chourete on GitHub (Feb 23, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3327 ### How are you running AnythingLLM? AnythingLLM Desktop app ### What happened? Hi Developer I’m encountering an issue when uploading a large .txt file (29MB). The system returns the following error: ``` OpenAI Failed to embed: [failed_to_embed]: 429 Rate limit reached for text-embedding-3-small in organization org-XXXXX on tokens per min (TPM): Limit 1,000,000, Used 1,000,000, Requested 38,761. Please try again in 2.325s. ``` It seems that the embedding process is exceeding the rate limit. Should we implement a rate limit delay or batch processing to avoid hitting the TPM restriction? ### Are there known steps to reproduce? Embedding Provider, both ![Image](https://github.com/user-attachments/assets/c01f9694-04a4-4898-8891-c96005fce0ca) OR ![Image](https://github.com/user-attachments/assets/c20ab8d3-84e7-440c-aa3b-216c7d41ae89)
yindo added the possible bug label 2026-02-22 18:28:19 -05:00
yindo closed this issue 2026-02-22 18:28:19 -05:00
Author
Owner

@shatfield4 commented on GitHub (Feb 24, 2025):

We do have batching already in the OpenAI provider to prevent rate limiting from happening. If you're using the generic OpenAI provider try reducing the max concurrent chunks to even less. I also just want to let you know that uploading a .txt. file with 29 MB of text is not going to give the results you are probably looking for when using RAG. It will be very hard for RAG to find the data you are looking for and will not give accurate results. Closing for now.

@shatfield4 commented on GitHub (Feb 24, 2025): We do have batching already in the OpenAI provider to prevent rate limiting from happening. If you're using the generic OpenAI provider try reducing the max concurrent chunks to even less. I also just want to let you know that uploading a `.txt.` file with 29 MB of text is not going to give the results you are probably looking for when using RAG. It will be very hard for RAG to find the data you are looking for and will not give accurate results. Closing for now.
Author
Owner

@chourete commented on GitHub (Feb 24, 2025):

Hi developer, this is just a test, for case in point, if multiple users are uploading files at the same time, it can easily lead to a rate limit.
For example, when librechat uses embedding with openai, it has a retry delay seconds in the backend(rag-api). I think this is a good idea...

for anythingllm
Even if it's a text-only 29MB, or 14MB, I've found that he triggers an error causing the file to fail to be embedded.

@chourete commented on GitHub (Feb 24, 2025): Hi developer, this is just a test, for case in point, if multiple users are uploading files at the same time, it can easily lead to a rate limit. For example, when librechat uses embedding with openai, it has a retry delay seconds in the backend(rag-api). I think this is a good idea... for anythingllm Even if it's a text-only 29MB, or 14MB, I've found that he triggers an error causing the file to fail to be embedded.
yindo changed title from [BUG]: embedding with OpenAI API, 429 Rate limit to [GH-ISSUE #3327] [BUG]: embedding with OpenAI API, 429 Rate limit 2026-06-05 14:44:47 -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#2141