{"id":14964679,"url":"https://github.com/m0wer/aibot","last_synced_at":"2025-10-25T08:30:19.598Z","repository":{"id":250218131,"uuid":"833827296","full_name":"m0wer/aibot","owner":"m0wer","description":"Telegram bot powered by Ollama, capable of handling text and voice messages, with configurable language models and system prompts.","archived":false,"fork":false,"pushed_at":"2024-08-04T07:45:17.000Z","size":52,"stargazers_count":4,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-30T03:39:51.756Z","etag":null,"topics":["ai","assistant","llama3","ollama","telegram","telegram-bot","tts","whisper"],"latest_commit_sha":null,"homepage":"https://t.me/aibot_llm_bot","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m0wer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-25T20:49:38.000Z","updated_at":"2024-08-30T17:57:12.000Z","dependencies_parsed_at":"2024-07-25T23:42:42.358Z","dependency_job_id":"b6a7b18e-587b-4548-b916-85ceb0304517","html_url":"https://github.com/m0wer/aibot","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"beb9c654692d10cddb80db69da63cff10b9e4b30"},"previous_names":["m0wer/aibot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0wer%2Faibot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0wer%2Faibot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0wer%2Faibot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0wer%2Faibot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m0wer","download_url":"https://codeload.github.com/m0wer/aibot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219866279,"owners_count":16555908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","assistant","llama3","ollama","telegram","telegram-bot","tts","whisper"],"created_at":"2024-09-24T13:33:37.163Z","updated_at":"2025-10-25T08:30:19.307Z","avatar_url":"https://github.com/m0wer.png","language":"Python","readme":"# Ollama Telegram Bot\n\nThis project implements a Telegram bot powered by Ollama, capable of handling text and voice messages, with configurable language models and system prompts.\n\n## Features\n\n- Handles text and voice messages\n- Uses Ollama for natural language processing\n- Configurable Ollama URL and model\n- Text-to-Speech (TTS) and Speech-to-Text (STT) capabilities\n- Uses RQ (Redis Queue) for processing messages and audio conversion\n- Different priority queues and a special GPU queue for Whisper STT using CUDA\n- Allows users to adjust their system prompt\n- Uses recent messages as context for responses\n- Stores all interactions in SQLite using SQLModel\n- Dockerized setup with configurable resource limits\n\n## Prerequisites\n\n- Docker and Docker Compose\n- Ollama server running (can be on the same machine or a remote server)\n- Telegram Bot Token (obtainable from BotFather on Telegram)\n\n\n## Running the Bot\n\n1. Build and start the services:\n   ```\n   cp .env.example .env\n   # Edit the .env file and set your TELEGRAM_TOKEN and OLLAMA_URL\n   docker compose up --build \n   ```\n\n2. The bot should now be running and responding to messages on Telegram.\n\n## Configuration\n\nYou can configure the following environment variables in your `.env` file:\n\n- `TELEGRAM_TOKEN`: Your Telegram Bot Token (required)\n- `OLLAMA_URL`: URL of your Ollama server (default: http://host.docker.internal:11434)\n- `OLLAMA_MODEL`: Ollama model to use (default: llama3.1)\n\n## Usage\n\n- Start a chat with your bot on Telegram\n- Send text messages or voice notes to interact with the bot\n- Use the `/prompt` command to change the system prompt for the Ollama model\n\n## Development\n\nTo modify the bot or add new features:\n\n1. Edit the `bot.py` file to change the bot's behavior\n1. Modify the `Dockerfile` if you need to add new system dependencies\n1. Update the `requirements.in` file if you add or remove Python dependencies\n1. Rebuild the `requirements.txt` file using `pip-compile requirements.in`\n1. Rebuild and restart the services using `docker compose up --build`\n\n## Troubleshooting\n\n- If the bot can't connect to Ollama, make sure the `OLLAMA_URL` is correctly set and the Ollama server is running and accessible.\n- For GPU support, ensure you have the necessary GPU drivers and Docker GPU runtime set up. Otherwise, disable the GPU reservations from the `docker compose.yaml` file with `sed -i 's/^.*devices:.*$/#\u0026/' docker-compose.yaml`.\n- Check the Docker logs for any error messages: `docker compose logs`.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm0wer%2Faibot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm0wer%2Faibot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm0wer%2Faibot/lists"}