Executable programs and extensions

Connect OpenClaw to a Local Model with Ollama or Managed llama.cpp

Connect a local model to OpenClaw and verify tool execution

OpenClaw is an AI agent1 that reads files and runs tools based on instructions you give in a conversation. When you connect a model on your computer, the model interprets the instructions and OpenClaw carries out the required tasks.

For example, put meeting notes in a test folder and ask for a summary. This requires an OpenClaw installation, a connected model, and a file-reading tool. We will walk through connecting an existing Ollama setup and choosing managed llama.cpp during onboarding.

Requirements and key details
  • The OpenClaw Gateway coordinates requests; Ollama or llama.cpp runs inference.
  • The baseline Node versions are 24.16 or later, or 26.1 or later; check current supported versions in the official guide before installation.
  • A successful short chat does not verify an agent tool call.

Prepare the Gateway and model server separately

OpenClaw Gateway2 coordinates conversation channels and tool execution. A model server such as Ollama or llama.cpp loads the model to interpret instructions and generate answers. Preparing the Gateway and model server in sequence also makes it clear which status and logs to check if something fails.

The official installer below can be used for macOS, Linux, and WSL2. On Windows, use the official Windows Hub or PowerShell instructions. This installs OpenClaw; connecting a local model is a separate step.

Installer for macOS, Linux, and WSL2
curl -fsSL https://openclaw.ai/install.sh | bash
Before running a script fetched from the network, verify the domain and installer details in the official documentation.
A laptop connected to a local server with separate paths to several work panels
The Gateway coordinates channels and tools; the model server handles inference.

Check the Node version and installer details first

The official installation guide supports Node.js 24.16 or later, or 26.1 or later, and recommends Node 26. Even if Node is already installed, check its version and SQLite runtime3 requirements. Supported versions can change, so verify them in the official documentation before installing.

The curl installer runs a script fetched from the internet in a shell. Verify the official domain and review what the installer does; on managed or sensitive systems, inspect the script or choose another supported installation method.

Connect an Ollama model you already use

Choose Ollama when you want to manage the server and model yourself. Install it from the official source, start it, and download a model. The ollama pull gemma4 command in OpenClaw's guide is an example, not a standing model recommendation; check the exact name, tag, and tool-calling support in Ollama's official catalog.

In OpenClaw setup, select Ollama authentication and enter the local or LAN endpoint and model ID. A local endpoint without a real secret can use the ollama-local placeholder, but a public remote host or Ollama Cloud needs valid credentials. Do not expose the model server to the public internet for remote access; follow the official networking and authentication guidance.

List Ollama models visible to OpenClaw
openclaw models list --provider ollama
Shows models registered under the Ollama provider and visible to OpenClaw.

Managed llama.cpp guides model and server setup

If you do not want to configure each model and runtime option yourself, consider OpenClaw's managed llama.cpp path. The official local-model guide says to install the llama.cpp plugin and choose Managed local server in openclaw onboard. The setup shows the Gateway host, model, download size, and backend, then verifies an actual tool call4 before changing the default model.

Memory needs vary with weights, context size, runtime, and other host workloads. The lowest host-memory floor of 8 GiB among the managed catalog's 64K-context recipes applies to that recipe; it is not a universal OpenClaw minimum or a performance guarantee. Check the current hardware assessment in setup along with memory used by other applications.

A desk with a small Gateway device connected by cable to a separate local model server
Installing the Gateway and preparing the model server are separate steps.

Test a real tool after direct chat and Gateway responses

The model's direct response, a response routed through the Gateway, and an agent tool execution test different stages. Request inference5 directly first, then send the same prompt6 through the Gateway. Replace <provider/model> with an ID shown by openclaw models list and check the JSON output for pong.

After both responses work, make an actual tool call that reads a file from a read-only test folder. Confirm the tool name and result appear in the run log to verify the agent workflow.

Replace PROVIDER/MODEL in both examples with the actual ID from openclaw models list. Keep the quotes and replace the text inside them. Run local inference first, then test the Gateway path with the same ID after receiving a response.

Request inference directly from the local model
openclaw infer model run --local --model "PROVIDER/MODEL" --prompt "Reply with exactly: pong" --json
Check that the model responds before involving the Gateway.
Request inference through the Gateway
openclaw infer model run --gateway --model "PROVIDER/MODEL" --prompt "Reply with exactly: pong" --json
Verify an actual response routed through the Gateway, not just a model listing.

Diagnose the stage where the workflow stops

If the model does not load, check its ID, server status, completed download, and available memory. If chat works but tools do not, inspect the tool-calling format, chat template, OpenAI-compatible endpoint, and the full prompt size sent by OpenClaw. An agent request with conversation history and tool descriptions can use more memory or exceed the context limit compared with a short chat.

Do not set the model as default until an actual tool call has been verified. A local model may not include the safety filters of a hosted provider. Even when documents are read locally, messaging or search requests may go to external services, so check data flows and permissions.

A person checking permission scopes at three doors representing files, terminal, and network access
Verify both that tool calls work and that only necessary permissions are enabled.

Start with a read-only task and add only needed permissions

Choose Ollama if you already manage its model and tag. If you want guided installation and hardware-based model selection, consider the llama.cpp plugin and Managed local server in openclaw onboard. Either way, start by reading one note from a test folder and drafting a summary.

Check the tool and arguments in the run log, then compare the result with the source. If there is no record of reading the file, the model may have guessed. Even after the test passes, add messaging, automation, or file-writing permissions only when the task needs them.

Terminology notes

  1. AI agent — A program setup that takes a goal, selects tools, checks their results, and continues with the next task. Available actions are set by connected tools and granted permissions.

    Back to the text
  2. Gateway — A program that receives requests across clients, channels, models, or tools and routes them to the appropriate path.

    Back to the text
  3. Runtime — The software environment that provides facilities needed while a program runs. In local AI, it can also refer to a model execution engine.

    Back to the text
  4. Tool call — A structured request from a model for an external function such as reading a file, searching, or running a command. The agent runtime and its permission settings decide whether the request is actually executed.

    Back to the text
  5. Inference — The process of using a trained model to compute an output for an input. Here, local inference means running the model on the user’s device.

    Back to the text
  6. Prompt — The input text sent to a model. For generative models it describes the desired result and strongly shapes the output.

    Back to the text

Frequently asked questions

What should you check first in this article?
OpenClaw is an AI agent that reads files and runs tools based on instructions you give in a conversation. When you connect a model on your computer, the model interprets the instructions and OpenClaw carries out the required tasks.
How much memory does it need?
Memory needs vary with weights, context size, runtime, and other host workloads. The lowest host-memory floor of 8 GiB among the managed catalog's 64K-context recipes applies to that recipe; it is not a universal OpenClaw minimum or a performance guarantee. Check the current hardware assessment in setup along with memory used by other applications.