AI & LLM Tools

Paperless-ngx + AI: Setup, Privacy, and Trade-offs

J
James Eriksson
··12 min read
Paperless-ngx AI setup guide: compare Ollama, cloud APIs, and built-in LLM features. Privacy, hardware, auto-tagging, OCR, and document chat explained.
TL;DR
  • Paperless-ngx + AI automates tagging, improves OCR, and lets you chat with your documents
  • Paperless-AI (open source) connects to local Ollama (private) or cloud APIs (simple but costs money)
  • Local setup: $400-600 GPU one-time + free software, or $20-40/month on managed hosting
  • Step-by-step: Ollama + Paperless-AI in Docker, 30 minutes to configure
  • Skip AI if you have < 50 documents, no IT ops, or a strict uptime SLA

Paperless-ngx is a fully searchable document archive. Add AI, and it becomes a document brain: auto-tagging, smart OCR, and an interface to ask questions about your files. This guide walks you through which AI path fits your setup, hardware requirements, and step-by-step configuration of the most popular combination: Paperless-AI + Ollama.

What Is AI for Paperless-ngx? Why You Might Want It

Paperless-ngx alone works well for 20-50 documents. Beyond that, search and manual tagging break down. You end up with a pile of unsorted PDFs and scans again.

AI solves this by automatically understanding what a document is about and sorting it. With AI enabled, Paperless-ngx can:

  • Auto-tag documents based on content (invoice tagged as "expenses", medical form tagged as "insurance")
  • Generate smart titles ("Q3 Electric Bill" instead of "invoice_scan_12_28_2024.pdf")
  • Let you chat with your archive ("How much did we spend on office supplies this year?")
  • Improve OCR quality for scans of poor-quality originals

The difference matters. A small business with 500 scanned invoices can retrieve specific ones in seconds instead of hunting through folders. A freelancer can ask "what projects did I invoice in September" and get an instant answer with citations. Privacy is preserved: all processing happens on your server or locally, not on someone else's cloud.

Paperless-ngx itself has 48.6K GitHub stars and is actively maintained. The ecosystem around it--Paperless-AI, Ollama, Open WebUI--adds the AI layer without leaving your infrastructure.

Built-In vs Companion: Which AI Path Is Right for You?

Paperless-ngx offers three ways to add AI. Each has trade-offs.

Built-in LLM features (optional, disabled by default). Paperless-ngx 2.0+ can call an LLM API if you configure one. You point it at OpenAI, Anthropic, or a local service. This works but is minimal: mostly metadata suggestions. Requires an API key and internet connection (unless you run a local LLM API separately).

Paperless-AI (6.2K GitHub stars). A companion tool that runs in a separate Docker container. It connects to your Paperless-ngx instance and adds aggressive automation: auto-tagging using document embeddings and classification, chat-with-documents (RAG), and improved OCR via PaddleOCR. You can run it with a local LLM (Ollama) or cloud APIs. This is the most feature-complete option and the most recommended by the community. MIT licensed, 538 commits, actively maintained.

Paperless-GPT. Focused on OCR and metadata extraction using vision models. Lighter weight than Paperless-AI if you only care about improving scans. Less active development than Paperless-AI.

Ollama + Open WebUI directly. Run Ollama (the LLM runtime) and Open WebUI (a chat interface) separately and manually query them. Full privacy, full control, no Paperless-ngx integration needed--you get a knowledge base UI but not auto-tagging. Best for users who want a document Q&A tool without automatic tagging.

Most users choose Paperless-AI + Ollama: it automates tagging (saves time), runs locally (privacy), costs nothing (Ollama is free), and is well-documented in community guides. That is the path this guide covers.

Local AI vs Cloud APIs: Privacy & Performance Tradeoffs

When you set up Paperless-AI, you choose where the LLM runs. This choice shapes everything.

Local LLM (Ollama, LM Studio). The model runs on your server or home machine. Documents never leave your network. Speed is slow (a 7B parameter model processes a document in 10-30 seconds on a CPU; with a GPU, 1-3 seconds). Cost: free software, but hardware costs money (a used Mac Mini with an M1 chip, $400-600; an NVIDIA RTX 4060 Ti, $300-400). Best for: privacy-first users, sensitive documents, long-term cost savings, teams with IT resources. No vendor lock-in. Downside: you manage the hardware and updates yourself.

Cloud LLM (OpenAI, Anthropic, Azure AI). The model is hosted elsewhere. You send document text to the vendor's API. Speed is fast (responses in 1-3 seconds). Cost: pay per token ($0.001-0.05 per document, depending on length and model). Easy to set up: one API key. Best for: small batches, users who don't have spare hardware, teams without ops experience. Downside: vendor controls price, your documents are in their system (even with GDPR compliance promises, they are not on your server), and cost scales with document volume.

Hybrid. Use local OCR (Tesseract or PaddleOCR) for image-to-text, then send that text to a cloud LLM. Saves bandwidth and cost (images are bigger than text). Text is what you care about for classification anyway.

For a 10-person team with 1000 documents to process: local Ollama costs $500 hardware + electricity. Cloud LLM costs $10-50 one-time (assuming 10,000 tokens per document). For 10,000 documents, cloud is $100-500. For 100,000 documents, local is cheaper and faster. Local is also private by definition.

Hardware & Resource Requirements

Your hardware choice depends on your tolerance for speed and your privacy stance.

Minimal CPU-only setup. Paperless-ngx + Paperless-AI + Ollama running a 7B-parameter model on a 2-core CPU with 4 GB RAM. Processing a document takes 30-60 seconds. Good for small archives (<100 docs), infrequent processing, users on a tight budget. Example: an older PC or a Raspberry Pi 4. Free tier of a managed server.

Recommended GPU setup. 8-16 GB RAM, an NVIDIA GPU (RTX 3060 Ti or better) or Apple Silicon (M1/M2 Mac). Processing time drops to 1-3 seconds per document. Comfortable for 1000+ documents. This is what most home-lab enthusiasts run.

Rob McBryde's setup (a case study in the community) is a Mac Mini with M1 chip ($600 used), running Ollama and Paperless-ngx. Processing is fast enough that he runs batch imports of 100+ scans overnight or while working. He uses Llama 3.2 and Nomic Embed models, both 7B parameters and open source.

Managed hosting. You run Paperless-ngx on Opsily or similar (8 GB RAM, 2 vCPUs, $20-40/month). Paperless-AI runs in a separate container on the same instance. Add a GPU tier if the provider supports it (most don't; this limits local LLM options). Check pricing and GPU availability per provider. Upside: no hardware to manage. Downside: limited GPU options, vendor lock-in, higher cost than self-hosted over time.

Step-by-Step Setup: Paperless-AI + Ollama

This is the path most people take. Prerequisites: a Linux server or Mac, Docker and Docker Compose installed, 8+ GB RAM, patience for 30 minutes of configuration.

1. Set up Paperless-ngx first (if you haven't already). Use the official Docker Compose setup from docs.paperless-ngx.com or a managed host like Opsily. Test that it works: sign in, upload a document, make sure it is searchable.

2. Install Ollama. Visit ollama.ai, download the app for your OS (Linux, Mac, Windows). Run it, which starts the Ollama API service on the default port. Verify the API is running by making a request to the endpoint.

3. Download a model. Run the Ollama pull command (e.g., ollama pull llama2:7b for Llama 2, 7 billion parameters, or ollama pull qwen:7b for Qwen, optimized for classification tasks). This downloads 4-5 GB to your disk and takes 5-15 minutes depending on internet speed. Run ollama list to verify the model is available.

4. Create a Paperless-AI Docker container. Clone the Paperless-AI repo or use the Docker image directly. Create a docker-compose.yml file (or add to your existing one) with Paperless-AI service configuration:

Set the Paperless-ngx URL to point to your instance. Get your API token from Paperless-ngx settings (Admin > Users > Your user > API token). Point the LLM service to your Ollama instance using the appropriate Docker networking address (host.docker.internal if Ollama runs on the host, or the service name if it runs in Docker). Specify the LLM model you downloaded.

5. Start Paperless-AI. Run docker-compose up -d paperless-ai. Check logs to monitor startup: docker-compose logs -f paperless-ai. Wait for the connection message; it should indicate "Connected to Paperless-ngx" and "LLM ready".

6. Test it. Upload a document to Paperless-ngx. Wait 30-60 seconds (or 2-5 seconds if you have a GPU). Check that the title has changed, tags have been added, and the AI processing log shows no errors.

That is it. Paperless-AI will process new documents automatically and backfill old ones if you trigger it.

Testing & Troubleshooting

Is AI actually running? Check Paperless-ngx admin logs (Admin > Logs). Search for "paperless_ai" or "LLM". You should see processing lines. Check Paperless-AI container logs using docker-compose logs and filter for processing, error, or success messages.

Documents are not being tagged. Common causes: (1) LLM URL is wrong or unreachable. (2) Model not loaded on the Ollama instance. (3) Paperless-ngx token is incorrect; regenerate it in settings. (4) Paperless-AI crashed on startup; restart it with docker-compose restart paperless-ai.

Processing is very slow. (1) You are on CPU-only mode and processing a large document. This is normal; a 50-page PDF scan can take 2-3 minutes. (2) The model is too large (13B+ parameters on a 4-core CPU). Switch to a smaller model. (3) Your server is out of RAM; Paperless-ngx + Ollama + Paperless-AI can use 6-8 GB together.

API timeout errors. Paperless-AI is waiting for Ollama and giving up. Usually a network issue between containers. If using Docker: ensure both containers are on the same network or use appropriate Docker networking settings. If using separate machines: ensure firewall allows traffic on the Ollama port.

Version mismatch after update. Paperless-ngx occasionally changes its API. Paperless-AI might not keep up immediately. Check the Paperless-AI GitHub releases for a compatible version. Pin to a specific tag in your docker-compose configuration instead of latest.

OCR, Tagging & Chat: What Each Tool Actually Does

Paperless-AI auto-tagging. Reads the document content, generates an embedding (a numerical representation of meaning), and compares it to a learned classification model trained on your past tags and documents. First time setup: manually tag 20-50 documents, then run the training command or let it retrain on a schedule. After that, new documents are tagged automatically with ~80-90% accuracy (errors depend on document complexity and your tag consistency). Takes about 2-5 seconds per document with a GPU.

Paperless-AI smart titles. Suggests a filename based on document content. Often better than "scan_1234.pdf". Example: a credit card statement becomes "Chase Visa 2024-11" automatically. Not always perfect (sometimes suggests generic names), but saves manual work.

Paperless-AI document chat (RAG). You ask a question. The tool searches your documents for relevant text, feeds that text to the LLM as context, and generates an answer with citations. Example: "How much did we spend on contractors last year?" searches all invoices tagged "contractor", extracts amounts, and returns a summary. Requires Paperless-AI to have indexed your documents with embeddings. First run takes time; after that, chat is fast.

PaddleOCR vs Tesseract (the OCR models). Tesseract is Paperless-ngx's default. It is old, reliable, and accurate for clean printed text. PaddleOCR (available via Paperless-AI) is newer, better at handwriting and skewed scans, but slower. Paperless-AI can run PaddleOCR before passing text to Paperless-ngx, improving the searchability of poor-quality scans. Enable it in Paperless-AI config.

Classification training (optional). If Paperless-AI's auto-tagging is not accurate enough, you can train a custom classifier on your documents. Requires tagging 100+ documents manually first. Paperless-AI then uses those examples to build a model. Best for specialized workflows (e.g., a tax firm with specific document types).

When This Is NOT the Right Tool

AI adds complexity. Know when to skip it.

Small archive (< 50 documents). Manual tagging is faster than setup and troubleshooting. Skip AI.

Non-technical team. Paperless-ngx + Ollama requires Docker knowledge, SSH access, debugging logs. If your team is not comfortable with that, buy a managed solution (Docspell, Teedy, Mayan EDMS) or use Opsily's managed Paperless-ngx hosting and avoid the AI layer. This saves 10 hours of support burden.

Sensitive documents + no IT ops. Privacy requires running Ollama locally. Local Ollama requires hardware maintenance, model updates, and monitoring. If you have no IT team, use cloud APIs (OpenAI) or a managed service. The trade-off is worth the simplicity.

Very large documents (> 100 MB PDFs). Processing becomes prohibitively slow. Consider splitting files or using a cloud service with better hardware.

Budget under $200/year. Paperless-ngx (free), Ollama (free), but GPU hardware ($300+) is not in budget. CPU-only works but processing time is 30+ seconds per document. For comparison, cloud LLM APIs ($100-200/year for 10,000 documents) are simpler. CPU-only is an option but expect frustration.

You need 99.9% uptime. Self-hosted Ollama is reliable but not enterprise-grade. No SLA, no redundancy. For mission-critical workflows, use managed hosting and cloud APIs.

Frequently Asked Questions

Can Paperless-ngx use AI to improve OCR?

Yes. Paperless-AI includes PaddleOCR, which outperforms the default Tesseract for skewed, low-quality, or handwritten scans. Enable it and re-run OCR on existing documents. The searchable text improves, but the original PDF image is unchanged.

How do you set up Ollama with Paperless-ngx?

Install Ollama separately on your server or Mac, download a model (e.g., ollama pull qwen:7b), and configure Paperless-AI to point to Ollama's API endpoint. Paperless-AI handles the rest. See Step-by-Step Setup above for the full flow.

Is Paperless-ngx AI private?

Yes, if you use local Ollama. Documents stay on your server. No cloud uploads, no third-party API calls. If you use cloud LLMs (OpenAI, Anthropic), data is sent to them. Paperless-ngx itself is GDPR-compliant when self-hosted, but that is separate from the AI layer.

What's the difference between Paperless-AI and Paperless-GPT?

Paperless-AI is broader: auto-tagging, smart titles, chat, OCR improvement. Paperless-GPT focuses on OCR and metadata extraction using vision models. Paperless-AI is more active and recommended. Both work with local LLMs or cloud APIs.

Do you need a GPU for local LLM AI tagging?

No, but it helps. CPU-only works (30-60 seconds per document). With a GPU (NVIDIA RTX or Apple M1/M2), processing is 10-50x faster. For small archives, CPU is acceptable. For 1000+ documents, GPU pays for itself in time saved.

What LLM models work best for document classification?

Qwen 7B (optimized for text classification), Llama 3.2 (general-purpose, good for chat), and MiniCPM-V (smaller, vision-capable for OCR). Sizes 7B-14B are balanced: smart enough but not too heavy. Avoid 70B models on consumer hardware.

How much does running Ollama locally cost?

Software is free. Hardware: buy a used Mac Mini M1 ($400-600), or a used desktop with NVIDIA GPU ($300-500). Electricity: $5-15/month depending on usage. No subscription. Managed hosting (Opsily) costs $20-40/month but abstracts hardware.

The Bottom Line

Paperless-ngx + AI bridges the gap between a searchable archive and a document brain. For teams with 500+ documents, the time saved on tagging and retrieval is real. Local Ollama keeps data private and costs nothing long-term. The setup is not trivial--expect one evening of work--but the community is helpful and documentation is solid.

Start with Paperless-ngx alone, process 50 documents manually, then decide if AI is worth your time. If your document volume keeps growing, add Ollama. For more details on hosting Paperless-ngx reliably, see the guide to open-source DMS systems and check Opsily's managed Paperless-ngx pricing.

Run Paperless-ngx on EU servers
Managed hosting with pre-configured Paperless-ngx, automatic backups, and no AI setup required. Privacy-first infrastructure in the EU.
Get Started Free

Ready to self-host your own apps?

One server. Multiple apps. No per-app fees.

Get started →