How to Build a DeepSeek AI Chat Assistant Using Huawei Developer Space
This guide walks you through creating an AI chat assistant powered by the DeepSeek‑V3 large language model on Huawei Developer Space, covering cloud container setup, free token acquisition, MaaS model activation, environment configuration, code deployment with Gradio, and end‑to‑end testing.
Overview
The tutorial demonstrates how to build an AI‑powered chat assistant ( 智语灵犀 ) using the DeepSeek‑V3 model on Huawei Developer Space. It combines a cloud development container, Huawei MaaS services, and a Python + Gradio stack to deliver a responsive web‑based chatbot.
Prerequisites
Huawei Developer Space account (real‑name verified)
Access to the MaaS DeepSeek‑V3 model (free token coupon)
VS Code with the Huawei Developer Space extension installed
Basic knowledge of Python and Docker‑style containers
Step‑by‑Step Procedure
1. Register and Claim Free Token
Log in to Huawei Developer Space, navigate to the token‑coupon page, and claim a million‑token voucher. The API key generated here will be used to call the DeepSeek model.
2. Create a Cloud Development Container
In the Developer Space console, create a new container using the Python public template (or start from a blank container). Name the environment (e.g., test) and confirm creation. The container will be ready in about two minutes.
3. Install VS Code Remote Plugin
Install the Huawei Developer Space extension in VS Code, authorize the connection, and open the remote container. VS Code will prompt to install the required server component; accept and trust the authors.
4. Activate the DeepSeek Model Service
In the MaaS console, go to Model Inference → Online Inference → Commercial Service , locate DeepSeek‑V3‑64K , and click Enable Service . After confirming the service agreement, create an API key.
5. Clone the Project and Install Dependencies
Use VS Code’s Source Control to clone the repository https://gitcode.com/sinat_41661654/chat_assistant.git into /workspace/python/ai_chat_assistant. Then create a virtual environment and install the required packages.
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt6. Configure the API Key
Edit config.py and replace the placeholder your_API_Key with the key obtained in step 4.
# API configuration
API_CONFIG = {
"api_key": "your_API_Key", # replace with your actual key
"base_url": "https://api.modelarts-maas.com/v1/chat/completions",
"model": "DeepSeek-V3"
}7. Run and Test the Assistant
Start the application with python main.py. VS Code will offer to open the web UI in a browser at http://localhost:7860/. Enter a query such as “你好,请帮我简单介绍一下华为开发者空间”, and the assistant will respond using the DeepSeek model.
python main.pyWith the environment fully configured, developers can experiment with long‑context, multi‑turn dialogues and extend the assistant for custom applications.
Project Structure
ai_chat_assistant/
├── main.py # entry point
├── config.py # configuration (API key, model)
├── chat_assistant.py# core logic for calling DeepSeek
├── styles.css # UI styling for Gradio
├── requirements.txt # Python dependencies
└── README.md # documentationThe guide combines cloud resource provisioning, API management, and Python development to deliver a complete, reproducible AI chatbot solution.
Huawei Cloud Developer Alliance
The Huawei Cloud Developer Alliance creates a tech sharing platform for developers and partners, gathering Huawei Cloud product knowledge, event updates, expert talks, and more. Together we continuously innovate to build the cloud foundation of an intelligent world.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
