Why Switch Providers?
Avoid Rate Limits
Claude Pro has usage limits. When you hit a rate limit, switch to an API provider and continue immediately:Optimize Costs
Switch to cheaper models for simple tasks:Leverage Different Models
Switch to more powerful models for complex reasoning:Using —resume
The--resume flag lets you pick up a previous conversation exactly where you left off.
Basic Resume
Resume with Different Tier
Resume with Different Provider
Resume with Custom Model
Session Continuity
When you use--resume, Andi AIRun:
- Loads the previous conversation from your most recent session
- Preserves all context (files, code, decisions)
- Switches the provider seamlessly
- Continues the task without interruption
Setting a Default Provider
Avoid typing the provider flag every time by setting a default:Setting Default with Custom Model
Clearing the Default
Overriding the Default
Session Isolation
All provider changes are session-scoped and automatically isolated:Terminal Isolation
Auto-Cleanup on Exit
Process Safety
- No global state - changes only affect the current terminal session
- No config files modified - all changes via environment variables
- Crash-safe - no cleanup needed if the session crashes
- Multiple sessions - run different providers simultaneously
Common Switching Patterns
Pattern 1: Rate Limit Recovery
Pattern 2: Cost Optimization
Pattern 3: Model Experimentation
Pattern 4: Development Workflow
Provider-Specific Considerations
Local Providers (Ollama, LM Studio)
Pros:- Free (no API costs)
- No rate limits
- Private (data stays local)
- Fast (no network latency)
- Requires hardware (VRAM/RAM)
- Model quality varies
- Setup required
- Cost-conscious development
- Private/sensitive code
- Frequent iterations
- Learning and experimentation
Cloud Providers (AWS, Vertex, Anthropic)
Pros:- Most powerful models
- No hardware requirements
- Always available
- Latest model versions
- Pay per use
- Rate limits (especially Claude Pro)
- Network dependency
- Data sent to provider
- Complex reasoning
- Large refactors
- Production work
- Critical tasks
Vercel AI Gateway
Pros:- Access to 100+ models
- Single API for all providers
- Unified billing
- Easy switching
- Pay per use
- Network dependency
- Rate limits vary by model
- Multi-model workflows
- Experimentation
- Provider flexibility
Tips for Effective Switching
1. Configure Multiple Providers
Set up 2-3 providers insecrets.sh for maximum flexibility:
2. Use Tier Flags for Cost Control
3. Set Defaults for Common Workflows
4. Monitor Usage and Costs
Keep an eye on your API usage:- AWS: CloudWatch metrics
- Google: Cloud Console
- Anthropic: Console dashboard
- Vercel: AI Gateway dashboard
5. Use Local for Development
Troubleshooting
Resume Not Working
Provider Not Responding
Model Not Available
Next Steps
Provider Overview
Learn about the provider system
Local Providers
Set up free local models
Cloud Providers
Configure cloud APIs