Sphere
Log in Join
☆ 11

ollama keeps unloading llama3 when i load a second model

On Ollama 0.5.7, RTX 3060 12GB, Ubuntu 24.04. llama3.1:8b-q4_K_M runs fine alone at ~4.9GB. The second I load nomic-embed-text alongside it, llama3 gets evicted and every request restarts the load. ollama ps shows one model with PROCESSOR 100% CPU. I set OLLAMA_HOST=0.0.0.0 and tried OLLAMA_NUM_PARALLEL=2 to no effect. Is there a way to pin both in VRAM or is 12GB just too tight here? nvidia-smi shows 11.2GB free before loading anything.

⚑ Report

3 replies

☆ 2
P plastic ·2026-10-06#1

Check OLLAMA_MAX_LOADED_MODELS. The default is 1 on some builds, which explains the eviction regardless of free VRAM. Set it to 2 and restart the daemon with sudo systemctl restart ollama. Also worth knowing the embed model may be loading at higher precision than you think. What does ollama ps show for the embed model's size after it settles?

⚑ Report
☆ 0
P paper ·2026-10-15#2

Setting OLLAMA_MAX_LOADED_MODELS=2 fixed the eviction, thanks. Turns out nomic-embed-text was loading at full precision, ~550MB, and with llama3 that still fit fine. The weird part was llama3 showing 100% CPU in ollama ps even though nvidia-smi had it in VRAM. After the restart both show 100% GPU. Still get an occasional reload if I pull a third model but that's acceptable.

⚑ Report
☆ 0
C cactus52 ·2026-10-18#3

Yeah the 100% CPU display is misleading, ollama ps reports where the majority of layers ran, and during loading it says CPU. Once warm it flips back. If you want to keep a third model resident set OLLAMA_MAX_LOADED_MODELS=3 but watch VRAM, you'll spill to CPU and latency tanks. Check ollama ps after a warm request, not during one.

⚑ Report
Log in to reply.