Running OpenClaw with Ollama: Best Local Models (2026)
Run OpenClaw with Ollama using the best local models for 2026. Hardware tiers, qwen3.5 & gemma4 picks, Ollama Cloud fallback, and full config examples.
Last updated: 25 min read

Disclosure: this guide contains referral links. If you buy through them, I may earn a commission at no extra cost to you.
I’ve been running OpenClaw with API providers for a while and the bills add up. Even cheap models cost something per token, and every message goes through someone else’s server. So I pointed OpenClaw at a local Ollama instance and never looked back. This guide covers running OpenClaw with Ollama using the best local models for 2026: hardware tiers, current model picks, and full config examples.
The 2026 model lineup has shifted a lot since this guide was first published. The old default picks (qwen2.5-coder, Llama 3.x, Mistral) now trigger deprecation warnings when launched as agent models. The current shortlist is qwen3.5, gemma4, gpt-oss, and the surprisingly capable Nanbeige4.2-3B for budget hardware. I’ll walk through all of them.
What You'll Need
- OpenClaw installed and running (setup guide here)
- A machine with at least 8GB RAM (16GB+ recommended for good models)
- Ollama installed (one command on Linux/macOS)
- Ollama v0.40+ and OpenClaw v2026.11+ for the config keys shown here
- No API keys required; everything runs locally
Why Run OpenClaw with Local Models
Three reasons to bother with this instead of just using an API:
- $0 per token: Ollama is free. No API bills, no rate limits, no usage caps
- Privacy: conversations never leave your machine. No third-party logging, no data retention policies to read
- No internet dependency: works on an airgapped network, during outages, on a plane
The tradeoff is real: local models are slower and less capable than Claude Opus or GPT-5. But for everyday OpenClaw stuff like answering messages and running scheduled jobs, a decent local model handles it fine. And if you want a middle ground, Ollama Cloud now offers cheap cloud overflow through the same daemon. More on that in the hybrid section below.
Hardware Requirements
This is the part most guides get wrong. They tell you the model size and forget about the actual experience. Here’s what to expect across different tiers.
VRAM Is What Matters
Models run in GPU VRAM when available. If the model doesn’t fit in VRAM, it spills into system RAM and gets much slower. CPU-only inference works but expect 5-10x slower responses. A rough rule of thumb: Q4-quantized models need about 0.6GB per billion parameters, plus 2-4GB headroom for context and system overhead.
| Hardware Tier | VRAM / RAM | Best Model Size | Response Speed |
|---|---|---|---|
| Low-end (no GPU, 8GB RAM) | 8GB system | 1B-3B models | Slow (order of magnitude: 5-15 tok/s) |
| Mid-range (no GPU, 16-32GB RAM) | 16-32GB system | 7B-12B models | Moderate (10-25 tok/s) |
| GPU entry (RTX 3060 12GB / M1 16GB) | 12-16GB | 7B-14B models | Good (30-60 tok/s) |
| GPU mid (RTX 4070 Ti 16GB / M2 Pro 32GB) | 16-32GB | 14B-32B models | Good (40-80 tok/s) |
| GPU high (RTX 4090 24GB / M4 Max 128GB) | 24-128GB | 32B-70B models | Fast (50-100+ tok/s) |
Speed values above are order-of-magnitude estimates, not ported benchmarks. Your numbers will depend on quantization, context length, and whether the model is cold-loaded.
Here’s where the model actually lives depending on your hardware:
Apple Silicon Note
M1/M2/M3/M4 Macs share unified memory between CPU and GPU, so Ollama can use all system RAM as VRAM. Since Ollama v0.40, MLX is the default runtime on Apple Silicon. This affects both speed and how much memory a model needs. A Mac Mini M4 with 32GB RAM can comfortably run 14B-32B models. Shopping for one now? The best Mac mini for OpenClaw guide covers the 2026 M6 and M5 Pro memory tiers.
Recommended Builds
Looking for hardware specifically for local LLMs? The best mini PC for local LLMs and Ollama covers dedicated boxes. For a quick pick by budget:
Budget VPS
Hetzner CAX31 or similar
- 8 vCPU (ARM), 32GB RAM, no GPU
- Runs 7B-12B models at usable speeds
- Best model:
gemma4:12borqwen3.5:9b - Cost: ~€15/mo on Hetzner Cloud (check current pricing)
Good enough for a personal assistant handling messages and simple tasks. Don’t expect fast responses on complex coding problems.
Quick check after setup: ollama ps shows the model loaded at expected size.
Mac Mini
Mac Mini M4 with 32GB RAM
- Unified memory acts as VRAM (MLX runtime)
- Runs 14B-32B models comfortably
- Best model:
qwen3.5:27borgemma4:31b - Cost: one-time ~$800
The sweet spot for most people. 27B-31B models handle coding, writing, and tool calls well. Note: with the MLX runtime, verify actual memory fit before committing to 32B-class models; quantization and context length matter more than raw parameter count. This is what I’d buy if starting fresh.
Quick check after setup: ollama ps shows the model loaded at expected size.
GPU Server
RTX 4090 24GB or dual GPU setup
- 24GB VRAM for a single 70B quantized model
- Best model:
qwen3.5:35bordeepseek-r1:70b - Cost: one-time ~$2000+ for the GPU
The 70B models come close to API-quality responses. Worth it if you’re replacing a $100+/mo API habit.
Quick check after setup: ollama ps shows the model loaded at expected size.
Minimal (8GB RAM)
Any machine with 8GB RAM
- CPU-only inference, slow but works
- Best model:
Nanbeige4.2-3B(see section below) - Fallback:
qwen3.5:2borgemma4:e2b - With Ollama Cloud fallback, even 8GB becomes viable for most tasks
Surprisingly usable for simple conversations and basic tasks. Not great for coding. A compact mini PC works well for this tier if you don’t want to use a VPS.
Quick check after setup: ollama ps shows the model loaded at expected size.
Installing Ollama
One command on Linux (canonical URL as of Nov 2026; ollama.ai/install.sh still redirects but use the new domain):
curl -fsSL https://ollama.com/install.sh | shOn macOS, download from ollama.com or use Homebrew:
brew install ollamaVerify it’s running:
ollama --version
# expect 0.40.x as of Nov 2026
curl http://localhost:11434/api/tags
# empty list = healthy daemonIf curl returns a JSON response (even with zero models), you’re set. If it says “connection refused,” the daemon isn’t running.
Failure modes:
- Port 11434 already in use:
ss -tlnp | grep 11434to find what’s holding it - Service not started on Linux:
systemctl status ollamaandsystemctl start ollama
Best Models for OpenClaw in 2026
Old Picks Are Deprecated
If you’re still running qwen2.5-coder, llama3.3, mistral, codellama, or starcoder as agent models, Ollama v0.32.0 (2026-07-11) now shows a deprecation warning on launch. These models still work but aren’t maintained for agent tool calling. The shortlist below is the current generation.
Not every model works well with OpenClaw. You need tool calling support (so the agent can use its tools) and ideally good instruction following. Vision and thinking capabilities are nice-to-have. Here are the models that hold up in 2026.
Best Models by Tier
| Model | Size | VRAM (Q4 est.) | Tool Calling | Best For |
|---|---|---|---|---|
gemma4:31b |
31B | ~18GB | Yes | Best local quality |
qwen3.5:27b |
27B | ~16GB | Yes | Coding, complex tasks |
qwen3.5:35b |
35B | ~20GB | Yes | Heavy workloads |
gpt-oss:20b |
20B | ~14GB | Yes | General, tool use |
qwen3.5:9b |
9B | ~6GB | Yes | General purpose |
gemma4:12b |
12B | ~8GB | Yes | Balanced speed/quality |
qwen3.5:4b |
4B | ~3GB | Yes | Budget general |
gemma4:e4b |
4B | ~3GB | Yes | Budget + vision |
Nanbeige4.2-3B* |
3B | ~2.5GB | See note | Budget, low-end |
deepseek-r1:70b |
70B | ~42GB | Yes | Best local reasoning |
* Community upload on Ollama. See Nanbeige section below for tool-calling caveats.
VRAM values are Q4 quantization estimates. For the “best local quality” tier, see also the best open source LLMs to replace Claude Opus.
My Picks
- 32GB Mac Mini or 16GB+ GPU:
qwen3.5:27bprimary,qwen3.5:9bfallback - 16GB RAM, no GPU:
gemma4:12bprimary,qwen3.5:9bfallback - 8GB RAM:
Nanbeige4.2-3Bprimary, Ollama Cloud fallback for overflow
Pull your chosen model:
# For 32GB Mac / 16GB+ GPU:
ollama pull qwen3.5:27b
# For 16GB no-GPU:
ollama pull gemma4:12b
# For 8GB budget:
ollama pull ndavat/Nanbeige4.2-3B
# General purpose alternatives:
ollama pull gemma4
ollama pull qwen3.5:9b
ollama pull gpt-oss:20bVerify It Works
Verify
After pulling models, run this three-step check:
openclaw models list --provider ollama: confirms OpenClaw sees your modelsopenclaw models status: shows health and current assignmentsopenclaw agent --model ollama/gemma4 "ping": live inference test
If step 3 returns a response, you’re connected. If models don’t appear in step 1, they may not be loaded in memory yet. Check with curl http://localhost:11434/api/ps and run ollama run <model> once to warm it up.
Nanbeige4.2-3B: The Budget Surprise
Nanbeige4.2-3B is a 3B parameter model from Nanbeige Lab that punches way above its weight class. It uses a Looped Transformer architecture. The model reuses its internal layers instead of having unique layers for each block, which is why a 4B total / 3B non-embedding model can compete with much larger ones. It claims the #1 spot on Artificial Analysis’s small-model leaderboard and explicitly targets OpenClaw as a local personal assistant scaffold.
The benchmarks against models 3-4x its size are hard to ignore:
| Benchmark | Nanbeige4.2-3B | Qwen3.5-9B | Gemma4-12B |
|---|---|---|---|
| Claw-Gym (agent tasks) | 65.0 | 56.1 | 40.8 |
| SWE-Bench Verified (coding) | 63.6 | 53.1 | 44.2 |
| Terminal-Bench 2.0 | 44.1 | n/a | n/a |
| GPQA-Diamond (science) | 87.4 | n/a | n/a |
| LiveCodeBench-V6 (coding) | 72.5 | n/a | n/a |
It has a 256K context window, is Apache-2.0 licensed, and the tech report is on arXiv:2607.22083. Nanbeige4.5 is in training for late 2026.
Legacy Note
The previous version, Nanbeige4.1-3B, is still available as tomng/nanbeige4.1 on Ollama. If you already have it pulled it still works, but 4.2 is the model to use going forward.
When to Use It
- Your machine has 8GB RAM and no GPU
- You want a backup model that uses minimal resources
- You’re running on a Raspberry Pi 5 or similar ARM board
- You need an emergency fallback when your main model is too slow
When NOT to Use It
- You have hardware for bigger models. 9B+ will still give better results on complex tasks
- You need long creative writing or nuanced conversation
- You’re doing heavy multi-file code refactoring
Installing Nanbeige4.2-3B
The primary path is a community upload on Ollama (2.6GB, 256K context):
ollama pull ndavat/Nanbeige4.2-3BVerify it’s loaded and check tool support:
ollama show ndavat/Nanbeige4.2-3B | grep -i toolsTool Calling Caveat
Community uploads may not advertise the tools capability that OpenClaw’s auto-discovery requires. If the grep above returns nothing, you have two options: configure the model explicitly in openclaw.json (see Step 3 below), or add compat.supportsTools: false to the model entry if the model chokes on tool schemas. Don’t assume tool calling works until you’ve seen it work.
You can also import a specific GGUF quantization from HuggingFace (bartowski quants are well-maintained):
# Download a Q4_K_M quantization from:
# huggingface.co/bartowski/Nanbeige_Nanbeige4.2-3B-GGUF
cat > Modelfile << 'EOF'
FROM ./Nanbeige4.2-3B-Q4_K_M.gguf
PARAMETER temperature 0.6
PARAMETER top_p 0.95
PARAMETER repeat_penalty 1.0
TEMPLATE """{{- if .System }}{{ .System }}{{ end }}
{{- range .Messages }}
{{- if eq .Role "user" }}
{{ .Content }}
{{- else if eq .Role "assistant" }}
{{ .Content }}
{{- end }}
{{- end }}"""
EOF
ollama create nanbeige4.2-3b -f ModelfileConfiguring OpenClaw for Ollama
Upgrading From an Old Config?
If you have an existing openclaw.json from before mid-2026, run openclaw doctor --fix first. It migrates legacy auth profiles (from flat JSON to SQLite) and adjusts context budget keys automatically.
Step 1: Enable Ollama
Auth Changed
Since Ollama Cloud launched, OLLAMA_API_KEY in the environment is treated as the Ollama Cloud convention and is not sent to local/self-hosted hosts by default. For loopback, private-network, .local, or bare-hostname Ollama URLs, the ollama-local marker is what you want. Public remote hosts need a real credential (env var, auth profile, or provider apiKey).
For a local Ollama instance, set the marker:
export OLLAMA_API_KEY="ollama-local"Or add it permanently:
echo 'OLLAMA_API_KEY=ollama-local' >> ~/.openclaw/.envStep 2: Verify Discovery
OpenClaw auto-discovers tool-capable Ollama models, but with a caveat: it only considers models loaded in memory (visible in /api/ps) with tool support and ≥16K confirmed context. A model that’s installed but not loaded won’t appear.
# Check what's loaded:
curl http://localhost:11434/api/ps
# Check what OpenClaw found:
openclaw models list --provider ollamaIf a model is pulled but not listed: it’s not loaded. Run it once (ollama run <model>) or configure it explicitly in the next step.
Step 3: Set Your Model
For a straightforward setup with one model:
openclaw models set ollama/gemma4Or edit your config file (~/.openclaw/openclaw.json):
{
"agents": {
"defaults": {
"model": {
"primary": "ollama/qwen3.5:27b"
}
}
}
}Never Use /v1
When configuring a custom baseUrl, use the native Ollama API, no /v1 suffix. The OpenAI-compatible /v1/chat/completions endpoint breaks tool calling: models emit raw tool-call JSON as plain text instead of structured calls. Always use "api": "ollama" with a baseUrl like http://localhost:11434.
Step 4: Set Up Fallbacks
Fallbacks matter more with local models because a single model might be too slow or run out of context. Configure a chain:
{
"agents": {
"defaults": {
"model": {
"primary": "ollama/qwen3.5:27b",
"fallbacks": [
"ollama/qwen3.5:9b",
"ollama/gemma4:12b"
]
}
}
}
}Or use the CLI:
openclaw models fallbacks add ollama/qwen3.5:9b
openclaw models fallbacks add ollama/gemma4:12bIf the 27B model chokes on a long context, OpenClaw falls through to the 9B, then to gemma4.
Full Config Example (Mid-Range Hardware)
Here’s a complete config for a 32GB Mac Mini:
{
"models": {
"providers": {
"ollama": {
"baseUrl": "http://localhost:11434",
"apiKey": "ollama-local",
"api": "ollama",
"timeoutSeconds": 300,
"models": [
{
"id": "qwen3.5:27b",
"name": "qwen3.5:27b",
"reasoning": true,
"input": ["text"],
"contextTokens": 32768,
"params": {
"num_ctx": 32768,
"keep_alive": "15m",
"thinking": false
}
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "ollama/qwen3.5:27b",
"fallbacks": ["ollama/qwen3.5:9b"]
},
"imageModel": {
"primary": "ollama/gemma4:12b"
}
}
}
}Full Config Example (Low-End / Remote GPU)
Low-end local (8GB RAM):
{
"agents": {
"defaults": {
"model": {
"primary": "ollama/ndavat/Nanbeige4.2-3B",
"fallbacks": ["ollama/qwen3.5:2b"]
}
}
}
}Remote GPU box on LAN:
{
"models": {
"providers": {
"ollama": {
"baseUrl": "http://gpu-box.local:11434",
"apiKey": "ollama-local",
"api": "ollama",
"timeoutSeconds": 300,
"maxTokens": 8192,
"models": [
{
"id": "qwen3.5:27b",
"name": "qwen3.5:27b",
"reasoning": true,
"input": ["text"],
"contextTokens": 32768,
"params": {
"num_ctx": 32768,
"keep_alive": "15m",
"thinking": false
}
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "ollama/qwen3.5:27b"
}
}
}
}Security Reminder
If you’re exposing Ollama over the network, make sure it’s on a trusted network (Tailscale, LAN behind firewall). Ollama has no built-in authentication. See the OpenClaw security guide for hardening your setup. The ollama-local marker means no credential is sent. Don’t reuse it for public endpoints.
Cost note for the LAN GPU box: one-time hardware cost + electricity. No per-token cost. If you’re sourcing a dedicated box, a compact mini PC works for light inference, though a real GPU is needed for 27B+ models. The best GPU for local LLMs guide sizes that GPU by VRAM and by dollars per GB.
Ollama Cloud: The Hybrid Local + Cloud Setup
Ollama now has a cloud tier, and it slots neatly into OpenClaw’s fallback chain. You get local-first privacy with cheap cloud overflow when your local model can’t handle a task.
There are three setup modes:
Local Only
Pure local: zero cost, zero network dependency
No Ollama Cloud account needed. Models run on your hardware, responses never leave your machine. This is the default if you want maximum privacy.
Configure fallbacks between local models of different sizes (27B → 9B → 3B). No cloud tokens consumed.
Cloud + Local (recommended)
Hybrid: local primary, cloud overflow
Sign in to Ollama Cloud from your daemon:
ollama signinThen use :cloud suffix models in your fallback chain:
{
"agents": {
"defaults": {
"model": {
"primary": "ollama/qwen3.5:27b",
"fallbacks": [
"ollama/qwen3.5:9b",
"ollama/glm-5.3-flash:cloud"
]
}
}
}
}When the local model hits its limits (context too long, task too complex), OpenClaw falls through to the cloud model automatically. You only pay for overflow: cents per message, not dollars.
Hosted Only (ollama-cloud)
No local daemon: pure API via Ollama’s cloud
Use the dedicated ollama-cloud provider if you don’t want to run Ollama locally at all:
export OLLAMA_API_KEY="olw_your_key_here"
openclaw onboard --auth-choice ollama-cloudThen set ollama-cloud/kimi-k3 or similar as your primary. This is the cleanest path if you just want the Ollama ecosystem without managing a daemon.
Ollama Cloud Pricing (Nov 2026)
| Plan | Cost | Usage Credits | Concurrent Requests |
|---|---|---|---|
| Free | $0 | Pay-as-you-go | 3 |
| Pro | $20/mo | $60 included | 5 |
| Max | $100/mo | $300 included | 10 |
| Team | $500/mo | Custom | Custom |
Off-peak discount: Select models are half price outside 12:00-18:00 UTC weekdays and all weekend.
Cheap fallback models (per M tokens, in/out):
| Model | Input | Output |
|---|---|---|
nemotron-3-nano |
$0.06 | $0.24 |
gpt-oss:20b |
$0.07 | $0.30 |
glm-5.3-flash |
$0.15 | $0.50 |
minimax-m3.1-flash |
$0.15 | $0.60 |
deepseek-v4.1-flash |
$0.30 | $1.20 |
Cost Reality
A personal assistant’s overflow on the Pro plan ($20/mo) will barely dent the $60 in credits. For most people, the Free tier with pay-as-you-go covers occasional fallback needs. The cheapest AI models for AI agents guide compares more options if you’re optimizing cost across providers.
For current-generation API models that pair well with a local setup (GLM-5.3, Kimi-K3, DeepSeek-V4), see the best open source models for OpenClaw.
Ollama 0.40.1+ proxies GET /api/balance, so your cloud quota shows up in OpenClaw’s /status output (make sure plugins.allow includes ollama).
Here’s how the fallback chain works end to end:
Switching Models On the Fly
You don’t have to restart OpenClaw to change models. Use the /model command in chat:
/model # Show available models
/model list # Full list with providers
/model ollama/qwen3.5:9b # Switch to a different model
/model default # Clear session overrideFor thinking/reasoning models (qwen3.5, gemma4), you can control reasoning depth:
/think low # Light reasoning (faster)
/think medium # Balanced
/think high # Deep reasoning
/think max # Maximum effort
/think off # Disable thinkingCLI equivalent: openclaw agent --model ollama/gemma4 --thinking low. Default is Off. One quirk: on Qwen3.5, low counts as thinking-enabled, so it won’t be fully off.
Verify: /model status shows the current model and auth state.
Note: a model pulled after OpenClaw started may not appear in /model list until it’s loaded in memory (see the discovery caveat in Step 2 above).
Performance Tuning
Context Window
There are three keys that control context, and getting them wrong is the most common source of “why is my model forgetting things”:
contextWindow: the model’s native window metadata (informational)contextTokens: caps OpenClaw’s active-input budget (auto-discovery caps at 32,768)params.num_ctx: sets Ollama’s actual request context (default: 4096)
The native adapter sets options.num_ctx from params.num_ctx first, then contextTokens. Only if neither is set does Ollama fall back to its own 4096 default. Keep them aligned when hardware can’t run the full advertised context:
{
"models": {
"providers": {
"ollama": {
"models": [{
"id": "qwen3.5:27b",
"contextTokens": 32768,
"params": {
"num_ctx": 32768
}
}]
}
}
}
}Larger context windows use more VRAM (KV cache scales with context). If you’re hitting memory limits, reduce params.num_ctx. Provider-level maxTokens controls the output-token default.
Keep Models Loaded & Run Multiple
The “slow second message” problem is almost always a cold model load. Fix it with keep_alive:
{
"params": {
"keep_alive": "15m"
}
}This keeps the model in memory for 15 minutes after the last request. The global OLLAMA_KEEP_ALIVE env var still works as a default.
For running multiple models simultaneously (e.g., a coding model and a general model), OLLAMA_NUM_PARALLEL controls concurrency. The default is now 1 (it used to be higher). RAM usage scales with num_ctx × parallel, so increase carefully:
OLLAMA_NUM_PARALLEL=2 ollama serveOn Apple Silicon with MLX (default since Ollama v0.40), memory fit and speed characteristics may differ from the CUDA path. Test before committing to a parallel count.
GPU Layers
Fix: Fake Env Var
An earlier version of this guide showed OLLAMA_GPU_LAYERS=35 ollama serve. That env var does not exist and never did. The correct mechanism is the per-model num_gpu parameter, which OpenClaw forwards as options.num_gpu in /api/chat.
To offload a specific number of layers to GPU (e.g., a 70B model on 24GB VRAM that doesn’t fully fit):
{
"models": {
"providers": {
"ollama": {
"models": [
{
"id": "llama3.3:70b",
"params": {
"num_gpu": 35
}
}
]
}
}
}
}More layers on GPU = faster but more VRAM. Experiment to find your sweet spot. If you leave num_gpu unset, Ollama automatically decides based on available memory.
Troubleshooting
Common Problems
Model doesn’t show up in openclaw models list
OpenClaw auto-discovery only shows models that are loaded in memory (/api/ps), have tool support, and report ≥16K context. If a model is pulled but not listed, run it once to warm it up, or configure it explicitly in models.providers.ollama. Check with:
curl http://localhost:11434/api/ps
ollama listResponses are extremely slow
Your model is probably running on CPU. Check if the model fits in your available VRAM/RAM. Solutions:
- Switch to a smaller model (
qwen3.5:9binstead ofqwen3.5:27b) - On Mac: close other apps to free unified memory
- On Linux with GPU: check
nvidia-smifor VRAM usage
“Connection refused” errors
Ollama isn’t running. Start it:
ollama serveOr on macOS, open the Ollama app. Check the API is accessible:
curl http://localhost:11434/api/tagsTool calls failing or being ignored
The model might not support tool calling well. Switch to a model known to handle tools: gemma4, qwen3.5, gpt-oss, or Nanbeige4.2-3B. Avoid older models like llama2, codellama, or qwen2.5-coder for OpenClaw.
Out of memory crashes
The model is too large. Either:
- Pull a smaller quantization:
ollama pull qwen3.5:9b-q4_0 - Switch to a smaller model
- Add more RAM/swap (not ideal but works)
Nanbeige4.2-3B not found
It’s a community upload, not in the official library. Pull with the namespace:
ollama pull ndavat/Nanbeige4.2-3BNew Issues in 2026
WSL2 crash loop on boot
Symptom: Windows reboots or freezes when WSL2 starts with Ollama.
Cause: ollama.service uses Restart=always + CUDA model load during boot → memory pinning → Windows kills the WSL2 VM → reboot loop (ollama/ollama#11317).
Fix: disable auto-start and cap memory:
sudo systemctl disable ollamaIn %USERPROFILE%\.wslconfig:
[experimental]
autoMemoryReclaim=disabledThen wsl --shutdown and restart.
Model emits raw tool-call JSON as plain text
Symptom: responses contain XML tags like <tool_call> or Action: ... instead of structured tool calls.
Cause: the model doesn’t handle tool schemas well, or you’re using the /v1 OpenAI-compatible endpoint instead of the native Ollama API.
Fix: OpenClaw auto-retries one native call when it detects raw tool-call text. For small models that consistently choke, set "compat": { "supportsTools": false } on the model entry. And check your baseUrl: no /v1 suffix.
First message times out on a cold model
Symptom: openclaw agent hangs or errors on the first request but works after.
Cause: cold-loading a large model exceeds the default timeout budget.
Fix: add timeoutSeconds: 300 to the provider config (see Full Config Example above).
Model pulled but not appearing in auto-discovery
Symptom: openclaw models list --provider ollama doesn’t show your model.
Cause: auto-discovery only considers models loaded in memory with tool support and ≥16K context.
Fix: run ollama run <model> once to load it, or configure it explicitly in models.providers.ollama.models[].
Security Considerations
Running models locally is inherently more private than API calls, but don’t skip the basics:
- Ollama has no auth: anyone on your network who can reach port 11434 can use your models. Bind to localhost or use a firewall. The
ollama-localmarker means no credential is sent to local hosts. Don’t reuse it for public endpoints. - Model downloads: Ollama pulls models from ollama.com. If you’re security-conscious, verify model checksums or use airgapped installs.
- OpenClaw security: local models don’t change the OpenClaw threat model. Still follow the OpenClaw security guide for gateway binding, sandbox mode, and skill vetting.
Related Guides
- OpenClaw Setup Guide: full installation on Hetzner VPS or Mac Mini
- Best Open Source Models for OpenClaw: API-based models (GLM-5.3, Kimi-K3) for when local isn’t enough
- Best Mini PC for Local LLMs and Ollama: dedicated hardware picks for running models locally
- Best Mac mini for OpenClaw: which Mac Mini config you actually need
- DuckDuckGo Search for OpenClaw: free web search that pairs well with local models
- OpenClaw Security Guide: hardening your instance, especially relevant when running on a LAN
- Best OpenClaw Dashboards: track local vs cloud model usage and cost
- OpenClaw Alternatives: other platforms with their own local model support
Frequently Asked Questions
Can I run OpenClaw entirely offline with Ollama?
Yes, once the models are pulled and OpenClaw is installed. No internet required for inference. You won’t have web search or channel integrations (Telegram, WhatsApp), but CLI and local sessions work fine.
Which model gives the best quality per watt (or per euro)?
On a 32GB Mac Mini, qwen3.5:27b gives the best results for the power draw. On a budget VPS, gemma4:12b is the sweet spot. On 8GB RAM, Nanbeige4.2-3B is the best tradeoff between speed and capability. If you want quality without hardware costs at all, Ollama Cloud’s free tier gives you API-grade models at pay-as-you-go rates.
How does Nanbeige4.2-3B compare to API models like GLM-5.3?
GLM-5.3 and Kimi-K3 are still better for complex, multi-step tasks. Nanbeige4.2-3B is competitive on benchmarks (it beats much larger models on agent tasks and coding), but real-world OpenClaw usage involves long contexts and multi-turn conversations where bigger models have an edge. Use Nanbeige for quick tasks and messages, API models for the heavy stuff.
Can I use Ollama and API providers at the same time?
Yes, and I recommend it. Set an Ollama model as primary and a cheap API model as fallback. OpenClaw handles the switching automatically. Ollama Cloud is the simplest path for this. Same provider, same daemon, just a :cloud suffix on the fallback model.
Does tool calling work with all Ollama models?
No. OpenClaw’s auto-discovery only shows models that report tool support and are loaded in memory. Older models and some smaller ones don’t support it. The models listed in this guide all support tool calling (verify Nanbeige4.2 separately (see the caveat above). Check with ollama show <model> and look for tools in the capabilities.
What about running Ollama on a Raspberry Pi?
A Raspberry Pi 5 with 8GB RAM can run 1B-3B models. Nanbeige4.2-3B or qwen3.5:2b are your best options. Responses will be slow (order of magnitude 2-5 tokens/second), but functional for simple tasks. Don’t expect it to handle coding questions.
Is vLLM better than Ollama for OpenClaw?
vLLM gives better throughput on multi-GPU setups and production workloads. Ollama is simpler to set up and better for single-user scenarios. For a personal OpenClaw instance, Ollama is the right choice. If you’re running multiple agents or need concurrent inference, look at vLLM.
How much RAM do I actually need for X model?
Rough formula: model parameters × 0.6GB for Q4 quantization. So a 9B model needs ~5.4GB, a 12B needs ~7.2GB, a 27B needs ~16.2GB. Add 2-4GB headroom for the system and Ollama overhead. These are minimums. More RAM means larger context windows.
What is Ollama Cloud and do I need it?
Ollama Cloud is Ollama’s hosted inference tier. You don’t need it for pure local use. But if you want cheap overflow when your local model hits its limits, it’s the cleanest option. Same tooling, same API, just :cloud models in your fallback chain. The Free tier ($0, pay-as-you-go) is enough for occasional use.
What is the ollama CLI’s own agent mode?
Since Ollama v0.32, the bare ollama command launches an interactive agent, and ollama launch openclaw starts OpenClaw through Ollama’s own tooling. It’s an adjacent on-ramp, not a replacement for this guide. The config and model-picking advice here applies either way.
Local models with Ollama won’t replace Claude Opus for complex work. But they cover most of what I use OpenClaw for: answering messages, running cron jobs, lookups, automations. The hybrid setup (local primary + cloud fallback) means privacy and zero cost most of the time, with API quality when you actually need it.
Start with whatever fits your hardware. Mac Mini → qwen3.5:27b. 8GB budget → Nanbeige4.2-3B. Want zero-config overflow → try Ollama Cloud’s free tier.
For the rest of the OpenClaw stack: setup guide, API model recommendations, free web search, security hardening, dashboards, and alternative platforms.
Did this guide work for you?
Need help with Astro, VPS, or a self-hosted app? View services →


