r/SelfHostedAI • u/81Ack5mith • 5d ago
Need help with a local document processing application
I have hundreds of pages and hundreds of folders of files. I want to use ChatGPT to analyze them, but I can't give them away directly because they contain a lot of sensitive data. I'm working on building a system on my Mac Mini M5 Pro 48GB computer that includes OCR dumping, Markdown conversion, redaction of sensitive data, and second-in-command review. Which models should I use for these processes? Speed and accuracy are important to me, but accuracy is paramount. Do you have any general advice to guide me?
1
u/yudhanjaya 5d ago
Cloudflare dropped a model that's nearly exactly what you need: https://huggingface.co/Cloudflare/clairic
1
1
u/Long_Berry_7169 4d ago
for legal docs i wouldnt let the model do the redaction alone, run a regex / name detection pass first and then have the model look for whatever slipped through. 48gb is plenty for a decent mid size model on the review step and since accuracy matters more id go bigger and slower over fast
1
u/81Ack5mith 4d ago
I actually use that method. I tested qwen 3.8 27b dense model but it was slow&inaccurate. now i use Qwen3.6 35B A3B Claude 4.7 Opus OQ4e DWQ MC MTP Vision as main llm model. do you have suggestion to improve qwen 3.8 27b's inaccuracy?
2
u/macromind 5d ago
For hundreds of folders, separate extraction, indexing, retrieval, and generation instead of asking one model to ingest everything. Start by parsing PDFs and office files locally, preserving filename, path, page number, and modification date as metadata. Chunk by document structure rather than fixed character counts, create local embeddings, and retrieve a small evidence set for each question. Require page-level citations in every answer. Test first on 20 representative files, including scans and duplicates, and manually score retrieval accuracy before scaling. If the material is sensitive, keep OCR, embeddings, vector storage, and inference local.
1
u/Hot-Imagination6380 5d ago
used ocrmypdf + grep on a similar pile last month, kept everything local, stripped names/IDs with regex, then fed the clean markdown into a local qwen3-32b via llama.cpp. worked better than expected.
1
u/AncientBumblebee75 4d ago
For the redaction step, don’t rely on an LLM alone. Use something like Microsoft Presidio first, which catches names, emails, phone numbers and ID numbers with rules plus a small model, and then have the LLM look for whatever it missed. Rules don’t get “creative” the way a model can.
1
u/LiaVKane 4d ago
Do you need it just to parse the document to understand the meaning and use it as Agentic RAG? Or you need a orchestrated pipline: document intake => document classification with LLM=>data recognition with PaddleOCR=>data extraction and post processing with LLM => data validation for exceptions with human in loop (when data per field is below the defined threshold)=>data export=>document archiving. If you need orchestrated AI document processing pipline, worth to check open source from elDoc (proven on large enterprise scale) https://github.com/elDocAI/elDoc-idp-oss/
With this open source, all components can run absolutely on your promise with no connection to internet, you may connect any open-weight LLM to it and run it locally
1
u/Wise_Message4170 3d ago
There is a model that perplexity released that does similar for their hybrid model, local LLM and cloud. So as I underhand that model identify possible sensitive data and help with teh detection and mask it, This may help you in your project. Model here: https://huggingface.co/perplexity-ai/pplx-pii-masking and study here: https://arxiv.org/abs/2609.22200
0
2
u/SlightlyOverbuilt_ 5d ago
It's an interesting task. I didn't see the main thing in your post, which is what problems you'll need to solve once you've built all this.
I wouldn't try to solve everything with one technology or one model.
First, I'd run everything through OCR, and only use an LLM if recognition is an issue. Then I'd pick out all the sensitive information using something like regular expressions or other algorithms. You definitely need someone to check this, at least do some spot checks.
Once you're done, you can index everything and put it into a RAG, or just store it as MD. It depends on what you're going to do with the knowledge base afterwards. For certain tasks, an LLM + filesytem and grep command are even better together.
Here are some models for a 48GB RAM setup:
- gpt-oss:20b - pretty easy
- qwen3.6:27b, qwen3-coder:30b - good
- Llama 70B - just about making it