https://github.com/rewired-gh/ichigo-bot
đ Telegram chat bot for accessing various LLM services in one place
https://github.com/rewired-gh/ichigo-bot
ai chatbot golang llm markdown openai openai-api telegram telegram-bot
Last synced: about 1 year ago
JSON representation
đ Telegram chat bot for accessing various LLM services in one place
- Host: GitHub
- URL: https://github.com/rewired-gh/ichigo-bot
- Owner: rewired-gh
- License: gpl-3.0
- Created: 2025-01-31T11:32:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-18T14:27:14.000Z (over 1 year ago)
- Last Synced: 2025-04-10T09:17:12.070Z (about 1 year ago)
- Topics: ai, chatbot, golang, llm, markdown, openai, openai-api, telegram, telegram-bot
- Language: Go
- Homepage: https://hub.docker.com/repository/docker/dockerrewired/ichigo-bot
- Size: 103 KB
- Stars: 22
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# đ Ichigo Bot
[](https://github.com/rewired-gh/ichigo-bot/actions/workflows/release.yml) [](https://github.com/rewired-gh/ichigo-bot/releases/latest) [](https://hub.docker.com/r/dockerrewired/ichigo-bot)
[English](README.md) | [įŽäŊ䏿](asset/README_zh.md)
A delightful Telegram AI chat bot powered for aggregating models and API providers. đ
If you're not sure where to start, check out [cheahjs/free-llm-api-resources](https://github.com/cheahjs/free-llm-api-resources) for a wealth of LLM API resources, and visit [Telegram Bots](https://core.telegram.org/bots#how-do-i-create-a-bot) for guidance on creating your own bot.
## ⨠Features
- đĄī¸ Production-ready with super-robust error handling
- đĢ Magical streaming chat responses
- đŧī¸ Supports image in chat for multimodal LLM
- đ¤ Compatible with almost any API providers
- đŽ Mix and match your favorite models and providers
- đ Keeps your chats and models safe with user access control
- đ Beautiful Telegram Markdown V2 formatting
- đ¯ Smart system prompts for better conversations
- đĒļ Light as a feather on your server
## đŗ Quick Docker Deployment (beta)
1. Create a local data directory. **Assume** the data directory path is `/path/to/data`:
```bash
mkdir -p /path/to/data
```
2. Create a configuration file `config.toml` in `/path/to/data`. The configuration file's name **must** be `config.toml`, not any other name. Please refer to [`asset/example_config.toml`](asset/example_config.toml) for an example configuration.
3. Run the Docker container (replace `/path/to/data` with the real data directory path):
```bash
sudo docker run -d \
--name ichigod \
-v /path/to/data:/etc/ichigod \
-e ICHIGOD_DATA_DIR=/etc/ichigod \
--restart unless-stopped \
dockerrewired/ichigo-bot:latest
```
## đŽ Commands
- `/chat` - Chat with Ichigo (Can be omitted in private messages)
- `/new` - Start a new conversation
- `/set` - Switch to a different model
- `/list` - Show available models
- `/list_prompts` - List available system prompts
- `/undo` - Remove last conversation round
- `/stop` - Stop the current response
- `/set_temp` - Set text completion temperature
- `/set_prompt` - Set system prompt
- `/help` - Get the list of commands
Admin Commands:
- `/get_config` - View current configuration
- `/set_config` - Update configuration and shutdown
- `/clear` - Clear data
- `/tidy` - Auto delete sessions and chat records whose IDs no longer exist
## đ Quick Start
### Prerequisites
- Go 1.21 or later
- Make
- Python 3 with `telegramify-markdown` package installed
- A Telegram bot token (obtained via [@BotFather](https://t.me/BotFather))
- OpenAI API key or other compatible API provider credentials
- Tip: User IDs and group chat IDs can be retrieved via [@RawDataBot](https://t.me/RawDataBot)
### Build
```bash
make build
```
That's it! **Assume** the built binary is `/project_root/target/ichigod`.
### Deploy (Linux with systemd)
1. Move the built binary to `/usr/bin` and grant necessary permissions:
```bash
# Example commands
sudo chmod a+rx /project_root/target/ichigod
sudo cp -f /project_root/target/ichigod /usr/bin/ichigod
```
2. Create a data directory at `/etc/ichigod`:
```bash
# Example commands
sudo mkdir -p /etc/ichigod
```
3. Create a configuration file `config.toml` in `/etc/ichigod`. The configuration file's name must be `config.toml`, not any other name. Please refer to [`asset/example_config.toml`](asset/example_config.toml) for an example configuration.
4. Create a Python virtual environment with `telegramify-markdown` installed in `/etc/ichigod/venv`:
```bash
# Example commands
cd /etc/ichigod
python3 -m venv venv
source venv/bin/activate
pip install telegramify-markdown
```
5. Create a systemd service unit at `/etc/systemd/system/ichigod.service`:
```ini
# Example service unit
[Unit]
Description=Ichigo Telegram Bot Service
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/bin/ichigod
Restart=always
RestartSec=5
Environment="ICHIGOD_DATA_DIR=/etc/ichigod"
Environment="PATH=/etc/ichigod/venv/bin"
[Install]
WantedBy=multi-user.target
```
6. Enable and start the service:
```bash
# Example commands
sudo systemctl daemon-reload
sudo systemctl enable ichigod
sudo systemctl start ichigod
```
7. Check the service log:
```bash
# Example commands
sudo journalctl -u ichigod.service | tail -8
# Example outputs
# systemd[1]: Started ichigod.service - Ichigo Telegram Bot Service.
# ichigod[202711]: INFO starting ichigod
# ichigod[202711]: INFO initializing bot service
# ichigod[202711]: INFO bot API client initialized username= debug_mode=false
```
## đ ī¸ Development
Development commands:
```bash
make dev # Run in development mode
make debug # Run with debugger
make build # Build for current platform
make build_x64 # Build for Linux x64
```
## âī¸ Configuration
The bot looks for `config.toml` in these locations:
1. `$ICHIGOD_DATA_DIR`
2. `/etc/ichigod/`
3. `$HOME/.config/ichigod/`
4. Current directory