llmcord (Discord)
Integrate llmcord.py with Jan
Section titled “Integrate llmcord.py with Jan”llmcord.py lets you and your friends chat with LLMs directly in your Discord server.
To integrate Jan with llmcord.py, follow the steps below:
-
Clone the Repository Clone the discord bot’s repository by using the following command:
Terminal window git clone https://github.com/jakobdylanc/discord-llm-chatbot.git -
Install the Required Libraries After cloning the repository, run the following command:
Terminal window pip install -r requirements.txt -
Set the Environment
- Create a copy of
.env.example. - Change the name to
.env. - Set the environment with the following options:
Setting Instructions DISCORD_BOT_TOKENCreate a new Discord bot at discord.com/developers/applications, obtain a token from the Bot tab, and enable MESSAGE CONTENT INTENT. DISCORD_CLIENT_IDFound under the OAuth2 tab of the Discord bot you just made. LLMFor Jan, set to local/openai/(MODEL_NAME), where(MODEL_NAME)is your loaded model’s name.LLM_SYSTEM_PROMPTAdjust the bot’s behavior as needed. LOCAL_SERVER_URLURL of your local API server. For Jan, set it to http://localhost:1337/v1.For more configuration options, refer to llmcord.py’s README.
- Create a copy of
-
Run the Bot Run the bot by using the following command in your command prompt:
Terminal window python llmcord.pyThe bot’s invite URL will be printed in the console. Use it to add the bot to your server.