Giter VIP home page Giter VIP logo

gptt's Introduction

The project is under development

ChatGPT Telegram Bot: Fast. No daily limits. Special chat modes + DALL-E

Пример

We all love chat.openai.com, but... It's TERRIBLY laggy, has daily limits, and is only accessible through an archaic web interface.

This repo is ChatGPT re-created with GPT-3.5 LLM as Telegram Bot. And it works great.

You can deploy your own bot, or use mine: @ai_open_gpt_chat_bot

Features

  • Low latency replies (it usually takes about 3-5 seconds)
  • No request limits
  • Code highlighting
  • Special chat modes: 👩🏼‍🎓 Assistant, 👩🏼‍💻 Code Assistant, 🎬 Movie Expert. More soon
  • List of allowed Telegram users
  • Track $ balance spent on OpenAI API

Bot commands

  • /retry – Regenerate last bot answer
  • /new – Start new dialog
  • /mode – Select chat mode
  • /balance – Show balance
  • /help – Show help

Setup на свой сервер

  1. Get your OpenAI API key

  2. Get your Telegram bot token from @BotFather

    • Репозиторий chatgpt_telegram_bot.git >> Settings >> Secrets and variables > Actions
  • Указать следующие переменные:

.env

  • TELEGRAM_TOKEN
  • OPENAI_API_KEY
  • BOT_DOMAIN
  • ALLOWED_TELEGRAM_USERNAMES= [] # if empty, the bot is available to anyone
  • NEW_DIALOG_TIMEOUT= 600 # new dialog starts after timeout (in seconds)

DOCKER

  • DOCKER_USERNAME - никнейм в DockerHub
  • DOCKER_PASSWORD - пароль от DockerHub

SERVER

  • HOST - публичный IPv4 сервера
  • USER - никнейм пользователя
  • SSH_KEY - приватный ssh ключ (cat ~/.ssh/id_rsa)
  • PASSPHRASE - кодовая фраза для ssh-ключа

DB

  • MONGODB_PATH=./mongodb # local path where to store MongoDB

  • MONGODB_PORT=27017 # MongoDB port

  • MONGO_EXPRESS_PORT=8081 # Mongo Express port

  • MONGO_EXPRESS_USERNAME=username # Mongo Express username

  • MONGO_EXPRESS_PASSWORD=password # Mongo Express password

TELEGRAM

  • TELEGRAM_TO - id от телеграмм аккаунта
  • TELEGRAM_TOKEN - токен бота

Локально:

  1. Запустить докер композ
docker compose up -d --build

Деплой на сервер:

    • Передать файлы docker-compose.yml на свой сервер
scp docker-compose.yml <username>@<host>:/home/<username>/docker-compose.yml
scp docker-compose.yml [email protected]:/home/maidaritsydenov/docker-compose.yml
    • Зайти на сервер
ssh username@server_address
    • Обновить установленные пакеты:
sudo apt update
sudo apt upgrade -y
    • Установить Docker и Docker-compose:
sudo apt install docker.io
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
    • Выйти из сервера
exit
    • Запушить изменения на GitHub
git add .
git commit -m 'start'
git push

Добавить про sudo nano /etc/mongod.conf

Каркас взят из репозитория https://github.com/karfly/chatgpt_telegram_bot. Спасибо!

gptt's People

Contributors

maidaritsydenov avatar

Watchers

 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.