wandb / openui

OpenUI let's you describe UI using your imagination, then see it rendered live.
https://openui.fly.dev
Apache License 2.0
19.07k stars 1.75k forks source link

Is there maybe a way to implement Ollama connection better to more easily use Ollama models? #18

Closed alfi4000 closed 6 months ago

alfi4000 commented 6 months ago

Is there maybe a way to implement Ollama connection better to more easily use Ollama models? I am confused a bit from the instruction about Ollama usage!

vanpelt commented 6 months ago

Hey @alfi4000 I'm going to make the codespace setup just work with Ollama and provide more instructions. I'll link to it and close this ticket once it's done hopefully later today.

alfi4000 commented 6 months ago

Hey @alfi4000 I'm going to make the codespace setup just work with Ollama and provide more instructions. I'll link to it and close this ticket once it's done hopefully later today.

Ok

rony432 commented 6 months ago

im interested too

vanpelt commented 6 months ago

Hey guys, just pushed the changes, should work now. Instructions for GH codespaces here.

rony432 commented 6 months ago

with new codespace not working. problem is official OPENAI package, all project that use it have problems with Ollama.

ollama installed manually.

/workspaces/openui (main) $ ollama list
NAME                    ID              SIZE    MODIFIED           
codellama:latest        8fdf8f752f6e    3.8 GB  5 minutes ago     
llama2:latest           78e26419b446    3.8 GB  8 seconds ago     
llava:latest            8dd30f6b0cb1    4.7 GB  About a minute ago

error in python

  File "/workspaces/openui/backend/openui/server.py", line 138, in chat_completions
    raise HTTPException(status_code=e.status_code, detail=msg)
fastapi.exceptions.HTTPException: 401: Error code: 401 - {'error': {'message': 'Incorrect API key provided: xxx. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}
INFO:     10.240.0.222:0 - "POST /v1/chat/completions HTTP/1.1" 401 Unauthorized

npm - lots of errors

  VITE v5.2.7  ready in 524 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
src/components/ErrorBoundary.tsx(31,3): Unexpected console statement. no-console
src/hooks/index.ts(9,21): Expected to return a value at the end of arrow function. @typescript-eslint/consistent-return
src/pages/AI/index.tsx(33,4): Unexpected console statement. no-console
src/components/HistoryItem.tsx(22,2): Prop name `active` doesn’t match rule `^(is|has)[A-Z]([A-Za-z0-9]?)+` react/boolean-prop-naming
src/components/HistoryItem.tsx(23,2): Prop name `collapsed` doesn’t match rule `^(is|has)[A-Z]([A-Za-z0-9]?)+` react/boolean-prop-naming
src/components/Register.tsx(34,26): Prefer the safe `: unknown` for a catch callback variable. @typescript-eslint/use-unknown-in-catch-callback-variable
src/components/Register.tsx(34,36): Unexpected console statement. no-console
src/components/Register.tsx(44,5): Unexpected console statement. no-console
src/components/Settings.tsx(41,4): Unexpected console statement. no-console
src/components/Settings.tsx(93,29): Unsafe assignment of an `any` value. @typescript-eslint/no-unsafe-assignment
src/components/Settings.tsx(93,31): Unsafe member access .digest on an `any` value. @typescript-eslint/no-unsafe-member-access
src/components/Settings.tsx(93,58): Unsafe member access .name on an `any` value. @typescript-eslint/no-unsafe-member-access
src/components/Settings.tsx(94,16): Unsafe member access .name on an `any` value. @typescript-eslint/no-unsafe-member-access
src/components/Settings.tsx(135,18): Prefer the safe `: unknown` for a catch callback variable. @typescript-eslint/use-unknown-in-catch-callback-variable
src/components/Settings.tsx(135,28): Unexpected console statement. no-console
src/components/ui/dropdown-menu.tsx(1,1): Filename is not in camel case or pascal case. Rename it to `dropdownMenu.tsx` or `DropdownMenu.tsx`. unicorn/filename-case
src/components/ui/dropdown-menu.tsx(172,46): Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`. arrow-body-style
src/components/ui/label.tsx(24,10): Prefer default export on a file with single export. import/prefer-default-export
src/components/ui/slider.tsx(26,10): Prefer default export on a file with single export. import/prefer-default-export
src/api/ollama.ts(8,3): Unsafe return of an `any[]` typed value. @typescript-eslint/no-unsafe-return
src/api/ollama.ts(10,3): Unexpected console statement. no-console
src/api/openui.ts(57,3): Unexpected console statement. no-console
src/api/openui.ts(68,2): Async function 'getSession' expected no return value. @typescript-eslint/consistent-return
src/api/openui.ts(147,3): Unexpected console statement. no-console
src/api/openui.ts(172,2): Unexpected console statement. no-console
src/api/openui.ts(190,3): Unexpected console statement. no-console
src/state/atoms/history.ts(177,6): Unexpected console statement. no-console
src/api/openai.ts(93,3): Unexpected console statement. no-console
src/pages/AI/Builder.tsx(60,3): Unexpected console statement. no-console
src/pages/AI/Builder.tsx(65,2): Unexpected console statement. no-console
src/pages/AI/Builder.tsx(69,47): Prop name `shared` doesn’t match rule `^(is|has)[A-Z]([A-Za-z0-9]?)+` react/boolean-prop-naming
src/pages/AI/Builder.tsx(128,16): Prefer the safe `: unknown` for a catch callback variable. @typescript-eslint/use-unknown-in-catch-callback-variable
src/pages/AI/Builder.tsx(129,5): Unexpected console statement. no-console
src/pages/AI/Builder.tsx(174,5): Unexpected console statement. no-console
src/pages/AI/Builder.tsx(213,13): Prefer the safe `: unknown` for a catch callback variable. @typescript-eslint/use-unknown-in-catch-callback-variable
src/pages/AI/Builder.tsx(217,6): Unexpected console statement. no-console
src/pages/AI/Builder.tsx(272,4): Unexpected console statement. no-console
src/pages/AI/Builder.tsx(342,4): Unexpected console statement. no-console
src/pages/AI/Builder.tsx(410,11): Prefer the safe `: unknown` for a catch callback variable. @typescript-eslint/use-unknown-in-catch-callback-variable
src/pages/AI/Builder.tsx(412,5): Unexpected console statement. no-console
src/pages/AI/Builder.tsx(434,4): Unexpected console statement. no-console
src/pages/AI/Builder.tsx(544,27): Prefer the safe `: unknown` for a catch callback variable. @typescript-eslint/use-unknown-in-catch-callback-variable
src/pages/AI/Builder.tsx(544,36): Unexpected console statement. no-console
src/components/CodeViewer.tsx(66,2): Prop name `shared` doesn’t match rule `^(is|has)[A-Z]([A-Za-z0-9]?)+` react/boolean-prop-naming
src/lib/markdown.ts(62,3): Unexpected console statement. no-console
src/components/HtmlAnnotator.tsx(75,2): Prop name `rendering` doesn’t match rule `^(is|has)[A-Z]([A-Za-z0-9]?)+` react/boolean-prop-naming
src/components/HtmlAnnotator.tsx(197,5): Unexpected console statement. no-console
src/components/HtmlAnnotator.tsx(478,12): Unexpected console statement. no-console
src/components/Scaffold.tsx(4,2): Prop name `loading` doesn’t match rule `^(is|has)[A-Z]([A-Za-z0-9]?)+` react/boolean-prop-naming
src/components/ShareDialog.tsx(33,13): Prefer the safe `: unknown` for a catch callback variable. @typescript-eslint/use-unknown-in-catch-callback-variable
src/components/ShareDialog.tsx(34,6): Unexpected console statement. no-console
src/components/FileUpload.tsx(49,7): Unexpected console statement. no-console
src/components/FileUpload.tsx(52,7): Unexpected alert. no-alert

it does not hit ollama serve end point at all

/workspaces/openui (main) $ ollama serve
time=2024-04-03T12:39:37.108Z level=INFO source=images.go:804 msg="total blobs: 16"
time=2024-04-03T12:39:37.109Z level=INFO source=images.go:811 msg="total unused blobs removed: 0"
time=2024-04-03T12:39:37.113Z level=INFO source=routes.go:1118 msg="Listening on 127.0.0.1:11434 (version 0.1.30)"
time=2024-04-03T12:39:37.114Z level=INFO source=payload_common.go:113 msg="Extracting dynamic libraries to /tmp/ollama2919922707/runners ..."
time=2024-04-03T12:39:41.032Z level=INFO source=payload_common.go:140 msg="Dynamic LLM libraries [cpu_avx2 cpu rocm_v60000 cpu_avx cuda_v11]"
time=2024-04-03T12:39:41.032Z level=INFO source=gpu.go:115 msg="Detecting GPU type"
time=2024-04-03T12:39:41.032Z level=INFO source=gpu.go:265 msg="Searching for GPU management library libcudart.so*"
time=2024-04-03T12:39:41.247Z level=INFO source=gpu.go:311 msg="Discovered GPU libraries: [/tmp/ollama2919922707/runners/cuda_v11/libcudart.so.11.0]"
time=2024-04-03T12:39:41.248Z level=INFO source=gpu.go:340 msg="Unable to load cudart CUDA management library /tmp/ollama2919922707/runners/cuda_v11/libcudart.so.11.0: cudart init failure: 35"
time=2024-04-03T12:39:41.248Z level=INFO source=gpu.go:265 msg="Searching for GPU management library libnvidia-ml.so"
time=2024-04-03T12:39:41.250Z level=INFO source=gpu.go:311 msg="Discovered GPU libraries: []"
time=2024-04-03T12:39:41.250Z level=INFO source=cpu_common.go:11 msg="CPU has AVX2"
time=2024-04-03T12:39:41.250Z level=INFO source=routes.go:1141 msg="no GPU detected"

error in webui

Error! 401 Error code: 401 - {'error': {'message': 'Incorrect API key provided: xxx. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}