Ollama+Deepseek+Docker+RAGFlow打造自己的私人AI知识库
打造自己的AI知识库
架构
Ollama+Deepseek+Docker+RAGFlow
部署大模型
下载并安装Ollama
官网地址:Download Ollama on Windows
选择合适版本进行下载安装(注意修改模型下载位置)
Ollama环境变量配置
增加两个环境变量(rag访问ollama需要)
OLLAMA_HOST:0.0.0.0:11434
OLLAMA_MODELS:E:\AIData\OllamaModels
部署大模型DeepSeek-R1-Distill-Qwen-14B-GGUF:Q6_K
基于自己硬件配置选择合适的大模型,此大模型适合12g显存,个人可选择量化模型,精度损失不高,速度更快,显存要求大幅下降
ollama run hf.co/bartowski/DeepSeek-R1-Distill-Qwen-14B-GGUF:Q6_K
部署RAG
RAG下载
克隆仓库:ragflow/README_zh.md at main · infiniflow/ragflow
$ git clone https://github.com/infiniflow/ragflow.git
找到安装文件,由于默认轻量版无embedding模型,要改写配置
下载并安装Docker
Windows | Docker Docs
配置镜像加速器(不配的话,会经常超时失败)
{"builder": {"gc": {"defaultKeepStorage": "20GB","enabled": true}},"experimental": false,"features": {"buildkit": true},"insecure-registries": [],"registry-mirrors": ["https://docker.1ms.run"]
}
拉取RAG镜像
执行命令:
$ cd ragflow/docker
# Use CPU for embedding and DeepDoc tasks:
$ docker compose -f docker-compose.yml up -d# To use GPU to accelerate embedding and DeepDoc tasks:
# docker compose -f docker-compose-gpu.yml up -d
到这里就已经完全部署好了,剩下的就在页面配置了
最终页面配置
页面访问地址:http://127.0.0.1/user-setting/model
大模型配置
设置默认模型
创建知识库
上传文档,注意上传后一定要点解析
新建助理
选择知识库
按需调整参数