Chat with your LLM and generate images, using Telegram bot!
Feel free to contribute!
Here's features that you get out of the box:
- Fully dockerized bot
- Response streaming without ratelimit with SentenceBySentence method
- Mention [@] bot in group to receive answer
- Generate image using
/image description
- Use models from OpenWebUI
- Docker config & automated tags by StanleyOneG, ShrirajHegde
- History and
/reset
by ShrirajHegde - Add more API-related functions [System Prompt Editor, RAG, Voice, etc.]
-
Install latest Python
-
Clone Repository
git clone https://github.com/sebaxakerhtc/openwebui-telegram-bot
-
Install requirements from requirements.txt
pip install -r requirements.txt
-
Enter all values in .env.example
-
Rename .env.example -> .env
-
Launch bot
python3 run.py
-
Clone Repository
git clone https://github.com/sebaxakerhtc/openwebui-telegram-bot
-
Enter all values in .env.example
-
Rename .env.example -> .env
-
Run ONE of the following docker compose commands to start:
-
To run ollama in docker container (optionally: uncomment GPU part of docker-compose.yml file to enable Nvidia GPU)
docker compose up --build -d
-
To run ollama from locally installed instance (mainly for MacOS, since docker image doesn't support Apple GPU acceleration yet):
docker compose up --build -d openwebui-tg
-
Parameter | Description | Required? | Default Value | Example |
---|---|---|---|---|
TOKEN |
Your Telegram bot token. [How to get token?] |
Yes | yourtoken |
MTA0M****.GY5L5F.****g*****5k |
WEBUI_TOKEN |
from your webui interface | Yes | yourtoken |
sk-23nb536vynmbv534nmb345 |
ADMIN_IDS |
Telegram user IDs of admins. These can change model and control the bot. |
Yes | 1234567890 OR 1234567890,0987654321, etc. |
|
USER_IDS |
Telegram user IDs of regular users. These only can chat with the bot. |
Yes | 1234567890 OR 1234567890,0987654321, etc. |
|
INITMODEL |
Default LLM | No | llama3.1:latest |
mistral:latest mistral:7b-instruct |
WEBUI_BASE_URL |
Your OpenWebUI URL | No | localhost host.docker.internal |
|
WEBUI_PORT |
Your OpenWebUI port | No | 3000 | |
TIMEOUT |
The timeout in seconds for generating responses | No | 3000 | |
ALLOW_ALL_USERS_IN_GROUPS |
Allows all users in group chats interact with bot without adding them to USER_IDS list | No | 0 |