mirror of
https://github.com/kevinthedang/discord-ollama.git
synced 2026-09-23 17:08:58 -04:00
llmman (https://github.com/llmmanorg/llmman) serves the Ollama API on port 17434 and works with the bot as-is, so document it in setup-local and link it from the README. Since the backend is no longer Ollama-only, rename the env vars to LLM_ENDPOINT / LLM_PORT as requested in review. OLLAMA_IP / OLLAMA_PORT are kept as deprecated aliases in keys.ts and docker-compose.yml so existing deployments keep working.
3.7 KiB
3.7 KiB
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. - Since Ollama will run as a systemd service, there is no need to run
ollama serveunless you disable it. If you do disable it or have an olderollamaversion, do the following:- In terminal 1 ->
ollama serveto setup ollama - In terminal 2 ->
ollama run [model name], for exampleollama run llama2- The models can vary as you can create your own model. You can also view ollama's library of models.
- In terminal 1 ->
- Otherwise, if you have the latest
ollama, you can just runollama run [model name]rather than running this in 2 terminals. - If there are any issues running ollama because of missing LLMs, run
ollama pull [model name]as it will pull the model if Ollama has it in their library.- This can also be done in wsl for Windows machines.
- This should also not be a problem is a future feature that allows for pulling of models via discord client. For now, they must be pulled manually.
- You can now interact with the model you just ran (it might take a second to startup).
- Response time varies with processing power!
Note
You can now pull models directly from the Discord client using
/pull-model <model-name>or/switch-model <model-name>. They must exist from your local model library or from the Ollama Model Library
Using with llmman (alternative to Ollama)
- llmman is a local model runner that serves the Ollama API on port
17434. The bot talks to it exactly as it would to Ollama, only the port differs. - Install it with
curl -fsSL https://raw.githubusercontent.com/llmmanorg/llmman/main/install.sh | sh(Linux/macOS) orirm https://raw.githubusercontent.com/llmmanorg/llmman/main/install.ps1 | iex(Windows). - Start the server with
llmman serveand pull a model withllmman pull [model name], for examplellmman pull gemma4orllmman pull hf.co/unsloth/Qwen3.5-0.8B-GGUF. - Point the bot at it by setting
LLM_ENDPOINT = 127.0.0.1andLLM_PORT = 17434in your.env, then setMODELto a model you pulled./pull-model,/switch-modeland/delete-modelwork the same way.
To Run Locally (without Docker)
- Run
npm installto install the npm packages. - Ensure that your .env file's
LLM_ENDPOINTis127.0.0.1to work properly.- You only need your
CLIENT_TOKEN,LLM_ENDPOINT,LLM_PORT. - The LLM server ip and port should just use it's defaults by nature. If not, utilize
LLM_ENDPOINT = 127.0.0.1andLLM_PORT = 11434. - The older
OLLAMA_IP/OLLAMA_PORTnames are still accepted as deprecated aliases.
- You only need your
- Now, you can run the bot by running
npm run clientwhich 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.
- If you are using wsl, open up a separate terminal/shell to startup the ollama service. Again, if you are running an older ollama, you must run
ollama servein that shell.- If you are on an actual Linux machine/VM there is no need for another terminal (unless you have an older ollama version).
- If you do not have a model, you can optionally run
ollama pull [model name]in wsl prior to application start. You are not required as it can be pulled from the Discord client.