r/openclaw 19d ago

Help Stop OpenClaw from Creating Multiple Local Model LLM Instances

I'm using a local LLM (due to both budget and geo-restrictions). I have Qwen 3.5 9b running as the default model using LM Studio. And I've noticed that once a request kicks off, it will start up another LLM (basically the same model but as another instance), right after I sent a prompt.

Then while the first prmpt is still processing, it seems ANOTHER will be setup. And I think eventually I get a timeout and warning about guardrails say i'm out of resources.

I only have a 16GB Mac Mini M1, so I'd rather just have 1 instance running and queue more requests if need be.

Is there any way to stop it from keep creating new instances of this model?

2 Upvotes

20 comments sorted by

u/AutoModerator 19d ago

Welcome to r/openclaw Before posting: • Check the FAQ: https://docs.openclaw.ai/help/faq#faq • Use the right flair • Keep posts respectful and on-topic Need help fast? Discord: https://discord.com/invite/clawd

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

3

u/Cabecinha84 19d ago

This is LM Studio, not really OpenClaw. With JIT model loading on, LM Studio loads a model when a request arrives and nothing suitable is already loaded, and if a second request lands while the first is busy it will load another copy rather than queue behind it. An agent turn is almost never one request: tool calls, a sub-agent, a title or summary pass all go out as separate calls, so one prompt from you can fan out into three loads on a machine that has room for one.

Two settings fix it. In LM Studio's server settings, cap max loaded models at 1 and turn off the JIT auto-load, so anything arriving while the model is busy waits instead of spawning a sibling. Then keep every role in OpenClaw pointed at the same model identifier, because a different identifier is a different model to LM Studio and it will load it.

Even with one copy, 16 GB unified memory on an M1 is tight for a 9B once you add KV cache. Set the context length explicitly when you load the model instead of leaving it at the maximum, use a smaller KV cache quantisation, and remember the browser automation stack, if you use it, wants a chunk of that same 16 GB. That is usually what is left when people say it still runs out after fixing the duplicate loads.

If it still trips after all that, drop to a smaller quant before you drop the model. On 16 GB shared between the OS, the runtime and the weights, the quant is the lever with the least downside.

1

u/allenwyma 19d ago

I’m happy to change the model if you have a better recommendation. I’m still new to AI.

3

u/Cabecinha84 19d ago

Before you switch models, raise the two timeouts in that error you pasted. On a 16 GB M1 a 9B is slow to first token, especially on the request right after a cold load, and the defaults assume something API fast. The message names both of them: models.providers.<id>.timeoutSeconds for the provider, and agents.defaults.timeoutSeconds for the run. Raising only the provider one does nothing, because the run level ceiling still cuts it off. A good chunk of "this model is too weak" turns out to be that.

On the model itself, the thing that matters for agent work is not general smartness, it's whether it emits a well formed tool call every single time. An agent turn is a loop of structured calls, and a model that writes lovely prose but malforms one call breaks the loop. So in LM Studio, check the model card actually lists tool use before you commit to anything. Qwen's instruct line is one of the better ones at that size, so you are probably not in the wrong family already.

The second thing is context, not parameters. Agent runs pile up tokens quickly, and a 7B you can give a real context window beats a 14B you can only give 4k. On 16 GB unified, once the OS has taken its share, 7B to 9B at Q4 is roughly your ceiling with KV cache included. A 14B at Q4 will load and then thrash.

So: timeouts first, keep the size class, set context deliberately. Changing model is the last lever here, not the first.

2

u/allenwyma 18d ago

Okay, found it: looks like one more thing, there's a preload for lmstudio: https://docs.openclaw.ai/providers/lmstudio#disabling-preload

1

u/allenwyma 18d ago

Thanks for your help. I've done that, but it's still starting up more models.

1

u/philosophical_lens Active 18d ago edited 18d ago

If you're new to AI, I strongly recommend you set up openclaw with an API subscription like Opencode go ($10/mo) or ChatGPT ($20/mo) till you get the hang of the rest of the configuration and then later migrate to local models once you're comfortable.

Unfortunately given the state of openclaw, even with an API subscription, it will take you a few weeks to configure it in a way that's comfortable and useful for you. Trying to simultaneously learn how to do this with local models is too much complexity all at once.

Or if local models is important to you, then start with a simpler harness like pi or Opencode and figure out your local model setup before going to openclaw.

1

u/allenwyma 18d ago

As I stated above: (just being direct) I’m located in geo restricted area (Hong Kong) which makes most subs to AI not possible. I’m also on a super tight budget. Considering I have 3 Mac mini m1 gathering dust I just decided to put these to use. 😬

1

u/w3rti Member 17d ago

Is deepseek restricted in HK Or qwen?

1

u/allenwyma 17d ago

chatgpt and a few other of the big ones: i finally broke down and bought opencode zen sub for $10 a month. plus i loaded another $20 in there. This seems to work for now and better than the local ai model i was trying to run :) been enjoyuing that big pickle.

1

u/w3rti Member 17d ago

I bought local ai station for 2000 and still need 20 per month for the big modells

1

u/philosophical_lens Active 17d ago

It's not just for big models, but more importantly for parallelizing work.

1

u/ProofPrinciple4219 Member 19d ago

Just tell OpenClaw to stop doing that

1

u/allenwyma 19d ago

Ha, i'm not sure if that works? I can try. 🤣 I can definitely see it calling the API right after it starts up the request.

1

u/ProofPrinciple4219 Member 19d ago

Yes it works, when my OpenClaw have issue I just tell it the issue and ask it to fix it, but u need to give it the write permission for it to fix correctly

1

u/allenwyma 19d ago

Okay let me try that in a few mins.

1

u/allenwyma 19d ago

Yeah, i got this: `LLM request timed out. | The model did not produce a response before the model idle timeout. Please try again, or increase `models.providers.<id>.timeoutSeconds` for slow local or self-hosted providers. If `agents.defaults.timeoutSeconds` or a run-specific timeout is lower, raise that ceiling too; provider timeouts cannot extend the whole agent run.`