From 836babdef44eb26e3dba09fe0ee24ce6413806ab Mon Sep 17 00:00:00 2001 From: cloudXabide Date: Sat, 2 Dec 2023 08:39:21 -0500 Subject: [PATCH 01/11] Added verbiage for running as container on Apple Silicon --- TROUBLESHOOTING.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index db9f1582..54cfce40 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -25,3 +25,20 @@ Ensure that the Ollama URL is correctly formatted in the application settings. F It is crucial to include the `/api` at the end of the URL to ensure that the Ollama Web UI can communicate with the server. By following these troubleshooting steps, you should be able to identify and resolve connection issues with your Ollama server configuration. If you require further assistance or have additional questions, please don't hesitate to reach out or refer to our documentation for comprehensive guidance. + +## Running ollama-webui as a cintainer on Apple Silicon Mac + +If you are running Docker on a M{1..3} based Mac and have taken the steps to run an x86 container, add "--platform linux/amd64" to the docker run command. +Example: +```bash +docker run -d -p 3000:8080 --env-file=$OLLAMA_ENV_FILE --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main +``` +Becomes +``` +docker run -it --platform linux/amd64 -d -p 3000:8080 -e OLLAMA_API_BASE_URL=http://10.10.10.20:11434/api --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main + +``` + +## References +[Change Docker Desktop Settings on Mac](https://docs.docker.com/desktop/settings/mac/) Search for "x86" in that page. +[Run x86 (Intel) and ARM based images on Apple Silicon (M1) Macs?](https://forums.docker.com/t/run-x86-intel-and-arm-based-images-on-apple-silicon-m1-macs/117123) From 6eadfb8a734129f436e7c2fce9b6455dbdfcd8a5 Mon Sep 17 00:00:00 2001 From: James Radtke <47249757+cloudxabide@users.noreply.github.com> Date: Sat, 2 Dec 2023 14:47:05 -0500 Subject: [PATCH 02/11] Update TROUBLESHOOTING.md Made style/formatting changes suggested in commit conversation. --- TROUBLESHOOTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 54cfce40..38c32711 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -31,11 +31,11 @@ By following these troubleshooting steps, you should be able to identify and res If you are running Docker on a M{1..3} based Mac and have taken the steps to run an x86 container, add "--platform linux/amd64" to the docker run command. Example: ```bash -docker run -d -p 3000:8080 --env-file=$OLLAMA_ENV_FILE --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main +docker run -d -p 3000:8080 --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main ``` Becomes ``` -docker run -it --platform linux/amd64 -d -p 3000:8080 -e OLLAMA_API_BASE_URL=http://10.10.10.20:11434/api --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main +docker run -it --platform linux/amd64 -d -p 3000:8080 -e OLLAMA_API_BASE_URL=http://example.com:11434/api --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main ``` From 1ce0356860fb049c0c1de386301ea4c676f8b0d6 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 4 Dec 2023 03:31:36 -0500 Subject: [PATCH 03/11] Update TROUBLESHOOTING.md --- TROUBLESHOOTING.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 38c32711..fa6cd83d 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -26,17 +26,20 @@ It is crucial to include the `/api` at the end of the URL to ensure that the Oll By following these troubleshooting steps, you should be able to identify and resolve connection issues with your Ollama server configuration. If you require further assistance or have additional questions, please don't hesitate to reach out or refer to our documentation for comprehensive guidance. -## Running ollama-webui as a cintainer on Apple Silicon Mac +## Running ollama-webui as a container on Apple Silicon Mac + +If you are running Docker on a M{1..3} based Mac and have taken the steps to run an x86 container, add "--platform linux/amd64" to the docker run command to prevent a warning. -If you are running Docker on a M{1..3} based Mac and have taken the steps to run an x86 container, add "--platform linux/amd64" to the docker run command. Example: + ```bash docker run -d -p 3000:8080 --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main ``` + Becomes + ``` docker run -it --platform linux/amd64 -d -p 3000:8080 -e OLLAMA_API_BASE_URL=http://example.com:11434/api --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main - ``` ## References From e5a1419d19ba369aafde4a784d573668c8d550e5 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 4 Dec 2023 03:32:31 -0500 Subject: [PATCH 04/11] Update TROUBLESHOOTING.md --- TROUBLESHOOTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index fa6cd83d..d5799397 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -33,7 +33,7 @@ If you are running Docker on a M{1..3} based Mac and have taken the steps to run Example: ```bash -docker run -d -p 3000:8080 --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main +docker run -d -p 3000:8080 -e OLLAMA_API_BASE_URL=http://example.com:11434/api --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main ``` Becomes From e5ffa149cf7ce9229d48ed873a73d7f520405465 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 4 Dec 2023 03:33:24 -0500 Subject: [PATCH 05/11] Update TROUBLESHOOTING.md --- TROUBLESHOOTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index d5799397..0b5536c5 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -39,7 +39,7 @@ docker run -d -p 3000:8080 -e OLLAMA_API_BASE_URL=http://example.com:11434/api - Becomes ``` -docker run -it --platform linux/amd64 -d -p 3000:8080 -e OLLAMA_API_BASE_URL=http://example.com:11434/api --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main +docker run --platform linux/amd64 -d -p 3000:8080 -e OLLAMA_API_BASE_URL=http://example.com:11434/api --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main ``` ## References From 1ff1c7e94e9048a869a34455ed6d8e0ba8f1d187 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 5 Dec 2023 01:58:58 -0500 Subject: [PATCH 06/11] doc: local build tldr section added --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 6a41f802..f553442c 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,26 @@ docker run -d -p 3000:8080 -e OLLAMA_API_BASE_URL=https://example.com/api --name While we strongly recommend using our convenient Docker container installation for optimal support, we understand that some situations may require a non-Docker setup, especially for development purposes. Please note that non-Docker installations are not officially supported, and you might need to troubleshoot on your own. +### TL;DR + +Run the following commands to install: + +```sh +git clone https://github.com/ollama-webui/ollama-webui.git +cd ollama-webui/ + +# Building Frontend +cp -RPp example.env .env +npm i +npm run build + +# Serve Frontend with the Backend +cd ./backend +pip install -r requirements.txt +sh start.sh +``` +You should have the Ollama Web UI up and running at http://localhost:8080/. Enjoy! 😄 + ### Project Components The Ollama Web UI consists of two primary components: the frontend and the backend (which serves as a reverse proxy, handling static frontend files, and additional features). Both need to be running concurrently for the development environment using `npm run dev`. Alternatively, you can set the `PUBLIC_API_BASE_URL` during the build process to have the frontend connect directly to your Ollama instance or build the frontend as static files and serve them with the backend. From 179b963525bb16d8f4a4a91a384d4e878f869103 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 5 Dec 2023 02:01:49 -0500 Subject: [PATCH 07/11] Update example.env --- example.env | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/example.env b/example.env index 09911a5c..00b399d9 100644 --- a/example.env +++ b/example.env @@ -1,8 +1,9 @@ +# If serving with the backend (Recommended) +PUBLIC_API_BASE_URL='/ollama/api' + +# Comment above and Uncomment below if you're serving only the frontend (Not supported) # must be defined, but defaults to 'http://{location.hostname}:11434/api' # can also use path, such as '/api' -PUBLIC_API_BASE_URL='' +# PUBLIC_API_BASE_URL='' -OLLAMA_API_ID='my-api-token' -OLLAMA_API_TOKEN='xxxxxxxxxxxxxxxx' -# generated by passing the token to `caddy hash-password` -OLLAMA_API_TOKEN_DIGEST='$2a$14$iyyuawykR92xTHNR9lWzfu.uCct/9/xUPX3zBqLqrjAu0usNRPbyi' +OLLAMA_API_BASE_URL='http://localhost:11434/api' From 78bf9bad9468af45eb41e9f635276b08f8958c02 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 4 Dec 2023 23:17:51 -0800 Subject: [PATCH 08/11] chore: example.env updated --- backend/config.py | 5 ++--- example.env | 13 ++++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/backend/config.py b/backend/config.py index fa73a1f9..14ad30e4 100644 --- a/backend/config.py +++ b/backend/config.py @@ -6,8 +6,7 @@ from secrets import token_bytes from base64 import b64encode import os - -load_dotenv(find_dotenv()) +load_dotenv(find_dotenv("../.env")) #################################### # ENV (dev,test,prod) @@ -38,7 +37,7 @@ WEBUI_VERSION = os.environ.get("WEBUI_VERSION", "v1.0.0-alpha.21") #################################### -WEBUI_AUTH = True if os.environ.get("WEBUI_AUTH", "TRUE") == "TRUE" else False +WEBUI_AUTH = True if os.environ.get("WEBUI_AUTH", "FALSE") == "TRUE" else False #################################### diff --git a/example.env b/example.env index 00b399d9..9c628b42 100644 --- a/example.env +++ b/example.env @@ -1,9 +1,12 @@ -# If serving with the backend (Recommended) +# If you're serving both the frontend and backend (Recommended) +# Set the public API base URL for seamless communication PUBLIC_API_BASE_URL='/ollama/api' -# Comment above and Uncomment below if you're serving only the frontend (Not supported) -# must be defined, but defaults to 'http://{location.hostname}:11434/api' -# can also use path, such as '/api' -# PUBLIC_API_BASE_URL='' +# If you're serving only the frontend (Not recommended and not fully supported) +# Comment above and Uncomment below +# You can use the default value or specify a custom path, e.g., '/api' +# PUBLIC_API_BASE_URL='http://{location.hostname}:11434/api' +# Ollama URL for the backend to connect +# The path '/ollama/api' will be redirected to the specified backend URL OLLAMA_API_BASE_URL='http://localhost:11434/api' From 9b35b1fd90255b9cceabc49a1caecc4bbddbeae5 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 4 Dec 2023 23:25:41 -0800 Subject: [PATCH 09/11] doc: better comments for tldr --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f553442c..5e26ae56 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Also check our sibling project, [OllamaHub](https://ollamahub.com/), where you c - 🤖 **Multiple Model Support**: Seamlessly switch between different chat models for diverse interactions. -- 🗃️ **Modelfile Builder**: Easily create Ollama modelfiles via the web UI. Create and add your own character to Ollama by customizing system prompts, conversation starters, and more. +- 🧩 **Modelfile Builder**: Easily create Ollama modelfiles via the web UI. Create and add characters/agents, customize chat elements, and import modelfiles effortlessly through [OllamaHub](https://ollamahub.com/) integration. - ⚙️ **Many Models Conversations**: Effortlessly engage with various models simultaneously, harnessing their unique strengths for optimal responses. Enhance your experience by leveraging a diverse set of models in parallel. @@ -59,7 +59,7 @@ Also check our sibling project, [OllamaHub](https://ollamahub.com/), where you c - 🌟 **Continuous Updates**: We are committed to improving Ollama Web UI with regular updates and new features. -## 🔗 Also Check Out OllamaHub! +## 🔗 Also Check Out OllamaHub! Don't forget to explore our sibling project, [OllamaHub](https://ollamahub.com/), where you can discover, download, and explore customized Modelfiles. OllamaHub offers a wide range of exciting possibilities for enhancing your chat interactions with Ollama! 🚀 @@ -121,7 +121,7 @@ docker run -d -p 3000:8080 -e OLLAMA_API_BASE_URL=https://example.com/api --name While we strongly recommend using our convenient Docker container installation for optimal support, we understand that some situations may require a non-Docker setup, especially for development purposes. Please note that non-Docker installations are not officially supported, and you might need to troubleshoot on your own. -### TL;DR +### TL;DR 🚀 Run the following commands to install: @@ -129,16 +129,19 @@ Run the following commands to install: git clone https://github.com/ollama-webui/ollama-webui.git cd ollama-webui/ -# Building Frontend +# Copying required .env file cp -RPp example.env .env + +# Building Frontend npm i npm run build -# Serve Frontend with the Backend +# Serving Frontend with the Backend cd ./backend pip install -r requirements.txt sh start.sh ``` + You should have the Ollama Web UI up and running at http://localhost:8080/. Enjoy! 😄 ### Project Components @@ -231,7 +234,6 @@ See [TROUBLESHOOTING.md](/TROUBLESHOOTING.md) for information on how to troubles Here are some exciting tasks on our roadmap: - - 🔄 **Multi-Modal Support**: Seamlessly engage with models that support multimodal interactions, including images (e.g., LLava). - 📚 **RAG Integration**: Experience first-class retrieval augmented generation support, enabling chat with your documents. - 🔐 **Access Control**: Securely manage requests to Ollama by utilizing the backend as a reverse proxy gateway, ensuring only authenticated users can send specific requests. From 9de56550abc28cba8ec7b254903644bd9ca76e97 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 5 Dec 2023 16:36:44 -0800 Subject: [PATCH 10/11] feat: custom model chat styling updated --- src/lib/components/chat/Messages.svelte | 12 +++++++++++- src/routes/(app)/modelfiles/+page.svelte | 2 +- src/routes/(app)/modelfiles/create/+page.svelte | 9 ++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index 6f827fd2..b58dd592 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -317,7 +317,17 @@
{#if selectedModelfile} - {selectedModelfile.desc} + + {selectedModelfile.title} + +
+ {selectedModelfile.desc} +
+ {#if selectedModelfile.user} + + {/if} {:else} How can I help you today? {/if} diff --git a/src/routes/(app)/modelfiles/+page.svelte b/src/routes/(app)/modelfiles/+page.svelte index ca46f393..5887eabb 100644 --- a/src/routes/(app)/modelfiles/+page.svelte +++ b/src/routes/(app)/modelfiles/+page.svelte @@ -7,7 +7,7 @@ const deleteModelHandler = async (tagName) => { let success = null; - const res = await fetch(`${OLLAMA_API_BASE_URL}/delete`, { + const res = await fetch(`${$settings?.API_BASE_URL ?? OLLAMA_API_BASE_URL}/delete`, { method: 'DELETE', headers: { 'Content-Type': 'text/event-stream', diff --git a/src/routes/(app)/modelfiles/create/+page.svelte b/src/routes/(app)/modelfiles/create/+page.svelte index a49d0fd1..6e4e3f7d 100644 --- a/src/routes/(app)/modelfiles/create/+page.svelte +++ b/src/routes/(app)/modelfiles/create/+page.svelte @@ -52,6 +52,8 @@ num_ctx: '' }; + let modelfileCreator = null; + $: tagName = title !== '' ? `${title.replace(/\s+/g, '-').toLowerCase()}:latest` : ''; $: if (!raw) { @@ -202,7 +204,8 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, ''); desc: desc, content: content, suggestionPrompts: suggestions.filter((prompt) => prompt.content !== ''), - categories: Object.keys(categories).filter((category) => categories[category]) + categories: Object.keys(categories).filter((category) => categories[category]), + user: modelfileCreator !== null ? modelfileCreator : undefined }); await goto('/modelfiles'); } @@ -237,6 +240,10 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, ''); } ]; + modelfileCreator = { + username: modelfile.user.username, + name: modelfile.user.name + }; for (const category of modelfile.categories) { categories[category.toLowerCase()] = true; } From b1081c2c8136809d8edcaae8a51ed2791f45750f Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 5 Dec 2023 16:39:26 -0800 Subject: [PATCH 11/11] feat: use display name if it exists --- src/lib/components/chat/Messages.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index b58dd592..173ae05d 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -325,7 +325,11 @@
{#if selectedModelfile.user} {/if} {:else}