Mateodioev / ollama-bot

Telegram bot to interact with ollama models

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ollama telegram bot

This bot helps you to interact with ollama models

out.mp4

Commands

If you want to generate a completion just send a private message to the bot or if you want to use in a public group use the command /chat followed by the text of your choice. Other commands:

  • /setmodel Change your current model
  • /start

Installation

Requirements:

  • >= PHP 8.2
  • Mysql
  • Access to ollama api

Steps

  1. Clone this repository
git clone https://github.com/Mateodioev/ollama-bot.git
cd ollama-bot
  1. Install dependencies
composer install --optimize-autoloader --no-interaction --no-dev
  1. Setup your database mysql with file db/main.sql

  2. Create an edit .env file

cp .env.example .env
vim .env # Or use your favorite editor
  1. Run the bot
php index.php

Note

If your default model is diferent to codellama for example llama2, edit the file src/Events/Middlewares.php line 13

See ollama docs in https://github.com/jmorganca/ollama

About

Telegram bot to interact with ollama models

License:MIT License


Languages

Language:PHP 100.0%