Kotaemon本地部署流程

kotaemon是一个基于RAG的开源框架,用于与文档进行对话,用于与你的文档聊天, 它支持实现Hybrid RAG和Graph RAG

链接: https://cinnamon.github.io/kotaemon/

这里我采用的离线安装方式

一、安装kotaemon,映射本地端口访问

conda create -n kotaemon python=3.10

conda activate kotaemon

git clone https://github.com/Cinnamon/kotaemon

cd kotaemon

pip install -e "libs/kotaemon[all]"

pip install -e "libs/ktem"

export HF_ENDPOINT=https://hf-mirror.com

cd scripts

bash run_linux.sh

这里就已经可以访问127.0.0.1:7860来进入ui界面了

Default username / password are: admin / admin.

如果是远程服务器,可以做映射

ssh hoo@10.12.1.44 -L 127.0.0.1:7860:127.0.0.1:7860

端口默认是7860,当然也可以自己改

二、设置本地LLM及Embedding模型

由于本地服务器无法访问huggingface的api,所以这里我们选择设置本地LLM及Embedding模型,推荐Ollama OpenAI兼容的服务

1、安装ollama并启动程序

curl -fsSL https://ollama.com/install.sh | sh

拉取模型

ollama pull llama3.1:8b

ollama pull nomic-embed-text

2、 在Resources页面中的LLMs和Embedding分别设置LLM和Embedding

api_key: ollama

base_url: http://localhost:11434/v1/

model: llama3.1:8b (for llm) | nomic-embed-text (for embedding)

3、使用本地模型用于RAG

1) 将本地LLM和Embedding模型设置为default

2) 将File Collection中的Embedding设置为本地模型(例如: ollama)

3) 在Retrieval Setting页面,选择本地模型作为LLM相关模型。

现在就可以上传文件进行文档问答体验了。

三、设置本地的GraphRAG

pip install graphrag

piip install 

为了使用本地模型来用GraphRAG,我们需要修改.env文件中的USE_CUSTOMIZED_GRAPHRAG_SETTING=true

然后调整 settings.yaml.example里面如下几个设置为true

参考:https://zhuanlan.zhihu.com/p/720088106

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值