Cline is an intelligent programming plugin for VSCode. Integrate models from Alibaba Cloud Model Studio to complete complex programming tasks.
Prerequisites
Get your API key and API host. Ensure that you have activated the model service in Alibaba Cloud Model Studio.
In the Model list, select the Qwen model that you want to use.
Because Cline's features are subject to change, the list of supported models may vary.
Download and install VSCode.
Steps
1. Install Cline
Open VSCode. In the extension marketplace, search for Cline and install it.

2. Configure models and API keys
After installation, click the
icon 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 to use a wider range of models, including the latest ones.
Alternative: Select Alibaba Qwen. The configuration is simpler, but this option may not support some of the latest models.
If you have used Cline before, you can change the configuration by clicking the Settings button in the upper-right corner.
This document applies only to pay-as-you-go mode. Coding Plan users must use your exclusive base URL and API key instead. For details, see Coding Plan for Cline.
OpenAI Compatible
This method is recommended because it supports a wider range of models. Configure the settings 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
You can use the Auto-approve option above the input box to grant Cline permission to read, write, and execute commands.
Enabling these permissions increases token consumption. Before you enable them, ensure that you understand Cline's features.
Cline operates in two modes: Plan and Act.
In Plan mode, Cline primarily 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 solution and then performs the required operations. 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 Python quicksort algorithm, you can ask Cline in Plan mode: "Write a Python quicksort algorithm and provide the code directly."

In Plan mode, Cline does not create or modify code files. In Act mode, Cline 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 Python quicksort algorithm, you can ask Cline: "Write a Python quicksort algorithm."

Cline generates the code and writes it to a file. It then asks whether you want to run the file for testing. Cline runs the command only after you provide confirmation.
FAQ
Q: Why do I get a 401 Incorrect API key provided error?
A: This error can occur for the following reasons:
The region of your API key does not match the region of the Base URL. Ensure that they are in the same region.
An older version of Cline does not support selecting Alibaba Qwen as the API Provider. To resolve this, upgrade Cline or change the API Provider to OpenAI Compatible.
Q: Why is my token consumption high?
A: Cline reads your local project files and makes multiple API calls, which consumes many tokens. For simple question-and-answer scenarios, clear the Auto-approve checkbox and use Plan mode.
Q: How can I reduce token usage?
A:
Reduce irrelevant files: To avoid scanning unrelated files and consuming tokens unnecessarily, start Cline from your specific project folder, which should contain only essential project files.
Summarize conversations: Cline uses your conversation history as context. Click the Compact Task button or enter the command
/compactto summarize the conversation.
Use precise instructions: Vague requests can trigger unnecessary file scans and consume more tokens. Provide clear, specific questions or exact instructions when you use Cline.
Break down tasks: For complex tasks, split them into several simple jobs.
Q: Why do I get this error when using the QwQ model: 400 <400> InternalError.Algo.InvalidParameter: An error during model pre-process?
A: In the Settings interface, click MODEL CONFIGURATION and select the Enable R1 messages format checkbox.

