Fix: LLM Timeout โ Remote Ollama Server
Request Timed Out Before Ollama Responded
OpenClaw sent a prompt to the remote Ollama server and did not get a response within the timeout window. The model may not be loaded, the URL may be wrong, or a firewall is blocking the connection.
Running Ollama on a remote machine (a home server, a VPS, another machine on your LAN) introduces latency that the default OpenClaw timeout doesn't account for. The error LLM timeout received almost always means one of four things: wrong URL, model not loaded, timeout too short, or network blocked.
Next Step
Fix now, then reduce repeat incidents
If this issue keeps coming back, validate your setup in Doctor first, then harden your config.
Jump to Fix
The Error
The ECONNREFUSED 127.0.0.1 variant means OpenClaw is still pointing at localhost instead of the remote server โ the most common mistake.
Fix A: Set the Correct Remote baseUrl (Most Common)
By default, OpenClaw looks for Ollama at http://localhost:11434. When your Ollama instance runs on another machine, you must point to its IP:
{
"llm": {
"provider": "ollama",
"baseUrl": "http://192.168.1.100:11434",
"model": "llama3.2"
}
}Replace 192.168.1.100 with your server's actual IP. To find it:
- โข Linux/macOS:
ip addr showorifconfig - โข Windows:
ipconfig - โข Use the LAN IP (192.168.x.x or 10.x.x.x) for local network
Also make sure Ollama on the remote machine is listening on all interfaces (not just localhost):
OLLAMA_HOST=0.0.0.0 ollama serve
Or set it permanently in your Ollama service config:
# /etc/systemd/system/ollama.service.d/override.conf [Service] Environment="OLLAMA_HOST=0.0.0.0:11434"
Fix B: Keep the Model Loaded
Ollama unloads models from memory after 5 minutes of inactivity by default. When OpenClaw sends a request to an unloaded model, Ollama must reload it โ which can take 30โ90 seconds and trigger the timeout.
On the Ollama server, set OLLAMA_KEEP_ALIVE to keep the model resident:
# In your Ollama service environment OLLAMA_KEEP_ALIVE=-1 ollama serve # Or in systemd override Environment="OLLAMA_KEEP_ALIVE=-1"
Use -1 to never unload, or a duration like 60m to keep it loaded for 60 minutes.
Fix C: Increase OpenClaw's Timeout
For slower hardware (CPU-only, older GPU), even a loaded model can take longer than the default timeout to respond to a prompt. Increase the timeout in OpenClaw's config:
{
"llm": {
"provider": "ollama",
"baseUrl": "http://192.168.1.100:11434",
"model": "llama3.2",
"requestTimeout": 120000
}
}120000 is 120 seconds. For very large models (70B+) on CPU, you may need 300000 (5 minutes).
Fix D: Open Firewall Port 11434
If your Ollama server is on a different subnet or behind a firewall, port 11434 may be blocked:
# Allow from your OpenClaw machine's IP only sudo ufw allow from 192.168.1.50 to any port 11434 # Or allow from entire LAN (less secure) sudo ufw allow from 192.168.1.0/24 to any port 11434
Test Connectivity Before Restarting OpenClaw
# Check if Ollama is reachable
curl http://192.168.1.100:11434/api/tags
# Run a quick inference test
curl http://192.168.1.100:11434/api/generate \
-d '{"model":"llama3.2","prompt":"hi","stream":false}'curl /api/tags returns model list
Confirms Ollama is reachable and listening on the right interface
/api/generate responds in under 60s
Confirms the model is loaded and inference speed is within timeout
No firewall errors (Connection refused / timed out)
Port 11434 must be open from the OpenClaw host
Run the Doctor
Checks Ollama connectivity, baseUrl config, and model availability automatically.
Related Issues
Other Ollama and timeout problems:
Fix It Faster With Our Tools
Did this guide solve your problem?