Appearance
本地知识库搭建
基于deepseek+ragflow
ai模型的的本地环境搭建、部署、本地化训练、知识库
ollama
ollama 安装
安装模型(deepseek)
- 模型选择
- 模型安装
问答1
问答2
局域网网络配置
- Mac
sh
# 设置host
launchctl setenv OLLAMA_HOST "0.0.0.0:11434"
# 重启ollama
launchctl restart ollama
# 或者
OLLAMA_HOST=0.0.0.0 ollama serve
- Window
测试
docker安装
傻瓜式一键安装
ragflow 安装
源代码下载
- 下载方式
sh
git clone https://github.com/infiniflow/ragflow.git
或者直接下载zip
修改配置
- 改成国内镜像,否则下载不下来(不要下slim,不然要自己搞各个环境)
sh
# The RAGFlow Docker image to download.
# Defaults to the v0.16.0-slim edition, which is the RAGFlow Docker image without embedding models.
# RAGFLOW_IMAGE=infiniflow/ragflow:v0.16.0-slim
#
# To download the RAGFlow Docker image with embedding models, uncomment the following line instead:
# RAGFLOW_IMAGE=infiniflow/ragflow:v0.16.0
# 阿里云镜像
RAGFLOW_IMAGE=registry.cn-hangzhou.aliyuncs.com/infiniflow/ragflow:v0.16.0
# 华为云镜像
# RAGFLOW_IMAGE=swr.cn-north-4.myhuaweicloud.com/infiniflow/ragflow:v0.16.0
安装
在ragflow/docker目录下执行命令(不行就要上梯子了)
sh
docker compose -f docker-compose.yml up -d
ragflow运行
sh
docker compose -f docker-compose.yml up -d
ragflow macos/国产 安装(linux/arm64/v8平台)
sh
# 下载ragflow
git clone https://github.com/infiniflow/ragflow.git
cd ragflow/
# 安装环境
pip3 install huggingface_hub nltk
python3 download_deps.py
# 编译
docker build -f Dockerfile.deps -t infiniflow/ragflow_deps .
# 镜像
docker build -f Dockerfile -t infiniflow/ragflow:nightly .
# 运行
docker compose -f docker/docker-compose-macos.yml up -d
本地知识库搭建
- 浏览器本地ip
注册本地用户
创建知识库
- 上传材料
- 解析文件
- 新建助手
- 然后就可以开始聊天了