[GH-ISSUE #5161] [BUG]: Ollama embedding requests abort after 5 minutes despite OLLAMA_RESPONSE_TIMEOUT #4944

Closed
opened 2026-06-05 14:51:02 -04:00 by yindo · 3 comments
Owner

Originally created by @Sarmingsteiner on GitHub (Mar 6, 2026).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5161

Originally assigned to: @timothycarambat on GitHub.

How are you running AnythingLLM?

Docker (remote machine)

What happened?

Hi team,

I found an issue with Ollama when used as an embedding provider:

When Ollama is used as an LLM provider, the OLLAMA_RESPONSE_TIMEOUT setting works correctly and allows long-running requests.

When Ollama is used as an embedding provider, requests always abort exactly after 5 minutes, even if the chunks are large.

This behavior appears to be a bug, as the timeout setting is not respected for embeddings.

Expected behavior:
OLLAMA_RESPONSE_TIMEOUT (or a similar configuration) should also apply to embedding requests, allowing long-running embeddings to complete successfully.

Observed behavior:
All embedding requests terminate after 5 minutes regardless of timeout settings.

This causes failures for large documents and datasets.

Thanks!

Are there known steps to reproduce?

No response

Originally created by @Sarmingsteiner on GitHub (Mar 6, 2026). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5161 Originally assigned to: @timothycarambat on GitHub. ### How are you running AnythingLLM? Docker (remote machine) ### What happened? Hi team, I found an issue with Ollama when used as an embedding provider: When Ollama is used as an LLM provider, the OLLAMA_RESPONSE_TIMEOUT setting works correctly and allows long-running requests. When Ollama is used as an embedding provider, requests always abort exactly after 5 minutes, even if the chunks are large. This behavior appears to be a bug, as the timeout setting is not respected for embeddings. Expected behavior: OLLAMA_RESPONSE_TIMEOUT (or a similar configuration) should also apply to embedding requests, allowing long-running embeddings to complete successfully. Observed behavior: All embedding requests terminate after 5 minutes regardless of timeout settings. This causes failures for large documents and datasets. Thanks! ### Are there known steps to reproduce? _No response_
yindo added the enhancementpossible bug labels 2026-06-05 14:51:02 -04:00
yindo closed this issue 2026-06-05 14:51:02 -04:00
Author
Owner

@timothycarambat commented on GitHub (Mar 7, 2026):

Yes, because that is the ollama SDK (underlying node fetch HTTP timeout). While it cannot be changed in the UI, you can actually add OLLAMA_RESPONSE_TIMEOUT=7200000 as an ENV in your storage/.env and it will patch that on slower-inference machines

<!-- gh-comment-id:4015666235 --> @timothycarambat commented on GitHub (Mar 7, 2026): Yes, because that is the ollama SDK (underlying `node fetch` HTTP timeout). While it cannot be changed in the UI, you can actually add [`OLLAMA_RESPONSE_TIMEOUT=7200000`](https://github.com/Mintplex-Labs/anything-llm/blob/master/docker/.env.example#L49-L49) as an ENV in your storage/.env and it will patch that on slower-inference machines
Author
Owner

@Sarmingsteiner commented on GitHub (Mar 7, 2026):

Dear @timothycarambat,

thanks for your reply! I understand that OLLAMA_RESPONSE_TIMEOUT affects the Ollama SDK when used as an LLM provider. However, the original bug report is specifically about Ollama being used as an embedding provider. In that context, the 5-minute timeout is still hardcoded and the environment variable does not apply, which causes large embedding jobs to fail.

I have patched server/utils/EmbeddingEngines/ollama/index.js to bypass this, and embedding now works correctly.

Could you please reopen the original issue or track it separately for embedding usage? It’s not just a UI/SDK timeout issue; it affects real embedding workloads.

Thanks for considering!

<!-- gh-comment-id:4017453681 --> @Sarmingsteiner commented on GitHub (Mar 7, 2026): Dear @timothycarambat, thanks for your reply! I understand that OLLAMA_RESPONSE_TIMEOUT affects the Ollama SDK when used as an _LLM provider_. However, the original bug report is specifically about Ollama being used as an **embedding provider**. In that context, the 5-minute timeout is still hardcoded and the environment variable does not apply, which causes large embedding jobs to fail. I have patched `server/utils/EmbeddingEngines/ollama/index.js` to bypass this, and embedding now works correctly. Could you please reopen the original issue or track it separately for embedding usage? It’s not just a UI/SDK timeout issue; it affects real embedding workloads. Thanks for considering!
Author
Owner

@timothycarambat commented on GitHub (Mar 9, 2026):

Ah, i totally missed that, will apply this to embedder as well!

<!-- gh-comment-id:4025676086 --> @timothycarambat commented on GitHub (Mar 9, 2026): Ah, i totally missed that, will apply this to embedder as well!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4944