← Back to blog

OpenClaw with Ollama: Running Local Models

| Weihao Ming

A Reddit user named u/synthwav3 posted benchmarks last month comparing OpenClaw running on GPT-4o versus a local Llama 3.3 70B through Ollama. The local setup was slower, obviously. But the interesting part was that for straightforward tasks like file management and web scraping, the quality gap was smaller than most people assumed.

Ollama lets you run open-weight language models locally on your own hardware. OpenClaw supports it as a backend, which means you can have a fully functional AI agent without paying per-token API costs to OpenAI or Anthropic.

Setting it up

You install Ollama separately from OpenClaw. It runs as its own process (or container, if you prefer Docker) and exposes a local API that is compatible with the OpenAI format. In your OpenClaw config, you point the model endpoint at http://localhost:11434 instead of the OpenAI API, specify which model you want to use, and that is basically it.

The Ollama docs list supported models, and the list grows every week. For OpenClaw specifically, the community consensus leans toward the larger Llama variants (70B and above) or Mixtral for the best balance of speed and capability. Smaller models like 7B and 13B work, but they struggle with complex multi-step instructions where the agent needs to maintain context across a long task chain.

If you are already running OpenClaw in Docker, you can add Ollama as another service in your compose file and keep everything on the same internal network. That avoids exposing the Ollama port to the outside world.

The real performance picture

Running local models means your hardware becomes the bottleneck. A machine with a decent GPU (an RTX 3090 or better, or an M-series Mac with 32GB+ of unified memory) can run 70B models at a usable speed for interactive tasks, maybe 15 to 25 tokens per second depending on quantization. That is noticeably slower than cloud APIs, which typically return responses in a few seconds even for long outputs.

For batch tasks where you do not care about response latency, this works fine. Your agent processes files overnight, researches topics while you sleep, whatever. But for interactive back-and-forth where you are waiting on the agent in Telegram, the delay gets annoying fast with larger models.

The smaller quantized models (Q4, Q5) are faster but lose some reasoning quality. I find the Q5 variants hit a decent sweet spot for most OpenClaw use cases, though your mileage depends on what you are actually asking the agent to do.

When to use Ollama versus cloud APIs

The cost argument is straightforward. Cloud APIs charge per token, and an active OpenClaw agent can easily burn through $30 to $100 a month in API costs depending on usage. Ollama costs electricity and whatever you paid for the GPU, but per-token cost is essentially zero after that.

Privacy is the other reason. With Ollama, your conversations and data never leave your machine. No third-party API sees your prompts. For people working with sensitive business data, this matters a lot.

But cloud models are still better at complex reasoning, long-context tasks, and anything that requires understanding nuanced instructions. If you are using OpenClaw for research or multi-step workflows that chain ten actions together, the cloud models produce noticeably fewer errors mid-chain.

My take: start with a cloud API key so you can see what OpenClaw is capable of at full strength, then experiment with Ollama for the tasks where local performance is good enough. Or skip the hardware investment entirely and use a managed setup like OpenClaw Cloud with your own API key so you still control the model choice without managing the infrastructure.

← Back to blog