Skip to content

Telegram bot

igardev edited this page Jul 29, 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".

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) /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 - 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.
telegram1 telegram2 telegram3

Clone this wiki locally