[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-73277":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":16,"starSnapshotCount":16,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},73277,"paperless-gpt","icereed\u002Fpaperless-gpt","icereed","Use LLMs and LLM Vision (OCR) to handle paperless-ngx - Document Digitalization powered by AI","",null,"Go",2414,171,18,152,0,9,28,75,27,98.21,"MIT License",false,"main",true,[27,28,29,30,31,32,33,34],"ai","chatgpt","llm","mistral","ocr","ollama","paperless","paperless-ngx","2026-06-12 04:01:08","# paperless-gpt\n\n[![License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Ficereed\u002Fpaperless-gpt)](LICENSE)\n[![Discord Banner](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FJoin%20us%20on-Discord-blue?logo=discord)](https:\u002F\u002Fdiscord.gg\u002FfJQppDH2J7)\n[![Docker Pulls](https:\u002F\u002Fimg.shields.io\u002Fdocker\u002Fpulls\u002Ficereed\u002Fpaperless-gpt)](https:\u002F\u002Fhub.docker.com\u002Fr\u002Ficereed\u002Fpaperless-gpt)\n[![GitHub Container Registry](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGHCR-Package-181717?logo=github)](https:\u002F\u002Fgithub.com\u002Ficereed\u002Fpaperless-gpt\u002Fpkgs\u002Fcontainer\u002Fpaperless-gpt)\n[![Contributor Covenant](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FContributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)\n[![GitHub Sponsors](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSponsor-icereed-ea4aaa?logo=github-sponsors)](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Ficereed)\n\n\n\u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F12701\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Ftrendshift.io\u002Fapi\u002Fbadge\u002Frepositories\u002F12701\" alt=\"icereed%2Fpaperless-gpt | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\u003C\u002Fa>\n\n![Screenshot](.\u002Fpaperless-gpt-screenshot.png)\n\n\u003Csub>💡 Maintained by [Icereed](https:\u002F\u002Fgithub.com\u002Ficereed). Proudly supported by [BubbleTax.de](https:\u002F\u002Fbubbletax.de\u002F?utm_source=github&utm_medium=readme&utm_campaign=paperless) – automated, BMF-compliant tax reports for Interactive Brokers traders in Germany.\u003C\u002Fsub>\n\n---\n**paperless-gpt** seamlessly pairs with [paperless-ngx][paperless-ngx] to generate **AI-powered document titles** and **tags**, saving you hours of manual sorting. While other tools may offer AI chat features, **paperless-gpt** stands out by **supercharging OCR with LLMs**-ensuring high accuracy, even with tricky scans. If you're craving next-level text extraction and effortless document organization, this is your solution.\n\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fbd5d38b9-9309-40b9-93ca-918dfa4f3fd4\n\n> **❤️ Support This Project**  \n> If paperless-gpt is helping you organize your documents and saving you time, please consider [sponsoring its development](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Ficereed). Your support helps ensure continued improvements and maintenance!\n\n---\n\n## Key Highlights\n\n1. **LLM-Enhanced OCR**  \n   Harness Large Language Models (OpenAI or Ollama) for **better-than-traditional** OCR—turn messy or low-quality scans into context-aware, high-fidelity text.\n\n2. **Use specialized AI OCR services**\n\n   - **LLM OCR**: Use OpenAI or Ollama to extract text from images.\n   - **Google Document AI**: Leverage Google's powerful Document AI for OCR tasks.\n   - **Azure Document Intelligence**: Use Microsoft's enterprise OCR solution.\n   - **Docling Server**: Self-hosted OCR and document conversion service\n\n3. **Automatic Title, Tag & Created Date Generation**  \n   No more guesswork. Let the AI do the naming and categorizing. You can easily review suggestions and refine them if needed.\n\n4. **Supports reasoning models in Ollama**  \n   Greatly enhance accuracy by using a reasoning model like `qwen3:8b`. The perfect tradeoff between privacy and performance! Of course, if you got enough GPUs or NPUs, a bigger model will enhance the experience.\n\n5. **Automatic Correspondent Generation**  \n   Automatically identify and generate correspondents from your documents, making it easier to track and organize your communications.\n\n6. **Automatic Custom Field Generation**  \n   Extract and populate custom fields from your documents. Configure which fields to target and how they should be filled. This feature must be enabled in the settings, and you must select at least one custom field for it to function. Three write modes are available:\n   - **Append**: This is the safest option: It only adds new fields that do not already exist on the document. It will never overwrite an existing field, even if it's empty.\n   - **Update**: Adds new fields and overwrites existing fields with new suggestions. Fields on the document that don't have a new suggestion are left untouched.\n   - **Replace**: Deletes all existing custom fields on the document and replaces them entirely with the suggested fields.\n\n7. **Searchable & Selectable PDFs**  \n   Generate PDFs with transparent text layers positioned accurately over each word, making your documents both searchable and selectable while preserving the original appearance.\n\n7. **Extensive Customization**\n\n   - **Customizable Prompts via Web UI**: Tweak and manage all AI prompts for titles, tags, correspondents, and more directly within the web interface under the \"Settings\" menu. The application uses a safe `default_prompts` and `prompts` directory structure, ensuring your customizations are persistent.\n   - **Tagging**: Decide how documents get tagged—manually, automatically, or via OCR-based flows.\n   - **PDF Processing**: Configure how OCR-enhanced PDFs are handled, with options to save locally or upload to paperless-ngx.\n\n8. **Simple Docker Deployment**  \n   A few environment variables, and you're off! Compose it alongside paperless-ngx with minimal fuss.\n\n9. **Unified Web UI**\n\n   - **Manual Review**: Approve or tweak AI's suggestions.\n   - **Auto Processing**: Focus only on edge cases while the rest is sorted for you.\n\n9. **Ad-hoc Document Analysis**\n   Perform ad-hoc analysis on a selection of documents using a custom prompt. Gain quick insights, summaries, or extract specific information from multiple documents at once.\n\n---\n\n## Table of Contents\n\n- [paperless-gpt](#paperless-gpt)\n  - [Key Highlights](#key-highlights)\n  - [Table of Contents](#table-of-contents)\n  - [Getting Started](#getting-started)\n    - [Prerequisites](#prerequisites)\n    - [Installation](#installation)\n      - [Docker Compose](#docker-compose)\n      - [Manual Setup](#manual-setup)\n  - [OCR Providers](#ocr-providers)\n    - [1. LLM-based OCR (Default)](#1-llm-based-ocr-default)\n    - [2. Azure Document Intelligence](#2-azure-document-intelligence)\n    - [3. Google Document AI](#3-google-document-ai)\n    - [4. Docling Server](#4-docling-server)\n  - [OCR Processing Modes](#ocr-processing-modes)\n    - [Image Mode (Default)](#image-mode-default)\n    - [PDF Mode](#pdf-mode)\n    - [Whole PDF Mode](#whole-pdf-mode)\n    - [Provider Compatibility](#provider-compatibility)\n    - [Existing OCR Detection](#existing-ocr-detection)\n  - [Enhanced OCR Features](#enhanced-ocr-features)\n    - [PDF Text Layer Generation](#pdf-text-layer-generation)\n    - [Local File Saving](#local-file-saving)\n    - [PDF Upload to paperless-ngx](#pdf-upload-to-paperless-ngx)\n    - [Metadata Copying Limitations](#metadata-copying-limitations)\n    - [Safety Features](#safety-features)\n    - [Usage Recommendations](#usage-recommendations)\n  - [Configuration](#configuration)\n    - [Environment Variables](#environment-variables)\n    - [Custom Prompt Templates](#custom-prompt-templates)\n      - [Template Variables](#template-variables)\n  - [LLM-Based OCR: Compare for Yourself](#llm-based-ocr-compare-for-yourself)\n    - [Example 1](#example-1)\n    - [Example 2](#example-2)\n    - [How It Works](#how-it-works)\n  - [Usage](#usage)\n  - [Troubleshooting](#troubleshooting)\n    - [Working with Local LLMs](#working-with-local-llms)\n      - [Token Management](#token-management)\n    - [PDF Processing Issues](#pdf-processing-issues)\n    - [Custom Field Generation Issues](#custom-field-generation-issues)\n  - [Contributing](#contributing)\n  - [Support the Project](#support-the-project)\n  - [License](#license)\n  - [Star History](#star-history)\n  - [Disclaimer](#disclaimer)\n\n---\n\n## Getting Started\n\n### Prerequisites\n\n- [Docker][docker-install] installed.\n- A running instance of [paperless-ngx][paperless-ngx].\n- Access to an LLM provider:\n  - **OpenAI**: An API key with models like `gpt-4o` or `gpt-3.5-turbo`.\n  - **Ollama**: A running Ollama server with models like `qwen3:8b`.\n\n### Installation\n\n#### Docker Compose\n\nHere's an example `docker-compose.yml` to spin up **paperless-gpt** alongside paperless-ngx:\n\n```yaml\nservices:\n  paperless-ngx:\n    image: ghcr.io\u002Fpaperless-ngx\u002Fpaperless-ngx:latest\n    # ... (your existing paperless-ngx config)\n\n  paperless-gpt:\n    # Use one of these image sources:\n    image: icereed\u002Fpaperless-gpt:latest # Docker Hub\n    # image: ghcr.io\u002Ficereed\u002Fpaperless-gpt:latest  # GitHub Container Registry\n    environment:\n      PAPERLESS_BASE_URL: \"http:\u002F\u002Fpaperless-ngx:8000\"\n      PAPERLESS_API_TOKEN: \"your_paperless_api_token\"\n      PAPERLESS_PUBLIC_URL: \"http:\u002F\u002Fpaperless.mydomain.com\" # Optional\n      MANUAL_TAG: \"paperless-gpt\" # Optional, default: paperless-gpt\n      AUTO_TAG: \"paperless-gpt-auto\" # Optional, default: paperless-gpt-auto\n      # LLM Configuration - Choose one:\n\n      # Option 1: Standard OpenAI\n      LLM_PROVIDER: \"openai\"\n      LLM_MODEL: \"gpt-4o\"\n      OPENAI_API_KEY: \"your_openai_api_key\"\n\n      # Option 2: Mistral\n      # LLM_PROVIDER: \"mistral\"\n      # LLM_MODEL: \"mistral-large-latest\"\n      # MISTRAL_API_KEY: \"your_mistral_api_key\"\n\n      # Option 3: Azure OpenAI\n      # LLM_PROVIDER: \"openai\"\n      # LLM_MODEL: \"your-deployment-name\"\n      # OPENAI_API_KEY: \"your_azure_api_key\"\n      # OPENAI_API_TYPE: \"azure\"\n      # OPENAI_BASE_URL: \"https:\u002F\u002Fyour-resource.openai.azure.com\"\n\n      # Option 4: Ollama (Local)\n      # LLM_PROVIDER: \"ollama\"\n      # LLM_MODEL: \"qwen3:8b\"\n      # OLLAMA_HOST: \"http:\u002F\u002Fhost.docker.internal:11434\"\n      # OLLAMA_CONTEXT_LENGTH: \"8192\" # Sets Ollama NumCtx (context window)\n      # TOKEN_LIMIT: 1000 # Recommended for smaller models\n\n      # Option 5: Anthropic\u002FClaude\n      # LLM_PROVIDER: \"anthropic\"\n      # LLM_MODEL: \"claude-sonnet-4-5\"\n      # ANTHROPIC_API_KEY: \"your_anthropic_api_key\"\n\n      # Optional LLM Settings\n      # LLM_LANGUAGE: \"English\" # Optional, default: English\n\n      # OCR Configuration - Choose one:\n      # Option 1: LLM-based OCR\n      OCR_PROVIDER: \"llm\" # Default OCR provider\n      VISION_LLM_PROVIDER: \"ollama\" # openai, ollama, mistral, or anthropic\n      VISION_LLM_MODEL: \"minicpm-v\" # minicpm-v (ollama) or gpt-4o (openai) or claude-sonnet-4-5 (anthropic\u002Fclaude)\n      OLLAMA_HOST: \"http:\u002F\u002Fhost.docker.internal:11434\" # If using Ollama\n\n      # OCR Processing Mode\n      OCR_PROCESS_MODE: \"image\" # Optional, default: image, other options: pdf, whole_pdf\n      PDF_SKIP_EXISTING_OCR: \"false\" # Optional, skip OCR for PDFs with existing OCR\n\n      # Option 2: Google Document AI\n      # OCR_PROVIDER: 'google_docai'       # Use Google Document AI\n      # GOOGLE_PROJECT_ID: 'your-project'  # Your GCP project ID\n      # GOOGLE_LOCATION: 'us'              # Document AI region\n      # GOOGLE_PROCESSOR_ID: 'processor-id' # Your processor ID\n      # GOOGLE_APPLICATION_CREDENTIALS: '\u002Fapp\u002Fcredentials.json' # Path to service account key\n\n      # Option 3: Azure Document Intelligence\n      # OCR_PROVIDER: 'azure'              # Use Azure Document Intelligence\n      # AZURE_DOCAI_ENDPOINT: 'your-endpoint' # Your Azure endpoint URL\n      # AZURE_DOCAI_KEY: 'your-key'        # Your Azure API key\n      # AZURE_DOCAI_MODEL_ID: 'prebuilt-read' # Optional, defaults to prebuilt-read\n      # AZURE_DOCAI_TIMEOUT_SECONDS: '120'  # Optional, defaults to 120 seconds\n      # AZURE_DOCAI_OUTPUT_CONTENT_FORMAT: 'text' # Optional, defaults to 'text', other valid option is 'markdown'\n      # 'markdown' requires the 'prebuilt-layout' model\n\n      # Enhanced OCR Features\n      CREATE_LOCAL_HOCR: \"false\" # Optional, save hOCR files locally\n      LOCAL_HOCR_PATH: \"\u002Fapp\u002Fhocr\" # Optional, path for hOCR files\n      CREATE_LOCAL_PDF: \"false\" # Optional, save enhanced PDFs locally\n      LOCAL_PDF_PATH: \"\u002Fapp\u002Fpdf\" # Optional, path for PDF files\n      PDF_UPLOAD: \"false\" # Optional, upload enhanced PDFs to paperless-ngx\n      PDF_REPLACE: \"false\" # Optional and DANGEROUS, delete original after upload\n      PDF_COPY_METADATA: \"true\" # Optional, copy metadata from original document\n      PDF_OCR_TAGGING: \"true\" # Optional, add tag to processed documents\n      PDF_OCR_COMPLETE_TAG: \"paperless-gpt-ocr-complete\" # Optional, tag name\n\n      # Option 4: Docling Server\n      # OCR_PROVIDER: 'docling'              # Use a Docling server\n      # DOCLING_URL: 'http:\u002F\u002Fyour-docling-server:port' # URL of your Docling instance\n      # DOCLING_IMAGE_EXPORT_MODE: \"placeholder\" # Optional, defaults to \"embedded\"\n      # DOCLING_OCR_PIPELINE: \"standard\" # Optional, defaults to \"vlm\"\n      # DOCLING_OCR_ENGINE: \"easyocr\" # Optional, defaults to \"easyocr\" (only used when `DOCLING_OCR_PIPELINE is set to 'standard')\n\n\n      AUTO_OCR_TAG: \"paperless-gpt-ocr-auto\" # Optional, default: paperless-gpt-ocr-auto\n      OCR_LIMIT_PAGES: \"5\" # Optional, default: 5. Set to 0 for no limit.\n      LOG_LEVEL: \"info\" # Optional: debug, warn, error\n    volumes:\n      - .\u002Fprompts:\u002Fapp\u002Fprompts # Mount the prompts directory\n      # For Google Document AI:\n      - ${HOME}\u002F.config\u002Fgcloud\u002Fapplication_default_credentials.json:\u002Fapp\u002Fcredentials.json\n      # For local hOCR and PDF saving:\n      - .\u002Fhocr:\u002Fapp\u002Fhocr # Only if CREATE_LOCAL_HOCR is true\n      - .\u002Fpdf:\u002Fapp\u002Fpdf # Only if CREATE_LOCAL_PDF is true\n    ports:\n      - \"8080:8080\"\n    depends_on:\n      - paperless-ngx\n```\n\n**Pro Tip**: Replace placeholders with real values and read the logs if something looks off.\n\n#### Manual Setup\n\n1. **Clone the Repository**\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Ficereed\u002Fpaperless-gpt.git\n   cd paperless-gpt\n   ```\n2. **Create a `prompts` Directory**\n   ```bash\n   mkdir prompts\n   ```\n3. **Build the Docker Image**\n   ```bash\n   docker build -t paperless-gpt .\n   ```\n4. **Run the Container**\n   ```bash\n   docker run -d \\\n     -e PAPERLESS_BASE_URL='http:\u002F\u002Fyour_paperless_ngx_url' \\\n     -e PAPERLESS_API_TOKEN='your_paperless_api_token' \\\n     -e LLM_PROVIDER='openai' \\\n     -e LLM_MODEL='gpt-4o' \\\n     -e OPENAI_API_KEY='your_openai_api_key' \\\n     -e LLM_LANGUAGE='English' \\\n     -e VISION_LLM_PROVIDER='ollama' \\\n     -e VISION_LLM_MODEL='minicpm-v' \\\n     -e LOG_LEVEL='info' \\\n     -v $(pwd)\u002Fprompts:\u002Fapp\u002Fprompts \\\n     -p 8080:8080 \\\n     paperless-gpt\n   ```\n\n---\n\n## OCR Providers\n\nFor detailed provider-specific documentation:\n\n- [Mistral AI Integration](docs\u002Fmistral_llm.md)\n\npaperless-gpt supports four different OCR providers, each with unique strengths and capabilities:\n\n### 1. LLM-based OCR (Default)\n\n- **Key Features**:\n  - Uses vision-capable LLMs like gpt-4o or MiniCPM-V\n  - High accuracy with complex layouts and difficult scans\n  - Context-aware text recognition\n  - Self-correcting capabilities for OCR errors\n- **Best For**:\n  - Complex or unusual document layouts\n  - Poor quality scans\n  - Documents with mixed languages\n- **Configuration**:\n  ```yaml\n  OCR_PROVIDER: \"llm\"\n  VISION_LLM_PROVIDER: \"openai\" # or \"ollama\"\n  VISION_LLM_MODEL: \"gpt-4o\" # or \"minicpm-v\"\n  ```\n\n### 2. Azure Document Intelligence\n\n- **Key Features**:\n  - Enterprise-grade OCR solution\n  - Prebuilt models for common document types\n  - Layout preservation and table detection\n  - Fast processing speeds\n- **Best For**:\n  - Business documents and forms\n  - High-volume processing\n  - Documents requiring layout analysis\n- **Configuration**:\n  ```yaml\n  OCR_PROVIDER: \"azure\"\n  AZURE_DOCAI_ENDPOINT: \"https:\u002F\u002Fyour-endpoint.cognitiveservices.azure.com\u002F\"\n  AZURE_DOCAI_KEY: \"your-key\"\n  AZURE_DOCAI_MODEL_ID: \"prebuilt-read\" # optional\n  AZURE_DOCAI_TIMEOUT_SECONDS: \"120\" # optional\n  AZURE_DOCAI_OUTPUT_CONTENT_FORMAT:\n    \"text\" # optional, defaults to text, other valid option is 'markdown'\n    # 'markdown' requires the 'prebuilt-layout' model\n  ```\n\n### 3. Google Document AI\n\n- **Key Features**:\n  - Enterprise-grade OCR\u002FHTR solution\n  - Specialized document processors\n  - Strong form field detection\n  - Multi-language support\n  - High accuracy on structured documents\n  - **Exclusive hOCR generation** for creating searchable PDFs with text layers\n  - **Only provider that supports** enhanced PDF generation features\n- **Best For**:\n  - Forms and structured documents\n  - Documents with tables\n  - Multi-language documents\n  - Handwritten text (HTR)\n- **Configuration**:\n  ```yaml\n  OCR_PROVIDER: \"google_docai\"\n  GOOGLE_PROJECT_ID: \"your-project\"\n  GOOGLE_LOCATION: \"us\"\n  GOOGLE_PROCESSOR_ID: \"processor-id\"\n  CREATE_LOCAL_HOCR: \"true\" # Optional, for hOCR generation\n  LOCAL_HOCR_PATH: \"\u002Fapp\u002Fhocr\" # Optional, default path\n  CREATE_LOCAL_PDF: \"true\" # Optional, for applying OCR to PDF\n  LOCAL_PDF_PATH: \"\u002Fapp\u002Fpdf\" # Optional, default path\n  ```\n\n### 4. Docling Server\n\n- **Key Features**:\n  - Self-hosted OCR and document conversion service\n  - Supports various input and output formats (including text)\n  - Utilizes multiple OCR engines (EasyOCR, Tesseract, etc.)\n  - Can be run locally or in a private network\n- **Best For**:\n  - Users who prefer a self-hosted solution\n  - Environments where data privacy is paramount\n  - Processing a wide variety of document types\n- **Configuration**:\n  ```yaml\n  OCR_PROVIDER: \"docling\"\n  DOCLING_URL: \"http:\u002F\u002Fyour-docling-server:port\"\n  DOCLING_IMAGE_EXPORT_MODE: \"placeholder\" # Optional, defaults to \"embedded\"\n  DOCLING_OCR_PIPELINE: \"standard\" # Optional, defaults to \"vlm\"\n  DOCLING_OCR_ENGINE: \"macocr\" # Optional, defaults to \"easyocr\" (only used when `DOCLING_OCR_PIPELINE is set to 'standard')\n  ```\n\n## OCR Processing Modes\n\npaperless-gpt offers different methods for processing documents, giving you flexibility based on your needs and OCR provider capabilities:\n\n### Image Mode (Default)\n\n- **How it works**: Converts PDF pages to images before processing\n- **Best for**: Compatibility with all OCR providers.\n- **Configuration**: `OCR_PROCESS_MODE: \"image\"`\n\n### PDF Mode\n\n- **How it works**: Processes PDF pages directly without image conversion\n- **Best for**: Preserving PDF features, potentially faster processing and improved accuracy with some providers\n- **Configuration**: `OCR_PROCESS_MODE: \"pdf\"`\n\n### Whole PDF Mode\n\n- **How it works**: Processes the entire PDF document in a single operation\n- **Best for**: Providers that handle multi-page documents efficiently, reduced API calls\n- **Configuration**: `OCR_PROCESS_MODE: \"whole_pdf\"`\n- **Note**: Processing large PDFs may cause you to hit the API limit of your OCR provider. If you encounter problems with large documents, consider switching to `pdf` mode, which processes pages individually.\n\n### Provider Compatibility\n\nDifferent OCR providers support different processing modes:\n\n| Provider | Image Mode | PDF Mode | Whole PDF Mode |\n|----------|------------|----------|----------------|\n| **LLM-based OCR** (OpenAI\u002FOllama) | ✅ | ❌ | ❌ |\n| **Azure Document Intelligence** | ✅ | ❌ | ❌ |\n| **Google Document AI** | ✅ | ✅ | ✅ |\n| **Mistral OCR** | ✅ | ✅ | ✅ |\n| **Docling Server** | ✅ | ✅ | ✅ |\n\n> **Important**: paperless-gpt will validate your configuration at startup and prevent unsupported mode\u002Fprovider combinations. If you specify an unsupported mode for your provider, the application will fail to start with a clear error message.\n\n### Existing OCR Detection\n\nWhen using PDF or whole PDF modes, you can enable automatic detection of existing OCR:\n\n```yaml\nenvironment:\n  OCR_PROCESS_MODE: \"pdf\" # or \"whole_pdf\"\n  PDF_SKIP_EXISTING_OCR: \"true\" # Skip processing if existing OCR is detected in the PDF\n```\n\n> **Note**: Not all OCR providers support all processing modes. Some may work better with certain modes than others. Processing as PDF might use more or fewer API tokens than processing as images, depending on the provider. Results may vary based on document complexity and provider capabilities. It's recommended to experiment with different modes to find what works best for your specific documents and OCR provider.\n\n## Enhanced OCR Features\n\npaperless-gpt includes powerful OCR enhancements that go beyond basic text extraction:\n\n> **Important Note**: The PDF text layer generation and hOCR features are currently **only supported with Google Document AI** as the OCR provider. These features are not available when using LLM-based OCR or Azure Document Intelligence.\n\n### PDF Text Layer Generation\n\n- **Searchable & Selectable PDFs**: Creates PDFs with transparent text overlays accurately positioned over each word in the document\n- **hOCR Integration**: Utilizes hOCR format (HTML-based OCR representation) to maintain precise text positioning\n- **Document Quality Improvement**: Makes documents both searchable and selectable while preserving the original appearance\n- **Google Document AI Required**: These features rely on Google Document AI's ability to generate hOCR data with accurate word positions\n\n### Local File Saving\n\npaperless-gpt can save both the hOCR files and enhanced PDFs locally:\n\n```yaml\nenvironment:\n  # Enable local file saving\n  CREATE_LOCAL_HOCR: \"true\" # Save hOCR files locally\n  CREATE_LOCAL_PDF: \"true\" # Save generated PDFs locally\n  LOCAL_HOCR_PATH: \"\u002Fapp\u002Fhocr\" # Path to save hOCR files\n  LOCAL_PDF_PATH: \"\u002Fapp\u002Fpdf\" # Path to save PDF files\nvolumes:\n  # Mount volumes to access the files from your host\n  - .\u002Fhocr_files:\u002Fapp\u002Fhocr\n  - .\u002Fpdf_files:\u002Fapp\u002Fpdf\n```\n\n> **Note**: You must mount these directories as volumes in your Docker configuration to access the generated files from your host system.\n\n### PDF Upload to paperless-ngx\n\nDue to limitations in paperless-ngx's API, it's not possible to directly update existing documents with their OCR-enhanced versions. As a workaround, paperless-gpt can:\n\n1. Upload the enhanced PDF as a new document\n2. Copy metadata from the original document to the new one\n3. Optionally delete the original document\n\n```yaml\nenvironment:\n  # PDF upload configuration\n  PDF_UPLOAD: \"true\" # Upload processed PDFs to paperless-ngx\n  PDF_COPY_METADATA: \"true\" # Copy metadata from original to new document\n  PDF_REPLACE: \"false\" # Whether to delete the original document (use with caution!)\n  PDF_OCR_TAGGING: \"true\" # Add a tag to mark documents as OCR-processed\n  PDF_OCR_COMPLETE_TAG: \"paperless-gpt-ocr-complete\" # Tag used to mark OCR-processed documents\n```\n\n> **⚠️ WARNING ⚠️**  \n> Setting `PDF_REPLACE: \"true\"` will delete the original document after uploading the enhanced version. This process cannot be undone and may result in data loss if something goes wrong during the upload or metadata copying process. Use with extreme caution!\n\n### Metadata Copying Limitations\n\nWhen copying metadata from the original document to the new one, paperless-gpt attempts to copy:\n\n- Document title\n- Tags (including adding the OCR complete tag)\n- Correspondent information\n- Created date\n\nHowever, some metadata **cannot** be copied due to paperless-ngx API limitations:\n\n- Document ID (new document always gets a new ID)\n- Added date (will reflect the current upload date)\n- Modified date\n- Custom fields that might be added by other paperless-ngx plugins\n- Notes and annotations\n\n### Safety Features\n\nTo prevent accidental creation of incomplete documents, paperless-gpt includes several safety features:\n\n1. **Page Count Check**: If using `OCR_LIMIT_PAGES` to process only a subset of pages (for speed or resource reasons), PDF generation will be skipped entirely if fewer pages would be processed than exist in the original document.\n\n```yaml\nenvironment:\n  OCR_LIMIT_PAGES: \"5\" # Limit OCR to first 5 pages, set to 0 for no limit\n```\n\n2. **OCR Complete Tagging**: Documents that have been fully processed with OCR can be automatically tagged with a special tag, preventing duplicate processing.\n\n3. **Processing Skip**: If a document already has the OCR complete tag, processing will be skipped automatically.\n\n### Usage Recommendations\n\nFor best results with the enhanced OCR features:\n\n1. **Initial Testing**: Start with `PDF_REPLACE: \"false\"` until you've confirmed the process works well with your documents.\n\n2. **Regular Backups**: Ensure you have backups of your paperless-ngx database and documents before enabling document replacement.\n\n3. **Process Management**: For large documents, consider using `OCR_LIMIT_PAGES: \"0\"` to ensure all pages are processed, even though this will take longer.\n\n4. **Local Copies**: Enable local file saving (`CREATE_LOCAL_HOCR` and `CREATE_LOCAL_PDF`) to keep copies of the enhanced files as an extra precaution.\n\n5. **Tagging Strategy**: Use the OCR complete tag (`PDF_OCR_COMPLETE_TAG`) to track which documents have already been processed.\n\n## Configuration\n\n### Environment Variables\n\n> **Note:** When using Ollama, ensure that the Ollama server is running and accessible from the paperless-gpt container.\n\n| Variable                            | Description                                                                                                                                                                                   | Required | Default                    |\n| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------- |\n| `PAPERLESS_BASE_URL`                | URL of your paperless-ngx instance (e.g. `http:\u002F\u002Fpaperless-ngx:8000`).                                                                                                                        | Yes      |                            |\n| `PAPERLESS_API_TOKEN`               | API token for paperless-ngx. Generate one in paperless-ngx admin.                                                                                                                             | Yes      |                            |\n| `PAPERLESS_PUBLIC_URL`              | Public URL for Paperless (if different from `PAPERLESS_BASE_URL`).                                                                                                                            | No       |                            |\n| `MANUAL_TAG`                        | Tag for manual processing.                                                                                                                                                                    | No       | paperless-gpt              |\n| `AUTO_TAG`                          | Tag for auto processing.                                                                                                                                                                      | No       | paperless-gpt-auto         |\n| `LLM_PROVIDER`                      | AI backend (`openai`, `ollama`, `googleai`, `mistral`, or `anthropic`).                                                                                                                       | Yes      |                            |\n| `LLM_MODEL`                         | AI model name (e.g., `gpt-4o`, `mistral-large-latest`, `qwen3:8b`, `claude-sonnet-4-5`).                                                                                               | Yes      |                            |\n| `OPENAI_API_KEY`                    | OpenAI API key (required if using OpenAI).                                                                                                                                                    | Cond.    |                            |\n| `MISTRAL_API_KEY`                   | Mistral API key (required if using Mistral).                                                                                                                                                  | Cond.    |                            |\n| `ANTHROPIC_API_KEY`                 | Anthropic API key (required if using Anthropic\u002FClaude).                                                                                                                                       | Cond.    |                            |\n| `OPENAI_API_TYPE`                   | Set to `azure` to use Azure OpenAI Service.                                                                                                                                                   | No       |                            |\n| `OPENAI_BASE_URL`                   | Base URL for OpenAI API. For Azure OpenAI, set to your deployment URL (e.g., `https:\u002F\u002Fyour-resource.openai.azure.com`).                                                                       | No       |                            |\n| `LLM_LANGUAGE`                      | Likely language for documents (e.g. `English`). Appears in the prompt to help the LLM.                                                                                                                                               | No       | English                    |\n| `GOOGLEAI_API_KEY`                  | Google Gemini API key (required if using `LLM_PROVIDER=googleai`).                                                                                                                            | Cond.    |                            |\n| `GOOGLEAI_THINKING_BUDGET`          | (Optional, googleai only) Integer. Controls Gemini \"thinking\" budget. If unset, model default is used (thinking enabled if supported). Set to `0` to disable thinking (if model supports it). | No       |                            |\n| `OLLAMA_HOST`                       | Ollama server URL (e.g. `http:\u002F\u002Fhost.docker.internal:11434`).                                                                                                                                 | No       |                            |\n| `LLM_REQUESTS_PER_MINUTE`           | Maximum requests per minute for the main LLM. Useful for managing API costs or local LLM load.                                                                                                | No       | 120                        |\n| `LLM_MAX_RETRIES`                   | Maximum retry attempts for failed main LLM requests.                                                                                                                                          | No       | 3                          |\n| `LLM_BACKOFF_MAX_WAIT`              | Maximum wait time between retries for the main LLM (e.g., `30s`).                                                                                                                             | No       | 30s                        |\n| `OCR_PROVIDER`                      | OCR provider to use (`llm`, `azure`, or `google_docai`).                                                                                                                                      | No       | llm                        |\n| `OCR_PROCESS_MODE`                  | Method for processing documents: `image` (convert to images first), `pdf` (process PDF pages directly), or `whole_pdf` (entire PDF at once).                                                  | No       | image                      |\n| `VISION_LLM_PROVIDER`               | AI backend for LLM OCR (`openai`, `ollama`, `mistral`, or `anthropic`). Required if OCR_PROVIDER is `llm`.                                                                                    | Cond.    |                            |\n| `VISION_LLM_MODEL`                  | Model name for LLM OCR (e.g. `minicpm-v`). Required if OCR_PROVIDER is `llm`.                                                                                                                 | Cond.    |                            |\n| `VISION_LLM_REQUESTS_PER_MINUTE`    | Maximum requests per minute for the Vision LLM. Useful for managing API costs or local LLM load.                                                                                              | No       | 120                        |\n| `VISION_LLM_MAX_RETRIES`            | Maximum retry attempts for failed Vision LLM requests.                                                                                                                                        | No       | 3                          |\n| `VISION_LLM_BACKOFF_MAX_WAIT`       | Maximum wait time between retries for the Vision LLM (e.g., `30s`).                                                                                                                           | No       | 30s                        |\n| `VISION_LLM_MAX_TOKENS`             | Maximum tokens for Vision LLM OCR output.                                                                                                                                                     | No       |                            |\n| `VISION_LLM_TEMPERATURE`            | Sampling temperature for Vision OCR generation. Lower is more deterministic. Important: For OpenAI GPT-5 it must be explicitly set to `1.0`.                                                  | No       |                            |\n| `OLLAMA_CONTEXT_LENGTH`             | (Ollama only) Integer. Sets NumCtx (context window) for the Ollama runner. If unset or 0, the model default is used.                                                                          | No       |                            |\n| `OLLAMA_OCR_TOP_K`                  | (Ollama only) Top-k token sampling for Vision OCR. Lower favors more likely tokens; higher increases diversity.                                                                               | No       |                            |\n| `AZURE_DOCAI_ENDPOINT`              | Azure Document Intelligence endpoint. Required if OCR_PROVIDER is `azure`.                                                                                                                    | Cond.    |                            |\n| `AZURE_DOCAI_KEY`                   | Azure Document Intelligence API key. Required if OCR_PROVIDER is `azure`.                                                                                                                     | Cond.    |                            |\n| `AZURE_DOCAI_MODEL_ID`              | Azure Document Intelligence model ID. Optional if using `azure` provider.                                                                                                                     | No       | prebuilt-read              |\n| `AZURE_DOCAI_TIMEOUT_SECONDS`       | Azure Document Intelligence timeout in seconds.                                                                                                                                               | No       | 120                        |\n| `AZURE_DOCAI_OUTPUT_CONTENT_FORMAT` | Azure Document Intelligence output content format. Optional if using `azure` provider. Defaults to `text`. 'markdown' is the other option and it requires the 'prebuild-layout' model ID.     | No       | text                       |\n| `GOOGLE_PROJECT_ID`                 | Google Cloud project ID. Required if OCR_PROVIDER is `google_docai`.                                                                                                                          | Cond.    |                            |\n| `GOOGLE_LOCATION`                   | Google Cloud region (e.g. `us`, `eu`). Required if OCR_PROVIDER is `google_docai`.                                                                                                            | Cond.    |                            |\n| `GOOGLE_PROCESSOR_ID`               | Document AI processor ID. Required if OCR_PROVIDER is `google_docai`.                                                                                                                         | Cond.    |                            |\n| `GOOGLE_APPLICATION_CREDENTIALS`    | Path to the mounted Google service account key. Required if OCR_PROVIDER is `google_docai`.                                                                                                   | Cond.    |                            |\n| `DOCLING_URL`                       | URL of the Docling server instance. Required if OCR_PROVIDER is `docling`.                                                                                                                    | Cond.    |                            |\n| `DOCLING_IMAGE_EXPORT_MODE`         | Mode for image export. Optional; defaults to `embedded` if unset.                                                                                                                             | No       | embedded                   |\n| `DOCLING_OCR_PIPELINE`              | Sets the pipeline type. Optional; defaults to `vlm` if unset.                                                                                                                                 | No       | vlm                        |\n| `DOCLING_OCR_ENGINE`                | Sets the ocr engine, if `DOCLING_OCR_PIPELINE` is set to `standard`. Optional; defaults to `easyocr`                                                                                          | No       | easyocr                    |\n| `CREATE_LOCAL_HOCR`                 | Whether to save hOCR files locally.                                                                                                                                                           | No       | false                      |\n| `LOCAL_HOCR_PATH`                   | Path where hOCR files will be saved when hOCR generation is enabled.                                                                                                                          | No       | \u002Fapp\u002Fhocr                  |\n| `CREATE_LOCAL_PDF`                  | Whether to save enhanced PDFs locally.                                                                                                                                                        | No       | false                      |\n| `LOCAL_PDF_PATH`                    | Path where PDF files will be saved when PDF generation is enabled.                                                                                                                            | No       | \u002Fapp\u002Fpdf                   |\n| `PDF_UPLOAD`                        | Whether to upload enhanced PDFs to paperless-ngx.                                                                                                                                             | No       | false                      |\n| `PDF_REPLACE`                       | Whether to delete the original document after uploading the enhanced version (DANGEROUS).                                                                                                     | No       | false                      |\n| `PDF_COPY_METADATA`                 | Whether to copy metadata from the original document to the uploaded PDF. Only applicable when using PDF_UPLOAD.                                                                               | No       | true                       |\n| `PDF_OCR_TAGGING`                   | Whether to add a tag to mark documents as OCR-processed.                                                                                                                                      | No       | true                       |\n| `PDF_OCR_COMPLETE_TAG`              | Tag used to mark documents as OCR-processed.                                                                                                                                                  | No       | paperless-gpt-ocr-complete |\n| `PDF_SKIP_EXISTING_OCR`             | Whether to skip OCR processing for PDFs that already have OCR. Works with `pdf` and `whole_pdf` processing modes (`OCR_PROCESS_MODE`).                                                        | No       | false                      |\n| `AUTO_OCR_TAG`                      | Tag for automatically processing docs with OCR.                                                                                                                                               | No       | paperless-gpt-ocr-auto     |\n| `OCR_LIMIT_PAGES`                   | Limit the number of pages for OCR. Set to `0` for no limit.                                                                                                                                   | No       | 5                          |\n| `LOG_LEVEL`                         | Application log level (`info`, `debug`, `warn`, `error`).                                                                                                                                     | No       | info                       |\n| `LISTEN_INTERFACE`                  | Network interface to listen on.                                                                                                                                                               | No       | 8080                       |\n| `AUTO_GENERATE_TITLE`               | Generate titles automatically if `paperless-gpt-auto` is used.                                                                                                                                | No       | true                       |\n| `AUTO_GENERATE_TAGS`                | Generate tags automatically if `paperless-gpt-auto` is used.                                                                                                                                  | No       | true                       |\n| `CREATE_NEW_TAGS`                   | Allow the LLM to suggest new tags that don't exist in paperless-ngx yet. When enabled, new tags will be created automatically in paperless-ngx.                                               | No       | false                      |\n| `AUTO_GENERATE_CORRESPONDENTS`      | Generate correspondents automatically if `paperless-gpt-auto` is used.                                                                                                                        | No       | true                       |\n| `AUTO_GENERATE_DOCUMENT_TYPE`       | Generate document types automatically if `paperless-gpt-auto` is used. Only existing document types from paperless-ngx will be used.                                                          | No       | true                       |\n| `AUTO_GENERATE_CREATED_DATE`        | Generate the created dates automatically if `paperless-gpt-auto` is used.                                                                                                                     | No       | true                       |\n| `TOKEN_LIMIT`                       | Maximum tokens allowed for prompts\u002Fcontent. Set to `0` to disable limit. Useful for smaller LLMs.                                                                                             | No       |                            |\n| `IMAGE_MAX_PIXEL_DIMENSION`         | Maximum pixels along any side when rendering document pages to images.                                                                                                                        | No       | 10000                      |\n| `IMAGE_MAX_TOTAL_PIXELS`            | Maximum total pixel count (width × height) when rendering document pages to images.                                                                                                           | No       | 40000000                   |\n| `IMAGE_MAX_RENDER_DPI`              | Maximum DPI used when rendering document pages to images.                                                                                                                                     | No       | 600                        |\n| `IMAGE_MAX_FILE_BYTES`              | Maximum JPEG file size in bytes for rendered page images. Images exceeding this are compressed or resized.                                                                                     | No       | 10485760                   |\n| `CORRESPONDENT_BLACK_LIST`          | A comma-separated list of names to exclude from the correspondents suggestions. Example: `John Doe, Jane Smith`.                                                                              | No       |                            |\n\n### Custom Prompt Templates\n\npaperless-gpt's flexible **prompt templates** let you shape how AI responds. While you can still manually manage files, the recommended way to customize prompts is through the **Settings** page in the web UI.\n\nThe application uses two directories for management:\n- **`default_prompts\u002F`**: Contains the built-in, default templates. These should not be modified.\n- **`prompts\u002F`**: Your working directory. On first run, the default templates are copied here. All edits made in the UI are saved to the files in this directory.\n\nTo ensure your custom prompts persist across container restarts, you must mount the `prompts` directory as a volume in your `docker-compose.yml`:\n\n```yaml\nvolumes:\n  # This is crucial to save your custom prompts!\n  - .\u002Fprompts:\u002Fapp\u002Fprompts\n```\n\nThe application reloads the templates instantly after you save them in the UI and also on startup, so no restart is needed to apply changes.\n\n#### Template Variables\n\nEach template has access to specific variables:\n\n**title_prompt.tmpl**:\n\n- `{{.Language}}` - Target language (e.g., \"English\")\n- `{{.Content}}` - Document content text\n- `{{.Title}}` - Original document title\n\n**tag_prompt.tmpl**:\n\n- `{{.Language}}` - Target language\n- `{{.AvailableTags}}` - List of existing tags in paperless-ngx\n- `{{.OriginalTags}}` - Document's current tags\n- `{{.Title}}` - Document title\n- `{{.Content}}` - Document content text\n\n**ocr_prompt.tmpl**:\n\n- `{{.Language}}` - Target language\n\n**correspondent_prompt.tmpl**:\n\n- `{{.Language}}` - Target language\n- `{{.AvailableCorrespondents}}` - List of existing correspondents\n- `{{.BlackList}}` - List of blacklisted correspondent names\n- `{{.Title}}` - Document title\n- `{{.Content}}` - Document content text\n\n**created_date_prompt.tmpl**:\n\n- `{{.Language}}` - Target language\n- `{{.Content}}` - Document content text\n\n**custom_field_prompt.tmpl**:\n\n- `{{.DocumentType}}` - The name of the document's type in paperless-ngx.\n- `{{.CustomFieldsXML}}` - An XML string listing the custom fields selected in the settings for processing.\n- `{{.Title}}` - Document title\n- `{{.CreatedDate}}` - Document's created date\n- `{{.Content}}` - Document content text\n\nThe templates use Go's text\u002Ftemplate syntax. paperless-gpt automatically reloads template changes after UI saves and on startup.\n\n---\n\n## LLM-Based OCR: Compare for Yourself\n\n\u003Cdetails>\n\u003Csummary>Click to expand the vanilla OCR vs. AI-powered OCR comparison\u003C\u002Fsummary>\n\n### Example 1\n\n**Image**:\n\n![Image](demo\u002Focr-example1.jpg)\n\n**Vanilla Paperless-ngx OCR**:\n\n```\nLa Grande Recre\n\nGentre Gommercial 1'Esplanade\n1349 LOLNAIN LA NEWWE\nTA BERBOGAAL Tel =. 010 45,96 12\nTicket 1440112 03\u002F11\u002F2006 a 13597:\n4007176614518. DINOS. TYRAMNESA\nTOTAET.T.LES\nReslE par Lask-Euron\nRencu en Cash Euro\nV.14.6 -Hotgese = VALERTE\nTICKET A-GONGERVER PORR TONT. EEHANGE\nHERET ET A BIENTOT\n```\n\n**LLM-Powered OCR (OpenAI gpt-4o)**:\n\n```\nLa Grande Récré\nCentre Commercial l'Esplanade\n1348 LOUVAIN LA NEUVE\nTVA 860826401 Tel : 010 45 95 12\nTicket 14421 le 03\u002F11\u002F2006 à 15:27:18\n4007176614518 DINOS TYRANNOSA 14.90\nTOTAL T.T.C. 14.90\nRéglé par Cash Euro 50.00\nRendu en Cash Euro 35.10\nV.14.6 Hôtesse : VALERIE\nTICKET A CONSERVER POUR TOUT ECHANGE\nMERCI ET A BIENTOT\n```\n\n---\n\n### Example 2\n\n**Image**:\n\n![Image](demo\u002Focr-example2.jpg)\n\n**Vanilla Paperless-ngx OCR**:\n\n```\nInvoice Number: 1-996-84199\n\nFed: Invoica Date: Sep01, 2014\nAccaunt Number: 1334-8037-4\nPage: 1012\n\nFod£x Tax ID 71.0427007\n\nIRISINC\nSHARON ANDERSON\n4731 W ATLANTIC AVE STE BI\nDELRAY BEACH FL 33445-3897 ’ a\nInvoice Questions?\n\nBing, ‚Account Shipping Address: Contact FedEx Reı\n\nISINC\n4731 W ATLANTIC AVE Phone: (800) 622-1147 M-F 7-6 (CST)\nDELRAY BEACH FL 33445-3897 US Fax: (800) 548-3020\n\nInternet: www.fedex.com\n\nInvoice Summary Sep 01, 2014\n\nFodEx Ground Services\nOther Charges 11.00\nTotal Charges 11.00 Da £\n>\npolo) Fz\u002F\u002F \u002FG\nTOTAL THIS INVOICE .... usps 11.00 P 2\u002F1 f\n\n‘The only charges accrued for this period is the Weekly Service Charge.\n\nThe Fedix Ground aceounts teferencedin his involce have been transteired and assigned 10, are owned by,andare payable to FedEx Express:\n\nTo onsurs propor credit, plasa raturn this portion wirh your payment 10 FodEx\n‚Please do not staple or fold. Ploase make your chack payablı to FedEx.\n\n[TI For change ol address, hc har and camphat lrm or never ide\n\nRemittance Advice\nYour payment is due by Sep 16, 2004\n\nNumber Number Dus\n\n1334803719968 41993200000110071\n\nAT 01 0391292 468448196 A**aDGT\n\nIRISINC Illallun elalalssollallansdHilalellund\nSHARON ANDERSON\n\n4731 W ATLANTIC AVE STEBI FedEx\n\nDELRAY BEACH FL 334453897 PO. Box 94516\n\nPALATINE IL 60094-4515\n```\n\n**LLM-Powered OCR (OpenAI gpt-4o)**:\n\n```\nFedEx.                                                                                      Invoice Number: 1-996-84199\n                                                                                           Invoice Date: Sep 01, 2014\n                                                                                           Account Number: 1334-8037-4\n                                                                                           Page: 1 of 2\n                                                                                           FedEx Tax ID: 71-0427007\n\nI R I S INC\nSHARON ANDERSON\n4731 W ATLANTIC AVE STE B1\nDELRAY BEACH FL 33445-3897\n                                                                                           Invoice Questions?\nBilling Account Shipping Address:                                                          Contact FedEx Revenue Services\nI R I S INC                                                                                Phone: (800) 622-1147 M-F 7-6 (CST)\n4731 W ATLANTIC AVE                                                                        Fax: (800) 548-3020\nDELRAY BEACH FL 33445-3897 US                                                              Internet: www.fedex.com\n\nInvoice Summary Sep 01, 2014\n\nFedEx Ground Services\nOther Charges                                                                 11.00\n\nTotal Charges .......................................................... USD $          11.00\n\nTOTAL THIS INVOICE .............................................. USD $                 11.00\n\nThe only charges accrued for this period is the Weekly Service Charge.\n\n                                                                                           RECEIVED\n                                                                                           SEP _ 8 REC'D\n                                                                                           BY: _\n\n                                                                                           posted 9\u002F21\u002F14\n\nThe FedEx Ground accounts referenced in this invoice have been transferred and assigned to, are owned by, and are payable to FedEx Express.\n\nTo ensure proper credit, please return this portion with your payment to FedEx.\nPlease do not staple or fold. Please make your check payable to FedEx.\n\n❑ For change of address, check here and complete form on reverse side.\n\nRemittance Advice\nYour payment is due by Sep 16, 2004\n\nInvoice\nNumber\n1-996-84199\n\nAccount\nNumber\n1334-8037-4\n\nAmount\nDue\nUSD $ 11.00\n\n133480371996841993200000110071\n\nAT 01 031292 468448196 A**3DGT\n\nI R I S INC\nSHARON ANDERSON\n4731 W ATLANTIC AVE STE B1\nDELRAY BEACH FL 33445-3897\n\nFedEx\nP.O. Box 94515\n```\n\n---\n\n\u003C\u002Fdetails>\n\n**Why Does It Matter?**\n\n- Traditional OCR often jumbles text from complex or low-quality scans.\n- Large Language Models interpret context and correct likely errors, producing results that are more precise and readable.\n- You can integrate these cleaned-up texts into your **paperless-ngx** pipeline for better tagging, searching, and archiving.\n\n### How It Works\n\n- **Vanilla OCR** typically uses classical methods or Tesseract-like engines to extract text, which can result in garbled outputs for complex fonts or poor-quality scans.\n- **LLM-Powered OCR** uses your chosen AI backend—OpenAI or Ollama—to interpret the image's text in a more context-aware manner. This leads to fewer errors and more coherent text.\n- **Google Document AI and Azure Document Intelligence** provide high-accuracy OCR with advanced layout analysis.\n- **Enhanced PDF Generation** combines OCR results with the original document to create searchable PDFs with properly positioned text layers.\n\n---\n\n## Usage\n\n1. **Tag Documents**\n\n   - Add `paperless-gpt` tag to documents for manual processing\n   - Add `paperless-gpt-auto` for automatic processing\n   - Add `paperless-gpt-ocr-auto` for automatic OCR processing\n\n2. **Visit Web UI**\n\n   - Go to `http:\u002F\u002Flocalhost:8080` (or your host) in your browser\n   - Review documents tagged for processing\n\n3. **Generate & Apply Suggestions**\n\n   - Click \"Generate Suggestions\" to see AI-proposed titles\u002Ftags\u002Fcorrespondents\n   - Review and approve or edit suggestions\n   - Click \"Apply\" to save changes to paperless-ngx\n\n4. **OCR Processing**\n   - Tag documents with appropriate OCR tag to process them\n   - If enhanced PDF features are enabled, documents will be processed accordingly:\n     - For local file saving, check the configured directories for output files\n     - For PDF uploads, new documents will appear in paperless-ngx with copied metadata\n   - Monitor progress in the Web UI\n   - Review results and apply changes\n\n## Troubleshooting\n\n### Working with Local LLMs\n\nWhen using local LLMs (like those through Ollama), you might need to adjust certain settings to optimize performance:\n\n#### Token Management\n\n- Use `TOKEN_LIMIT` environment variable to control the maximum number of tokens sent to the LLM\n- For Ollama, set `OLLAMA_CONTEXT_LENGTH` to control the model's context window (NumCtx). This is independent of `TOKEN_LIMIT` and configures the server-side KV cache size. If unset or 0, the model default is used. Choose a value within the model's supported window (e.g., 8192).\n- Smaller models might truncate content unexpectedly if given too much text\n- Start with a conservative limit (e.g., 1000 tokens) and adjust based on your model's capabilities\n- Set to `0` to disable the limit (use with caution)\n\nExample configuration for smaller models:\n\n```yaml\nenvironment:\n  TOKEN_LIMIT: \"2000\" # Adjust based on your model's context window\n  OLLAMA_CONTEXT_LENGTH: \"4096\" # Controls Ollama NumCtx (context window); if unset, model default is used\n  LLM_PROVIDER: \"ollama\"\n  LLM_MODEL: \"qwen3:8b\" # Or other local model\n```\n\nCommon issues and solutions:\n\n- If you see truncated or incomplete responses, try lowering the `TOKEN_LIMIT`\n- On Ollama, if you hit \"context length exceeded\" or memory issues, reduce `OLLAMA_CONTEXT_LENGTH` or choose a smaller model\u002Fcontext size.\n- If processing is too limited, gradually increase the limit while monitoring performance\n- For models with larger context windows, you can increase the limit or disable it entirely\n\n### PDF Processing Issues\n\n- If PDFs aren't being generated, check that `OCR_LIMIT_PAGES` isn't set too low compared to your document page count\n- Ensure volumes are properly mounted if using `CREATE_LOCAL_PDF` or `CREATE_LOCAL_HOCR`\n- When using `PDF_REPLACE: \"true\"`, verify you have recent backups of your paperless-ngx data\n\n### Custom Field Generation Issues\n\n- **Feature Not Working**: If custom field suggestions are not being generated even though the feature is enabled, ensure you have selected at least one custom field in the settings. The feature requires at least one field to be selected to know what to process.\n\n---\n\n## Contributing\n\n**Pull requests** and **issues** are welcome!\n\n1. Fork the repo\n2. Create a branch (`feature\u002Fmy-awesome-update`)\n3. Commit changes (`git commit -m \"Improve X\"`)\n4. Open a PR\n\nCheck out our [contributing guidelines](CONTRIBUTING.md) for details.\n\n---\n\n## Support the Project\n\nIf paperless-gpt is saving you time and making your document management easier, please consider supporting its continued development:\n\n- **[GitHub Sponsors](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Ficereed)**: Help fund ongoing development and maintenance\n- **Share** your success stories and use cases\n- **Star** the project on GitHub\n- **Contribute** code, documentation, or bug reports\n\nYour support helps ensure paperless-gpt remains actively maintained and continues to improve!\n\n---\n\n## Maintainer Note\n\nThis project is fully open-source and will remain free to use.  \nIt's maintained by [Icereed](https:\u002F\u002Fgithub.com\u002Ficereed), with partial support from my other project:  \n👉 [BubbleTax.de](https:\u002F\u002Fbubbletax.de\u002F?utm_source=github&utm_medium=footer&utm_campaign=paperless) — automated tax reports for IBKR traders in Germany.  \nIf you're a developer who also trades, check it out. If not – no worries 😊\n\n---\n\n## License\n\npaperless-gpt is licensed under the [MIT License](LICENSE). Feel free to adapt and share!\n\n---\n\n## Star History\n\n[![Star History Chart](https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=icereed\u002Fpaperless-gpt&type=Date)](https:\u002F\u002Fwww.star-history.com\u002F#icereed\u002Fpaperless-gpt&Date)\n\n---\n\n## Disclaimer\n\nThis project is **not** officially affiliated with [paperless-ngx][paperless-ngx]. Use at your own risk.\n\n---\n\n**paperless-gpt**: The **LLM-based** companion your doc management has been waiting for. Enjoy effortless, intelligent document titles, tags, and next-level OCR.\n\n[paperless-ngx]: https:\u002F\u002Fgithub.com\u002Fpaperless-ngx\u002Fpaperless-ngx\n[docker-install]: https:\u002F\u002Fdocs.docker.com\u002Fget-docker\u002F\n","paperless-gpt 是一个利用大语言模型和OCR技术来实现文档数字化的项目。它通过结合LLM（如OpenAI或Ollama）增强OCR功能，能够将模糊或低质量的扫描件转化为高精度的文本，并自动生成文档标题、标签和创建日期。此外，该项目还支持多种专业的OCR服务，包括Google Document AI、Azure Document Intelligence等，以适应不同场景下的需求。paperless-gpt非常适合需要高效处理大量纸质文档并希望将其数字化的企业和个人使用，尤其适用于那些追求高质量文本提取与自动化文档管理的场合。",2,"2026-06-11 03:44:49","high_star"]