Skip to content

Connect abetlen/llama-cpp-python to telegram bot api.

License

Notifications You must be signed in to change notification settings

gjmulder/llama-cpp-telegram_bot

 
 

Repository files navigation

#Extension connecting llama-cpp-python to telegram bot api.

Image1

This is wrapper for abetlen/llama-cpp-python providing chat like telegram bot interface.

REQUIREMENTS:

  • python-telegram-bot==13.15
  • pyyaml
  • deep-translator==1.9.2
  • llama-cpp-python

HOW TO INSTALL:

  1. clone this repo to "text-generation-webui\extensions"
cd text-generation-webui
git clone https://github.com/innightwolfsleep/llama-cpp-telegram_bot 
  1. install requirements.
pip install -r llama-cpp-telegram_bot\requirements.txt

HOW TO USE:

  1. add your bot token to llama-cpp-telegram_bot/telegram_token.txt (ask https://t.me/BotFather how to get token)
  2. add your model bin file to llama-cpp-telegram_bot/models
  3. write path to your bin model file in llama-cpp-telegram_bot/telegram_llm_model_path.txt
  4. run "python llama-cpp-telegram_bot/main.py"

FEATURES:

  • chat and notebook modes
  • session for all users are separative (by chat_id)
  • local session history - conversation won't be lost if server restarts. Separated history between users and chars.
  • nice "X typing" during generating (users will not think that bot stucking)
  • buttons: continue previous message, regenerate last message, remove last messages from history, reset history button, new char loading menu
  • you can load new characters from text-generation-webui\characters with "/load" command!!!
  • you can load new model during conversation with /models
  • chatting # prefix for impersonate: "#You" or "#Castle guard" or "#Alice thoughts about me"
  • "!" prefix to replace last bot message
  • "++" prefix permanently replace bot name during chat (switch conversation to another character)
  • save/load history in chat by downloading/forwarding to chat .json file
  • integrated auto-translate (you can set model/user language parameter)

TBC:

  • replace "X typing" by yield from generator
  • group chat mode (need to be tested, does current workflow is ok?)
  • migrate to aiogram or not?
  • 1-world-delete-button
  • help button?

About

Connect abetlen/llama-cpp-python to telegram bot api.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%