Skip to content

Telegram bot

igardev edited this page Aug 3, 2026 · 13 revisions

Telegram Bot

Requred servers

  • Tools server
  • Embeddings server (if search_source tool is used)

Overview

You can program from your phone with llama-vscode and Telegram. Part of the agent functionality of llama-vscode could be used from Telegram (i.e. from phone) via a Telegram Bot. The user creates a Telegram Bot and sets it's token in setting telegram_api_token. After that all messages to this bot are forwarded to the agent in llama-vscode. The AI agent answers are sent to the user in Telegram. For security reasons, only users from a white list (setting telegram_bot_users) are allowed to use the bot. The bot answers, for example to /help command, are provided in the language, which is set in setting "Language". The user could also confirm permission requests for terminal commands, changing and deleting files from Telegram.

How to use it

  1. Create a Telegram Bot. Creating a bot in Telegram is simple - open bot @BotFather, click Start and execute the command /newbot. There you will see the bot API token.
  2. Set the bot API token in setting telegram_api_token
  3. Find your user id in Telegram (in Telegram bot @userinofobot send "/start") and add it to setting telegram_bot_users
  4. Enable the bot in setting telegram_bot_enabled

Every message to your Telegram bot (from 1.) will be forwarded to the agent in llama-vscode and the bot will send back the answer.
Here are the commands (messages, which start with "/"), which the bot can execute (if the message doesn't start with "/", it is sent to the agent) :

  • /env - shows the current tools model and agent
  • /models - shows the available models
  • /agents - shows the available agents
  • /setmodel n - sets the model to the n-th model. (models numbers are available from command /models)
  • /setagent n - sets the agent to the n-th agent. (agents numbers are available from command /agents)
  • /tools - lists all tools with a check for the active ones
  • /addtools x,y,z - sets the active tools (x,y,z are the numbers of the tools from /tools command)
  • /removetools x,y,z - removes the tools (x,y,z are the numbers of the tools from /tools command)
  • /stop - stops the agent
  • /status - shows the current status of the agent
  • /chat n - gets the last n characters of the current chat. If n is not specified, the last 1000 characters are returned
  • /newchat, /new - stops the current chat and starts a new chat
  • /setlang xx - sets the language, which is used by the bot: bg - Bulgarian (Български), cn - Chinese (中文), en - English, fr - French (Français), de - German (Deutsch), ru - Russian (Русский), es - Spanish (Español)
  • / - shows available commands
  • /help - shows help information for using the bot

Settings:

  • telegram_api_token - Telegram Bot token
  • telegram_bot_users - List of users, which are allowed to use the bot.
  • telegram_bot_enabled - Enable/disable the bot.
  • telegram_chunk_size - The size of the chunks (in chars), which are sent as AI response to Telegram. Each chunk is a separate message.
  • language - The language, on which the bot provides help and other bot specific answers.
  • tools_permission_timeout - The timeout (in seconds) for giving tool execution permission. If not answered within this timeout, the agent will assume a silent answer with No. Default 600 seconds.
telegram1 telegram2 telegram3

Clone this wiki locally