A telegram bot that leverages the Ollama AI model for text processing.
Follow these steps to set up and run the application:
Make sure you have the Ollama app installed on your machine. Download it from the official Ollama website and follow the installation instructions for your platform.
After installing Ollama, download the model you want to use (e.g., llama3.2
). Run the following command in your terminal:
ollama pull llama3.2
Launch the Ollama app by running:
ollama serve
This will start the Ollama Server and make it accessible via localhost:11434
by default.
Create a .env file in the root directory of the project, based on the provided .env.example file. Populate it with your API token and model name.
Example .env file:
API_TOKEN=your_telegram_api_token_here
LLAMA_MODEL=llama3.2
Replace your_telegram_api_token_here with your Telegram Bot API token and llama3.2 with the name of the model you downloaded.
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
venv\Scripts\activate
source venv/bin/activate
Install the required Python libraries by running:
pip install -r requirements.txt
Start the application by running:
python main.py