Skip to content

leraroden/Telegram_Translator_Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Translation Bot with integrated local AI

A Telegram bot that translates messages using a locally running LLM (Ollama), so no data leaving your machine.

Example:

  • Input: Hello, how are you?
  • Output: Привет, как дела?

How translation works

  • Language is detected using langdetect
  • Target language is selected via simple rules (you can easily customise it however you like):
    • EN / DE -> Russian
    • RU -> English
  • A prompt is sent to the local LLM
  • The model returns only the translated text

Setup

1. Clone repository

2. Create virtual environment

python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate

3. Install dependencies

pip install -r requirements.txt

4. Setup environment variables

Create a .env file:

TOKEN=your_telegram_bot_token
MODEL=model_of_your_choice

5. Start Ollama

Make sure Ollama is running locally:

ollama run qwen3

Default API endpoint:

http://localhost:11434/api/generate

6. Run the bot

python bot.py

About

A Telegram bot that translates messages using a locally running LLM (Ollama), so no data leaving your machine.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages