Skip to content

OpenClaw and Ollama: error, unknown command "launch" for "ollama"

This error is not a bug and not a version problem. The command does not exist, because the relationship runs the other way around: OpenClaw calls Ollama as a model provider, Ollama never launches OpenClaw.

The errors people hit here come in two forms:

error: unknown command "launch" for "ollama"
ollama launch openclaw error: unknown integration: openclaw

Why the command does not exist

Both errors come from Ollama, not from OpenClaw, and both are Ollama correctly telling you that you asked for something it does not do. Ollama has no launch subcommand and no plugin system that OpenClaw could register with as an "integration".

The mental model is backwards. Ollama serves models. OpenClaw is the agent gateway that calls those models. So OpenClaw talks to Ollama, and Ollama never needs to know OpenClaw exists.

What Ollama actually accepts

ollama serve      # start the API server
ollama pull       # download a model
ollama run        # chat with a model directly
ollama list       # list installed models
ollama ps         # list running models
ollama stop       # stop a running model
ollama rm         # remove a model

If you were following a guide that told you to run ollama launch, the guide is wrong.

The correct sequence

Four steps, in this order.

# 1. start Ollama so its API is listening
ollama serve

# 2. pull whichever model you want the agent to use
ollama pull llama3.1

# 3. set the key variable, the value is not checked
export OLLAMA_API_KEY=local

# 4. start OpenClaw
openclaw

OpenClaw auto-detects Ollama at 127.0.0.1:11434, so on a standard setup there is nothing further to configure. It uses Ollama's native /api/chat endpoint rather than an OpenAI-compatible shim.

The API key trap

This catches nearly everyone. Ollama running locally needs no authentication, so it feels wrong to set a key at all. OpenClaw still requires the variable to be present before it will treat the provider as configured, and it never validates the contents. Any non-empty string is fine. Unset is not.

Pointing at a non-default host or port

If Ollama runs on another machine or a different port, name it explicitly in ~/.openclaw/openclaw.json rather than relying on auto-detection. If you are unsure where that file lives, see our guide on where the OpenClaw config file is.

The context window default that quietly hurts output quality

When a model does not report its context length, OpenClaw falls back to 8192 tokens. That is safe but often far below what the model can handle, and the symptom is an agent that forgets things sooner than it should. If your model supports more, declare it in the provider configuration instead of accepting the fallback.

Before you commit to local models

Two things are worth knowing up front. Local models skip the safety filtering that hosted providers apply, so keep agent permissions narrow and leave compaction on. And running a local model at production quality needs serious hardware, roughly two Mac Studios or an equivalent GPU rig. Aggressive quantization to fit a smaller machine reduces quality and raises the risk of prompt injection succeeding, so if you are squeezing a large model onto a small box, treat the result as an experiment rather than something to leave unattended.

Frequently asked questions

Is there any version of Ollama with a launch command?
No. Ollama's commands are serve, run, pull, list, ps, stop, rm, cp, show, create and push. There has never been a launch subcommand.
Does OpenClaw need an Ollama API key?
It needs OLLAMA_API_KEY to be set, but the value is not checked. Any non-empty string works. Leaving it unset is what breaks the connection.
Why does my local model give short or confused answers?
If the model does not report its context window, OpenClaw assumes 8192 tokens. Declare the real context length in your provider config.
Fix: unknown command launch for ollama