HuixiangDou: Overcoming Group Chat Scenarios with LLM-based Technical Assistance
HuixiangDou: Overcoming Group Chat Scenarios with LLM-based Technical Assistance
HuixiangDou2(ACL25) is a GraphRAG solution whose effectiveness has been demonstrated in the plant-science domain and that contributed to the cover paper in Cell Molecular Plant. If you work outside computer science, give the new release a try.
English | 简体中文
HuixiangDou1 is a professional knowledge assistant based on LLM.
Advantages:
chat_in_group copes with group chat scenario, answer user questions without message flooding, see 2401.08772, 2405.02817, Hybrid Retrieval and Precision Reportchat_with_repo for real-time streaming chatCheck out the scenes in which HuixiangDou are running and current public service status:
If this helps you, please give it a star ⭐
Our Web version has been released to OpenXLab, where you can create knowledge base, update positive and negative examples, turn on web search, test chat, and integrate into Feishu/WeChat groups. See BiliBili and YouTube !
The Web version's API for Android also supports other devices. See Python sample code.
--standalonelangchain | LoRA-Qwen1.5-14B | LoRA-Qwen1.5-32B | alpaca data | arXiv |
| LLM | File Format | Retrieval Method | Integration | Preprocessing |
|
|
|
The following are the GPU memory requirements for different features, the difference lies only in whether the options are turned on.
| Configuration Example | GPU mem Requirements | Description | Verified on Linux |
|---|---|---|---|
| config-cpu.ini | - | Use siliconcloud API for text only |
|
| [Standard Edition]config.ini | 2GB | Use openai API (such as kimi, deepseek and stepfun to search for text only | |
| config-multimodal.ini | 10GB | Use openai API for LLM, image and text retrieval |
We take the standard edition (local running LLM, text retrieval) as an introduction example. Other versions are just different in configuration options.
Click to agree to the BCE model agreement, log in huggingface
huggingface-cli loginInstall dependencies
# parsing `word` format requirements
apt update
apt install python-dev libxml2-dev libxslt1-dev antiword unrtf poppler-utils pstotext tesseract-ocr flac ffmpeg lame libmad0 libsox-fmt-mp3 sox libjpeg-dev swig libpulse-dev
# python requirements
pip install -r requirements.txt
# For python3.8, install faiss-gpu instead of faissWe use some novels to build knowledge base and filtering questions. If you have your own documents, just put them under repodir.
Copy and execute all the following commands (including the '#' symbol).
…Set the model and api-key in config.ini. If running LLM locally, we recommend using vllm.
vllm serve /path/to/Qwen-2.5-7B-Instruct --served-model-name vllm --enable-prefix-caching --served-model-name Qwen-2.5-7B-InstructHere is an example of the configured config.ini:
…Then run the test:
… Also run a simple Web UI with gradio:
python3 -m huixiangdou.gradio_uiOr run a server to listen 23333, default pipeline is chat_with_repo:
python3 -m huixiangdou.api_server
# test async API
curl -X POST http://127.0.0.1:23333/huixiangdou_stream -H "Content-Type: application/json" -d '{"text": "how to install mmpose","image": ""}'
# cURL sync API
curl -X POST http://127.0.0.1:23333/huixiangdou_inference -H "Content-Type: application/json" -d '{"text": "how to install mmpose","image": ""}'Please update the repodir documents, good_questions and bad_questions, and try your own domain knowledge (medical, financial, power, etc.).
We provide typescript front-end and python back-end source code:
Same as OpenXlab APP, please read the web deployment document.
Try right-bottom button on the page and document.
If there is no GPU available, model inference can be completed using the siliconcloud API.
Taking docker miniconda+Python3.11 as an example, install CPU dependencies and run:
…If you find the installation too slow, a pre-installed image is provided in Docker Hub. Simply replace it when starting the docker.
If you have 10G GPU mem, you can further support image and text retrieval. Just modify the model used in config.ini.
# config-multimodal.ini
# !!! Download `https://huggingface.co/BAAI/bge-visualized/blob/main/Visualized_m3.pth` to `bge-m3` folder !!!
embedding_model_path = "BAAI/bge-m3"
reranker_model_path = "BAAI/bge-reranker-v2-minicpm-layerwise"Note:
bpe_simple_vocab_16e6.txt.gz No open issues yet, or sync has not completed.