Installation Guide
OpenClaw
+ llama.cpp
Install OpenClaw from scratch on Ubuntu and connect it to a local llama.cpp server. No API costs. No cloud. Full inference on your own GPU.
Model Qwen3.5-35B-A3B Q8_0
Prerequisites
Your llama.cpp server must be running and accessible before starting. Verify it is up:
curl http://localhost:8080/v1/models
Installation Steps
OpenClaw requires Node.js v22 or higher. Install via NodeSource.
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
node --version
Install the latest OpenClaw globally via npm.
npm install -g openclaw@latest
openclaw --version
Run the wizard to initialize the workspace and install the gateway daemon. Skip provider selection — we configure llama.cpp manually in the next step.
openclaw onboard --install-daemon
ℹ
Complete the wizard with any provider selection. The config file will be overwritten in the next step with the correct llama.cpp settings.
Replace the contents of ~/.openclaw/openclaw.json with the following config.
{
"models": {
"providers": {
"llamacpp": {
"baseUrl": "http://127.0.0.1:8080/v1",
"apiKey": "dummy",
"api": "openai-completions",
"models": [
{
"id": "Qwen3.5-35B-A3B",
"name": "Qwen3.5-35B-A3B",
"reasoning": true,
"input": ["text"],
"cost": {
"input": 0, "output": 0,
"cacheRead": 0, "cacheWrite": 0
},
"contextWindow": 32768,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "llamacpp/Qwen3.5-35B-A3B"
},
"workspace": "/home/Ubuntu/.openclaw/workspace"
}
},
"gateway": {
"port": 18789,
"mode": "local",
"bind": "loopback",
"auth": {
"mode": "token"
}
}
}
openai-completions
✓ USE THIS
Standard OpenAI format. Correct for llama.cpp, vLLM, LiteLLM, and Ollama. Returns standard chat/completions response.
openai-responses
NOT FOR LLAMA.CPP
Only for specialized APIs like MiniMax that return non-standard response formats. Do not use with llama.cpp.
Start OpenClaw gateway in verbose mode to confirm llama.cpp connection.
openclaw gateway --port 18789 --verbose
Send a message directly to the agent and confirm it is routing through llama.cpp.
openclaw agent --message "What is the derivative of x squared times sin 3x?"
openclaw status
openclaw doctor
✓
If the response arrives and matches the quality you saw from the Python test, llama.cpp routing is working correctly. You can now add any channel (Telegram, Discord, Slack) on top of this config.
To add Telegram or any other channel, extend the config with the channels section. The llama.cpp provider config stays exactly the same.
"channels": {
"telegram": {
"botToken": "YOUR_BOT_TOKEN_HERE",
"dmPolicy": "pairing"
}
}
⚠
After adding a channel, restart the gateway: openclaw gateway restart