Cline is an intelligent programming extension for VSCode. It lets you integrate Qwen models from Alibaba Cloud Model Studio to complete complex programming tasks.
Prerequisites
Create an API key, and ensure that Model Studio is activated.
From the model list, select a Qwen model that you want to use.
Supported models may vary because Cline's features are subject to change.
Download and install the VSCode IDE.
Steps
1. Install Cline
Open VSCode. In the Extensions Marketplace, search for Cline and install it.

2. Configure the model and API key
After the installation is complete, click
in the sidebar to open the Cline interface. Click Bring my own API key. In the dialog box that appears, select an API Provider:
Recommended: Select OpenAI Compatible. This option lets you use a wider range of models, including the latest ones.
Alternative: Select Alibaba Qwen. The configuration is simpler, but it may not support some of the latest models.
If you have used Cline before, click the Settings button in the upper-right corner to adjust the settings.
OpenAI Compatible
This is the recommended method because it supports a wider range of models. Configure the parameters as follows:
Click Continue to complete the configuration. If you have used Cline before, click Done in the upper-right corner. |
|
Alibaba Qwen
Click Continue to complete the configuration. If you have used Cline before, click Done in the upper-right corner. |
|
3. Use Cline
Configure permissions for Cline, such as reading, writing, and executing commands, using the Auto-approve option above the input box.
Enabling these permissions can increase token consumption. Enable them only after you fully understand the features of Cline.
Cline has two working modes: Plan and Act.
In Plan mode, Cline collects information, breaks down problems, and designs a detailed plan to complete the task. It does not directly modify files.
In Act mode, Cline focuses on creating a plan and completing the operations step by step. It can run commands and modify files.
You can switch between modes at the bottom of the dialog box.
Plan
For example, to generate a quicksort algorithm in Python, ask Cline the following question in Plan mode: "Write a Python quicksort algorithm? Just give me the code directly."

In Plan mode, Cline does not create or modify code files. In contrast, Act mode creates a new file and writes the code into it.
Act
Start a new session and switch to Act mode. For example, to generate a quicksort algorithm in Python, ask Cline: "Write a Python quicksort algorithm?"

Cline generates the code and writes it to a file. It then prompts you for confirmation before running the file to test the result. The command is run only after you confirm.
FAQ
Q: Why do I get a 401 Incorrect API key provided error?
A: This error can occur for the following reasons:
The region for the API key does not match the region of the Base URL. Ensure that they match.
Older versions of Cline do not support Alibaba Qwen as an API Provider. Upgrade Cline, or change the API Provider to OpenAI Compatible.
Q: Why is token consumption high?
A: Cline consumes many tokens because it reads your local project files and calls the API multiple times. If you only need to use Cline for simple Q&A, clear the Auto-approve checkbox above the input box and use Plan mode.
Q: How can I save tokens?
A:
Reduce irrelevant files: To prevent token consumption from scanning irrelevant files, start Cline in a project folder that contains only the necessary files.
Summarize conversations: Cline uses the conversation history as context. To summarize the conversation, click the Compact Task button or enter the
/compactcommand.
Use precise instructions: Vague requests can trigger unnecessary file scans and consume more tokens. Provide clear and specific questions or instructions when using Cline.
Break down tasks: When handling complex tasks, break them down into multiple simple tasks.
Q: Why do I get a 400 <400> InternalError.Algo.InvalidParameter: An error during model pre-process error when using the QwQ model?
A: In the Settings interface, click MODEL CONFIGURATION and select the Enable R1 messages format checkbox.

