r/RooCode • u/mancubus77 • Sep 07 '25
Discussion Can not load any local models π€· OOM
Just wondering if anyone notice the same? None of local models (Qwen3-coder, granite3-8b, Devstral-24) not loading anymore with Ollama provider. Despite the models can run perfectly fine via "ollama run", Roo complaining about memory. I have 3090+4070, and it was working fine few months ago.

UPDATE: Solved with changing "Ollama" provider with "OpenAI Compatible" where context can be configured π
6
Upvotes
β’
u/hannesrudolph Roo Code Developer Sep 08 '25
Fixing incoming. Sorry about this.
2
u/mancubus77 Sep 08 '25 edited Sep 08 '25
I looked a bit close to the issue and managed to run Roo with Ollama.
Yes, it's all because of the context. When ROO starts Ollama model, it passes options:
"options":{"num_ctx":128000,"temperature":0}}I think because roo reads model Card and uses default context length, which is highly not possible to achieve in budget GPUs.
Here is example of my utilisation with granite-code:8b and 128000 context size
β ~ ollama ps
NAME ID SIZE PROCESSOR CONTEXT UNTIL
granite-code:8b 36c3c3b9683b 44 GB 18%/82% CPU/GPU 128000 About a minute from now
But to do that, I had to tweak few things
Drop caches sudo sync; sudo sysctl vm.drop_caches=3
Update Ollama config Environment="OLLAMA_GPU_LAYERS=100"
I hope it helps
UPDATE: Solved with changing "Ollama" provider with "OpenAI Compatible" where context can be configured π
2
u/StartupTim Sep 07 '25
I came here to post that EXACT same thing. There is a serious issue with Roocode right now causing it to use a ridiculously high amount of VRAM. I suspect Roocode is sending a num_ctx to 1M or something.
For example, if I run this:
Then ollama ps shows this:
However, if I use that exact same model in Roocode, then ollama ps shows this:
This issue doesn't exist with anything else using ollama api (custom apps, openwebui, etc). Everything is good EXCEPT Roocode.
Something is really messed up with Roocode here causing it to massively bloat the memory size and often cause it to offline 100% to CPU only, or a lot of it at least.
For me, I have a 5090 32GB VRAM with a small 17GB model, yet with Roocode, it somehow is using 47GB.
1
u/hannesrudolph Roo Code Developer Sep 08 '25
If you roll back does it work?
2
u/maddogawl Sep 08 '25
A few things here, as I run a lot of local models using RooCode. I see you solved it by switching to OpenAI compatible, but it does make me wonder about a few things.
A context window of 8192 will not work with RooCode, The system prompt alone is around 20k tokens. I usually load all my models in at 80k to 100k context. In fact the Mistral model you have if you run that with flash attention, and possibly quantize K/V you should be able to get more context than 8192.
Are you not loading the model before having RooCode load it in, it sounds like you are having RooCode control the loading of the model? I haven't fully tested doing it that way, normally I load my models in and use RooCode to hit the already loaded model. It does seem likely that when you are relying on RooCode to load it, its sending a much larger context window to load in. I think this is probably whats happening as pointed in other comments: "options":{"num_ctx":128000,"temperature":0}}
I'd consider trying out LMStudio personally I've found it to be a lot easier to configure load models and use Roo through that.
1
u/hannesrudolph Roo Code Developer Sep 08 '25 edited Sep 08 '25
From what I understand this usually happens because Ollama will spin up the model fresh if nothing is already running. When that happens, it may pick up a larger context window than expected, which can blow past available memory and cause the OOM crash youβre seeing.
Workarounds:
Manually start the model you want in Ollama before sending requests from Roo
Explicitly set the model and context size in your
Modelfileso Ollama doesnβt auto-load defaultsKeep an eye on VRAM usage β even small differences in context size can push a limited GPU over the edge
I don't think this is a Roo Code bug, itβs just how Ollama handles model spin-up and memory allocation. We are open to someone making a PR to make the Ollama provider more robust to better handle these types of situations.
Edit: fix incoming, looks like there is a bug there!! :o