Skip to content

An LLM-based tool to chat with your documents and databases, including a management system | 面向企业内部环境的大模型(LLM)知识库问答系统,包含后台管理系统

License

DemoGit4LIANG/Chat2Anything

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chat2Anything

| github |

Chat2Anything是面向企业内部环境的大模型(LLM)知识库问答系统,它具备以下功能:

  • 包含客户端(Chat2Anything)与后台管理系统(Chat2Anything Admin),其中后台管理系统负责大模型知识库的创建与管理,用户可通过上传Excel、Word、PDF等文件向大模型添加企业内部知识(Langchain机制);管理系统包含完整的用户权限、角色、组织、数据字典管理等功能

  • 支持ChatGPT、ChatGLM、Vicuna等主流大模型,用户可随时切换大模型;当使用ChatGLM、Vicuna时,整套系统可实现完全私域部署,企业数据100%内部流转

  • 支持业务系统数据库接入,手动/自动选择查询分析涉及的表,根据用户问题描述Text2SQL(待完善),查询结果自动执行并可视化(待开发)


部署

Chat2Anything (客户端)

  1. 本地配置ChatGLM (https://github.com/THUDM/ChatGLM-6B) / Vicuna (https://github.com/lm-sys/FastChat) 等大模型,如使用ChatGPT,在Chat2Anything/configs/openai_config.py文件中配置OPENAI_API_KEY和OPENAI_API_BASE

  2. 运行controller:

    python3 -m fastchat.serve.controller
  3. 运行model_worker (ChatGLM-6B, 推荐ChatGLM2-6B (https://github.com/THUDM/ChatGLM2-6B)):

    python3 -m fastchat.serve.model_worker_chatglm --model-path /path/to/model/weights

    or

    运行model_worker (vicuna):

    python3 -m fastchat.serve.model_worker --model-path /path/to/model/weights
  4. 运行client web server

    python3 -m fastchat.serve.chat2anything_web_server

    如使用ChatGPT, 添加启动参数 --add-chatgpt

  5. 基本测试环境

    Ubuntu 20.04 CUDA 11.7 Python 3.9 PyTorch 1.13
    Tesla V100 32GB * 1

Chat2Anything Admin (后台管理端)

  1. 数据库(MySQL)配置:

    # MySql配置信息
      MYSQL_HOST=数据库地址
      MYSQL_PORT=数据库端口
      MYSQL_DATABASE=chat2anything_db
      MYSQL_USERNAME=账户
      MYSQL_PASSWORD=密码
      
    # 密钥配置
      SECRET_KEY='一定要改'
  2. 模型相关配置:

    # model_config.py
      embedding_model_dict = {
      'text2vec": "/Path/to/text2vec-large-chinese',
     }
      
    # 密钥配置
      VECTOR_ROOT_PATH = os.path.join('/Path/to/Chat2Anything', 'vector_stores')
  3. 数据库初始化:

      flask db init
      flask db migrate
      flask db upgrade
      flask admin init
  4. 运行:

      # Windows
      run.bat
    
      # Linux
      chmod +x run.sh
      ./run.sh
    
      # 管理员默写账户密码
      admin 123456

相关项目

Appreciate the following contributions:

About

An LLM-based tool to chat with your documents and databases, including a management system | 面向企业内部环境的大模型(LLM)知识库问答系统,包含后台管理系统

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages