# Clean Sensitive Docs with a Local Model
Canonical: https://social-archive.org/arc/adjyVJkHl9
Original URL: https://unlock-ai.natebjones.com/guides/clean-sensitive-docs-locally
Author: Nate B. Jones
Platform: web
Share mode: full
## Content
## The work you've been doing by hand Everyone has a file they would never paste into a chatbot — a contract, a board deck, a client record, an HR document. AI could obviously help, but the file can't leave, so the work stays manual or doesn't happen at all. This guide is the hands-on lane of Nate's executive briefing on using AI on work you cannot upload. The briefing covers why companies like Bayer and Discovery Bank are paying to escape this exact trade-off, where the laptop stops being enough, and the questions to ask before trusting any AI product with a private file. Here, we set up the laptop half: a local model with one job — producing a proposed redacted copy of a document for you to check. ## How a local model keeps the document private A local model is a file of numbers — the weights — that you download once and run on your own machine. When you send it a document, the inference happens in your laptop's RAM and GPU. There is no account, no API call, and no per-token bill, because there is no server on the other end. That is the whole privacy argument: with the model and document on the same machine, chat and document processing work entirely offline. You can pull up WiFi settings and switch the network off, and the model keeps answering. Nothing you paste can travel anywhere. Local processing removes one route off your laptop. It doesn't audit the app around the model, make the machine compliant, or replace your company's rules about where a file may live. For a real document, use a machine and workflow you're authorized to use. ## Why this one Gemma 4 is Google DeepMind's open-weight model family, released March 31, 2026 under the Apache 2.0 license. E2B is the "effective 2B" member: it has about 4.6B parameters, but a per-layer embeddings trick gives it the memory footprint of a 2B-class model — the download is ~4.4 GB, and it runs comfortably on a 16 GB laptop. Despite the size it handles text and images, has a reasoning mode, supports tool calling, and takes a 128K-token context, which matters when the document you're cleaning runs long. The honest sizing rule: pick the model by your machine's RAM, not by benchmark charts. LM Studio flags what fits ("Full GPU Offload Possible" is the green light), and a model that technically loads but takes twenty minutes to answer will never become part of your real workflow. ## What a model this size is — and isn't — for Don't ask a 4.6B-parameter model to write your code or reason through open-ended strategy; models small enough to download to a laptop aren't big enough for that. What they are good at is a narrow, well-specified job with a strong system prompt — and redacting sensitive strings from a document is exactly that shape. In our testing, E2B caught disguised items a keyword search would miss: a phone number written out in words, an SSN with the dashes removed, an obfuscated email address. This assumes LM Studio is already installed — lmstudio.ai has the installer and its own setup guide. ## Search for Gemma 4 E2B Open Model Search (the magnifying glass in the left rail), search "gemma 4 2b", and pick Gemma 4 E2B — the entry published by Google (google/gemma-4-e2b), not the community re-uploads. The detail pane confirms what you're getting: 5.1B params, vision, tool use, reasoning, GGUF and MLX builds. ![LM Studio Model Search showing staff picks with the google/gemma-4-e2b detail pane open.](https://unlock-ai.natebjones.com/_next/image?url=%2Fguides%2Fclean-sensitive-docs-locally%2Flm-model-search.png&w=3840&q=75&dpl=dpl_7hhX6aPwgdjrRoexWJS9mn62Ausb) ## Pick a format and size Under Download Options you'll see two formats: MLX is Apple's machine-learning framework — take it on a Mac; GGUF runs everywhere else (and also on Macs). The quantization variants trade size for fidelity — the ~4.4 GB 4-bit build is the right default. If LM Studio shows "Full GPU Offload Possible", your machine can run that variant at full speed. ![LM Studio download options for Gemma 4 E2B showing GGUF and MLX variants from about 4.4 to 6 GB.](https://unlock-ai.natebjones.com/_next/image?url=%2Fguides%2Fclean-sensitive-docs-locally%2Flm-download-options.png&w=3840&q=75&dpl=dpl_7hhX6aPwgdjrRoexWJS9mn62Ausb) ## Download, then load it into a chat Click Download and wait it out. When it finishes, LM Studio offers "Use in New Chat" — take it, and the model loads into a fresh conversation. Say hello to confirm it's alive; small models answer fast. ![LM Studio download-completed toast for google/gemma-4-e2b with a Load Model button.](https://unlock-ai.natebjones.com/_next/image?url=%2Fguides%2Fclean-sensitive-docs-locally%2Flm-download-complete.png&w=3840&q=75&dpl=dpl_7hhX6aPwgdjrRoexWJS9mn62Ausb) ## Open the system prompt editor Open the right side panel and switch to the settings tab (the sliders icon). Under System Prompt, click Editor to get a full editing pane — the small field works, but you're about to paste something long. ![LM Studio settings panel showing the System Prompt field with its Editor button.](https://unlock-ai.natebjones.com/_next/image?url=%2Fguides%2Fclean-sensitive-docs-locally%2Flm-system-prompt-settings.png&w=3840&q=75&dpl=dpl_7hhX6aPwgdjrRoexWJS9mn62Ausb) ## Paste the Doc Cleaner prompt This is the prompt we validated against Gemma 4 E2B on a synthetic memo seeded with 20+ planted sensitive items — including a phone number spelled out in words, an SSN without dashes, and a deal-target company name hiding in running prose. The final version caught all of them. The typed placeholders ([NAME], [SSN], [CREDENTIAL], …) keep the cleaned document readable, and the consistency rule stops a name that was redacted in one paragraph from leaking in another. Show the full prompt ``` You are a data-privacy redaction system. The user's message contains a document (pasted or attached as a file). Your only job is to return that document with every piece of sensitive information redacted. You never answer questions about the document, never summarize it, and never add commentary — you only return the cleaned document. Redact every instance of the following, replacing each with a typed placeholder in square brackets: 1. People and identity — names of real people → [NAME]; dates of birth or other dates that identify a person → [DOB]; job titles that identify a specific person → [ROLE]. 2. Contact details — email addresses, including obfuscated forms like "name at company dot com" → [EMAIL]; phone numbers in any format, including numbers written out as words → [PHONE]; street or mailing addresses → [ADDRESS]. 3. Government and financial identifiers — Social Security or national ID numbers, with or without dashes → [SSN]; credit or debit card numbers in any format → [CARD]; bank account and routing numbers → [ACCOUNT]; salaries, offers, and confidential deal amounts → [AMOUNT]. 4. Credentials and technical identifiers — API keys, tokens, and passwords → [CREDENTIAL]; private keys → [PRIVATE KEY]; IP addresses → [IP]; MAC addresses → [MAC]; GPS coordinates → [COORDINATES]; cryptocurrency addresses → [CRYPTO]; WiFi network names and passwords → [WIFI]. 5. Medical information — patient names, medical record numbers, insurance IDs, provider names, and every diagnosis and medication name (e.g. drug names and conditions) → [MEDICAL]. 6. Confidential business information — internal project codenames → [PROJECT]; names of companies that are targets or counterparties in a confidential deal, acquisition, or dispute → [COMPANY]; unreleased financials, acquisition or deal terms → [CONFIDENTIAL]; customer or account identifiers → [CUSTOMER]; employee IDs → [EMPLOYEE ID]; trade secrets and non-public strategy → [CONFIDENTIAL]. - Replace only the sensitive value. Keep the surrounding sentence grammatically intact and do not change the meaning of non-sensitive text. - Keep the document's structure: headings, lists, tables, and line breaks stay where they are. - Be consistent: once a name or value qualifies for redaction anywhere in the document, redact every mention of it — including in running prose, headings, and shortened forms ("the Halcyon deal" is still [COMPANY] if Halcyon is a deal target). - Watch for disguised formats: numbers written as words, emails using "at" and "dot", IDs without separators, values split across lines. - If you are unsure whether something is sensitive, redact it. Over-redacting is safer than leaking. Return ONLY the redacted document. No introduction, no list of what you redacted, no closing summary. Your output must begin with the first line of the document. ``` ## Save it as a preset Click "Save Preset As…", name it — doc cleaner works — and save. The preset bundles the system prompt with the model settings, so any future chat becomes the document cleaner in one click. This is the difference between a trick you saw once and a tool you actually use. ![LM Studio preset save field named doc cleaner, with the system prompt loaded in the editor.](https://unlock-ai.natebjones.com/_next/image?url=%2Fguides%2Fclean-sensitive-docs-locally%2Flm-save-preset.png&w=3840&q=75&dpl=dpl_7hhX6aPwgdjrRoexWJS9mn62Ausb) ## Make a synthetic test file Don't start with a real document. Have any AI generate a fake memo full of planted sensitive items plus an answer key, so you can grade the redaction instead of eyeballing it. This mirrors the briefing's rule: measure the setup on synthetic material before it sees anything real. Show the full prompt ``` Create a synthetic test document I can use to evaluate a local document-redaction model. It should read like a real internal company memo. - Plant at least 20 fake sensitive items across these categories: names, emails, phone numbers, a date of birth, a street address, an SSN, a credit card number, bank account and routing numbers, salary and deal amounts, an API key, an IP address, a MAC address, a WiFi name and password, a cryptocurrency address, patient/medical details, an internal project codename, an acquisition target company, and customer account identifiers. - Disguise at least three items: one phone number written out in words, one email written as "name at company dot com", and one ID number without its usual separators. - Every item must be fictional. Do not use real people, companies, or working credentials. 1. The memo itself, saved as a plain-text file. 2. A separate answer key listing every planted item, so I can check the redacted output against it. ``` ## Attach the file and send Start a new chat, confirm the doc cleaner preset is active, then attach the file with the + button (or paste the text straight in). If you want the full offline proof, switch WiFi off after the model is loaded — everything keeps working. Then send. ![LM Studio chat composer with a text file attached and the gemma-4-e2b model selected.](https://unlock-ai.natebjones.com/_next/image?url=%2Fguides%2Fclean-sensitive-docs-locally%2Flm-attach-file.png&w=3840&q=75&dpl=dpl_7hhX6aPwgdjrRoexWJS9mn62Ausb) ## Check the output like it matters The model returns the document with every sensitive value replaced by a typed placeholder. Now grade it against the answer key: did every planted item get caught? Did it flag the disguised ones? A local model this size does the heavy lift, but the human check is part of the workflow, not an optional extra — what you produce here is a proposed redacted copy for a person to verify, never a certified-safe document. ![LM Studio chat showing the redacted document output with typed placeholders replacing sensitive values.](https://unlock-ai.natebjones.com/_next/image?url=%2Fguides%2Fclean-sensitive-docs-locally%2Flm-redacted-result.png&w=3840&q=75&dpl=dpl_7hhX6aPwgdjrRoexWJS9mn62Ausb) If the test passes, you have evidence for a better conversation with whoever owns security or privacy: an actual file, an observed run, and a specific ask — approve a local path for this job. Where the laptop stops — shared use, volume, audit trails, regulated work — is the enterprise half of the briefing.
## Media
1. image: https://social-archiver-api.social-archive.org/media/archives/arc/r9o3vtzqFl/media/0.png
