export LocalAISetup
/** Run OpenClaw with 100% local AI - Zero API costs, Complete Privacy */

🏠## Why Run AI Locally?
Running AI models locally represents the ultimate form of sovereign intelligence. Instead of sending your data to cloud servers, everything stays on your own hardware. This approach offers significant advantages for privacy-conscious users and developers who want complete control over their AI assistant.
With the rise of powerful open-source models like Llama 3, Mistral, and Gemma, running local AI has never been more accessible. Combined with OpenClaw's flexible architecture, you can build a personal AI assistant that rivals cloud-based solutions while maintaining complete privacy.
## 📦 Prerequisites
Before setting up local AI, ensure your system meets the minimum requirements. Local AI inference is computationally intensive, and having adequate hardware will significantly impact performance. The good news is that even a Mac Mini M2 with 16GB RAM can run impressive models.
// 💡 Apple Silicon Macs are ideal for local AI - unified memory allows larger models
## 🦙 Installing Ollama
Ollama is a powerful tool that makes running local LLMs incredibly simple. It handles model management, optimization, and provides a clean API that OpenClaw can connect to. The installation process takes just a few minutes and works seamlessly across all major platforms.
macOS / Linux Installation
Verify Installation
Once installed, Ollama runs as a background service. It automatically manages model loading and unloading based on available memory, making it perfect for systems with limited resources. The service starts automatically on boot, so your AI assistant is always ready.
## 🎯 Choosing Your Model

Choosing the right model depends on your hardware and use case. Larger models offer better reasoning and knowledge, but require more memory and are slower. For most personal assistant tasks, a 7B or 13B parameter model provides an excellent balance of quality and speed.
| Model | Size | RAM | Best For |
|---|---|---|---|
| llama3.2:3b | 2GB | 8GB | Quick tasks, low-resource systems |
| llama3.3:8b | 4.7GB | 16GB | General assistant, coding |
| mistral:7b | 4.1GB | 16GB | Fast responses, multilingual |
| codellama:13b | 7.4GB | 24GB | Programming, code review |
| llama3.3:70b | 40GB | 64GB+ | Maximum capability |
Download Your Model
## 🔗 Integrating with OpenClaw

OpenClaw provides native integration with Ollama through the LiteLLM provider system. This allows you to seamlessly switch between local and cloud models, or even use them together. The configuration is straightforward and can be done through the onboarding wizard or manually.
Option 1: Interactive Setup
Option 2: Manual Configuration
Test the Integration
## ✨ One-Prompt Setup with Claude Code

For users who prefer a guided approach, Claude Code (or similar AI coding assistants) can automate the entire setup process. Simply describe what you want, and the AI will handle installation, configuration, and testing. This method is ideal for beginners or those who want a quick setup.
The Magic Prompt
"Help me set up OpenClaw with local Ollama models. I want to connect it to WhatsApp and iMessage. Use Llama 3.3 as the default model. Configure security settings and set up automatic startup. Guide me step by step."
Claude Code will walk you through each step, automatically generating configuration files, testing the setup, and troubleshooting any issues. This approach combines the best of both worlds: the power of local AI with the convenience of guided setup.
## 💬 Configuring Messaging Channels
Once your local AI is running, connect it to your favorite messaging platforms. OpenClaw supports WhatsApp, Telegram, Discord, Slack, Signal, and iMessage. Each channel can be configured with different models or settings for specialized use cases.
WhatsApp Setup
Telegram Setup
// 💡 Pro tip: Use different models for different channels. Code tasks can use CodeLlama while general chat uses Llama 3.3 for faster responses.
## ⚡ Performance Optimization
Getting the best performance from local AI requires some tuning. These optimizations can significantly reduce response latency and memory usage, especially on systems with limited resources.
ollama pull llama3.3:8b-q4_K_Mollama infoOLLAMA_KEEP_ALIVE=24h## 🔧 Troubleshooting
ollama serveor check launchctl list | grep ollama ollama pull llama3.2:3bOLLAMA_KEEP_ALIVE=24h to keep models warm.## 🔒 Security Best Practices
⚠️ Security Warning
A phishing site openclawd.ai (with a 'd') has been identified. Only use official sources: openclaw.ai or github.com/openclaw/openclaw
## 🎉 Congratulations!
You now have a fully local, private AI assistant running on your own hardware! Explore these tutorials to extend your setup:
Was this tutorial helpful?
// Join our community on Discord for more help