【AI知识库云研发部署】RAGFlow + DeepSeek
gpu
安装screen:yum install screen
配置ollama:
下载官方安装脚本并执行: curl -fsSL https://ollama.com/install.sh | sh
通过screen后台运行ollama:screen -S ollama
在screen会话中启动服务:
export OLLAMA_KEEP_ALIVE=-1
export OLLAMA_HOST=0.0.0.0:11434
export OLLAMA_NUM_PARALLEL=16
export OLLAMA_ORIGINS=*
ollama serve
通过ollama拉取模型
ollama pull deepseek-r1:8b
ollama pull bge-m3
结束所有ollama进程:pkill -f ollama
安装cmake:yum install cmake
wget https://huggingface.co/klnstpr/bge-reranker-v2-m3-Q8_0-GGUF/resolve/main/bge-reranker-v2-m3-q8_0.gguf
git clone https://github.com/ggerganov/llama.cpp
TencentOS 3需要修改ggml/src/CMakeLists.txt才能编译:
find / -type f -path "*/ggml/src/CMakeLists.txt" 2>/dev/null
vim ggml/src/CMakeLists.txt
在llama.capp文件夹下
cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release -j16
cd build/bin
screen -S llama.cpp
注意路径是否正确:
./llama-server -m /data/workspace/bge-reranker-v2-m3-q8_0.gguf --port 11435 --reranking --pooling rank -ngl 25 --host 0.0.0.0 -ub 16384
cpu
在云服务器 CVM (cpu版)中,克隆 RAGFlow 知识库:git clone https://github.com/infiniflow/ragflow.git 根据README.md安装
这里用cvm没用云研发的原因是云研发已经是容器环境了,不支持docker in docker
安装后从本地浏览器直接访问cvm,比如我的cvm是9.34.5.10,则访问http:/9.34.5.10
同样的添加其他几个,添加完成后如图:
到这一步基本完成了,回到主页开始上传文档,然后开始rag问答
注意等待文档解析完成
由于用的模型很拉垮,这里会很慢,耐心等待