CoolFace
Apppublic

Nephalem/llama-cpp-telegram_bot

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
README.md50 linesDownload Raw Back to root
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