This is a lightweight Telegram bot written in Node.js that lets you chat with a local Large Language Model (LLM) using the Ollama API.
Messages are streamed and updated in real time, and the bot supports session resets and restricted access via chat ID.
- 🔁 Live streaming of model output with dynamic Telegram message updates
- 🧠 Per-user memory (in-memory session context)
- 🛑 /start command to reset chat history
- 🔒 Access control: restrict bot to specific chat IDs
- ⚙️ Configurable model, update rate, and API endpoint
- Node.js ≥ 16
- Ollama installed and running locally (or access to a remote Ollama server)
- Telegram Bot Token from @BotFather
- Clone the repo
git clone https://github.com/sacconazzo/telegram-llm-chat.git
cd telegram-llm-bot
- Configure
nano .env
- Install and run
yarn install
yarn start