Giter Site home page Giter Site logo

lrml / -chat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from swuecho/chat

0.0 0.0 0.0 2.49 MB

chat web app for teams, sass with user management and ratelimit, support openai, claude or custom model

Shell 0.15% JavaScript 0.13% Python 2.93% Go 37.05% TypeScript 19.64% CSS 0.01% Makefile 0.12% HTML 1.95% Vue 31.66% Dockerfile 0.18% Less 6.19%

-chat's Introduction

Demo

video.webm

image

image

image

规则

  • 第一个消息是系统消息(prompt)
  • 上下文默认附带最新创建的4条消息
  • 第一个注册的用户是管理员
  • 默认限流 100 chatGPT call /10分钟 (OPENAI_RATELIMIT=100)
  • 根据对话生成可以分享的静态页面(like ShareGPT), 也可以继续会话.
  • 对话快照目录(对话集), 支持全文查找(Enlgish), 方便整理, 搜索会话记录.
  • 支持OPEN AI, Claude 模型 免费申请链接

参与开发

  1. git clone
  2. golang dev
cd chat; cd api
go mod tidy
# export env var, change base on your env
export PG_HOST=192.168.0.135
export PG_DB=hwu
export PG_USER=hwu
export PG_PASS=pass
export PG_PORT=5432
# export DATABASE_URL= postgres://user:[email protected]:5432/db?sslmode=disable

# export OPENAI_API_KEY=sk-xxx, not required if you use `debug` model
# export OPENAI_RATELIMIT=100
#
make serve
  1. node env
cd ..; cd web
npm install
npm run dev
  1. e2e test
cd ..; cd e2e
# export env var, change base on your env
export PG_HOST=192.168.0.135
export PG_DB=hwu
export PG_USER=hwu
export PG_PASS=pass
export PG_PORT=5432
npm install
npx playwright test # --ui 

The instruction might not be accurate, ask in issue or discussion if unclear.

如何部署

参考 docker-compose.yaml

Deploy on Railway

然后配置环境变量就可以了.

PORT=8080
OPENAI_RATELIMIT=0

别的两个 api key 有就填.

image

部署之后, 注册用户, 第一个用户是管理员, 然后到 https://$hostname/static/#/admin/user, 设置 ratelimit, 公网部署, 只对信任的email 增加 ratelimit, 这样即使有人注册, 也是不能用的.

image

致谢

LICENCE: MIT

How to Use

  • The first message is a system message (prompt)
  • by default, the latest 4 messages are context
  • First user is superuser.
  • 100 chatgpt api call / 10 mins (OPENAI_RATELIMIT=100)
  • Snapshot conversation and Share (like ShareGPT)
  • Support OPEN AI, Claude model free application link

How to Deploy

Refer to docker-compose.yaml

Deploy on Railway

Then configure the environment variables.

PORT=8080
OPENAI_RATELIMIT=0

Fill in the other two keys if you have them.

image

After deployment, registering users, the first user is an administrator, then go to https://$hostname/static/#/admin/user to set rate limiting. Public deployment, only adds rate limiting to trusted emails, so even if someone registers, it will not be available.

image

This helps ensure only authorized users can access the deployed system by limiting registration to trusted emails and enabling rate limiting controls.

Acknowledgments

-chat's People

Contributors

exherb avatar guspan-tanadi avatar swuecho 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.