The /swarm command is now integrated into AIWB! You can test it directly from the interactive chat.
Pull the latest changes:
cd ~/AIworkbench
git fetch origin
git checkout claude/test-swarm-feature-fck5n
git pullStart AIWB and use the /swarm command:
./aiwbOnce in the chat interface, try these commands:
/swarm
Simply typing /swarm opens an interactive menu where you can:
- Toggle swarm on/off - Enable or disable swarm mode
- Select strategy - Choose auto, mapreduce, or hierarchical
- Configure worker model - Select the model for parallel processing
- Configure aggregator model - Select the model for final synthesis
- Set worker count - Choose how many parallel workers (1-20)
The menu looks like this:
π Swarm Mode (β DISABLED)
1) Strategy: auto
2) Worker model: gemini/2.5-flash
3) Aggregator model: claude/sonnet-4-5-20250929
4) Worker count: 5
5) Enable swarm
6) Back
You can also use direct commands:
Check Status:
/swarm status
Enable/Disable:
/swarm on
/swarm off
Toggle:
/swarm toggle
/help
Shows all available commands, including /swarm.
/swarm
You'll see an interactive menu:
π Swarm Mode (β DISABLED)
1) Strategy: auto
2) Worker model: gemini/2.5-flash
3) Aggregator model: claude/sonnet-4-5-20250929
4) Worker count: 5
5) Enable swarm
6) Back
?
Enable Swarm:
- Select option "5) Enable swarm"
- You'll see:
β Swarm mode ENABLED π - The menu updates to show
(β ENABLED)and option 5 changes to "Disable swarm"
Configure Strategy:
- Select option "1) Strategy: auto"
- Choose from:
auto - Let AIWB choose (Recommended)mapreduce - Parallel processinghierarchical - Battery-friendly (mobile)
Configure Worker Model:
- Select option "2) Worker model"
- Choose from fast/cheap options like:
gemini/2.5-flash ($0.10/1M) βgemini/2.0-flash-lite ($0.05/1M) ββgroq/llama-3.3-70b ($0.59/1M)claude/3.5-haiku ($1.00/1M)
Configure Aggregator Model:
- Select option "3) Aggregator model"
- Choose from smart models for synthesis:
claude/sonnet-4.5 ($3.00/1M) ββ NEWclaude/3.5-sonnet ($3.00/1M) ββgemini/2.5-flash ($0.10/1M)
Set Worker Count:
- Select option "4) Worker count"
- Enter a number between 1-20
- More workers = faster but more costly
Check Status:
/swarm status
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Swarm Mode Status β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Enabled: false
Strategy: auto
Workers: 5
Worker Provider: gemini
Worker Model: 2.5-flash
Aggregator Provider: claude
Aggregator Model: sonnet-4-5-20250929
Display: OFF
Quick Toggle:
/swarm toggle
β Swarm mode ENABLED π
Once swarm mode is enabled, test with different query sizes:
Write a hello world function in Python
Expected: Processes normally without swarm (too small).
/contextload
Analyze the entire codebase in lib/ and provide:
1. Architecture overview
2. Component relationships
3. Potential improvements
4. Code quality assessment
5. Testing coverage gaps
Expected: If context > 10K tokens, swarm mode activates automatically (when enabled).
Run the comprehensive test suite:
# Unit tests (19 tests)
bats tests/test_swarm.bats
# Integration tests (15 tests)
./scripts/test_swarm_integration.sh
# All tests (80+ tests)
bats tests/*.batsEdit your swarm configuration:
# View current config
cat ~/.aiwb/config.json | grep -A 10 "swarm"
# Edit configuration
nano ~/.aiwb/config.jsonExample configuration:
{
"swarm": {
"enabled": "true",
"strategy": "auto",
"worker_provider": "gemini",
"worker_model": "2.5-flash",
"aggregator_provider": "claude",
"aggregator_model": "sonnet-4-5-20250929",
"workers": "5"
}
}When strategy: "auto":
- Small contexts (< 10K tokens): Processes normally
- Large contexts (> 10K tokens): Activates map-reduce
- mapreduce: Explicitly use map-reduce strategy
- hierarchical: Not yet implemented (returns error)
Before running expensive queries, check the cost:
/estimateThis will show estimated cost and token usage. If swarm mode would activate, it includes the cost of multiple workers + aggregator.
If you see this error:
- Make sure you pulled the latest changes
- Restart AIWB
- Check that you're on the correct branch
git branch
# Should show: * claude/test-swarm-feature-fck5n-
Check if it's enabled:
/swarm status -
Verify your context is large enough (> 10K tokens):
/status -
Check configuration:
cat ~/.aiwb/config.json | grep -A 8 "swarm"
If swarm settings don't persist:
-
Check file permissions:
ls -la ~/.aiwb/config.json -
Verify JSON syntax:
jq . ~/.aiwb/config.json
All tests should pass:
Unit Tests: 19/19 β
Integration: 15/15 β
Total Suite: 80/80 β
If any tests fail, check:
- BATS is installed:
which bats - You're in project root:
pwdβ/home/user/AIworkbench - Scripts are executable:
chmod +x scripts/test_swarm_integration.sh
-
Enable swarm with multiple workers:
/swarm on -
Load large context:
/contextload -
Run analysis task:
Provide comprehensive analysis of all files in the context -
Monitor (in another terminal):
# Watch for parallel API calls tail -f ~/.aiwb/workspace/logs/api_calls.log
Edit config to test different worker/aggregator combos:
Fast workers + Smart aggregator:
{
"worker_provider": "gemini",
"worker_model": "2.5-flash",
"aggregator_provider": "claude",
"aggregator_model": "sonnet-4-5-20250929"
}All Claude:
{
"worker_provider": "claude",
"worker_model": "3-5-haiku-20241022",
"aggregator_provider": "claude",
"aggregator_model": "sonnet-4-5-20250929"
}Track swarm performance:
# View usage logs
cat ~/.aiwb/workspace/logs/usage.jsonl | tail -5
# Calculate total costs
./aiwb
/costsAfter testing:
- β
Verify
/swarmcommand works - β Run all test suites
- β Test with real workloads
- β Monitor costs and performance
- β Report any issues found
If you find bugs or have suggestions:
- Check existing tests for similar cases
- Run the test suite to confirm the issue
- Create a new test case demonstrating the problem
- Submit a pull request or issue with:
- Steps to reproduce
- Expected vs actual behavior
- Test case (if applicable)
- Implementation Details:
docs/SWARM_MODE_IMPLEMENTATION.md - User Guide:
docs/SWARM_MODE_USER_GUIDE.md - Test Report:
docs/SWARM_TEST_REPORT.md - Test Suite:
tests/test_swarm.bats - Integration Tests:
scripts/test_swarm_integration.sh
Happy testing! π
Note: The swarm feature is production-ready for the map-reduce strategy. Hierarchical and RAG strategies are planned for future releases.