Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
imClumsyPanda f9beb142c8 | 1 day ago | |
---|---|---|
.github | 2 weeks ago | |
chains | 5 months ago | |
common | 8 months ago | |
configs | 6 days ago | |
docs | 5 months ago | |
document_loaders | 1 month ago | |
embeddings | 3 months ago | |
img | 1 day ago | |
knowledge_base/samples/content | 3 months ago | |
markdown_docs | 2 weeks ago | |
nltk_data | 1 year ago | |
server | 6 days ago | |
tests | 3 months ago | |
text_splitter | 7 months ago | |
webui_pages | 2 weeks ago | |
.dockerignore | 2 weeks ago | |
.gitignore | 3 months ago | |
.gitmodules | 5 months ago | |
Dockerfile | 2 weeks ago | |
LICENSE | 1 year ago | |
README.md | 1 day ago | |
README_en.md | 2 weeks ago | |
README_ja.md | 2 weeks ago | |
copy_config_example.py | 5 months ago | |
init_database.py | 3 months ago | |
release.py | 1 year ago | |
requirements.txt | 6 days ago | |
requirements_api.txt | 6 days ago | |
requirements_lite.txt | 6 days ago | |
requirements_webui.txt | 2 months ago | |
shutdown_all.sh | 8 months ago | |
startup.py | 3 months ago | |
webui.py | 6 months ago |
🌍 READ THIS IN ENGLISH
🌍 日本語で読む
📃 LangChain-Chatchat (原 Langchain-ChatGLM)
基于 ChatGLM 等大语言模型与 Langchain 等应用框架实现,开源、可离线部署的检索增强生成(RAG)大模型知识库项目。
0.2.10
将会是0.2.x
系列的最后一个版本,0.2.x
系列版本将会停止更新和技术支持,全力研发具有更强应用性的 Langchain-Chatchat 0.3.x
。
0.2.10
的后续 bug 修复将会直接推送到master
分支,而不再进行版本更新。
🤖️ 一种利用 langchain
思想实现的基于本地知识库的问答应用,目标期望建立一套对中文场景与开源模型支持友好、可离线运行的知识库问答解决方案。
💡 受 GanymedeNil 的项目 document.ai
和 AlexZhangji
创建的 ChatGLM-6B Pull Request
启发,建立了全流程可使用开源模型实现的本地知识库问答应用。本项目的最新版本中通过使用 FastChat
接入 Vicuna, Alpaca, LLaMA, Koala, RWKV 等模型,依托于 langchain
框架支持通过基于 FastAPI 提供的 API
调用服务,或使用基于 Streamlit 的 WebUI 进行操作。
✅ 依托于本项目支持的开源 LLM 与 Embedding 模型,本项目可实现全部使用开源模型离线私有部署。与此同时,本项目也支持
OpenAI GPT API 的调用,并将在后续持续扩充对各类模型及模型 API 的接入。
⛓️ 本项目实现原理如下图所示,过程包括加载文件 -> 读取文本 -> 文本分割 -> 文本向量化 -> 问句向量化 ->
在文本向量中匹配出与问句向量最相似的 top k
个 -> 匹配出的文本作为上下文和问题一起添加到 prompt
中 -> 提交给 LLM
生成回答。
📺 原理介绍视频
从文档处理角度来看,实现流程如下:
🚩 本项目未涉及微调、训练过程,但可利用微调或训练对本项目效果进行优化。
🌐 AutoDL 镜像 中 0.2.10
版本所使用代码已更新至本项目 v0.2.10
版本。
🐳 Docker 镜像 已经更新到 0.2.10
版本。
🌲 本次更新后同时支持DockerHub、阿里云、腾讯云镜像源:
docker run -d --gpus all -p 80:8501 isafetech/chatchat:0.2.10
docker run -d --gpus all -p 80:8501 uswccr.ccs.tencentyun.com/chatchat/chatchat:0.2.10
docker run -d --gpus all -p 80:8501 registry.cn-beijing.aliyuncs.com/chatchat/chatchat:0.2.10
🧩 本项目有一个非常完整的Wiki , README只是一个简单的介绍,_
仅仅是入门教程,能够基础运行_。
如果你想要更深入的了解本项目,或者想对本项目做出贡献。请移步 Wiki
界面
该项目是一个可以实现 __完全本地化__推理的知识库增强方案, 重点解决数据安全保护,私域化部署的企业痛点。
本开源方案采用Apache License
,可以免费商用,无需付费。
我们支持市面上主流的本地大语言模型和Embedding模型,支持开源的本地向量数据库。
支持列表详见Wiki
$ python --version
Python 3.11.7
接着,创建一个虚拟环境,并在虚拟环境内安装项目的依赖
# 拉取仓库
$ git clone https://github.com/chatchat-space/Langchain-Chatchat.git
# 进入目录
$ cd Langchain-Chatchat
# 安装全部依赖
$ pip install -r requirements.txt
$ pip install -r requirements_api.txt
$ pip install -r requirements_webui.txt
# 默认依赖包括基本运行环境(FAISS向量库)。如果要使用 milvus/pg_vector 等向量库,请将 requirements.txt 中相应依赖取消注释再安装。
请注意,LangChain-Chatchat 0.2.x
系列是针对 Langchain 0.0.x
系列版本的,如果你使用的是 Langchain 0.1.x
系列版本,需要降级您的Langchain
版本。
如需在本地或离线环境下运行本项目,需要首先将项目所需的模型下载至本地,通常开源 LLM 与 Embedding
模型可以从 HuggingFace 下载。
以本项目中默认使用的 LLM 模型 THUDM/ChatGLM3-6B 与 Embedding
模型 BAAI/bge-large-zh 为例:
下载模型需要先安装 Git LFS
,然后运行
$ git lfs install
$ git clone https://huggingface.co/THUDM/chatglm3-6b
$ git clone https://huggingface.co/BAAI/bge-large-zh
按照下列方式初始化自己的知识库和简单的复制配置文件
$ python copy_config_example.py
$ python init_database.py --recreate-vs
按照以下命令启动项目
$ python startup.py -a
如果正常启动,你将能看到以下界面
以上方式只是为了快速上手,如果需要更多的功能和自定义启动方式
,请参考Wiki
2023年4月
: Langchain-ChatGLM 0.1.0
发布,支持基于 ChatGLM-6B 模型的本地知识库问答。
2023年8月
: Langchain-ChatGLM
改名为 Langchain-Chatchat
,0.2.0
发布,使用 fastchat
作为模型加载方案,支持更多的模型和数据库。
2023年10月
: Langchain-Chatchat 0.2.5
发布,推出 Agent 内容,开源项目在Founder Park & Zhipu AI & Zilliz
举办的黑客马拉松获得三等奖。
2023年12月
: Langchain-Chatchat
开源项目获得超过 20K stars.
2024年1月
: LangChain 0.1.x
推出,Langchain-Chatchat 0.2.x
发布稳定版本0.2.10
后将停止更新和技术支持,全力研发具有更强应用性的 Langchain-Chatchat 0.3.x
。
🔥 让我们一起期待未来 Chatchat 的故事 ···
🎉 Langchain-Chatchat 项目微信交流群,如果你也对本项目感兴趣,欢迎加入群聊参与讨论交流。
🎉 Langchain-Chatchat 项目官方公众号,欢迎扫码关注。
No Description
JavaScript Markdown Python SVG CSS other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》