main
md 57 lines 2.02 KB
Rendered Raw
1 # Dify
2
3 [Dify](https://github.com/langgenius/dify) is an open-source LLM app development platform. Its intuitive interface combines agentic AI workflow, RAG pipeline, agent capabilities, model management, observability features, and more, allowing you to quickly move from prototype to production.
4
5 It supports vLLM as a model provider to efficiently serve large language models.
6
7 This guide walks you through deploying Dify using a vLLM backend.
8
9 ## Prerequisites
10
11 Set up the vLLM environment:
12
13 ```bash
14 pip install vllm
15 ```
16
17 And install [Docker](https://docs.docker.com/engine/install/) and [Docker Compose](https://docs.docker.com/compose/install/).
18
19 ## Deploy
20
21 1. Start the vLLM server with the supported chat completion model, e.g.
22
23 ```bash
24 vllm serve Qwen/Qwen1.5-7B-Chat
25 ```
26
27 1. Start the Dify server with docker compose ([details](https://github.com/langgenius/dify?tab=readme-ov-file#quick-start)):
28
29 ```bash
30 git clone https://github.com/langgenius/dify.git
31 cd dify
32 cd docker
33 cp .env.example .env
34 docker compose up -d
35 ```
36
37 1. Open the browser to access `http://localhost/install`, config the basic login information and login.
38
39 1. In the top-right user menu (under the profile icon), go to Settings, then click `Model Provider`, and locate the `vLLM` provider to install it.
40
41 1. Fill in the model provider details as follows:
42
43 - **Model Type**: `LLM`
44 - **Model Name**: `Qwen/Qwen1.5-7B-Chat`
45 - **API Endpoint URL**: `http://{vllm_server_host}:{vllm_server_port}/v1`
46 - **Model Name for API Endpoint**: `Qwen/Qwen1.5-7B-Chat`
47 - **Completion Mode**: `Completion`
48
49 ![Dify settings screen](../../assets/deployment/dify-settings.png)
50
51 1. To create a test chatbot, go to `Studio → Chatbot → Create from Blank`, then select Chatbot as the type:
52
53 ![Dify create chatbot screen](../../assets/deployment/dify-create-chatbot.png)
54
55 1. Click the chatbot you just created to open the chat interface and start interacting with the model:
56
57 ![Dify chat screen](../../assets/deployment/dify-chat.png)