[GH-ISSUE #4720] Ollama unload model when embedding a large pdf file #2976

Closed
opened 2026-04-12 13:21:26 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @travisgu on GitHub (May 30, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4720

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

Hi there,

I am using ollama to serve Qwen 72B model with a NVidia L20 card. And I am using AnythingLLM as the RAG tool. When doing embedding with small texts, it all works fine. But when with large amount of text, the model unloading itself after a few API calls. I enabled the debug log and here is the log:
image
The log shows the model was unloaded during embedding processing. Not sure why this happend. Please help, thanks!

OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

0.1.38

Originally created by @travisgu on GitHub (May 30, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4720 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? Hi there, I am using ollama to serve Qwen 72B model with a NVidia L20 card. And I am using AnythingLLM as the RAG tool. When doing embedding with small texts, it all works fine. But when with large amount of text, the model unloading itself after a few API calls. I enabled the debug log and here is the log: <img width="1689" alt="image" src="https://github.com/ollama/ollama/assets/10804665/ce891296-2392-4afe-b88c-fa95b49983e6"> The log shows the model was unloaded during embedding processing. Not sure why this happend. Please help, thanks! ### OS Windows ### GPU Nvidia ### CPU Intel ### Ollama version 0.1.38
GiteaMirror added the bug label 2026-04-12 13:21:26 -05:00
Author
Owner

@jmorganca commented on GitHub (May 30, 2024):

Hi there are you running this with OLLAMA_MAX_LOADED set to 2+?

<!-- gh-comment-id:2140091694 --> @jmorganca commented on GitHub (May 30, 2024): Hi there are you running this with `OLLAMA_MAX_LOADED` set to 2+?
Author
Owner

@travisgu commented on GitHub (May 31, 2024):

OLLAMA_MAX_LOADED_MODELS is 1
image

Hi there are you running this with OLLAMA_MAX_LOADED set to 2+?

<!-- gh-comment-id:2141106089 --> @travisgu commented on GitHub (May 31, 2024): OLLAMA_MAX_LOADED_MODELS is 1 <img width="1691" alt="image" src="https://github.com/ollama/ollama/assets/10804665/42816229-4f19-46c5-96d6-6be82b76bb68"> > Hi there are you running this with `OLLAMA_MAX_LOADED` set to 2+?
Author
Owner

@dhiltgen commented on GitHub (Jul 26, 2024):

Please upgrade to the latest version, as concurrency has been enabled by default in 0.2.0 and up. You should see much better performance for RAG workflows using 2 models.

If you're still having trouble after upgrading, please share an updated server log (ideally the file/text, not a screen shot) and I'll reopen the issue.

<!-- gh-comment-id:2251604070 --> @dhiltgen commented on GitHub (Jul 26, 2024): Please upgrade to the latest version, as concurrency has been enabled by default in 0.2.0 and up. You should see much better performance for RAG workflows using 2 models. If you're still having trouble after upgrading, please share an updated server log (ideally the file/text, not a screen shot) and I'll reopen the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#2976