Field Guides / Run a private AI assistant offline
Setup guide · last checked December 2, 2026
Run a private AI assistant offline.
Size the hardware, pick a model you’re allowed to use, carry it across the gap, and prove nothing leaves.
For teams with controlled or sensitive data that can’t go to a cloud AI service. It assumes someone on your team can install software on a Linux or Windows machine. It does not assume you have done this before.
Step 1
Is offline right for you?
Offline is more work to run and less capable than the best cloud models. Choose it for a reason you can write down.
- A cloud service may be enough. A company plan that doesn’t train on your data, with retention you have checked, suits many teams. The AI tools guide explains what to check.
- Some data has rules about where it goes. A defense contractor storing covered defense information in a cloud service must use one that meets requirements equivalent to the FedRAMP Moderate baseline (DFARS 252.204-7012). Authorized services are listed on the FedRAMP Marketplace. If none fits your contract, or you have no reliable connection, offline is the way.
- Know what you give up. The most capable open-weight models trail the best closed models by about four months on Epoch AI’s capabilities index (Epoch AI, May 2026). Those are the largest open models, though; the one that fits your hardware will usually be further behind.
Step 2
Size the hardware
Memory decides which models you can run. A model needs room for its weights, plus room for the conversation and documents it is working on.
Quantization stores each weight in fewer bits, so the model takes less memory at some cost in quality. The llama.cpp project publishes these sizes for Llama 3.1 at full 32-bit precision and at its common 4-bit setting, Q4_K_M (llama.cpp):
| Model size | At 4-bit (Q4_K_M) | What that means |
|---|---|---|
| 8 billion parameters | 4.9 GB (32.1 GB at full precision) | Fits a 16 GB machine with room for context. |
| 70 billion parameters | 43.1 GB (280.9 GB) | Needs a 64 GB machine or 48 GB of GPU memory, and leaves little for context at 48 GB. |
| 405 billion parameters | 249.1 GB (1,625.1 GB) | Server-class hardware. Not a small-office install. |
Rule of thumb: memory in GB ≈ billions of parameters × bits per weight ÷ 8. Q4_K_M averages about 4.9 bits per weight (llama.cpp), so a 14-billion-parameter model needs about 14 × 4.9 ÷ 8 ≈ 8.6 GB for its weights.
Then add room for context. A longer context, meaning more conversation and more document text at once, needs more memory (Ollama docs), and so does each extra person using it at the same time. I size for the weights plus at least a quarter again, then test with real documents before buying more.
Step 3
Choose a model you may use
Open weights does not mean no rules. Read the licence before you build on a model.
| Model | Licence | Worth knowing |
|---|---|---|
| OpenAI gpt-oss-20b | Apache 2.0 | A permissive open-source licence. |
| Qwen3-8B | Apache 2.0 | A permissive open-source licence. |
| Mistral Small 3.2 (24B) | Apache 2.0 | A permissive open-source licence. |
| Llama 3.1 | Llama 3.1 Community License | Requires an acceptable use policy, a “Built with Llama” notice when you distribute it, and a separate licence above 700 million monthly users. |
| Gemma 3 | Gemma Terms of Use | Incorporates a prohibited use policy you must follow. |
Licences as shown on each model’s page on December 2, 2026. Read the licence file itself; this table is a summary, not legal advice.
- Test before you choose. Write twenty questions your team really asks, with answers you know, and run them on two or three candidate models that fit your hardware. Keep the questions for every upgrade.
- Prefer safe file formats. Loading a pickle file, the old default for PyTorch weights, can run arbitrary code (Hugging Face). Use safetensors (Hugging Face) or GGUF files from the model’s publisher.
Step 4
Pick a runtime
The runtime loads the model and answers requests. Start with the simplest one that fits how many people will use it.
| Runtime | Best for | Offline notes |
|---|---|---|
| llama.cpp | One machine, CPU or GPU, GGUF model files, the most control. | Has had memory-safety bugs in its model loader and its network server (see updates). Keep it current. |
| Ollama | The easiest start: one command to run a model, with a local API. | Listens on 127.0.0.1 only unless you change it (Ollama FAQ). Its cloud features can be switched off with OLLAMA_NO_CLOUD=1 (Ollama FAQ). |
| vLLM | A GPU server answering many people at once. | Collects anonymous usage data by default; VLLM_NO_USAGE_STATS=1 or DO_NOT_TRACK=1 turns it off (vLLM docs). |
I don’t call any of these “offline” until I have watched it run with the network blocked (Step 7). Settings change between versions; check them on the version you install.
Step 5
Add document search, carefully
Most teams want the assistant to answer from their own documents. That is retrieval: find the most relevant passages, then hand them to the model with the question.
- Wrong passage, confident answer. If search finds the wrong text, the model can still answer fluently and wrongly; generative models produce confidently stated false content (NIST AI 600-1). Show the source passages next to every answer so people can check.
- Permissions leak. If everyone searches one index, the assistant can quote a file someone isn’t allowed to open. OWASP recommends permission-aware indexes that keep each group’s documents apart (OWASP LLM08:2025).
- Documents can carry instructions. Text hidden in a file can steer the model (OWASP LLM01:2025). Index only documents from sources you trust, and don’t give the assistant power to act.
- Scans and stale copies. A scanned PDF with no text layer is invisible to search, and an index built once goes out of date. Check what was indexed and when.
Step 6
Carry it across the gap
Everything that crosses into the offline network, from installers and models to drivers and updates, goes through one recorded process.
- Download on a connected machine from the publisher’s own page. Note the exact version and the source address.
- Record a SHA-256 hash of every file (for example
sha256sum *on Linux orGet-FileHashon Windows). Compare it with the publisher’s checksum or signature wherever one is published. - Scan the media under your normal policy, carry it across, and hash every file again on the far side. Any mismatch stops the install.
- Write one line per file in a transfer log: date, file, version, hash, source, who carried it, who checked it.
Tools that download on first run need a hint that there is no internet. Hugging Face’s libraries, for example, make no network calls with HF_HUB_OFFLINE=1 and use only files already cached (Hugging Face).
Step 7
No outbound network, and proof
Settings reduce what software tries to send. Only a blocked network guarantees it can’t.
- Block by default. Set the machine’s or network’s firewall to deny all outbound traffic, then allow only what the team needs to reach the assistant from inside.
- Prove it. From the server, try to reach a public website and a public DNS name. Both should fail. Record the test, then repeat it after every change.
- Watch it. Log blocked outbound attempts and read the log in the first week. A runtime or plugin that keeps trying to reach the internet needs a setting changed or removing.
- Listen narrowly. Expose the assistant only to the internal network that needs it. Never expose a runtime’s debugging or remote-compute service; llama.cpp’s RPC server had a flaw that let a network client write to arbitrary memory (CVE-2024-42479).
Step 8
Keep it updated
An offline system still has vulnerabilities. It just doesn’t get patched on its own.
- Keep a version inventory: runtime, model file and its hash, GPU driver and operating system. Without it you can’t tell whether an advisory applies to you.
- Check advisories on a schedule, monthly at least, on a connected machine. Model files are untrusted input too: a crafted GGUF file could overflow a buffer in llama.cpp before version b5662 (CVE-2025-49847). In November 2026 another llama.cpp integer overflow was published, still awaiting analysis by NIST at the time of writing (CVE-2026-138092).
- Update the same way you installed: through the transfer log, with the old version kept so you can roll back, and the test questions re-run before people rely on it.
Install checklist
Twelve things to be able to say before people rely on it.
- Decide. We confirmed the data can’t go to a cloud service, or chose offline for another stated reason.
- Size. The model and its context fit in memory, with headroom.
- Licence. We read the model’s licence and recorded it.
- Files. Model weights are safetensors or GGUF from the publisher, not pickle files from a stranger.
- Transfer. Every file was hashed before and after the transfer, and the log is signed off.
- Network. Outbound traffic is blocked by default, and a test proved it.
- Exposure. Each service listens only where it must: the machine itself or the internal network.
- Settings. Telemetry, cloud features and online model downloads are switched off.
- Search. Document search respects the same permissions as the source files.
- Testing. A set of questions with known answers was run, and the results were recorded.
- Inventory. Every runtime, model, driver and OS version is written down.
- Updates. Someone owns checking advisories, on a date, with a rollback copy kept.
On paper: the printable checklist has these twelve lines with space to sign each one off.
Honest limits
What an offline assistant won’t do, so nobody is surprised.
- It won’t match the best cloud models. Expect weaker reasoning and writing than the frontier (Epoch AI), and plan the work around that: drafting, search and summaries checked by a person.
- It knows nothing after its training date except what your documents tell it.
- It is only as private as the machine. Accounts, disk encryption, physical access and backups still need your normal controls.
- It needs an owner. Someone has to run the updates in Step 8, or it quietly gets older and less safe.
If you’d rather have it set up for you, sized to your hardware and handed over with a runbook, that is my Offline AI Setup.
Sources and method
Written by Matthew Bonham with AI drafting assistance. Every fact on this page links to its source, and the sources below were last checked on December 2, 2026. The steps, sizing headroom and checklist are my recommendations, not requirements of any agency or vendor.
- Sizing and runtimes: llama.cpp quantization README (sizes and bits per weight); llama.cpp; Ollama FAQ; Ollama context length; vLLM usage stats collection; Hugging Face environment variables.
- Models and licences: gpt-oss-20b; Qwen3-8B; Mistral Small 3.2; Llama 3.1 Community License; Gemma Terms of Use; Hugging Face on pickle files; safetensors; Epoch AI, open models lag closed models by four months (May 2026).
- Security: CVE-2025-49847; CVE-2026-138092; CVE-2024-42479; OWASP LLM01:2025 Prompt Injection; OWASP LLM08:2025 Vector and Embedding Weaknesses; NIST AI 600-1.
- Rules: DFARS 252.204-7012; FedRAMP Marketplace.
No affiliation with any project, vendor or agency named here is implied. Spot an error or an out-of-date version? Tell me.