Skip to content

Latest commit

Β 

History

History
119 lines (77 loc) Β· 2.96 KB

File metadata and controls

119 lines (77 loc) Β· 2.96 KB

Ollama Telegram Bot Companion 🌟

Effortlessly bridge the gap between a self-hosted Llama 3.2 model and Telegram with this Node.js application.

Ollama Telegram Bot Companion enables users to interact directly with a local Ollama instance via Telegram, using the Node Telegram Bot API. Perfect for creating an AI-powered conversational companion or experimenting with Llama models in a seamless and efficient way.


✨ Features

  • AI-Powered Conversations: Leverage the advanced capabilities of Llama 3.2 for rich, contextual chat interactions.
  • Direct Telegram Integration: No need for a web serverβ€”interact directly with Ollama through Telegram.
  • PM2 Support: Designed to run reliably in production using PM2.
  • Simplified Setup: Straightforward configuration and deployment.

πŸš€ Getting Started

Prerequisites

Before you start, ensure you have the following installed:


Installation

  1. Clone the Repository

    git clone git@github.com:manozzo/ai-telegram-bot.git
    cd ai-telegram-bot
  2. Install Dependencies

    npm install
  3. Configure Environment Variables Create a .env file in the project root and configure it:

    TELEGRAM_BOT_TOKEN=your_telegram_bot_token
  4. Start with PM2 Use PM2 to run the bot for improved reliability and monitoring:

    pm2 start src/services/telegramBotService.js --name ai-telegram-bot
    pm2 save

    To view logs:

    pm2 logs ai-telegram-bot

Usage

  • Open Telegram and start a chat with your bot.
  • Send a message, and the bot will interact with your local Ollama instance to generate AI-driven responses.

πŸ”§ Project Structure

πŸ“ src/
β”œβ”€β”€ πŸ“ services/
β”‚   β”œβ”€β”€ πŸ“„ ollamaService.js   # Handles interactions with the local Ollama API
β”‚   └── πŸ“„ telegramBotService.js # Telegram bot logic and API integration

🀝 Contributing

Contributions are welcome! If you’d like to improve this project:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature-name).
  3. Commit your changes (git commit -m 'Add feature').
  4. Push to the branch (git push origin feature-name).
  5. Open a pull request.

πŸ› οΈ Future Improvements

  • Enhanced Error Handling
  • Support for Advanced Ollama Features
  • Scalability Enhancements

🌟 Show Your Support

If you find this project helpful, please ⭐ the repository and share it with your network!


πŸ“§ Contact

Have questions or suggestions? Feel free to open an issue or reach out via LinkedIn.


Let's build the future of AI, one chat at a time! πŸš€