Offline AI for Sensitive Data
What This Article Covers
- How to run AI completely offline without an internet connection.
- How air-gapped setups work for maximum security.
- Which industries need offline AI: healthcare, law, finance, government.
- How to install and update models offline.
- Real-world examples for sensitive use cases.
Introduction: Offline AI for Sensitive Data Explained
Some data is too sensitive to ever leave your organization: patient records, client data, financial information, classified documents. Cloud AI is out of the question for this data. But even local AI that needs the internet for updates carries risk. Offline AI takes things further: the machine has no internet connection, all models are installed offline, and all updates are applied offline.
This article is for users who need to run AI on sensitive data. You should already understand what local AI is and how Ollama works.
Why Do You Need Offline AI?
Imagine you’re a doctor and want to use AI on patient records. The data is extremely sensitive and legally protected. Cloud AI is ruled out. But local AI that still requires internet for updates is also a risk: what if an update script leaks sensitive data? Offline AI eliminates this risk entirely. The machine has no internet connection, no way to send data at all.
Offline AI for Sensitive Data in a Nutshell
Offline AI is local AI on a machine without an internet connection. Models are installed offline (via USB), updates are applied offline (via USB), and all data stays on the machine. There is no way to transmit data because no network connection exists.
The core principle is simple: no network, no data leakage.
Who This Article Is For
- Doctors, using AI on patient data.
- Lawyers, using AI on client data.
- Banks and insurance companies, using AI on financial data.
- Government agencies, using AI on classified documents.
- Security officers, who need maximum security.
Prior knowledge of local AI and security best practices is assumed.
Key Terms
- Offline AI - AI without an internet connection. Useful for: maximum security.
- Air-gapped - A machine with no network connection. Useful for: highest security level.
- Local AI - AI on your own hardware. Useful for: the foundation of offline AI.
- Ollama - A local model server. Useful for: runs offline.
- Quantization - Reducing model size. Useful for: running models on limited hardware.
- GDPR - General Data Protection Regulation. Useful for: understanding why offline AI helps.
- Audit logging - Recording access and activity. Useful for: traceability.
- Sandbox environments - Isolated execution. Useful for: additional security.
Air-Gapped Setup
Hardware
An air-gapped machine has:
- No network card (or it’s disabled)
- No WiFi
- No Bluetooth
- Only local connections (USB, display, keyboard)
Software
- Ubuntu Server or Debian (minimal installation)
- Ollama (installed offline)
- Open WebUI (installed offline)
- No internet, no cloud services
Installation
# On a machine WITH internet:
# 1. Download Ollama
curl -fsSL https://ollama.com/install.sh -o ollama-install.sh
# 2. Download models
ollama pull llama3.1
ollama pull qwen2.5
# 3. Copy everything to USB stick
cp ollama-install.sh /media/usb/
cp -r ~/.ollama /media/usb/ollama-models
# On the air-gapped machine:
# 1. Insert USB stick
# 2. Install Ollama
sudo bash /media/usb/ollama-install.sh
# 3. Copy models
cp -r /media/usb/ollama-models ~/.ollama
# 4. Disable network
sudo ip link set eth0 down
sudo ip link set wlan0 down
# 5. Start Ollama
ollama serve
Managing Models Offline
Downloading Models (with Internet)
# On a machine with internet:
ollama pull llama3.1
ollama pull qwen2.5
ollama pull nomic-embed-text
# List models
ollama list # Shows installed models
Copying Models to Air-Gapped Machine
# Models are located in ~/.ollama/models/
# Copy to USB stick:
cp -r ~/.ollama/models /media/usb/
# On the air-gapped machine:
cp -r /media/usb/models ~/.ollama/models
Updating Models (offline)
# On a machine with internet:
ollama pull llama3.1 # Updates the model
# Copy new version to USB stick
cp -r ~/.ollama/models/manifests /media/usb/
# On the air-gapped machine:
cp -r /media/usb/manifests ~/.ollama/models/
Real-World Example 1: Medical Practice
A medical practice uses offline AI for patient records:
- Document summarization: Condense long clinical reports.
- History taking support: AI assists during patient interviews.
- Translation: Translate foreign medical reports.
- Coding: Suggest ICD-10 codes.
Setup: Air-gapped machine with RTX 4070 (12GB), Ollama, Open WebUI. No internet connection, all patient data stays on the machine.
Security: Audit logging for all access, authentication for all users, full disk encryption.
Real-World Example 2: Law Firm
A law firm uses offline AI for client data:
- Document analysis: Analyze contracts, identify risks.
- Research: Search internal knowledge (with RAG).
- Drafting: Draft complaints and legal briefs.
- Translation: Translate foreign language documents.
Setup: Air-gapped machine with RTX 4090 (24GB), Ollama, Open WebUI. All client data stays within the firm.
Security: Audit logging, authentication, users and roles for granular access control.
Real-World Example 3: Government Agency
A government agency uses offline AI for classified documents:
- Document summarization: Summarize classified materials.
- Analysis: Identify patterns in large datasets.
- Translation: Translate foreign language documents.
Setup: Air-gapped machine in a secure room, with no network connectivity whatsoever. Models are loaded via verified USB sticks.
Security: Highest security level. Physical security, access restrictions, audit trail for every operation.
Security Considerations
- No internet connection: The machine must not have network access.
- Verify USB sticks: USB sticks can carry malware. Scan sticks on a separate machine.
- Encryption: Encrypt the hard drive (LUKS).
- Audit logging: Log all access and activity.
- Authentication: Every user needs an account.
- Physical security: Keep the machine in a secure location.
- Backups: Back up data to an encrypted external drive.
- Regular updates: Even offline, models and software must be updated regularly.
Common Pitfalls
- Forgotten network hardware: A stray WLAN stick or Bluetooth adapter is all it takes to compromise security.
- Unchecked USB drives: USB drives can carry malware. Scan every one.
- No backups: If the machine fails, all data is lost. Back up regularly.
- Unencrypted storage: Stolen data is unprotected without encryption.
- Neglected updates: Even offline systems need model updates to patch security vulnerabilities.
- Oversized models: Air-gapped machines often have limited hardware. Use quantization.
Further Reading
- Local AI Basics - What local AI is.
- Install Ollama - Installation guide.
- Open WebUI - Chat interface.
- Quantization - Reduce model size.
- Local RAG - Search internal knowledge.
- Data Protection - GDPR and AI.
- Audit Logging - Traceability.
- Authentication - Access control.
- Local AI in Enterprise - Enterprise deployment.
Key Takeaways:
- Offline AI is local AI without internet connectivity.
- Air-gapped: no network, no data leakage.
- Industries: healthcare, law, finance, government.
- Models install offline via USB drive.
- Security: encryption, audit logging, authentication, physical security.
FAQ
What is Offline AI?
What does Air-Gapped mean?
How do I install models offline?
How do I update offline?
Which industries need Offline AI?
How secure is Offline AI?
Are USB drives a risk?
How do I back up data on an air-gapped machine?
Which models can I run offline?
Is Offline AI GDPR compliant?
Sources and Further Reading
- BSI IT-Grundschutz - IT security.
- Ollama - Local model server.
- LUKS Encryption - Linux disk encryption.
- Data Protection - GDPR and AI.


