Bootstrap

大模型本地部署-dify私有化部署-教程

一、简介

dify是一个开源的LLM应用开发平台。其直观的界面结合了AI工作流、RAG管道、Agent、模型管理、可观测性功能等,可以让您快速从原型到生产。

二、核心功能列表

1、工作流:在画布上构建和测试功能强大的 AI 工作流程。

2、全面的模型支持:与数百种专有/开源 LLMs 以及数十种推理提供商和自托管解决方案无缝集成,涵盖 GPT、Mistral、Llama3 以及任何与 OpenAI API 兼容的模型。 完整的支持模型提供商列表可在此处找到。

3、Prompt IDE: 用于制作提示、比较模型性能以及向基于聊天的应用程序添加其他功能(如文本转语音)的直观界面。

4、RAG Pipeline: 广泛的 RAG 功能,涵盖从文档摄入到检索的所有内容,支持从 PDF、PPT 和其他常见文档格式中提取文本的开箱即用的支持。

5、Agent 智能体: 可以基于 LLM 函数调用或 ReAct 定义 Agent,并为 Agent 添加预构建或自定义工具。 • Dify 为 AI Agent 提供了50多种内置工具,如谷歌搜索、DALL·E、Stable Diffusion 和 WolframAlpha 等。

 6、LLMOps: 随时间监视和分析应用程序日志和性能。您可以根据生产数据和标注持续改进提示、数据集和模型。

7、后端即服务: 所有 Dify 的功能都带有相应的 API,因此您可以轻松地将 Dify 集成到自己的业务逻辑中。

三、部署

3.1 地址

https://github.com/langgenius/dify/tree/main

github地址:
https://github.com/langgenius/dify/tree/main

下载:
git clone https://github.com/langgenius/dify.git

如果git无法下载,可以在github上下载zip包。

3.2 部署

cd dify/docker
cp .env.example .env
docker compose up -d

四、此次用到的镜像

# grep image: docker-compose.yaml 
    image: langgenius/dify-api:1.0.0-beta.1
    image: langgenius/dify-api:1.0.0-beta.1
    image: langgenius/dify-web:1.0.0-beta.1
    image: postgres:15-alpine
    image: redis:6-alpine
    image: langgenius/dify-sandbox:0.2.10
    image: langgenius/dify-plugin-daemon:0.0.1-local
    image: ubuntu/squid:latest
    image: certbot/certbot
    image: nginx:latest
    image: semitechnologies/weaviate:1.19.0
    image: langgenius/qdrant:v1.7.3
    image: pgvector/pgvector:pg16
    image: tensorchord/pgvecto-rs:pg16-v0.3.0
    image: ghcr.io/chroma-core/chroma:0.5.20
    image: quay.io/oceanbase/oceanbase-ce:4.3.3.0-100000142024101215
    image: container-registry.oracle.com/database/free:latest
    image: quay.io/coreos/etcd:v3.5.5
    image: minio/minio:RELEASE.2023-03-20T20-16-18Z
    image: milvusdb/milvus:v2.5.0-beta
    image: opensearchproject/opensearch:latest
    image: opensearchproject/opensearch-dashboards:latest
    image: myscale/myscaledb:1.6.4
    image: docker.elastic.co/elasticsearch/elasticsearch:8.14.3
    image: docker.elastic.co/kibana/kibana:8.14.3
    image: downloads.unstructured.io/unstructured-io/unstructured-api:latest

五、下载地址-很慢

docker pull docker.m.daocloud.io/langgenius/dify-api:1.0.0-beta.1
docker pull docker.m.daocloud.io/langgenius/dify-api:1.0.0-beta.1
docker pull docker.m.daocloud.io/langgenius/dify-web:1.0.0-beta.1
docker pull docker.m.daocloud.io/docker.m.daocloud.io/postgres:15-alpine
docker pull docker.1panel.live/redis:6-alpine
docker pull docker.m.daocloud.io/langgenius/dify-sandbox:0.2.10
docker pull docker.m.daocloud.io/langgenius/dify-plugin-daemon:0.0.1-local
docker pull docker.1panel.live/ubuntu/squid:latest
docker pull docker.1panel.live/certbot/certbot
docker pull docker pull k8s-gcr.kubesre.xyz/nginx:latest
docker pull docker.1panel.live/semitechnologies/weaviate:1.19.0
docker pull docker.1panel.live/langgenius/qdrant:v1.7.3
docker pull docker.1panel.live/pgvector/pgvector:pg16
docker pull docker.1panel.live/tensorchord/pgvecto-rs:pg16-v0.3.0
docker pull docker.1panel.live/ghcr.io/chroma-core/chroma:0.5.20
docker pull docker.1panel.live/quay.io/oceanbase/oceanbase-ce:4.3.3.0-100000142024101215
docker pull docker.1panel.live/container-registry.oracle.com/database/free:latest
docker pull docker.1panel.live/quay.io/coreos/etcd:v3.5.5
docker pull docker.1panel.live/minio/minio:RELEASE.2023-03-20T20-16-18Z
docker pull docker.1panel.live/milvusdb/milvus:v2.5.0-beta
docker pull docker.1panel.live/opensearchproject/opensearch:latest
docker pull docker.1panel.live/opensearchproject/opensearch-dashboards:latest
docker pull docker.1panel.live/myscale/myscaledb:1.6.4
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.14.3
docker pull docker.elastic.co/kibana/kibana:8.14.3
docker pull downloads.unstructured.io/unstructured-io/unstructured-api:latest

六、问题处理

6.1 镜像修改

镜像无法下载或者部分镜像不存在等问题。此版本需要要修改docker-compose.yaml文件中的一下镜像版本。

image: langgenius/dify-api:1.0.0
image: langgenius/dify-api:1.0.0
image: langgenius/dify-web:1.0.0

改成:

image: langgenius/dify-api:1.0.0-beta.1
image: langgenius/dify-api:1.0.0-beta.1
image: langgenius/dify-web:1.0.0-beta.1

6.2 变量修改

6.3 判断镜像是否存在

https://hub.docker.com/

七、登录

;