Code Monkey home page Code Monkey logo

telegram-llm-assistant's Introduction

Rust

A minimalistic Telegram assistant with customizable LLM API providers. It has a very simple installation process: download the binary for your architecture and run it. It will create an Sqlite3 database file, run migrations and start the bot.

Built with:

  • Mobot Telegram bot framework
  • Sqlx SQL toolkit
  • Sqlite self-contained database

Creating a Telegram bot and obtaining a token

Go to BotFather and enter /newbot. Fill in the description and save the token to the TELEGRAM_TOKEN environment variable. To define the commands for the autocomplete: enter /setcommands, select your bot, and then paste:

new - Clear the current context and start a new chat.
get_behavior - Display the current system message that defines the bot's behavior.
set_behavior - Set the new system message for defining the bot's behavior.
get_model - Get the current completion model.
set_model - Set the completion model for your bot.
version - Display the current version.

Running using Docker

Make sure you have Docker & Docker Compose. On desktop, you can use Docker Desktop or OrbStack.

The Docker Compose file expects your environment variables to be loaded:

cp .env.example .envrc
# edit .envrc
source .envrc

Build the image and run the container:

docker build -t telegram-llm-assistant .
docker-compose up

Local development

  • Install Rust via RustUp
  • cp .env.example .envrc
  • Edit .envrc to set environment variables
  • Load environment variables from .envrc using direnv, or source .envrc-equivalent in your shell.
  • Now you can compile with cargo build

Building from source

  • Install Rust via RustUp
  • Clone the repository
  • Run cargo build --release

telegram-llm-assistant's People

Contributors

emkshv avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

shivamb25

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.