Overview
The/model command allows you to switch between different AI models during your session. This is useful for choosing models with different capabilities, speed, or cost characteristics.
Usage
In Interactive Mode
Via Command-Line Flag
Specify a model when starting Qwen Code:What It Does
The/model command:
- Displays Available Models: Shows all models you have access to
- Shows Current Model: Indicates which model is active
- Allows Selection: Lets you choose a new model
- Validates Access: Checks authentication and permissions
- Switches Seamlessly: Changes the model without losing context
Available Models
The available models depend on your authentication provider:Qwen Models (Dashscope)
- Qwen Coder
- Qwen Turbo
- Qwen Max
qwen-coder-plus
- Best for complex coding tasks
- 256K context window
- Optimized for multi-file edits
- Highest quality reasoning
OpenAI Models
When using OpenAI authentication:Anthropic Models
When using Anthropic authentication:Model Selection Dialog
When you run/model in interactive mode:
Model Switching
During a Session
Switch models mid-conversation:Between Sessions
Set a default model:Choosing the Right Model
For Complex Code Generation
Use powerful models for sophisticated tasks:- Multi-file refactoring
- Architecture decisions
- Complex algorithms
- Debugging difficult issues
For Quick Questions
Use fast models for simple queries:- Code explanations
- Simple questions
- Quick fixes
- Documentation
For General Development
Use balanced models for everyday work:- Regular development
- Code reviews
- Feature implementation
- Testing
Model Comparison
| Model | Context | Speed | Quality | Cost | Best For |
|---|---|---|---|---|---|
| qwen-coder-plus | 256K | Medium | Highest | $$$ | Complex coding |
| qwen-max | 200K | Medium | High | $$ | General purpose |
| qwen-turbo | 128K | Fast | Good | $ | Quick tasks |
Model Configuration
Via Settings File
Via Environment Variables
Via Command-Line
- Command-line flags (highest)
- Environment variables
- Project settings
- Global settings (lowest)
Context Window Limits
Each model has a context window limit:- Longer conversations
- More file content
- Better cross-file understanding
- Fewer compressions needed
Model Compatibility
Tool Support
All models support standard Qwen Code tools: ✅ File operations (read, write, edit)✅ Shell commands (bash)
✅ Code search and navigation
✅ Git operations
✅ Web search
Feature Support
Some features may work better with certain models:| Feature | qwen-coder-plus | qwen-max | qwen-turbo |
|---|---|---|---|
| Multi-file edits | ⭐⭐⭐ | ⭐⭐ | ⭐ |
| Code generation | ⭐⭐⭐ | ⭐⭐ | ⭐⭐ |
| Explanations | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐ |
| Speed | ⭐⭐ | ⭐⭐ | ⭐⭐⭐ |
| Cost efficiency | ⭐ | ⭐⭐ | ⭐⭐⭐ |
Custom Models
For custom or self-hosted models:Troubleshooting
Model Not Available
- Authentication is configured:
/auth - You have access to the model
- Model name is correct
- API key has proper permissions
Authentication Required
Model Switch Failed
- Check network connection
- Verify API credentials
- Test with a different model
- Restart Qwen Code
Best Practices
Start with Fast Models
Start with Fast Models
Begin with fast models for exploration:
Match Model to Task
Match Model to Task
Choose models based on task complexity:
- Simple questions: qwen-turbo
- Code generation: qwen-coder-plus
- General work: qwen-max
Set Project Defaults
Set Project Defaults
Configure appropriate defaults per project:
Monitor Costs
Monitor Costs
Track usage with different models:Switch to cheaper models when appropriate.
Model-Specific Tips
Qwen Coder Plus
- Best for: Multi-file refactoring, complex implementations
- Use when: Working on architecture or difficult problems
- Tip: Provide broader context for better results
Qwen Turbo
- Best for: Quick answers, simple code generation
- Use when: Iterating rapidly or asking questions
- Tip: Keep prompts focused and specific
Qwen Max
- Best for: Everyday development tasks
- Use when: General coding work
- Tip: Good default for most scenarios
See Also
Authentication
Set up model provider authentication
Configuration
Configure default models and settings
Statistics
View model usage statistics
Model Comparison
Detailed model comparison and benchmarks
