Skip to content

A Discord AI chat bot | Choose your LLM | This has been updated to no longer work with OpenAI and instead works with LM-Studio | Mistral API | Streamed responses | And more 🔥

Notifications You must be signed in to change notification settings

Emperornero/llmcord-lmstudio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

llmcord
(by jakobdylanc)

Code style: black

Talk to LLMs with your friends!

Features

  • BEST CHAT SYSTEM

    @ the bot and it will reply to your message. Reply to the bot's message to continue the conversation from that point. Build conversations with reply chains!

    Works when replying to ANY message in your server, just @ the bot!

  • STREAMED RESPONSES

    The bot's responses are dynamically generated just like ChatGPT.

    With intuitive color coding (orange = generating, green = done).

  • VISION SUPPORT

    The bot can see your image attachments when set to a vision model.

And more...

  • Choose your LLM (from OpenAI or Mistral API)
  • Easily set a custom personality (aka system prompt)
  • User identity aware
  • Fully asynchronous
  • 1 Python file, ~200 lines of code

Instructions

Before you start, install Python and clone this git repo.

  1. Install Python requirements:
pip install -r requirements.txt
  1. Create .env from .env.example and set it up:
Setting Instructions
DISCORD_BOT_TOKEN Create a new Discord application at discord.com/developers/applications and generate a token under the Bot tab. Also enable MESSAGE CONTENT INTENT.
OPENAI_API_KEY Only required if you select an OpenAI model. Generate an OpenAI API key at platform.openai.com/account/api-keys. You must also add a payment method to your OpenAI account at platform.openai.com/account/billing/payment-methods.
MISTRAL_API_KEY Only required if you select a Mistral model. Generate a Mistral API key at console.mistral.ai/user/api-keys. You must also add a payment method to your Mistral account at console.mistral.ai/billing.
LLM OpenAI models:
   gpt-3.5-turbo-1106 (latest GPT-3.5 Turbo)
   gpt-4-1106-preview (GPT-4 Turbo)
   gpt-4-vision-preview (GPT-4 Turbo with vision)
Mistral models:
   mistral-tiny (Mistral-7B)
   mistral-small (Mixtral-8X7B)
   mistral-medium (Mistral internal prototype)
MAX_IMAGES The maximum number of image attachments allowed in a single message. Only applicable when using a vision model. (Default: 5)
MAX_MESSAGES The maximum number of messages in a reply chain. (Default: 20)
CUSTOM_SYSTEM_PROMPT Write practically anything you want to customize the bot's behavior!
  1. Invite the bot to your Discord server with this URL (replace <CLIENT_ID> with your Discord application's client ID found under the OAuth2 tab):
https://discord.com/api/oauth2/authorize?client_id=<CLIENT_ID>&permissions=412317273088&scope=bot
  1. Run the bot:
python llmcord.py

Star History

Star History Chart

About

A Discord AI chat bot | Choose your LLM | This has been updated to no longer work with OpenAI and instead works with LM-Studio | Mistral API | Streamed responses | And more 🔥

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%