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/26 13:06] – 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: | ||
| + | |||
| + | https:// | ||
| + | https:// | ||
| + | |||
| Nvidia GPU, linux: | Nvidia GPU, linux: | ||
| Line 7: | Line 13: | ||
| mkdir /opt/ollama | mkdir /opt/ollama | ||
| mkdir / | mkdir / | ||
| + | mkdir / | ||
| + | mkdir / | ||
| + | mkdir / | ||
| + | mkdir / | ||
| + | mkdir / | ||
| </ | </ | ||
| <code - docker-ollama.yml> | <code - docker-ollama.yml> | ||
| + | name: ollama | ||
| services: | services: | ||
| ollama: | ollama: | ||
| Line 19: | Line 31: | ||
| - 11434:11434 | - 11434:11434 | ||
| #runtime: nvidia | #runtime: nvidia | ||
| + | restart: unless-stopped | ||
| deploy: | deploy: | ||
| resources: | resources: | ||
| Line 24: | 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 44: | Line 59: | ||
| volumes: | volumes: | ||
| - / | - / | ||
| + | restart: unless-stopped | ||
| + | extra_hosts: | ||
| + | host.docker.internal: | ||
| + | environment: | ||
| + | - 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> | ||
| + | name: openedai-speech | ||
| + | services: | ||
| + | openedai-speech: | ||
| + | image: ghcr.io/ | ||
| + | container_name: | ||
| + | ports: | ||
| + | - " | ||
| + | volumes: | ||
| + | - / | ||
| + | - / | ||
| + | restart: unless-stopped | ||
| + | deploy: | ||
| + | resources: | ||
| + | reservations: | ||
| + | devices: | ||
| + | - driver: nvidia | ||
| + | device_ids: [' | ||
| + | capabilities: | ||
| + | environment: | ||
| + | - TZ=Europe/ | ||
| + | - TTS_HOME=voices | ||
| + | - HF_HOME=voices | ||
| + | # - PRELOAD_MODEL=xtts | ||
| + | # - PRELOAD_MODEL=xtts_v2.0.2 | ||
| + | # - PRELOAD_MODEL=parler-tts/ | ||
| + | </ | ||
| + | In open-webui under settings -> audio | ||
| + | - set to openai | ||
| + | - API Base URL: http:// | ||
| + | - API Key: sk-111111111 (note: this is a dummy API key, no key required) | ||
| + | - Under TTS Voice within the same audio settings menu in the admin panel, you can set the TTS Model to use from the following choices below that openedai-speech supports. The voices of these models are optimized for the English language.\\ tts-1 or tts-1-hd: alloy, echo, echo-alt, fable, onyx, nova, and shimmer (tts-1-hd is configurable; | ||
| + | |||
| + | <code - docker-pipelines.yml> | ||
| + | name: pipelines | ||
| + | services: | ||
| + | pipelines: | ||
| + | image: ghcr.io/ | ||
| + | container_name: | ||
| + | volumes: | ||
| + | - / | ||
| + | ports: | ||
| + | - 9099:9099 | ||
| restart: always | restart: always | ||
| + | extra_hosts: | ||
| + | host.docker.internal: | ||
| + | deploy: | ||
| + | resources: | ||
| + | reservations: | ||
| + | devices: | ||
| + | - driver: nvidia | ||
| + | device_ids: [' | ||
| + | capabilities: | ||
| + | </ | ||
| + | |||
| + | https:// | ||
| + | |||
| + | |||
| + | Under settings-> | ||
| + | - OPENAI API host: http:// | ||
| + | - 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: | extra_hosts: | ||
| host.docker.internal: | host.docker.internal: | ||
| environment: | environment: | ||
| - | - WEBUI_NAME="CustomGPT" | + | - 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> | ||
| + | # | ||
| + | |||
| + | docker exec -ti ollama ollama list | tail -n +2 | awk ' | ||
| + | echo "Updating model: $model..." | ||
| + | docker exec -t ollama ollama pull $model | ||
| + | echo " | ||
| + | done | ||
| + | echo "All models updated." | ||
| </ | </ | ||
| Line 92: | 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 99: | 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.1719403575.txt.gz · Last modified: by Wulf Rajek