Deploy DeepSeek to AnalyticDB for PostgreSQL
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.
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 |
|
|
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
Log on to the AnalyticDB for PostgreSQL console. Find the instance that you want to manage and click the instance ID.
In the left-side navigation pane, click AI Nodes.
In the upper-left corner, click Add AI Nodes. In the dialog box that appears, turn on the AI Nodes Switch by clicking Enable.
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.
For Number of AI Nodes, we recommend selecting 1.
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.
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
To the right of Vector Engine Optimization, click Enable Optimization.
-
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.
Log in to DMS 5.0.
Move the pointer over the
icon in the upper-left corner and choose . NoteIf you use the DMS console in normal mode, choose in the top navigation bar.
Configure a Dify workspace.
In the upper-right corner, click Create Workspace.
In the dialog box that appears, configure the Workspace Name, Region, and VPC ID, and then click OK.
NoteThe 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.
Click the workspace name and follow the on-screen instructions to enter the workspace.
Click .
In the upper-left corner, click Create Configuration. Scroll down to the vSwitch section.
In the vSwitch parameter, configure the vSwitch.
2.3 Configure the allowlist
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.
Log on to the AnalyticDB for PostgreSQL console. Find the instance that you want to manage and click the instance ID.
On the Data Security page, add the IP address of the vSwitch. For more information, see Configure an allowlist.
3. Deploy DeepSeek
On the Dify page, click the name of your target workspace. Follow the on-screen instructions and click .
On the Dify tab, click Create Configuration and configure the parameters.
NoteIf 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).
NoteYou cannot set a custom name for the vector workspace; it defaults to Dify.
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
To learn how to configure a model and create a chat assistant, see Use Dify, DeepSeek, and Quark Search to build a service with web search capabilities.
For a video tutorial, see Implement a DeepSeek service with full web search capabilities.