mirror of
https://github.com/kevinthedang/discord-ollama.git
synced 2025-12-12 11:56:06 -05:00
v0.1.3
* added options to queries * removed hard coded vals, added message options * updated importing * added check for message mentions * fix missing botID * updated token to uid * added contributer --------- Co-authored-by: JT2M0L3Y <jtsmoley@icloud.com>
Discord Ollama Integration

Ollama is an AI model management tool that allows users to install and use custom large language models locally. The goal is to create a discord bot that will utilize Ollama and chat with it on a Discord!
Ollama Setup
- Go to Ollama's Linux download page and run the simple curl command they provide. The command should be
curl https://ollama.ai/install.sh | sh. - Now the the following commands in separate terminals to test out how it works!
- You can now interact with the model you just ran (it might take a second to startup).
- Response time varies with processing power!
To Run
- Clone this repo using
git clone https://github.com/kevinthedang/discord-ollama.gitor just use GitHub Desktop to clone the repo. - Run
npm installto install the npm packages. - You will need a
.envfile in the root of the project directory with the bot's token.- For example,
CLIENT_TOKEN = [Bot Token]
- For example,
- Now, you can run the bot by running
npm run startwhich will build and run the decompiled typescript and run the setup for ollama.- IMPORTANT: This must be ran in the wsl/Linux instance to work properly! Using Command Prompt/Powershell/Git Bash/etc. will not work on Windows (at least in my experience).
- Refer to the resources on what node version to use.
Resources
- NodeJS
- This project uses
v20.10.0(npm10.2.5). Consider using nvm for multiple NodeJS versions.- To run dev in
ts-node, usingv18.18.2is recommended. CAUTION:v18.19.0orlts/hydrogenwill not run properly. - To run dev with
tsx, you can usev20.10.0or earlier.
- To run dev in
- This project supports any NodeJS version above
16.x.xto only allow ESModules.
- This project uses
- Ollama
- Discord Developer Portal
- Discord.js Docs
Acknowledgement
discord-ollama © 2023 by Kevin Dang is licensed under CC BY-NC 4.0
Description
Languages
TypeScript
99.5%
Dockerfile
0.5%