Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple the openwebui and the ollama. in inference-cpp-xpu dockerfile #12382

Merged
merged 5 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions docker/llm/inference-cpp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,6 @@ RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRO
# Install opencl-related repos
apt-get update && \
apt-get install -y --no-install-recommends intel-opencl-icd intel-level-zero-gpu=1.3.26241.33-647~22.04 level-zero level-zero-dev --allow-downgrades && \
# install nodejs and npm and get webui
apt purge nodejs -y && \
apt purge libnode-dev -y && \
apt autoremove -y && \
apt clean -y && \
wget -qO- https://deb.nodesource.com/setup_18.x | sudo -E bash - && \
apt install -y nodejs && \
git clone https://github.com/open-webui/open-webui.git /llm/open-webui && \
git -C /llm/open-webui checkout e29a999dc910afad91995221cb4bb7c274f87cd6 && \
cp -RPp /llm/open-webui/.env.example /llm/open-webui/.env && \
# Build frontend
npm --prefix /llm/open-webui i && \
npm --prefix /llm/open-webui run build && \
# Install Dependencies
# remove blinker to avoid error
find /usr/lib/python3/dist-packages/ -name 'blinker*' -exec rm -rf {} + && \
Expand All @@ -67,7 +54,6 @@ RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRO

COPY ./start-llama-cpp.sh /llm/scripts/start-llama-cpp.sh
COPY ./start-ollama.sh /llm/scripts/start-ollama.sh
COPY ./start-open-webui.sh /llm/scripts/start-open-webui.sh
COPY ./benchmark_llama-cpp.sh /llm/scripts/benchmark_llama-cpp.sh

WORKDIR /llm/
23 changes: 18 additions & 5 deletions docker/llm/inference-cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,25 @@ Please refer to this [documentation](https://ipex-llm.readthedocs.io/en/latest/d

### Running Open WebUI with Intel GPU

Start the ollama and load the model first, then use the open-webui to chat.
If you have difficulty accessing the huggingface repositories, you may use a mirror, e.g. add export HF_ENDPOINT=https://hf-mirror.com before running bash start.sh.
1. Start the ollama and load the model first, then use the open-webui to chat.

If you have difficulty accessing the huggingface repositories, you may use a mirror, e.g. add export HF_ENDPOINT=https://hf-mirror.com and run following script to start open-webui docker.

```bash
cd /llm/scripts/
bash start-open-webui.sh
# INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
export DOCKER_IMAGE=ghcr.io/open-webui/open-webui:main
export CONTAINER_NAME=<YOUR-DOCKER-CONTAINER-NAME>

docker rm -f $CONTAINER_NAME

docker run -itd \
-v open-webui:/app/backend/data \
-e PORT=8080 \
--privileged \
--network=host \
--name $CONTAINER_NAME \
--restart always $DOCKER_IMAGE
```

2. Visit <http://localhost:8080> to use open-webui, the default ollama serve address in open-webui is `http://localhost:11434`, you can change it in connections on `http://localhost:8080/admin/settings`.

For how to log-in or other guide, Please refer to this [documentation](https://ipex-llm.readthedocs.io/en/latest/doc/LLM/Quickstart/open_webui_with_ollama_quickstart.html) for more details.