https://github.com/bespredel/lmstudiotelegrambot
This repository contains a Go application for running a Telegram bot integrated with LM Studio.
https://github.com/bespredel/lmstudiotelegrambot
go golang lmstudio
Last synced: 4 months ago
JSON representation
This repository contains a Go application for running a Telegram bot integrated with LM Studio.
- Host: GitHub
- URL: https://github.com/bespredel/lmstudiotelegrambot
- Owner: BespredeL
- License: mit
- Created: 2025-02-03T12:46:32.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2025-02-03T12:56:39.000Z (4 months ago)
- Last Synced: 2025-02-03T13:40:42.149Z (4 months ago)
- Topics: go, golang, lmstudio
- Language: Go
- Homepage: https://bespredel.name
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Telegram Bot + LM Studio
[](https://github.com/bespredel/LMStudioTelegramBot/blob/master/README.md)
[](https://github.com/bespredel/LMStudioTelegramBot/blob/master/README_RU.md)
[](https://github.com/bespredel/LMStudioTelegramBot/blob/master/LICENSE)This repository contains a Go application for running a Telegram bot integrated with LM Studio. The bot can be configured to use either polling or webhook methods to interact with users. It features a graphical user interface (GUI) built with the [Fyne framework](https://fyne.io/), allowing users to configure bot settings, select models, and manage users.
## Features
- **Bot control**: Launch and stop the Telegram bot from the interface.
- **Configuration settings**: Easily configure the bot's API address, token, update method (polling/webhook), webhook details, and more.
- **Model management**: Select a model from the available options, and refresh the model list.
- **User management**: View and update the allowed status of users in the system.
- **Logs**: View bot logs in real-time.## Requirements
- Go (1.19+)
- Fyne (GUI framework)
- Telegram bot token (from [BotFather](https://core.telegram.org/bots#botfather))## Installation
1. Clone this repository:
```sh
git clone https://github.com/yourusername/telegram-bot-lmstudio.git
cd telegram-bot-lmstudio
```2. Install the required Go dependencies:
```sh
go get fyne.io/fyne/v2
```3. Build and run the application:
```sh
go run main.go
```## Configuration
Upon launching the application, the user is presented with several configuration options:
- **API Address**: The address of the LM Studio API (e.g., `http://localhost:1234`).
- **Max Tokens**: The token limit for the model.
- **Timeout**: The polling timeout in seconds.
- **Bot Token**: The Telegram bot token obtained from BotFather.
- **Update Method**: Choose between "polling" or "webhook" for receiving updates.
- **Webhook Domain/Port**: Details required for setting up a webhook (only for webhook method).
- **System Role**: The system role used in the LM Studio configuration.
- **LM Studio Mode**: Select between "stream" or "full" modes for interacting with LM Studio.
- **Language**: Choose the language for the bot (e.g., English or Russian).## Bot Control
You can start and stop the Telegram bot from the **Bot** tab. The bot interacts with Telegram users based on the selected model and configuration. The bot logs all interactions and displays them in real-time on the GUI.
- **Polling**: The bot regularly checks for new messages.
- **Webhook**: The bot listens for incoming requests on the specified webhook domain and port.## User Management
The **Users** tab displays a list of users, their ID, username, and whether they are allowed to interact with the bot. You can enable or disable user access by updating the "Allowed" checkbox.
## Logs
The **Bot** tab also displays logs, showing the requests received by the bot. The logs are refreshed every 2 seconds to provide real-time updates.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.