I sent a Telegram message from my phone, and my own PC answered. The reply came from a free AI model running locally in Ollama, with no API key and no subscription. In this post, we connect Hermes Agent to Telegram on Windows in 4 steps, then try three real things from the phone.
This is Part 2. If Hermes, Ollama and Qwen are not set up yet, start with Part 1: I Built a FREE AI Agent on My Windows PC.
🎥 Watch the Video
👉 Watch on YouTube: Hermes Agent Telegram Setup
🔗 How It Works
Your phone is the remote control. All the thinking happens on your PC.
- You send a message to your Telegram bot.
- The Hermes gateway on your PC keeps checking Telegram for new messages.
- Hermes hands your message to the AI model running in Ollama (Qwen 3.8).
- The model thinks, Hermes does the work, and the reply goes back to your phone. The default Telegram gateway uses outbound long polling, so you do not need a public IP, a domain or a VPS for this setup.
✅ Before You Start
Hermes and Ollama must already work on your PC. My setup for this video:
| Item | Value |
|---|---|
| GPU | RTX 4070 (12 GB VRAM) |
| RAM | 32 GB |
| OS | Windows 11 |
| Model |
qwen3.8:27b in Ollama |
| Context length | 64000 |
🤖 Step 1: Create a Telegram Bot with BotFather
- Open Telegram and search for BotFather. Pick the official one with the blue tick.
- Start the chat and send
/newbot. - Enter a name. This is the display name, so anything works, like My Hermes Agent.
- Enter a username. It must be unique and must end in
bot. BotFather now gives you a token. Treat it like your bot's password: anyone with it can control your bot. Never share it, and never show it in a screenshot or video.
🆔 Step 2: Get Your Telegram User ID
Search for userinfobot, start the chat, and it replies with a number. That number is your user ID. You need the number, not your @username.
This is the most important security setting. Hermes denies all users by default, and only replies to user IDs you allow. Even if someone finds your bot, Hermes ignores them.
⚙️ Step 3: Run Hermes Gateway Setup
Open PowerShell and run:
hermes gateway setup
The wizard walks you through it:
- Select Telegram. In my version it was option 21.
- Choose the manual path (option 2 for me) and paste the bot token from BotFather. The terminal may look blank after you paste. The token is still entered, so press Enter.
- Paste your user ID for allowed users. Never leave allowed users empty. That list is what keeps your PC under your control. Hermes saves these settings on your PC, so you only do this once.
🚀 Step 4: Start the Gateway and Test
hermes gateway
When the gateway is up, it reports that the Telegram adapter is connected. Keep this window open: the bot only replies while the gateway is running.
Now open your bot in Telegram, press Start and say hi. The reply comes from Qwen running on your own PC.
⏳ Tip: Use /busy queue
A local model on a 12 GB GPU can take a while to reply. If you send a new message while Hermes is still working, it treats your new message as a correction to the current task. Send this once in your bot chat:
/busy queue
Now new messages wait their turn and run as separate tasks. /busy status shows the current mode, and /stop cancels the running task.
📱 3 Things You Can Do From Your Phone
1. Check your PC from anywhere
Check how much free space is left on my C drive, and list the five biggest folders in my Downloads.
Hermes runs the commands on your PC and sends the answer back to Telegram.
2. Send a PDF and get a summary
Attach a PDF in the chat and ask:
Give me a five point summary of this file in simple English.
The file goes to your PC, the local model reads it, and the summary comes back to your phone.
3. Send a photo and ask what's in it
Send a photo from your phone and ask Hermes to identify what it shows. The image is processed by the model on your PC.
Hermes can also run scheduled tasks, so you can ask it to message you with a daily reminder or report.
⚖️ Honest Limits
- Your PC must stay on. If it is off or asleep, or the gateway window is closed, the bot cannot reply.
- Messages travel through Telegram. The AI model runs on your PC, but your chats pass through Telegram's servers. Keep that in mind for very private files.
-
Speed depends on your GPU. On a 12 GB card the 27B model is slow. On smaller GPUs, try
qwen3.5:9borqwen3.5:4b. ## 🧯 Quick Fixes
| Problem | Fix |
|---|---|
| Bot does not reply | Check the gateway window is still open and your user ID is in allowed users |
| Unauthorized or invalid token | Copy the token again from BotFather and re-run hermes gateway setup
|
| Replies slow or cut off | Run ollama ps and check the context is still 64000 |
| Hermes changed what it was doing | You sent a message mid-task. Use /busy queue or wait for the reply |
| Bot stopped overnight | Your PC went to sleep. Adjust Windows power settings |
Takeaways
Four steps turn your PC into a private AI agent you can reach from your phone: create the bot, get your user ID, run hermes gateway setup, and start hermes gateway. The one setting you must never skip is allowed users.
What would you ask your PC from your phone? Tell me in the comments on the video. Thanks for reading, and see you in the next one.
Sources
- Hermes scheduled tasks (cron)
Originally published on The Code Street. I make practical AI, local LLM and AI agent tutorials on YouTube. Follow me here on dev.to for more.
Top comments (0)