feat: Minimal Installation Option for Open WebUI #4503

Closed
opened 2025-11-11 15:55:34 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @dror-llm on GitHub (Mar 20, 2025).

Problem Description

Currently, when installing Open WebUI via pip (pip install open-webui), the installation includes a full set of dependencies including NVIDIA CUDA drivers, PyTorch, and various ML libraries that total approximately 7.7GB. However, many users only need the frontend UI and backend server to connect to a remote Ollama instance running on a separate machine, making these heavy dependencies unnecessary.

When installing via pip, the following large packages are included even when they won't be used:

2807552 /opt/venv/lib/python3.12/site-packages/nvidia
1583956 /opt/venv/lib/python3.12/site-packages/torch
701508 /opt/venv/lib/python3.12/site-packages/triton
381248 /opt/venv/lib/python3.12/site-packages/open_webui
207676 /opt/venv/lib/python3.12/site-packages/cusparselt
144852 /opt/venv/lib/python3.12/site-packages/milvus_lite
140704 /opt/venv/lib/python3.12/site-packages/pyarrow
130848 /opt/venv/lib/python3.12/site-packages/playwright
118796 /opt/venv/lib/python3.12/site-packages/scipy
99296 /opt/venv/lib/python3.12/site-packages/transformers
92284 /opt/venv/lib/python3.12/site-packages/opencv_python.libs

The Docker implementation already has an option to run with a remote Ollama instance, but the pip installation doesn't offer a lightweight alternative.

Desired Solution you'd like

Create a minimal installation option for Open WebUI that:

  1. Includes both frontend UI and backend server components
  2. Removes unnecessary ML/CUDA dependencies when connecting to a remote Ollama instance
  3. Maintains core functionality like chat history, user management, and other backend services
  4. Significantly reduces the installation size (potentially from 7.7GB to <1GB)

Possible implementation options:

  1. Create optional dependency groups in pyproject.toml:

    [project.optional-dependencies]
    minimal = [
        # Core dependencies for frontend and backend without ML/CUDA
    ]
    full = [
        # All dependencies including ML/CUDA
    ]
    

    Users could then install with: pip install open-webui[minimal]

  2. Create an installation script based on the Dockerfile's conditional logic:

    • The Dockerfile already has conditional logic using build arguments (USE_CUDA, USE_OLLAMA, etc.)
    • This could be translated into an installation script with command-line options
    • Users could specify whether they want CUDA support, which embedding model to use, etc.
  3. Provide a separate pip package like open-webui-minimal that only includes the necessary components for connecting to a remote Ollama instance.

Alternatives Considered

  1. Using Docker with the remote Ollama option - this works but many users prefer a direct pip installation for simplicity, especially in environments where Docker isn't available or preferred.

  2. Creating a custom installation by manually removing packages after installation - this is cumbersome and might break functionality.

  3. Building from source with custom options - this requires more technical knowledge than a simple pip install.

Additional Context

Benefits of this feature include:

  • Reduced disk usage requirements
  • Faster installation times
  • Better suited for low-resource environments
  • More flexible deployment options
  • Improved user experience for those who run Ollama on a separate machine

Technical considerations:

  • The backend still needs to handle API communication with remote Ollama instances
  • User data, chat history, and authentication should remain fully functional
  • The frontend UI should be identical to the full installation
  • Documentation should clearly explain the differences between installation options
Originally created by @dror-llm on GitHub (Mar 20, 2025). ### Problem Description Currently, when installing Open WebUI via pip (`pip install open-webui`), the installation includes a full set of dependencies including NVIDIA CUDA drivers, PyTorch, and various ML libraries that total approximately 7.7GB. However, many users only need the frontend UI and backend server to connect to a remote Ollama instance running on a separate machine, making these heavy dependencies unnecessary. When installing via pip, the following large packages are included even when they won't be used: ``` 2807552 /opt/venv/lib/python3.12/site-packages/nvidia 1583956 /opt/venv/lib/python3.12/site-packages/torch 701508 /opt/venv/lib/python3.12/site-packages/triton 381248 /opt/venv/lib/python3.12/site-packages/open_webui 207676 /opt/venv/lib/python3.12/site-packages/cusparselt 144852 /opt/venv/lib/python3.12/site-packages/milvus_lite 140704 /opt/venv/lib/python3.12/site-packages/pyarrow 130848 /opt/venv/lib/python3.12/site-packages/playwright 118796 /opt/venv/lib/python3.12/site-packages/scipy 99296 /opt/venv/lib/python3.12/site-packages/transformers 92284 /opt/venv/lib/python3.12/site-packages/opencv_python.libs ``` The Docker implementation already has an option to run with a remote Ollama instance, but the pip installation doesn't offer a lightweight alternative. ### Desired Solution you'd like Create a minimal installation option for Open WebUI that: 1. Includes both frontend UI and backend server components 2. Removes unnecessary ML/CUDA dependencies when connecting to a remote Ollama instance 3. Maintains core functionality like chat history, user management, and other backend services 4. Significantly reduces the installation size (potentially from 7.7GB to <1GB) Possible implementation options: 1. **Create optional dependency groups in pyproject.toml**: ```toml [project.optional-dependencies] minimal = [ # Core dependencies for frontend and backend without ML/CUDA ] full = [ # All dependencies including ML/CUDA ] ``` Users could then install with: `pip install open-webui[minimal]` 2. **Create an installation script** based on the Dockerfile's conditional logic: - The Dockerfile already has conditional logic using build arguments (`USE_CUDA`, `USE_OLLAMA`, etc.) - This could be translated into an installation script with command-line options - Users could specify whether they want CUDA support, which embedding model to use, etc. 3. **Provide a separate pip package** like `open-webui-minimal` that only includes the necessary components for connecting to a remote Ollama instance. ### Alternatives Considered 1. Using Docker with the remote Ollama option - this works but many users prefer a direct pip installation for simplicity, especially in environments where Docker isn't available or preferred. 2. Creating a custom installation by manually removing packages after installation - this is cumbersome and might break functionality. 3. Building from source with custom options - this requires more technical knowledge than a simple pip install. ### Additional Context Benefits of this feature include: - Reduced disk usage requirements - Faster installation times - Better suited for low-resource environments - More flexible deployment options - Improved user experience for those who run Ollama on a separate machine Technical considerations: - The backend still needs to handle API communication with remote Ollama instances - User data, chat history, and authentication should remain fully functional - The frontend UI should be identical to the full installation - Documentation should clearly explain the differences between installation options
Author
Owner

@dror-llm commented on GitHub (Mar 20, 2025):

Oops, sorry about this.
That's what happens when you let an llm open issues. Sometimes they get confused and post it to the wrong repo.

@dror-llm commented on GitHub (Mar 20, 2025): Oops, sorry about this. That's what happens when you let an llm open issues. Sometimes they get confused and post it to the wrong repo.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#4503