114 lines
2.6 KiB
Markdown
114 lines
2.6 KiB
Markdown
# Model Switching (Paid vs Free)
|
|
|
|
This setup adds two model profiles:
|
|
|
|
- `paid` -> `openrouter/moonshotai/kimi-k2.5` with OpenRouter fallbacks
|
|
- `free` -> `openrouter/qwen/qwen3-coder:free` with OpenRouter fallback
|
|
|
|
## Recommended workflow (prevents legacy drift)
|
|
|
|
```bash
|
|
cd /Volumes/Data/openclaw-setups/openclaw-setup-max
|
|
bash ./scripts/model_hygiene_workflow.sh paid
|
|
```
|
|
|
|
This command:
|
|
- Applies the selected profile
|
|
- Restages/restarts guard LaunchAgents
|
|
- Prunes legacy models/providers/auth entries not referenced by current config
|
|
|
|
## On-demand switch (immediate)
|
|
|
|
```bash
|
|
cd /Volumes/Data/openclaw-setups/openclaw-setup-max
|
|
bash ./scripts/model_profile_switch.sh free
|
|
```
|
|
|
|
Switch back:
|
|
|
|
```bash
|
|
bash ./scripts/model_profile_switch.sh paid
|
|
```
|
|
|
|
Notes:
|
|
- This updates OpenClaw default + fallbacks.
|
|
- It also pushes `/model ...` to the active `agent:main:main` session by default.
|
|
|
|
## Show status and available profiles
|
|
|
|
```bash
|
|
bash ./scripts/model_profile_switch.sh status
|
|
```
|
|
|
|
## Schedule auto-switching (example: free from 10pm-7am)
|
|
|
|
1. Edit config:
|
|
|
|
```bash
|
|
cd /Volumes/Data/openclaw-setups/openclaw-setup-max
|
|
open config/model-schedule.config.json
|
|
```
|
|
|
|
Ensure:
|
|
|
|
```json
|
|
{
|
|
"enabled": true,
|
|
"dayProfile": "paid",
|
|
"nightProfile": "free",
|
|
"dayStartHour": 7,
|
|
"nightStartHour": 22
|
|
}
|
|
```
|
|
|
|
2. Install schedule launchd job:
|
|
|
|
```bash
|
|
bash ./scripts/install_model_schedule_guard_launchd.sh
|
|
```
|
|
|
|
Note:
|
|
- Installer stages runtime files in `~/Library/Application Support/openclaw-local-model-guard`.
|
|
- If you edit configs/scripts in this repo, rerun installer scripts to sync stage files.
|
|
|
|
3. Verify:
|
|
|
|
```bash
|
|
launchctl print gui/$(id -u)/ai.openclaw.local.model-schedule-guard
|
|
tail -n 50 /tmp/openclaw-model-schedule-guard.log /tmp/openclaw-model-schedule-guard.err.log
|
|
```
|
|
|
|
If schedule is enabled, it will override manual model switches on the next run.
|
|
|
|
## Budget guard (optional but recommended)
|
|
|
|
This warns when high-cost models are left on and can auto-revert.
|
|
|
|
```bash
|
|
bash ./scripts/install_model_budget_guard_launchd.sh
|
|
```
|
|
|
|
Or install both schedule + budget:
|
|
|
|
```bash
|
|
bash ./scripts/install_local_model_guardrails.sh
|
|
```
|
|
|
|
## Disable / remove launchd jobs
|
|
|
|
```bash
|
|
launchctl bootout gui/$(id -u)/ai.openclaw.local.model-schedule-guard 2>/dev/null || true
|
|
launchctl bootout gui/$(id -u)/ai.openclaw.local.model-budget-guard 2>/dev/null || true
|
|
```
|
|
|
|
## After OpenClaw upgrades
|
|
|
|
Use the update workflow so guards/profile state are reapplied automatically:
|
|
|
|
```bash
|
|
cd /Volumes/Data/openclaw-setups/openclaw-setup-max
|
|
bash ./scripts/update_openclaw.sh
|
|
```
|
|
|
|
The update script reinstalls both guard LaunchAgents and kickstarts them immediately, so budget/profile logic is re-evaluated in the same run.
|