Telegram userbot integrated with local LLM (LM Studio)
Responds to messages, remembers chat history, and speaks in different moods. Triggered by the name "Lumi".
User-facing messages: Russian
|
Local AI Integration
|
Smart Memory System
|
|
Multiple Personalities
|
Management Commands
|
# Clone repository
git clone <repo_url>
cd lumi-bot
# Setup virtual environment
python -m venv .venv
# Activate environment
# Linux/macOS:
source .venv/bin/activate
# Windows:
.venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtCopy .env.example to .env and configure:
TG_API_ID=12345678
TG_API_HASH=your_api_hash
OWNER_IDS=123456789,987654321
SESSION_NAME=lumi_userbotpython main.pyImportant: LM Studio must be running at
http://localhost:1234
lumi/
├── main.py # entry point
├── config.py # all constants and env variables
├── requirements.txt
├── .env.example
├── ai/
│ ├── model.py # ask_model, clean_response
│ ├── moods.py # mood prompts
│ └── search.py # classifier, DuckDuckGo, analyze_and_search
├── bot/
│ ├── handler.py # message handler, rate limiting
│ ├── commands.py # all /commands
│ └── console.py # console debug mode
└── utils/
├── storage.py # chat data persistence (saved to data/)
└── history.py # in-memory conversation history
| Command | Description |
|---|---|
/ping |
Check response time |
/model |
Show active model |
/prompt |
Show current system prompt |
| Command | Description |
|---|---|
/memorize <text> |
Save a note |
/show_memory |
List saved notes |
/forget |
Delete all notes |
/forget <number> |
Delete specific note |
| Command | Description |
|---|---|
/mood |
Show current mood |
/mood <mood> |
Set mood |
/mood list |
List available moods |
Available moods: sarcastic, friendly, formal, funny, aggressive, shy, creative, philosophical, minimal, chaotic
| Command | Description |
|---|---|
/reset |
Clear history, memory and reset mood |
/set_prompt <text> |
Override system prompt for current chat |
API Endpoint: http://localhost:1234/v1/chat/completions
Default Model: llama-3.1-8b-instruct
Request Timeout: 60 seconds
Temperature: 0.5
Max Tokens: 200- User-facing messages: Russian
- Developer resources: English
- History size: Configurable via
HISTORY_MAXinconfig.py - Memory files: Stored in
data/directory, excluded from git - PROJECT_LINKS: Customizable in
config.py
Made with local AI




