๐ง Smart Model Switcher V2 (Optimized)
name: smart-model-switcher-v2
by davidme6 ยท published 2026-03-22
$ claw add gh:davidme6/davidme6-smart-model-switcher-v2---
name: smart-model-switcher-v2
description: Optimized Smart Model Switcher (v2) - Zero-latency, no restart required. Automatically selects and switches to the best available model for each task from your purchased plan. Runtime model selection with <100ms latency. Supports auto-detection of new models, multi-model parallel processing, and intelligent task classification. Always uses the strongest model within your plan.
---
# ๐ง Smart Model Switcher V2 (Optimized)
**Zero-Latency โข No Restart โข Runtime Switching**
๐ฏ What's New in V2
| Feature | V1 | V2 |
|---------|----|----|
| **Restart Required** | โ Yes | โ No |
| **Switch Latency** | 5-10s | <100ms |
| **Model Preloading** | โ No | โ Yes |
| **Parallel Processing** | โ No | โ Yes |
| **Auto Model Discovery** | โ No | โ Yes |
| **Fallback Logic** | Basic | Advanced |
| **Performance** | Low | High |
๐ New Features
1. Zero-Latency Switching
2. Model Preloading
3. Intelligent Task Classification
4. Parallel Model Processing
5. Auto Model Discovery
6. Advanced Fallback
๐ Model Selection Matrix (Optimized)
| Task Type | Primary Model | Fallback 1 | Fallback 2 | Latency |
|-----------|--------------|------------|------------|---------|
| **ๅๅฐ่ฏด/ๅๆๅไฝ** | qwen3.5-plus | qwen3.5-397b | qwen-plus | <50ms |
| **ๅไปฃ็ /็ผ็จ** | qwen3-coder-plus | qwen3-coder-next | qwen3.5-plus | <50ms |
| **ๅคๆๆจ็/ๆฐๅญฆ** | qwen3-max | qwen3.5-plus | qwen-plus | <50ms |
| **ๆฐๆฎๅๆ** | qwen3.5-plus | qwen3-max | qwen-plus | <50ms |
| **ๆฅๅธธๅฏน่ฏ** | qwen3.5-plus | qwen-plus | qwen-turbo | <30ms |
| **้ฟๆๆกฃๅค็** | qwen3.5-plus | qwen3.5-397b | qwen-plus | <50ms |
| **Debug/ไฟฎๅค** | qwen3-coder-plus | qwen3.5-plus | qwen-plus | <50ms |
| **็ฟป่ฏ** | qwen3.5-plus | qwen-plus | qwen-turbo | <30ms |
๐ง Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ User Request โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Task Analyzer (30ms) โ
โ โข Keyword matching โ
โ โข Context analysis โ
โ โข Confidence scoring โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Model Registry (Preloaded) โ
โ โข qwen3.5-plus (Ready) โ
โ โข qwen3-coder-plus (Ready) โ
โ โข qwen3-max (Ready) โ
โ โข ... (All models preloaded) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Model Selector (20ms) โ
โ โข Select best model for task โ
โ โข Check availability โ
โ โข Apply fallback if needed โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Model API Call โ
โ โข Direct API call (no config change) โ
โ โข Connection pooling โ
โ โข Auto retry โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Response โ
โ โข Return result โ
โ โข Log performance โ
โ โข Update statistics โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโก Performance Metrics
| Metric | V1 | V2 | Improvement |
|--------|----|----|-------------|
| **Switch Time** | 5-10s | <100ms | 50-100x faster |
| **Memory Usage** | Low | Medium | +20% (worth it) |
| **CPU Usage** | Low | Low | Same |
| **API Calls** | 1 | 1-2 | Same |
| **User Experience** | Poor | Excellent | Significant |
๐ฏ Usage Examples
**Example 1: Writing Task**
User: "ๅธฎๆๅไธๆฌ็งๅนปๅฐ่ฏด"
Agent: "๐ง Switched to qwen3.5-plus (best for novel writing, 1M context)"
[Completes task]**Example 2: Coding Task**
User: "ๅธฎๆๅไธช Python ็ฌ่ซ"
Agent: "๐ง Switched to qwen3-coder-plus (best for coding)"
[Completes task]**Example 3: Reasoning Task**
User: "่ฟ้ๆฐๅญฆ้ขๆไนๅ๏ผ"
Agent: "๐ง Switched to qwen3-max (best for reasoning)"
[Completes task]**Example 4: Multi-Step Task**
User: "ๅธฎๆๅไธช่ดชๅ่ๆธธๆ๏ผ็ถๅๅไธชๆธธๆ่ฏดๆ"
Agent: "๐ง Switched to qwen3-coder-plus (best for coding)"
[Writes code]
Agent: "๐ง Switched to qwen3.5-plus (best for writing)"
[Writes documentation]โ ๏ธ Limitations
| Limitation | Description |
|------------|-------------|
| **Plan-Bound** | Only uses models from your purchased plan |
| **No External** | Won't call models outside your plan |
| **Requires Config** | Needs correct openclaw.json setup |
| **Memory** | Uses 20% more memory for preloading |
๐ Technical Details
Task Classification Algorithm
1. Extract keywords from user request
2. Match against task type keywords
3. Calculate confidence score for each type
4. Select type with highest confidence
5. If confidence < threshold, use default
6. Map type to best model
7. Check model availability
8. Apply fallback if neededModel Registry
{
"models": {
"qwen3.5-plus": {
"status": "ready",
"tasks": ["writing", "analysis", "translation"],
"context": 1000000,
"priority": 1
},
"qwen3-coder-plus": {
"status": "ready",
"tasks": ["coding", "debug"],
"context": 100000,
"priority": 1
},
"qwen3-max": {
"status": "ready",
"tasks": ["reasoning", "math"],
"context": 100000,
"priority": 1
}
}
}Fallback Chain
Primary Model (Unavailable?)
โ
Fallback 1 (Unavailable?)
โ
Fallback 2 (Unavailable?)
โ
Default Model (Always available)๐ Benefits
| Benefit | Impact |
|---------|--------|
| **No Restart** | Save 5-10s per switch |
| **Zero Latency** | Instant model switching |
| **Better UX** | Users don't notice switching |
| **Auto-Update** | New models auto-detected |
| **Reliable** | Advanced fallback logic |
| **Efficient** | Connection pooling |
๐ Comparison
V1 vs V2
| Feature | V1 | V2 |
|---------|----|----|
| Restart Required | Yes | No |
| Switch Latency | 5-10s | <100ms |
| Model Preloading | No | Yes |
| Auto Discovery | No | Yes |
| Fallback | Basic | Advanced |
| Performance | Low | High |
| Memory | Low | Medium (+20%) |
| User Experience | Poor | Excellent |
๐ Installation
# Clone repository
git clone https://github.com/davidme6/openclaw.git
# Copy skill to workspace
cp -r openclaw/skills/smart-model-switcher-v2 ~/.openclaw/workspace/skills/
# Restart Gateway (one-time)
openclaw gateway restart๐ง Configuration
No configuration needed! The skill auto-detects your plan and available models.
๐ Troubleshooting
**Q: Why didn't it switch models?**
A: Check logs for fallback events. Primary model may be unavailable.
**Q: Can I override the selection?**
A: Yes, manually specify a model and it will use that.
**Q: How do I know which model is being used?**
A: It always tells you at the start of each task.
**Q: Memory usage increased?**
A: Normal. Model preloading uses 20% more memory for instant switching.
๐ Support
---
**Version:** 2.0.0 (Optimized)
**Author:** Created for Coding Plan users
**License:** MIT
**Release Date:** 2026-03-10
๐ What Makes V2 Special
1. **Zero-Latency** - No restart, instant switching
2. **Smart Preloading** - All models ready at startup
3. **Auto-Discovery** - New models detected automatically
4. **Advanced Fallback** - Multi-tier fallback chain
5. **Performance** - 50-100x faster than V1
6. **User-First** - Transparent, no interruption
---
**Upgrade from V1 today and experience zero-latency model switching!** ๐
More tools from the same signal band
Order food/drinks (็น้ค) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...