ivanfioravanti / chatbot-ollama

Chatbot Ollama is an open source chat UI for Ollama.
Other
1.41k stars 233 forks source link

support for "custom"/alternative endpoints #14

Open thoraxe opened 11 months ago

thoraxe commented 11 months ago

The following only partially works: podman run -it --rm -e OLLAMA_HOST=http://somewhere.com -p 3000:3000 -e DEFAULT_MODEL=mistral:7b-instruct ghcr.io/ivanfioravanti/chatbot-ollama:main

The UI seems to act like it's willing to follow the ENV, but then forces itself to default to mistral:latest and blows up with errors:

 [OllamaError: model 'mistral:latest' not found, try pulling it first] {
  name: 'OllamaError'
}

image

ivanfioravanti commented 11 months ago

I can't reproduce it, it works for me with: podman run -it --rm -e OLLAMA_HOST=http://somewhere.com:11434 -p 3000:3000 -e DEFAULT_MODEL=mistral:7b-instruct ghcr.io/ivanfioravanti/chatbot-ollama:main

tavindotson commented 11 months ago

First, I really enjoy this project! Thank you.

I am having the same issue. The web-ui reflects the environment variable override for the default model, but the actual request to the server does not.

I am able to work around this issue by first toggling between another installed model and back to the default. It will then work as expected.


I'll see if I can get more info, but here is what I have right now:

My docker-compose.yml file:

version: '3'

services:
  chatbot-ollama:
    image: ghcr.io/ivanfioravanti/chatbot-ollama:main
    environment:
      - OLLAMA_HOST=http://192.168.2.2:11434
      - DEFAULT_MODEL=orca-mini:latest
    ports:
      - 7035:3000
    networks:
      core-network:

networks:
  core-network:
    external: true

When not applying the workaround, this error shows up in the browser window: Application error: a client-side exception has occurred (see the browser console for more information).

screenshot

And the console output when the above error is shown:

framework-467b11a89995b152.js:9 TypeError: Cannot read properties of undefined (reading 'name')
    at index-0a94ad000d539e1c.js:1:31892
    at Xh (framework-467b11a89995b152.js:9:60992)
    at dj (framework-467b11a89995b152.js:9:72859)
    at cj (framework-467b11a89995b152.js:9:72069)
    at x (framework-467b11a89995b152.js:9:122828)
    at Vk (framework-467b11a89995b152.js:9:99132)
    at framework-467b11a89995b152.js:9:98999
    at Jk (framework-467b11a89995b152.js:9:99006)
    at Ok (framework-467b11a89995b152.js:9:95762)
    at Fk (framework-467b11a89995b152.js:9:96151)
Mi @ framework-467b11a89995b152.js:9
main-29b5a530a16ca0e3.js:1 TypeError: Cannot read properties of undefined (reading 'name')
    at index-0a94ad000d539e1c.js:1:31892
    at Xh (framework-467b11a89995b152.js:9:60992)
    at dj (framework-467b11a89995b152.js:9:72859)
    at cj (framework-467b11a89995b152.js:9:72069)
    at x (framework-467b11a89995b152.js:9:122828)
    at Vk (framework-467b11a89995b152.js:9:99132)
    at framework-467b11a89995b152.js:9:98999
    at Jk (framework-467b11a89995b152.js:9:99006)
    at Ok (framework-467b11a89995b152.js:9:95762)
    at Fk (framework-467b11a89995b152.js:9:96151)
renderError @ main-29b5a530a16ca0e3.js:1
main-29b5a530a16ca0e3.js:1 A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred
renderError @ main-29b5a530a16ca0e3.js:1
index-0a94ad000d539e1c.js:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'name')
    at index-0a94ad000d539e1c.js:1:28479
    at onSend (index-0a94ad000d539e1c.js:1:32939)
    at handleSend (index-0a94ad000d539e1c.js:1:8170)
    at onKeyDown (index-0a94ad000d539e1c.js:1:12074)
    at Object.Nb (framework-467b11a89995b152.js:9:14967)
    at Tb (framework-467b11a89995b152.js:9:15121)
    at framework-467b11a89995b152.js:9:33457
    at nf (framework-467b11a89995b152.js:9:33556)
    at se (framework-467b11a89995b152.js:9:33970)
    at framework-467b11a89995b152.js:9:39425
tavindotson commented 11 months ago

First, I really enjoy this project! Thank you.

I am having the same issue. The web-ui reflects the environment variable override for the default model, but the actual request to the server does not.

I am able to work around this issue by first toggling between another installed model and back to the default. It will then work as expected.

I tried reproducing my same issue and was unable to on two other machines, and after doing a fresh install on my original machine the issue went away. ¯\_(ツ)_/¯

ivanfioravanti commented 11 months ago

Same here, I can't reproduce this one ¯_(ツ)_/¯

ivanfioravanti commented 10 months ago

@thoraxe have you been able to sovle the issue?