Coder Social home page Coder Social logo

isingerw / langchain4j-aideepin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moyangzhan/langchain4j-aideepin

0.0 0.0 0.0 14.3 MB

JAVA版本的检索增强生成(RAG)大模型知识库项目

Home Page: http://www.aideepin.com

License: MIT License

Java 99.82% Dockerfile 0.18%

langchain4j-aideepin's Introduction

Getting Started

LangChain4j-AIDeepin 基于 ChatGPT 等大语言模型与 Langchain4j 等应用框架实现,开源、可离线部署的检索增强生成(RAG)大模型知识库项目。

该项目如对您有帮助,欢迎点赞

体验网址

http://www.aideepin.com

功能点

  • 注册&登录
  • 多会话(多角色)
  • 图片生成(文生图、修图、图生图)
  • 提示词
  • 额度控制
  • 基于大模型的知识库(RAG)
  • 多模型随意切换

接入的模型:

  • ChatGPT 3.5
  • 通义千问
  • 文心一言
  • ollama
  • DALL-E 2

技术栈

该仓库为后端服务,前端项目见langchain4j-aideepin-web

后端:

jdk17

springboot3.0.5

langchain4j(Java version of LangChain)

Postgresql(需要安装pgvector扩展)

前端:

vue3+typescript+pnpm

如何部署

初始化

a. 初始化数据库

  • 创建数据库aideepin
  • 执行docs/create.sql
  • 填充各模型的配置

openai的secretKey

update adi_sys_config set value = '{"secret_key":"my_openai_secret_key","models":["gpt-3.5-turbo"]}' where name = 'openai_setting';

灵积大模型平台的apiKey

update adi_sys_config set value = '{"api_key":"my_dashcope_api_key","models":["my model name,eg:qwen-max"]}' where name = 'dashscope_setting';

千帆大模型平台的配置

update adi_sys_config set value = '{"api_key":"my_qianfan_api_key","secret_key":"my_qianfan_secret_key","models":["my model name,eg:ERNIE-Bot"]}' where name = 'qianfan_setting';

ollama的配置

update adi_sys_config set value = '{"base_url":"my_ollama_base_url","models":["my model name,eg:tinydolphin"]}' where name = 'ollama_setting';

b. 修改配置文件

  • postgresql: application-[dev|prod].xml中的spring.datasource
  • redis: application-[dev|prod].xml中的spring.data.redis
  • mail: application.xml中的spring.mail

编译及运行

  • 进入项目
cd langchain4j-aideepin
  • 打包:
mvn clean package -Dmaven.test.skip=true
  • 运行

a. jar包启动:

cd adi-bootstrap/target
nohup java -jar -Xms768m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError adi-chat-0.0.1-SNAPSHOT.jar --spring.profiles.active=[dev|prod] dev/null 2>&1 &

b. docker启动

cd adi-bootstrap
docker build . -t aideepin:0.0.1
docker run -d \
  --name=aideepin \
  -e APP_PROFILE=[dev|prod] \
  -v="/data/aideepin/logs:/data/logs" \
  aideepin:0.0.1

待办:

增强RAG

截图

AI聊天: 1691583184761

1691583124744

1691583329105

知识库: kbindex

kb01

kb02

kb03

langchain4j-aideepin's People

Contributors

moyangzhan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.