Updated on 2026-07-08 GMT+08:00

Dify

Customer service systems are an important bridge between enterprises and consumers. However, traditional human-based customer service faces pain points such as high labor costs, difficulties in data collection and analysis, and the inability to provide 24/7 support.

With the rise of AI large models, a key question has emerged: how can advanced LLMs be leveraged to build intelligent customer service systems that deliver 24/7 natural, seamless conversations at lower cost, improve user efficiency, and enhance satisfaction?

You can build intelligent dialogue assistants based on the open-source framework Dify to allow users to directly call large models for open-ended Q&A. This approach applies to multiple business scenarios, including intelligent customer service, knowledge Q&A, and personalized recommendations. MaaS integrates large models such as DeepSeek and GLM. These large models are fully adapted and optimized on AI cloud services, resulting in significant improvements in accuracy and performance.

This section introduces how to use MaaS GLM-5.1 APIs to connect to Dify (an open-source Agent platform), quickly build an AI chatbot, and embed it into a webpage.

Solution Architecture

Figure 1 Solution architecture

  1. The user submits a request through the customer service chatbot interface on Dify.
  2. Dify sends the request to the MaaS model service.
  3. The MaaS model service processes the request and returns the results to Dify.
  4. Dify optimizes the results and returns them to the user through the customer service chatbot interface.

Billing

This section describes how to deploy or use a built-in service. The billing for deployment and use is as follows:

  • Using a built-in service: You can directly experience or call the model service for reference without waiting for deployment. You are billed based on the number of tokens. For details, see Inference Service Billing Items.
  • Deploying a built-in service: You can deploy custom models and fine-tuned models. You are billed based on the computing power. For details, see Compute Resource Billing Items.

Constraints

This function is only supported in the CN-Hong Kong region.

Prerequisites

Step 1: Deploy Dify on a Single Cloud Server

Dify is a robust open-source platform for developing LLM applications. It merges the concepts of Backend as a Service (BaaS) and LLMOps, offering user-friendly GUIs and APIs to simplify the creation of scalable generative AI applications.

  1. Quickly deploy Dify on a FlexusX instance. For details, see the single-server deployment method in Quickly Setting Up the Dify-LLM Application Development Platform.

    Dify must be deployed in the same region as the MaaS model service. In this example, Dify is deployed in the CN-Hong Kong region.

  2. Log in to Dify.

    Upon your first login, enter the email address, username, and password and click Set up to create an administrator account

    Figure 2 Creating an administrator account

Step 2: Obtain Model Information from MaaS

On the MaaS platform, you can call built-in models or models you have deployed. To call a model, you need to obtain the API URL and model name and create an API key.

  1. In the navigation pane of the MaaS console, choose Model Inference > Real-time inference.
  2. Click the Built-in Services tab. In the Operation column of the target service, click Subscribe.
  3. In the displayed dialog box, select built-in services as required, select I have read and agree to this statement and MaaS Service Agreement, and click Subscribe.

    Selecting a built-in service will subscribe to all its model versions.

  4. Click View Call Description in the Operation column of the subscribed built-in service. Select a version.
  5. In the View Call Description dialog box, click Create a new API key, set related parameters, and click OK.

    API keys are used for API authentication. You can create up to 30 keys. After an API key is created, its tag cannot be changed. 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. For details about the API key parameters, see Creating an API Key.

  6. In the Your API Key dialog box, copy the key and store it securely. After the key is saved, click Saved. Confirm and Close.

    After you click Saved. Confirm and Close, the key cannot be viewed again.

  7. Check the API URL and model name in the View Call Description dialog box. You will need these for the subsequent configuration.
  1. In the navigation pane of the MaaS console, choose Model Inference > Real-time inference.
  2. 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.
  3. Locate a running model service and choose More > View Call Description in the Operation column.
  4. In the View Call Description dialog box, click Create a new API key, set related parameters, and click OK.

    API keys are used for API authentication. You can create up to 30 keys. After an API key is created, its tag cannot be changed. 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. For details about the API key parameters, see Creating an API Key.

  5. In the Your API Key dialog box, copy the key and store it securely. After the key is saved, click Saved. Confirm and Close.

    After you click Saved. Confirm and Close, the key cannot be viewed again.

  6. Check the API URL and model name in the View Call Description dialog box. You will need these for the subsequent configuration.

Step 3: Connect Dify to the MaaS Model Service

  1. Log in to Dify and click Plugins in the upper right corner.
    Figure 3 Dify platform

  2. Click Explore Marketplace, enter MaaS in the search box, select for Huawei Cloud MaaS, and click Install. The Install Plugin dialog box is displayed.
    Figure 4 Searching for a plug-in

  3. On the Install Plugin page, click Install to install the MaaS plug-in.
    Figure 5 Installing the MaaS plug-in

    If the MaaS plug-in has been installed, upgrade it to the latest version.

  4. After the MaaS plug-in is installed, click the username in the upper right corner of the Dify page and choose Settings from the drop-down list. The Settings page is displayed.
    Figure 6 Settings page

  5. In the navigation pane, choose Model Provider. Click Config on the right of the MaaS plug-in to configure the API key.
    Figure 7 Model Provider

  6. On the API Key Authorization Configuration page, enter the API key obtained in Step 2: Obtain Model Information from MaaS and click Save. The API key-based authorization is successful.
    Figure 8 API key-based authorization settings

  7. Click Show N Models under the plug-in. The model list is displayed, as shown in the following figure.
    Figure 9 Adding a model

    Figure 10 Model list

Step 4: Create a Customer Service Chatbot in Dify

  1. Go to the Studio page of the Dify platform and click Create from Blank.
    Figure 11 Create from Blank

  2. On the Create from Blank page, select Chatbot, enter the App Name & Icon, and click Create.
    Figure 12 Creating an application

  3. After the customer service chatbot is created, the application debugging page is displayed. Select a provisioned model in the upper right corner and enter a question in the chat box below. If the model responds normally, the customer service chatbot is successfully installed.
    Figure 13 Application debugging page

  4. Click Publish in the upper right corner of the page. The application is published successfully. You can perform operations such as Publish Update, Run App, and Embed into Site on the application.
    Figure 14 Publishing an application

Helpful Links

For more applications on the Dify platform, see Using Dify.

FAQ

How long does it take for an API key to become valid after it is created in MaaS?

A MaaS API key becomes valid a few minutes after creation.