|
| 1 | +## Work with OpenClaw 🦞 |
| 2 | + |
| 3 | +### What is OpenClaw 🦞? |
| 4 | + |
| 5 | +[OpenClaw](https://openclaw.ai/) is an open-source personal AI assistant that runs on your own machine. Unlike cloud-based AI services, OpenClaw gives you full control over your data and infrastructure. |
| 6 | + |
| 7 | +Key features include: |
| 8 | + |
| 9 | +- **Multi-platform chat integration**: Interact via WhatsApp, Telegram, Discord, Slack, Signal, or iMessage |
| 10 | +- **Persistent memory**: Remembers your preferences and context across sessions |
| 11 | +- **Full system access**: Read/write files, run shell commands, and control your browser |
| 12 | +- **Extensible skills**: Use community-built skills or create your own |
| 13 | +- **Model flexibility**: Works with Anthropic, OpenAI, or local models |
| 14 | + |
| 15 | +Github repo of OpenClaw: https://github.com/openclaw/openclaw |
| 16 | + |
| 17 | +### Prerequisites |
| 18 | + |
| 19 | +To integrate Parallax with OpenClaw, you need to meet the prerequisites for both projects: |
| 20 | + |
| 21 | +- **Node.js**: >= 22 (required by OpenClaw) |
| 22 | +- **Python**: >=3.11 (required by Parallax) |
| 23 | + |
| 24 | +Before proceeding, we assume you have already deployed Parallax on your AI cluster. For deployment instructions, please refer to: |
| 25 | + |
| 26 | +- [Installation (Parallax)](./install.md) |
| 27 | +- [Quick Start (Parallax)](./quick_start.md) |
| 28 | + |
| 29 | + |
| 30 | +### Start your Parallax Service |
| 31 | + |
| 32 | +**Step 1: Start the Scheduler** |
| 33 | + |
| 34 | +On your scheduler machine, run: |
| 35 | + |
| 36 | +```bash |
| 37 | +parallax run --host 0.0.0.0 |
| 38 | +``` |
| 39 | + |
| 40 | +**Step 2: Select Model** |
| 41 | + |
| 42 | +Open your browser and navigate to `localhost:3001` on the scheduler machine. Select your model and click **Continue**. |
| 43 | + |
| 44 | +**Step 3: Start Edge Nodes** |
| 45 | + |
| 46 | +On your edge nodes, run: |
| 47 | + |
| 48 | +```bash |
| 49 | +parallax join --max-sequence-length 65536 --max-num-tokens-per-batch 65536 --enable-prefix-cache |
| 50 | +``` |
| 51 | + |
| 52 | +**Step 4: Test the Model** |
| 53 | + |
| 54 | +On the scheduler machine, open your browser and navigate to `localhost:3001`. Use the chat interface to test if the model is working properly. |
| 55 | + |
| 56 | +### Onboard OpenClaw |
| 57 | + |
| 58 | +**Step 1: Install OpenClaw** |
| 59 | + |
| 60 | +Use the official install script to install OpenClaw, skipping the onboard wizard: |
| 61 | + |
| 62 | +```bash |
| 63 | +curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard |
| 64 | +``` |
| 65 | + |
| 66 | +**Step 2: Create Configuration File** |
| 67 | + |
| 68 | +Create the configuration file at `~/.openclaw/openclaw.json` with the following content: |
| 69 | + |
| 70 | +```json |
| 71 | +{ |
| 72 | + "agents": { |
| 73 | + "defaults": { |
| 74 | + "model": { |
| 75 | + "primary": "parallax/your-model-name" |
| 76 | + } |
| 77 | + } |
| 78 | + }, |
| 79 | + "models": { |
| 80 | + "providers": { |
| 81 | + "parallax": { |
| 82 | + "baseUrl": "http://localhost:3001/v1", |
| 83 | + "apiKey": "placeholder", |
| 84 | + "api": "openai-completions", |
| 85 | + "models": [ |
| 86 | + { |
| 87 | + "id": "your-model-name", |
| 88 | + "name": "Parallax Model" |
| 89 | + } |
| 90 | + ] |
| 91 | + } |
| 92 | + } |
| 93 | + } |
| 94 | +} |
| 95 | +``` |
| 96 | + |
| 97 | +**Step 3: Run Onboard** |
| 98 | + |
| 99 | +```bash |
| 100 | +openclaw onboard --install-daemon |
| 101 | +``` |
| 102 | + |
| 103 | +During the onboard process: |
| 104 | + |
| 105 | +1. Read and accept the OpenClaw risk disclaimer |
| 106 | +2. When prompted for **onboarding mode**, select `Quick Start` |
| 107 | +3. When prompted for **config handling**, select `Use existing values` |
| 108 | +4. When prompted for **Model/auth provider**, select `Skip for now` |
| 109 | +5. When prompted for **Filter models by provider**, select `All providers` |
| 110 | +6. When prompted for **Default model**, select `Keep current (parallax/your-model-name)` |
| 111 | +7. When prompted for **Select channel**, configure the channel based on your needs, or select `Skip for now` |
| 112 | +8. When prompted for **Select skills**, configure the skills based on your needs, or select `Skip for now` |
| 113 | +9. When prompted for **Enable hooks**, configure the hooks based on your needs, or select `Skip for now` |
| 114 | +10. Wait a moment for Gateway services being installed. |
| 115 | +11. When prompted for **How do you want to hatch your bot**, configure the way you hatch your bot based on your needs. |
| 116 | + |
| 117 | +### Try on Browser |
| 118 | + |
| 119 | +Open your browser and navigate to http://127.0.0.1:18789/. Start sending messages to OpenClaw and enjoy! |
| 120 | + |
| 121 | +### Q&A |
| 122 | + |
| 123 | +**Q: OOM Error** |
| 124 | + |
| 125 | +``` |
| 126 | +libc++abi: terminating due to uncaught exception of type std::runtime_error: [METAL] Command buffer execution failed: Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory) |
| 127 | +``` |
| 128 | + |
| 129 | +**A:** Add the `--kv-cache-memory-fraction` parameter when starting Parallax on edge nodes: |
| 130 | + |
| 131 | +```bash |
| 132 | +parallax join --max-sequence-length 65536 --max-num-tokens-per-batch 65536 --enable-prefix-cache --kv-cache-memory-fraction 0.5 |
| 133 | +``` |
| 134 | + |
| 135 | +If OOM errors persist, try using a smaller value for `--kv-cache-memory-fraction`. |
0 commit comments