Skip to content

Integration of the advanced llama2 AI model with Telegram to provide real-time chatbot responses. Seamless interaction, smart replies, and scalable deployment.

License

Notifications You must be signed in to change notification settings

yihong1120/Llama2-Telegram-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Llama2-Telegram-Bot

Integration of the advanced llama2 AI model with Telegram to provide real-time chatbot responses. Seamless interaction, smart replies, and scalable deployment.

Prerequisites

  1. Python: You need to have Python installed on your system.
  2. Python Packages:
    • telegram
    • json
    • os
    • asyncio
  3. Llama C++ Library: Ensure you've properly installed and set up the llama_cpp library. The provided code assumes you have the Llama model stored at ./llama-2-7b.Q4_K_M.gguf.

Setting Up

  1. Clone this repository:

    git clone https://github.com/yihong1120/Llama2-Telegram-Bot.git
    cd Llama2-Telegram-Bot
  2. Install necessary Python packages:

    pip install -r requirements.txt
  3. Replace the TOKEN placeholder in the code with your Telegram bot token. This is essential for the bot to function.

Usage

Run the script:

python app.py

Upon execution, the bot will start listening to incoming messages. Users can start a conversation with the bot on Telegram. The bot will then respond to user messages using the Llama model.

The chatbot keeps track of the last 20 messages per user to ensure it has a relevant context while generating responses. Conversations are saved as JSON files, named according to the user's ID.

Contributing

Feel free to fork this repository and make modifications. Pull requests are welcome!

About

Integration of the advanced llama2 AI model with Telegram to provide real-time chatbot responses. Seamless interaction, smart replies, and scalable deployment.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published