Overview
OpenClaw supports local LLM inference vianode-llama-cpp and Ollama integration. The prebuilt native binary (@node-llama-cpp/linux-arm64) is included with the installation and loads successfully under the glibc environment — local LLM is technically functional on the phone.
However, there are practical constraints to consider before running local models.
☁️ Cloud Models Available: Ollama now supports cloud-hosted models! Use
ollama launch openclaw --model kimi-k2.5:cloud for superior performance without local resource usage. See Cloud Models section below.⚠️ Practical Constraints
For experimentation, small models like TinyLlama 1.1B (Q4, ~670MB) can run on the phone. For production use, cloud LLM providers are recommended.
☁️ Ollama Cloud Models
Best of both worlds: Run models in the cloud with Ollama’s cloud integration — no local RAM/storage constraints!Quick Start
Recommended Cloud Models
Commands
Why Cloud Models?
💡 Recommendation: Use cloud models for production workloads, local models for testing/experimentation.
🚀 Quick Start
Option 1: node-llama-cpp (Recommended for Android)
Why--ignore-scripts? The installer uses npm install -g openclaw@latest --ignore-scripts because node-llama-cpp’s postinstall script attempts to compile llama.cpp from source via cmake — a process that takes 30+ minutes on a phone and fails due to toolchain incompatibilities. The prebuilt binaries work without this compilation step, so the postinstall is safely skipped.
Install:
Option 2: Ollama (Full Server)
Ollama provides a complete local LLM server with model management. Install Ollama:🔗 Official Ollama OpenClaw Integration
OpenClaw officially integrates with Ollama to provide a seamless local AI assistant experience.Why it’s powerful
- Native API Integration: OpenClaw connects directly to Ollama’s native
/api/chatendpoint. This ensures full support for streaming and tool calling.⚠️ Important: Do not use the
/v1OpenAI-compatible URL with OpenClaw. It breaks tool calling and causes models to output raw JSON! - Automatic Model Discovery: OpenClaw queries
/api/tagsand/api/showto automatically find your downloaded Ollama models, detect if they support tool calling, and configure their context windows appropriately.
Setup Methods
Method A: Ollama Launcher (Recommended) The easiest way to connect OpenClaw to Ollama is using the official launcher command:http://127.0.0.1:11434).
Method C: Explicit Configuration
You can force OpenClaw to use Ollama by exporting the API key environment variable before starting the gateway:
📊 Model Recommendations
🔧 Configuration
node-llama-cpp Context Length
Reduce context length to save RAM:Ollama Configuration
Set environment variables before starting:🌐 Cloud vs Local Comparison
🛠️ Troubleshooting
”Cannot find module ‘node-llama-cpp’”
Make sure you installed with--ignore-scripts:
“Out of memory” error
Close other apps and reduce context size:Ollama killed by Android
Disable Phantom Process Killer:Model download fails
Use a different mirror or download on PC and transfer:📚 Resources
💡 Best Practices
- Start small: Begin with TinyLlama 1.1B to test your device
- Monitor RAM: Use
htopor Termux’stopto watch memory usage - Use tmux: Run long inference sessions in tmux to prevent disconnection
- Cool your phone: CPU inference generates heat; consider active cooling
- Cloud for production: Use local LLM for testing, cloud for real work
Pro Tip: Use OCA’s hybrid mode — route simple queries to local LLM, complex tasks to cloud APIs. Best of both worlds!