Skip to content

Replace PyMuPDF (AGPL-3.0) with pdf2image (MIT) — preserves vision pipeline#17

Open
BrandonS7 wants to merge 1 commit intoBirmingham-AI:mainfrom
BrandonS7:fix/license-compliance-v2
Open

Replace PyMuPDF (AGPL-3.0) with pdf2image (MIT) — preserves vision pipeline#17
BrandonS7 wants to merge 1 commit intoBirmingham-AI:mainfrom
BrandonS7:fix/license-compliance-v2

Conversation

@BrandonS7
Copy link
Copy Markdown

What this does

PyMuPDF is dual-licensed under AGPL-3.0 or Artifex Commercial. The project is MIT-licensed. When AGPL code is used in a network-accessible application, it requires the entire application source to be made available under AGPL. This creates a license incompatibility.

Replaced PyMuPDF with pdf2image (MIT) + Pillow (PIL License) for PDF page rendering:

  • pdf2image renders PDF pages to PIL Images using poppler (same quality)
  • Pillow handles PNG conversion for base64 encoding
  • The GPT-4 Vision analysis pipeline is fully preserved — pages are still rendered as images and sent to Vision API for content extraction
  • CLI interface, streaming interface, DPI parameter, and embedding generation all unchanged

Dependencies

  • Removed: PyMuPDF==1.26.6 (AGPL-3.0)
  • Added: pdf2image>=1.17.0 (MIT), Pillow>=10.0.0 (PIL/MIT-compatible)
  • Note: pdf2image requires poppler-utils on the system (typically available in Alpine/Debian Docker images via apk add poppler-utils or apt install poppler-utils)

What did NOT change

  • Vision model and prompt
  • OpenAI API integration
  • Embedding generation
  • File upload handling
  • Any other backend code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant