opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

Turn Any OpenAI-Compatible API into a Telegram Bot with Streaming and Plugins

Turn Any OpenAI-Compatible API into a Telegram Bot with Streaming and Plugins

GitHub RepoImpressions680

Project Description

View on GitHub

Turn Any OpenAI-Compatible API Into a Telegram Bot (With Streaming + Plugins)

Ever wanted to chat with your favorite LLM right inside Telegram, but without the hassle of building a full bot from scratch? Or maybe you're using a self-hosted OpenAI-compatible API (like vLLM, Ollama, or a custom endpoint) and want to give it a Telegram face?

There's a polished open-source project that does exactly that, and it's surprisingly feature-rich. Let's take a look at ChatGPT-Telegram-Bot.

What It Does

This is a Python bot that acts as a bridge between Telegram and any API that follows the OpenAI chat completion format. You point it at an endpoint (OpenAI, Azure, local vLLM, etc.), configure a bot token from BotFather, and you instantly get a fully interactive Telegram bot.

But it's not just a simple "send message, get reply" bridge. It supports streaming responses (so you see the reply word by word, like in ChatGPT), plugins for web search or code execution, and even conversation history that persists across sessions.

Why It’s Cool

Three things stand out for me:

1. Streaming actually works well. A lot of Telegram bot wrappers for LLMs send the entire response at once. This one streams tokens in real time by editing the Telegram message as new tokens arrive. It feels snappy and natural.

2. Plugin system is extensible. Out of the box, you get web search (via DuckDuckGo), URL summarization, and a simple calculator. But the plugin architecture is clean — you can add your own by dropping a Python file into the plugins folder. No magic, just a well-defined interface.

3. It works with any OpenAI-compatible backend. This is the killer feature. If you run a local model via Ollama with an OpenAI-compatible proxy, or you're using a custom fine-tuned model behind a vLLM server, this bot will talk to it. No vendor lock-in, no separate adapters.

How to Try It

The setup is a straightforward Docker deployment (or you can run it manually with Python):

git clone https://github.com/yym68686/ChatGPT-Telegram-Bot.git
cd ChatGPT-Telegram-Bot
cp config.example.yaml config.yaml
# Edit config.yaml with your bot token and API endpoint
docker compose up -d

Fill in your Telegram bot token (get one from @BotFather) and the API base URL for your LLM endpoint. If you're using OpenAI directly, leave the default. For a local Ollama server, set the base URL to http://localhost:11434/v1.

The README has clear examples for both OpenAI, Azure, and custom endpoints. You can also tweak things like system prompts, max tokens, and whether to enable plugins.

Final Thoughts

This project solves a very specific problem (bridging Telegram with any OpenAI-compatible backend) and solves it well. It's not over-engineered, the code is readable, and the plugin system is genuinely useful for extending it beyond just chat.

If you're already running a local LLM or have an API endpoint, this is the fastest way to give it a Telegram frontend that feels like a real product. No web dashboard needed, no mobile app to build — just a bot in your Telegram sidebar.

Worth a star if it saves you time.


Found this useful? Follow @githubprojects for more developer tools and open source highlights.

Back to Projects
Project ID: 39de1418-7ac4-4a71-9a43-cb53caaab985Last updated: June 18, 2026 at 07:41 AM