Skip to content

Commit 32aa00c

Browse files
author
1bcMax
committed
feat: enable smart routing by default
- reinstall.sh now auto-configures blockrun/auto as default model - Simplified Quick Start - one curl command does everything - Users get smart routing out of the box
1 parent 7d85674 commit 32aa00c

2 files changed

Lines changed: 36 additions & 23 deletions

File tree

README.md

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,40 +43,23 @@ One wallet, 30+ models, zero API keys.
4343
## Quick Start (2 mins)
4444

4545
```bash
46-
# 1. Install — auto-generates a wallet on Base
47-
openclaw plugins install @blockrun/clawrouter
46+
# 1. Install with smart routing enabled by default
47+
curl -fsSL https://raw.githubusercontent.com/BlockRunAI/ClawRouter/main/scripts/reinstall.sh | bash
4848

4949
# 2. Fund your wallet with USDC on Base (address printed on install)
5050
# $5 is enough for thousands of requests
5151

52-
# 3. Restart OpenClaw gateway to load the plugin
52+
# 3. Restart OpenClaw gateway
5353
openclaw gateway restart
5454
```
5555

56-
Done! Use any model with `blockrun/` prefix (e.g., `blockrun/openai/gpt-4o`).
57-
58-
### Optional: Enable Smart Routing
59-
60-
Automatically pick the cheapest model for each query. Add to `~/.openclaw/openclaw.json`:
61-
62-
```json
63-
{
64-
"agents": {
65-
"defaults": {
66-
"model": {
67-
"primary": "blockrun/auto"
68-
}
69-
}
70-
}
71-
}
72-
```
73-
74-
Or use `/model blockrun/auto` in any conversation to switch on the fly.
56+
Done! Smart routing (`blockrun/auto`) is now your default model.
7557

7658
### Tips
7759

78-
- **Already have a funded wallet?** `export BLOCKRUN_WALLET_KEY=0x...`
60+
- **Use `/model blockrun/auto`** in any conversation to switch on the fly
7961
- **Want a specific model?** Use `blockrun/openai/gpt-4o` or `blockrun/anthropic/claude-sonnet-4`
62+
- **Already have a funded wallet?** `export BLOCKRUN_WALLET_KEY=0x...`
8063

8164
---
8265

scripts/reinstall.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,35 @@ if (!store.profiles[profileKey]) {
7171
}
7272
"
7373

74+
# 6. Enable smart routing by default
75+
echo "→ Enabling smart routing..."
76+
node -e "
77+
const os = require('os');
78+
const fs = require('fs');
79+
const path = require('path');
80+
const configPath = path.join(os.homedir(), '.openclaw', 'openclaw.json');
81+
82+
if (fs.existsSync(configPath)) {
83+
try {
84+
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
85+
86+
// Ensure agents.defaults.model.primary exists
87+
if (!config.agents) config.agents = {};
88+
if (!config.agents.defaults) config.agents.defaults = {};
89+
if (!config.agents.defaults.model) config.agents.defaults.model = {};
90+
91+
// Set smart routing as default
92+
config.agents.defaults.model.primary = 'blockrun/auto';
93+
94+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
95+
console.log(' Smart routing enabled: blockrun/auto');
96+
} catch (e) {
97+
console.log(' Could not update config:', e.message);
98+
}
99+
} else {
100+
console.log(' No openclaw.json found, skipping');
101+
}
102+
"
103+
74104
echo ""
75105
echo "✓ Done! Run: openclaw gateway restart"

0 commit comments

Comments
 (0)