ai:ollama-openwebui
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ai:ollama-openwebui [2024/06/27 12:48] – Wulf Rajek | ai:ollama-openwebui [2024/08/08 17:31] (current) – Wulf Rajek | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Ollama Open-Webui ====== | ====== Ollama Open-Webui ====== | ||
+ | |||
+ | Note: You should have at least 8 GB of RAM available to run the 7B models, 16 GB to run the 13B models, and 32 GB to run the 33B models. | ||
Notes only for now: | Notes only for now: | ||
Line 14: | Line 16: | ||
mkdir / | mkdir / | ||
mkdir / | mkdir / | ||
+ | mkdir / | ||
+ | mkdir / | ||
</ | </ | ||
<code - docker-ollama.yml> | <code - docker-ollama.yml> | ||
+ | name: ollama | ||
services: | services: | ||
ollama: | ollama: | ||
Line 26: | Line 31: | ||
- 11434:11434 | - 11434:11434 | ||
#runtime: nvidia | #runtime: nvidia | ||
+ | restart: unless-stopped | ||
deploy: | deploy: | ||
resources: | resources: | ||
Line 31: | Line 37: | ||
devices: | devices: | ||
- driver: nvidia | - driver: nvidia | ||
- | device_ids: [' | + | |
+ | count: 1 | ||
capabilities: | capabilities: | ||
</ | </ | ||
<code - docker-openwebui.yml> | <code - docker-openwebui.yml> | ||
+ | name: open-webui | ||
services: | services: | ||
open-webui: | open-webui: | ||
Line 51: | Line 59: | ||
volumes: | volumes: | ||
- / | - / | ||
- | restart: | + | restart: |
extra_hosts: | extra_hosts: | ||
host.docker.internal: | host.docker.internal: | ||
environment: | environment: | ||
- | - WEBUI_NAME=" | + | - WEBUI_NAME=CustomGPTName |
+ | - TZ=Europe/ | ||
+ | - RAG_EMBEDDING_MODEL_TRUST_REMOTE_CODE=True # allow sentencetransformers to execute code like for alibaba-nlp/ | ||
</ | </ | ||
<code - docker-openedai-speech.yml> | <code - docker-openedai-speech.yml> | ||
+ | name: openedai-speech | ||
services: | services: | ||
openedai-speech: | openedai-speech: | ||
Line 91: | Line 103: | ||
<code - docker-pipelines.yml> | <code - docker-pipelines.yml> | ||
+ | name: pipelines | ||
services: | services: | ||
pipelines: | pipelines: | ||
Line 110: | Line 123: | ||
capabilities: | capabilities: | ||
</ | </ | ||
+ | |||
+ | https:// | ||
+ | |||
Under settings-> | Under settings-> | ||
- OPENAI API host: http:// | - OPENAI API host: http:// | ||
- OPENAI API Key: 0p3n-w3bu! | - OPENAI API Key: 0p3n-w3bu! | ||
+ | |||
+ | < | ||
+ | git clone https:// | ||
+ | </ | ||
+ | |||
+ | <code - docker-faster-whisper-server.yml> | ||
+ | name: faster-whisper-server | ||
+ | services: | ||
+ | faster-whisper-server-cuda: | ||
+ | image: fedirz/ | ||
+ | build: | ||
+ | dockerfile: faster-whisper-server/ | ||
+ | context: ./ | ||
+ | platforms: | ||
+ | - linux/amd64 | ||
+ | volumes: | ||
+ | - / | ||
+ | restart: unless-stopped | ||
+ | ports: | ||
+ | - 8010:8000 | ||
+ | develop: | ||
+ | watch: | ||
+ | - path: faster_whisper_server | ||
+ | action: rebuild | ||
+ | deploy: | ||
+ | resources: | ||
+ | reservations: | ||
+ | devices: | ||
+ | - capabilities: | ||
+ | |||
+ | </ | ||
+ | go to settings -> audio, set | ||
+ | - OPENAI API host: http:// | ||
+ | - OPENAI API Key: sk-something | ||
+ | - model: whisper-1 | ||
+ | |||
+ | |||
+ | NOTE: speech to text requires https connection to open-webui as browsers do not have access to microphone on http connection! | ||
+ | |||
+ | < | ||
+ | mkdir / | ||
+ | cd / | ||
+ | openssl req -subj '/ | ||
+ | </ | ||
+ | <code - / | ||
+ | server { | ||
+ | listen 80; | ||
+ | server_name _; | ||
+ | return 301 https:// | ||
+ | } | ||
+ | server { | ||
+ | listen 443 ssl; | ||
+ | ssl_certificate / | ||
+ | ssl_certificate_key / | ||
+ | location / { | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <code - docker-ssl-proxy.yml> | ||
+ | name: nginx-proxy | ||
+ | services: | ||
+ | nginx-proxy: | ||
+ | image: nginx | ||
+ | container_name: | ||
+ | ports: | ||
+ | - 80:80 | ||
+ | - 443:443 | ||
+ | volumes: | ||
+ | - / | ||
+ | restart: unless-stopped | ||
+ | extra_hosts: | ||
+ | host.docker.internal: | ||
+ | environment: | ||
+ | - TZ=Europe/ | ||
+ | </ | ||
+ | |||
+ | To pull an ollama image, better to use ollama directly as the webinterface doesn' | ||
+ | < | ||
+ | docker exec -ti ollama ollama pull imagename: | ||
+ | </ | ||
+ | |||
+ | To update all previously pulled ollama models, use this bash script: | ||
+ | <code bash update-ollama-models.sh> | ||
+ | #!/bin/bash | ||
+ | |||
+ | docker exec -ti ollama ollama list | tail -n +2 | awk ' | ||
+ | echo " | ||
+ | docker exec -t ollama ollama pull $model | ||
+ | echo " | ||
+ | done | ||
+ | echo "All models updated." | ||
+ | </ | ||
Line 156: | Line 266: | ||
</ | </ | ||
- | docker install - WSL2 backend | + | Create the respective docker volumes folder: |
- | cmd line | + | < |
+ | # p/ | ||
+ | mkdir P: | ||
+ | </ | ||
+ | |||
+ | # docker install - choose the WSL2 backend | ||
+ | # cmd line | ||
< | < | ||
docker compose -f docker-openwebui.yml up -d | docker compose -f docker-openwebui.yml up -d | ||
Line 163: | Line 280: | ||
</ | </ | ||
- | mkdir | + | |
- | p/Docker_Volumes | + | to update all ollama models on windows, use this powershell command - adjust for the hostname/ip ollama is running on: |
+ | <code powershell> | ||
+ | (Invoke-RestMethod http:// | ||
+ | |||
+ | #or if in docker | ||
+ | (Invoke-RestMethod http:// | ||
+ | </ | ||
+ | |||
+ | |||
+ | ====== Curl OpenAI API test ====== | ||
+ | |||
+ | < | ||
+ | curl http:// | ||
+ | -H " | ||
+ | -d '{ | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | }' | ||
+ | {" | ||
+ | </ |
ai/ollama-openwebui.1719488935.txt.gz · Last modified: 2024/06/27 12:48 by Wulf Rajek