Back to blog
GuideOpenClawOllamaLM StudioLocal LLMApple SiliconAI agents

Best Local Models for OpenClaw on a Mac: Memory and Setup

November 10, 20266 min readby Macyou Team

OpenClaw works with any local model that calls tools reliably and gets enough context, and on a Mac the memory decides which model fits. We size every model at 64K, the context of OpenClaw’s own llama.cpp recipes. The smallest Mac for each one, macOS included: Gemma 4 26B A4B, 24 GB; Qwen3.8 27B, 32 GB; Qwen3.6 35B A3B, 32 GB; Gemma 4 31B, 48 GB; Llama 3.3 70B, 64 GB. Below: the memory each model needs, what OpenClaw asks of a model, and how to connect Ollama or LM Studio on your own Mac or a rented one.

Which model fits which Mac

ModelTypeMemory at 64K, macOS includedSmallest Mac
Gemma 4 26B A4BMixture of experts23 GB24 GB
Qwen3.8 27BDense26 GB32 GB
Qwen3.6 35B A3BMixture of experts30 GB32 GB
Gemma 4 31BDense33 GB48 GB
Llama 3.3 70BDense58 GB64 GB

The figures come from the same sizing as our Mac LLM calculator: Q4 weights, runtime overhead, the cache for a 64K context and a reserve for macOS. Mixture of experts models read only a few billion active parameters per token, so they answer faster than dense models of the same size, which matters for an agent that calls the model many times per task.

OpenAI’s gpt-oss-20b and gpt-oss-120b are another common choice. OpenAI says the 20b model runs within 16 GB of memory and the 120b model fits a single 80 GB GPU; both handle up to 128K of context and function calling, under the Apache 2.0 license. With macOS and a 64K context on top, we would plan on 24 GB for the 20b model and 96 GB or more for the 120b one. That is our estimate, not a measurement.

What OpenClaw needs from a local model

  • Tool calls. OpenClaw offers an Ollama model automatically only when it is loaded, reports tool support and has at least 16K of context; an LM Studio model needs tool training and the same 16K. Its managed llama.cpp setup checks a real tool call before it changes the default model.
  • Context. The curated llama.cpp recipes use a 64K context, which is why the table sizes every model at 64K. A larger window needs more memory for the cache.
  • The largest build you can run. The documentation advises the largest available build of a model and warns against small or heavily quantized variants. It also notes that a model which answers a short prompt can still fail an agent turn, so test real tasks before you make it the default.

Connect Ollama

  1. Install Ollama, start it with ollama serve and pull a model that fits your memory. On a Mac you rent from us you are the administrator, so the install is the same as on your own Mac.
  2. Give the model the same 64K window on both sides: num_ctx sets the context Ollama allocates, and contextTokens caps what OpenClaw sends. keep_alive keeps the model loaded between turns, so the agent does not wait for a reload.
  3. Set OLLAMA_API_KEY="ollama-local", check the model with openclaw models list --provider ollama and make it the default with openclaw models set ollama/your-model.
{
  models: {
    providers: {
      ollama: {
        baseUrl: "http://127.0.0.1:11434",
        apiKey: "ollama-local",
        api: "ollama",
        timeoutSeconds: 300,
        models: [
          {
            id: "your-model",
            name: "your-model",
            contextTokens: 65536,
            params: { num_ctx: 65536, keep_alive: "15m" },
          },
        ],
      },
    },
  },
  agents: { defaults: { model: { primary: "ollama/your-model" } } },
}

Connect LM Studio

Start the server with lms server start --port 1234, or turn on JIT loading in the desktop app, and load the model with a 64K context: OpenClaw uses the context of the loaded instance, not the larger maximum the model advertises. Check that http://127.0.0.1:1234/v1/models lists the model, then make it the default with openclaw models set lmstudio/author/model; LM Studio names models by author and model name. OpenClaw talks to LM Studio through the OpenAI Responses API (api: "openai-responses"). A large model takes time to load: OpenClaw waits two minutes by default, and the provider’s timeoutSeconds raises that.

On a remote Mac

The simplest layout keeps OpenClaw and the model on the same Mac, so the model server only listens on localhost. If OpenClaw runs on another machine, reach the model through an SSH tunnel instead of opening a port, for example ssh -fN -L 11434:localhost:11434 user@your-mac for Ollama or port 1234 for LM Studio, and keep the base URL at 127.0.0.1.

If you would rather not buy a Mac for the model, we rent dedicated M4 Mac minis with administrator access: 24 GB from $113/mo and 32 GB from $130/mo billed annually, or $143 and $171 billed monthly. You install Ollama or LM Studio yourself and connect over SSH.

Which Mac mini to buy for OpenClaw is in Best Mac mini for OpenClaw, and what the whole agent costs a month, tokens included, in OpenClaw cost per month.

Rent a 24 GB Mac mini