deepseek搭建本地知识库
·
一、安装ollama
1、下载ollama
请访问 Ollama 的官方网站,根据你的操作系统选择合适的版本,下载 Ollama应用程序并进行安装:
2、检查安装结果
# 有版本号输出即可
# ollama -v
ollama version is 0.5.11
二、安装deepseek
1、下载deepseek
# ollama会自动下载deepseek,并启动(这里下载支持中断继续)
# ollama run deepseek-r1:14b
2、开启对话
# ollama run deepseek-r1:14b
>>> hi
<think>
</think>
Hello! How can I assist you today? 😊
>>>
>>>
>>> hi
<think>
Okay, the user wrote "hi" again. They probably want to start a
conversation.
In the previous interaction, they just said "hi", and I responded warmly.
Now, they're repeating it, so maybe they didn't get the chance to ask
their question yet or perhaps they're testing if I'm responsive.
I should keep the response friendly and open-ended to encourage them to
share what they need help with. Maybe add a smiley to keep it
approachable.
</think>
三、安装docker
1、安装docker
到官网https://www.docker.com/,选择适合自己系统的版本进行安装
2、启动docker
如果没有container可以等dify下载后再启动(后续会讲到)
3、镜像地址修改
默认的镜像无法访问,可能会出现超时
{
"registry-mirrors": [
"https://mirror.ccs.tencentyun.com",
"https://dockercf.jsdelivr.fyi",
"https://docker.jsdelivr.fyi",
"https://dockertest.jsdelivr.fyi",
"https://dockerproxy.com",
"https://mirror.iscas.ac.cn"
]
}
四、安装bge-m3
如果要建设本地库就需要安装预处理模块
ollama pull bge-m3
五、安装dify
1、下载dify
#下载
git clone https://github.com/langgenius/dify.git
2、启动dify
# 下载号dify项目后,进入docker文件夹
cd docker
cp .env.example .env
#拉取镜像,这步的坑比较多
docker compose up -d
3、启动失败处理
# 问题1:docker镜像地址无效或者访问不通。(更新有效的地址即可,上文已提到)
# 问题2:docker中软件版本太旧了,修改dify文件下的docker-compose.yaml文件将dify-api:1.0.0改成latest,如果不行将所有的1.0.0版本都改成latest
4、登录dify
访问通过 http://localhost/install 即可在本地打开,首次打开需要设置邮箱/用户名/和密码,
5、配置模型
配置LLM,如果 ollama 和 Dify 在同一台机器上部署,并且 Dify 是通过 Docker 容器部署的,那么应填写http://host.docker.internal:11434
配置Text embedding(需要下载bge-m3)
6、配置本地仓库
上传文件后要保证文件可以继续出来
7、新建chat
在新建chat的时候,应用自建的知识库。右侧提问,就可以看到模型引用的本地的知识库
更多推荐
所有评论(0)