Nephalem/llama-cpp-telegram_bot
0
1---2title: Telegram Bot LLM3emoji: "๐จ"4colorFrom: green5colorTo: blue6sdk: docker7sdk_version: '1.0'8pinned: false9license: mit10---11 12# Telegram Bot LLM13 14This project provides a simple Telegram bot using `llama-cpp-python`. It runs as a FastAPI service so it can be deployed easily to [Hugging Face Spaces](https://huggingface.co/spaces).15 16## Directory structure17 18```19/app20โโ llamabot/21โ โโ engine.py22โ โโ telegram_ui.py23โ โโ i18n.py24โ โโ settings.py25โโ main.py26โโ presets/27โโ characters/28```29 30## Environment variables31 32- `TELEGRAM_TOKEN` โ bot token.33- `HISTORY_DIR_PATH` โ history directory (`/tmp/history` by default).34- `MODEL_CACHE_DIR` โ model cache directory (`/tmp/model_cache`).35- `LLAMA_THREADS` โ number of inference threads (defaults to CPU count).36- `LLAMA_BATCH` โ batch size (512 by default).37- `MLLOCK_DISABLED` โ disable `mlock` when true.38 39## Running locally40 41Install dependencies and run the FastAPI app:42 43```bash44pip install -r requirements.txt45python app/main.py46```47 48For deployment on HF Spaces use the provided `Dockerfile`.49 50 