Skip to main content

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

This opens an interactive model selection dialog.

Via Command-Line Flag

Specify a model when starting Qwen Code:

What It Does

The /model command:
  1. Displays Available Models: Shows all models you have access to
  2. Shows Current Model: Indicates which model is active
  3. Allows Selection: Lets you choose a new model
  4. Validates Access: Checks authentication and permissions
  5. Switches Seamlessly: Changes the model without losing context

Available Models

The available models depend on your authentication provider:

Qwen Models (Dashscope)

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:
Your conversation context is preserved when switching models.

Between Sessions

Set a default model:
Then start Qwen Code:

Choosing the Right Model

For Complex Code Generation

Use powerful models for sophisticated tasks:
Best for:
  • Multi-file refactoring
  • Architecture decisions
  • Complex algorithms
  • Debugging difficult issues

For Quick Questions

Use fast models for simple queries:
Best for:
  • Code explanations
  • Simple questions
  • Quick fixes
  • Documentation

For General Development

Use balanced models for everyday work:
Best for:
  • Regular development
  • Code reviews
  • Feature implementation
  • Testing

Model Comparison

Model Configuration

Via Settings File

Via Environment Variables

Via Command-Line

Precedence order:
  1. Command-line flags (highest)
  2. Environment variables
  3. Project settings
  4. Global settings (lowest)

Context Window Limits

Each model has a context window limit:
Larger context windows allow:
  • 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:

Custom Models

For custom or self-hosted models:
Configuration:

Troubleshooting

Model Not Available

Check:
  1. Authentication is configured: /auth
  2. You have access to the model
  3. Model name is correct
  4. API key has proper permissions

Authentication Required

Configure authentication first:

Model Switch Failed

Try:
  1. Check network connection
  2. Verify API credentials
  3. Test with a different model
  4. Restart Qwen Code

Best Practices

Begin with fast models for exploration:
Choose models based on task complexity:
  • Simple questions: qwen-turbo
  • Code generation: qwen-coder-plus
  • General work: qwen-max
Configure appropriate defaults per project:
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