126w32 / chatgpt_telegram_bot

ChatGPT re-created with GPT-3.5 LLM as Telegram Bot. Light-weight fork.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

点击前往中文说明

This is a fork of karfly/chatgpt_telegram_bot with some customizations to simplify the deployment process.

  • Ready-to-use x86_64 and arm64 docker images.
  • Alpine base-image, only 65MB image size.
  • Sqlite database, no need for mongo.

Acknowledgments

ChatGPT Telegram Bot: Fast. No daily limits. Special chat modes

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: @chatgpt_karfly_bot

News

  • 2 Mar 2023: Added support of ChatGPT API. It's enabled by default and can be disabled with use_chatgpt_api option in config.

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
  • Support of ChatGPT API
  • 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

  3. Download config.example.yml

  4. Edit config.example.yml to set your tokens and run 3 commands below:

mv ./config.example.yml ./config.yml

touch ./sqlite.db

docker run -d --name chatgpt_telegram_bot --restart=unless-stopped -v $PWD/config.yml:/code/config/config.yml -v $PWD/sqlite.db:/sqlite.db ghcr.io/wy580477/chatgpt_telegram_bot:sqlite

Docker compose example:

version: '3.2'

  chatgpt_telegram_bot:
    image: ghcr.io/wy580477/chatgpt_telegram_bot:sqlite
    container_name: chatgpt_telegram_bot
    volumes:
      - type: bind
        source: "/etc/chatgpt_telegram_bot/config.yml"
        target: "/code/config/config.yml"
      - '/etc/chatgpt_telegram_bot/sqlite.db:/sqlite.db'
    restart: unless-stopped

References

  1. Build ChatGPT from GPT-3

About

ChatGPT re-created with GPT-3.5 LLM as Telegram Bot. Light-weight fork.

License:MIT License


Languages

Language:Python 97.0%Language:Dockerfile 1.9%Language:Shell 1.1%