Deploy DeepSeek to AnalyticDB for PostgreSQL

更新时间:
复制 MD 格式

AnalyticDB for PostgreSQL provides powerful query performance and high scalability. It supports a hybrid workload of transactional processing and analytical queries, and can efficiently handle the large volumes of data and complex analysis tasks that the DeepSeek model involves. In addition, AnalyticDB for PostgreSQL offers a pay-as-you-go model to help you save costs. Deploying the DeepSeek model to an AnalyticDB for PostgreSQL instance is simple and fast. This topic describes how to deploy the DeepSeek model on the ai nodes of an AnalyticDB for PostgreSQL instance.

Supported models and billing details

AnalyticDB for PostgreSQL supports the following DeepSeek models. When you deploy a DeepSeek model on an AnalyticDB for PostgreSQL of an AnalyticDB for PostgreSQL instance, AnalyticDB for PostgreSQL charges you for the ai node.

Note

These prices are for reference only and based on the China (Hangzhou) region. Prices may vary by region and are subject to change. For the latest pricing, check the console.

DeepSeek model

Minimum AnalyticDB for PostgreSQL AI node specification

AI node pay-as-you-go (CNY/node/hour)

AI node subscription (CNY/node/month)

14b

ADB.AIMedium.2

100.929

29,067.5

32b

ADB.AIMedium.2

100.929

29,067.5

70b

ADB.AILarge.2

201.858

58,135

Supported regions

DeepSeek can only be deployed on instances in the China (Hangzhou), China (Beijing), China (Shanghai), and China (Shenzhen) regions.

Deployment impact

Deploying DeepSeek does not affect the operation or data I/O of your AnalyticDB for PostgreSQL instance.

Choose a deployment type

Alibaba Cloud supports one-click deployment and manual deployment of DeepSeek models to AnalyticDB for PostgreSQL. You can choose a deployment method based on the information below.

One-click deployment

Manual deployment

  • Automatically creates an AnalyticDB for PostgreSQL instance.

  • You do not need to manually configure accounts, register with Data Management (DMS), or perform other setup.

  • Deploys to an existing AnalyticDB for PostgreSQL instance.

  • Requires manual configuration of accounts, registration with Data Management (DMS), and other setup.

One-click deployment

If you need to create a new AnalyticDB for PostgreSQL instance and deploy DeepSeek on it, see Dify one-click deployment.

Manual deployment

If you already have an AnalyticDB for PostgreSQL instance, you can choose manual deployment to deploy DeepSeek to your existing AnalyticDB for PostgreSQL instance.

Prerequisites

  • You have purchased the following cloud service instances, all located in the same VPC.

    • An AnalyticDB for PostgreSQL instance.

    • An RDS PostgreSQL instance.

    • A Redis instance.

  • You have created a database account for each purchased cloud service instance.

Procedure

1. Purchase AI nodes

  1. Log on to the AnalyticDB for PostgreSQL console. Find the instance that you want to manage and click the instance ID.

  2. In the left-side navigation pane, click AI Nodes.

  3. In the upper-left corner, click Add AI Nodes. In the dialog box that appears, turn on the AI Nodes Switch by clicking Enable.

  4. In the AI Node Specifications section, select a specification.

    For more information, see Specifications. Select a specification based on the model you want to deploy.

  5. For Number of AI Nodes, we recommend selecting 1.

  6. In the lower-right corner, click Buy Now.

2. Configure the instance

2.1 Enable vector engine optimization

If you need to use a knowledge base, you must enable AnalyticDB for PostgreSQL for your AnalyticDB for PostgreSQL instance.

Prerequisites

Before enabling this feature, verify that your instance meets the following requirements:

Requirement Supported values
Resource type Elastic storage mode only
Engine version (V6.0) V6.3.10.18 or later
Engine version (V7.0) V7.2.1.2 or later
Node specs — High-performance (Basic Edition) 4 cores and 16 GB or higher
Node specs — High-availability Edition 4 cores and 32 GB or higher

If your compute node specifications do not meet the requirements, upgrade or downgrade the compute nodes before proceeding.

Warning

Enabling or disabling vector search engine optimization restarts the instance. The instance is unavailable during the restart. Perform this operation during off-peak hours and make sure your application has an automatic reconnection mechanism.

Procedure
  1. To the right of Vector Engine Optimization, click Enable Optimization.

  2. In the dialog box, click OK.

2.2 Configure the Dify workspace network

If you have already configured the network for your Dify workspace, skip this step.

  1. Log in to DMS 5.0.

  2. Move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner and choose All Features > Data+AI > Dify.

    Note

    If you use the DMS console in normal mode, choose Data+AI > Dify in the top navigation bar.

  3. Configure a Dify workspace.

    1. In the upper-right corner, click Create Workspace.

    2. In the dialog box that appears, configure the Workspace Name, Region, and VPC ID, and then click OK.

      Note
      • The default workspace name in Data Management (DMS) is dify_default.

      • The new workspace name must be unique. If it conflicts with an existing name, the creation will fail.

      • The Dify workspace must be in the same VPC as the AnalyticDB for PostgreSQL instance.

    3. Click the workspace name and follow the on-screen instructions to enter the workspace.

    4. Click Create Dify Environment > Open Dify Resource Management.

    5. In the upper-left corner, click Create Configuration. Scroll down to the vSwitch section.

    6. In the vSwitch parameter, configure the vSwitch.

2.3 Configure the allowlist
  1. Click vSwitch. In the search box, enter the ID of the vSwitch that you configured in 2.2 Configure the Dify workspace network to view the vSwitch IP address.

  2. Log on to the AnalyticDB for PostgreSQL console. Find the instance that you want to manage and click the instance ID.

  3. On the Data Security page, add the IP address of the vSwitch. For more information, see Configure an allowlist.

3. Deploy DeepSeek

  1. On the Dify page, click the name of your target workspace. Follow the on-screen instructions and click Get Started > Create Dify Environment > Open Dify Resource Management.

  2. On the Dify tab, click Create Configuration and configure the parameters.

    Note

    If an instance is not yet registered with Data Management (DMS), click Create XXX Instance in the upper-right corner of the configuration item. You will be redirected to the DMS instance management page to register your instance. For more information, see Register cloud databases.

    The following table describes some of the key parameters. For a complete list of parameters, see Dify one-click deployment.

    Parameter

    Required

    Description

    Metadatabase Configurations

    Yes

    Create a new instance or select an existing RDS PostgreSQL, PolarDB for PostgreSQL, or ApsaraDB RDS for MySQL instance that is registered with Data Management (DMS).

    Redis Configurations

    Yes

    Create a new instance or select an existing Redis instance that is registered with Data Management (DMS).

    Vector Database

    Yes

    Select Create Instance or Import an Existing Instance.

    Database Engine

    Conditionally required

    If you select Import an Existing Instance, select the AnalyticDB for PostgreSQL engine.

    Database

    Conditionally required

    Select an AnalyticDB for PostgreSQL instance that is already registered with Data Management (DMS).

    Note

    You cannot set a custom name for the vector workspace; it defaults to Dify.

  3. Click Buy Now to start the automatic resource deployment.

    When the Dify status on the resource management page changes to Running, the deployment is complete.

Next steps