Add use_llm support to marker_server for OpenWebUI integration#944
Closed
bankjaneo wants to merge 12 commits intodatalab-to:masterfrom
Closed
Add use_llm support to marker_server for OpenWebUI integration#944bankjaneo wants to merge 12 commits intodatalab-to:masterfrom
bankjaneo wants to merge 12 commits intodatalab-to:masterfrom
Conversation
- Add Dockerfile.gpu for NVIDIA CUDA-enabled deployment - Add Dockerfile.cpu for lightweight CPU-only deployment - Add docker-compose.yml with both GPU and CPU service configurations - Add docker-entrypoint.sh with comprehensive environment variable support - Add .dockerignore to optimize build context - Add README-DOCKER.md with complete documentation Features: - Persistent model caching via volume mounts - Configurable LLM services (OpenAI, Gemini, Claude, Azure, Ollama) - OpenWebUI integration with configurable options - Health checks and automatic restarts - Support for all processing options (force OCR, paginate, output format, etc.)
…11BSiezjtC46DyRTT5HPYCv Add Docker support with GPU and CPU variants
Update package name from libgdk-pixbuf2.0-0 to libgdk-pixbuf-2.0-0 in the CPU Dockerfile. The old package name is not available in Debian Trixie (used by python:3.11-slim base image), causing build failures.
Change package name from libgdk-pixbuf2.0-0 to libgdk-pixbuf-2.0-0 in the GPU Dockerfile to match the CPU Dockerfile and ensure consistency across both build configurations.
…encies-01Vo4EvYC9FWfzBtbsxNvVx8 Claude/fix cpu dockerfile dependencies 01 vo4 ev yc9 f wfz btbsx nv vx8
Previously, the CPU-only Dockerfile was downloading the default PyTorch wheel which includes CUDA libraries and nvidia-* packages, unnecessarily increasing image size and build time. This change explicitly installs PyTorch from the CPU-specific wheel index before the main marker installation, preventing pip from downloading the CUDA-enabled version. Benefits: - Smaller image size (hundreds of MBs saved) - Faster build time - No unnecessary nvidia packages in CPU-only builds
Updated Dockerfile.gpu to support Blackwell architecture GPUs (RTX 5060 Ti and other RTX 50-series) which require CUDA 12.8 and sm_120 compute capability. Changes: - Upgrade base image from CUDA 12.1.0 to CUDA 12.8.0 - Install PyTorch with cu128 wheels explicitly before main installation - Ensures compatibility with newer GPUs like RTX 5060 Ti Without these changes, RTX 50-series GPUs would fail with "CUDA capability sm_120 is not compatible" errors.
…LCLvF5FA8Rak29nXf4vhbr Claude/incomplete description 01 lc lv f5 fa8 rak29n xf4vhbr
…ere's what changed: **Summary of changes:** 1. **GPU service (marker-gpu)**: Replaced named volumes with a bind mount: - Removed: `marker-models:/root/.cache/huggingface` and `marker-torch:/root/.cache/torch` - Added: `./datalab:/root/.cache/datalab` 2. **CPU service (marker-cpu)**: Applied the same fix: - Removed: `marker-models-cpu:/root/.cache/huggingface` and `marker-torch-cpu:/root/.cache/torch` - Added: `./datalab:/root/.cache/datalab` 3. **Cleaned up volumes section**: Removed all unused named volume definitions (`marker-models`, `marker-torch`, `marker-models-cpu`, `marker-torch-cpu`) **Why this fixes the issue:** The previous configuration used named Docker volumes, which store data in Docker's managed volume storage (typically at `/var/lib/docker/volumes/`). Your changes to use a bind mount (`./datalab:/root/.cache/datalab`) ensures that downloaded model files are directly saved to your local `./datalab` directory, making them easily accessible and persistent across container restarts.
…cleaner and more correct - only bind mounts are defined where needed in each service's volume configuration.
Fix cache folder mapping in docker-compose.yml (vibe-kanban)
- Add use_llm field to CommonParams model to accept LLM toggle from OpenWebUI - Update /marker/upload endpoint to accept use_llm form parameter - LLM service configuration (API keys, models) is read from environment variables - When use_llm=True, ConfigParser.get_llm_service() returns configured LLM service - Supports all LLM providers: Gemini, OpenAI, Claude, Ollama, Vertex AI, Azure OpenAI This enables OpenWebUI's "Use LLM" toggle to work with self-hosted marker, providing higher quality processing when LLM API credentials are configured in the docker-compose environment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA 0 out of 2 committers have signed the CLA. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
use_llmsupport to marker_server API to enable OpenWebUI's "Use LLM" toggle for enhanced PDF processing with Large Language Models.Changes
use_llm: bool = Falsefield toCommonParamsmodel inmarker/scripts/server.py/marker/uploadendpoint to acceptuse_llmform parameterHow It Works
When OpenWebUI sends
"use_llm": truein the request:use_llmflag through the conversion pipelineConfigParser.get_llm_service()checks ifuse_llm=Trueand returns the configured LLM serviceSupported LLM Providers
Environment Configuration
Users configure LLM credentials in their
docker-compose.yml:Or with other providers:
GEMINI_API_KEY,GEMINI_MODEL_NAMECLAUDE_API_KEY,CLAUDE_MODEL_NAMEOLLAMA_BASE_URL,OLLAMA_MODELTesting
The feature can be tested:
/marker/uploadwithuse_llm=trueform parameter/markerwith{"use_llm": true, ...}🤖 Generated with Claude Code