Quickly Building an AI Coding Assistant Using a ModelArts Studio (MaaS) DeepSeek API and Cline
This section describes how to use Cline to call a DeepSeek model deployed on ModelArts Studio to build an AI coding assistant.
Context
Cline is a VS Code plug-in that uses large language models (LLMs) to handle complex software development tasks. It offers a convenient and efficient coding experience. Advantages of Cline:
- Deep integration with ModelArts Studio (MaaS): Cline connects to DeepSeek model services on MaaS.
- File management and code correction: You can easily create and edit files while monitoring real-time linter and editor errors. Cline detects issues like missing imports or syntax errors, suggests fixes, and improves your coding efficiency.
- Terminal interaction and instant response: Cline includes a terminal for running commands and viewing outputs in real time. It helps you quickly find and fix server issues, keeping development smooth.
- One-stop web solution: For web tasks, Cline starts websites in a headless browser, simulates user actions, and captures screenshots and logs. This helps identify and correct runtime and visual errors, ensuring high-quality web applications.
Prerequisites
- You have registered a Huawei Cloud account and completed real-name authentication. For details, see Signing Up for a HUAWEI ID and Enabling Huawei Cloud Services and Real-Name Authentication.
- You have completed ModelArts agency authorization. For details, see Configuring ModelArts Studio (MaaS) Access Authorization.
- You have deployed a service. For details, see Deploying a Model Service in ModelArts Studio (MaaS).
Step 1: Installing Cline in VS Code
- Open VS Code. Click
on the navigation pane, enter Cline in the search box, and click Install.
If you see a small robot icon
on the left, Cline is installed.
Figure 1 Installing Cline
Step 2: Preparing for MaaS Model API Access
- Create an API key.
Each key is displayed only once after creation. Keep it secure. If the key is lost, it cannot be retrieved. In this case, create a new API key.
- Log in to ModelArts Studio (MaaS) console and select CN Southwest-Guiyang1 from the top navigation bar.
- In the navigation pane, choose API Keys.
- On the API Keys page, click Create API Key, enter the tag and description, and click OK.
The tag and description cannot be modified after the key is created.
Table 1 Parameters Parameter
Description
Tag
Tag of the API key. The tag must be unique. The tag can contain 1 to 100 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.
Description
Description of the custom API key. The value can contain 1 to 100 characters.
- In the Your Key dialog box, copy the key and store it securely.
- After the key is saved, click Close.
After you click Close, the key cannot be viewed again.
- Use a model from My Services.
The Cline plug-in uses a long system prompt to enhance model code generation. This requires a model with a large context length. Use the DeepSeek-R1-671B-32K or DeepSeek-V3-671B-32K model on the ModelArts Studio (MaaS) console. Access fails if the context length is less than 32K.
- In the navigation pane of the ModelArts Studio (MaaS) console, choose Real-Time Inference.
- Click the My Services tab and click Deploy Model in the upper right corner to create a model service. For details, see Deploying a Model Service in ModelArts Studio (MaaS).
- Choose More > View Call Description in the Operation column of the target running model service.
- Check the basic API URL and model name on the page. You will need these for the next steps in configuring Cline.
Step 3: Configuring the MaaS API in Cline
- Configure the MaaS model service.
- Open VS Code, click
in the navigation pane to open the Cline plug-in, and click
in the upper right corner.
Figure 2 Opening the cline plug-in - On the Settings page, configure related information and click Done.
- Open VS Code, click
- Use the Cline plug-in in VS Code to call the MaaS API for automatic code generation.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot