[GH-ISSUE #14258] feat: Make Non-Core Dependencies Optional #55859

Closed
opened 2026-05-05 18:10:44 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Azzeo on GitHub (May 23, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/14258

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

The current Open WebUI installation requires installing ALL dependencies regardless of actual usage needs. This creates several issues:

  1. Large Installation Size: Users must install ~100+ packages even if they only need basic chat functionality
  2. Unnecessary Dependencies:
    • Users with a separate inference server are forced to install GPU-only packages
    • Non-Google Cloud users must install Google SDK packages
    • Non-Azure users must install Azure libraries
    • Users not needing OCR still get OpenCV and document processing libraries
  3. Dependency Conflicts: More dependencies increase the chance of version conflicts
  4. Deployment Overhead: Docker images and deployments are larger than necessary
  5. Security Surface: More installed packages = larger attack surface for vulnerabilities. The are approximately 1400 CVEs for the full installation image and 120 CVEs for a minimal installation image
  6. It's difficult for users to determine what is actually required for a minimal deployment, or a deployment for their needs.

Desired Solution you'd like

Reorganize pyproject.toml to use Python's optional dependencies feature and change the Dockerfile to use appropriate dependencies (depending on the tag):

Installation Examples

# Minimal installation
pip install open-webui

# With specific features
pip install open-webui[gpu,google]
pip install open-webui[microsoft,vectordb-extended]

# Everything (current behavior)
pip install open-webui[all]

This change requires modifying imports throughout the codebase to handle optional dependencies gracefully. E.g. with lazy imports or conditional imports with fallbacks

Alternatives Considered

  1. Multiple Package Variants: Create separate packages like open-webui-lite, open-webui-gpu, etc.

    • Pros: Clear separation
    • Cons: Maintenance nightmare, package name confusion
  2. Docker-only Solution: Only optimize Docker images with gpu/minimum tags that truly installs what it says it should install

    • Pros: Keeps it simple for pip installation
    • Cons: Doesn't help pip users, still need to maintain multiple Dockerfiles

Additional Context

Breaking Changes

  • None for users installing with pip install open-webui[all]
  • Existing installations may need to add optional groups when upgrading
  • Custom deployments may need to update their installation commands
Originally created by @Azzeo on GitHub (May 23, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/14258 ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description The current Open WebUI installation requires installing ALL dependencies regardless of actual usage needs. This creates several issues: 1. **Large Installation Size**: Users must install ~100+ packages even if they only need basic chat functionality 2. **Unnecessary Dependencies**: - Users with a separate inference server are forced to install GPU-only packages - Non-Google Cloud users must install Google SDK packages - Non-Azure users must install Azure libraries - Users not needing OCR still get OpenCV and document processing libraries 3. **Dependency Conflicts**: More dependencies increase the chance of version conflicts 4. **Deployment Overhead**: Docker images and deployments are larger than necessary 5. **Security Surface**: More installed packages = larger attack surface for vulnerabilities. The are approximately 1400 CVEs for the full installation image and 120 CVEs for a minimal installation image 6. It's difficult for users to determine what is actually required for a minimal deployment, or a deployment for their needs. ### Desired Solution you'd like Reorganize `pyproject.toml` to use Python's optional dependencies feature and change the Dockerfile to use appropriate dependencies (depending on the tag): ### Installation Examples ```bash # Minimal installation pip install open-webui # With specific features pip install open-webui[gpu,google] pip install open-webui[microsoft,vectordb-extended] # Everything (current behavior) pip install open-webui[all] ``` This change requires modifying imports throughout the codebase to handle optional dependencies gracefully. E.g. with lazy imports or conditional imports with fallbacks ### Alternatives Considered 1. **Multiple Package Variants**: Create separate packages like `open-webui-lite`, `open-webui-gpu`, etc. - **Pros**: Clear separation - **Cons**: Maintenance nightmare, package name confusion 2. **Docker-only Solution**: Only optimize Docker images with gpu/minimum tags that truly installs what it says it should install - **Pros**: Keeps it simple for pip installation - **Cons**: Doesn't help pip users, still need to maintain multiple Dockerfiles ### Additional Context ## Breaking Changes - None for users installing with `pip install open-webui[all]` - Existing installations may need to add optional groups when upgrading - Custom deployments may need to update their installation commands
Author
Owner

@tjbck commented on GitHub (May 23, 2025):

PR welcome!

<!-- gh-comment-id:2905920733 --> @tjbck commented on GitHub (May 23, 2025): PR welcome!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#55859