Yes, you can run an AI agent offline. Download a free open-weight model once, then the agent plans, edits files, runs commands and commits to git with no internet, no API key and no token bill. Since v0.8.0, Atomic Agent has an Offline mode switch that refuses every connection to anything but your own machine, so you do not have to trust a promise: the agent itself cannot reach out.
We tested it on 25 November 2026 on a 16 GB MacBook Air (M4). With Offline mode and analytics off, the agent read three notes, wrote a checklist and committed it to git in 6.5 minutes. During the run, its processes connected to one address only: 127.0.0.1, the laptop itself.
Checked on 25 Nov 2026 with Atomic Agent v0.8.0 and the project README.
Looking for an offline chat app for your phone rather than an agent that does tasks? Our sister project Atomic Chat keeps a list of offline AI apps for iPhone and Android.
What “offline” means for an AI agent
An offline AI agent runs the whole reasoning loop on your hardware. The model is a file on your disk, a llama.cpp server runs it on 127.0.0.1, and the agent’s tools (files, shell, git, memory) are local too. No prompt goes to a provider, so there is nothing to authenticate against and no key to leak.
You need the internet twice: to install the agent and to download the model. After that, unplug.
Two honest limits:
- Tasks that need the web still need it. A web search, a live website or a remote MCP server fails offline, and the agent tells you which step failed.
- Offline mode covers the agent, not every program it starts. The configuration docs say shell commands and stdio MCP servers are not isolated. If you ask the agent to run
curl, that command can still go out. Turn Wi-Fi off too if you need a hard guarantee.
New to the idea? What a local AI agent is covers the basics, and local vs cloud agents covers when cloud still wins.
Hardware: what you need
Memory decides everything. The model has to fit, and the agent needs room on top for its context, which grows with every tool result.
| Your RAM (or VRAM) | Model to run | Download | What to expect |
|---|---|---|---|
| 8 GB | qwen-3.5-4b | 2.7 GB | Runs. Simple file and shell tasks, short context |
| 16 GB | qwen-3.5-9b | 5.3 GB | Everyday tasks. This is what we tested |
| 24 GB | qwen-3.8-27b (4-bit) | 17.9 GB | The capable model, with room for context |
| 32 GB and up | qwen-3.8-27b with a long context | 17.9 GB | Multi-step tasks with many tool calls |
You do not have to read this table. Run atomic-agent models recommend and it reads your RAM, GPU memory and free disk and picks for you. On our MacBook Air it printed:
This machine: 16 GB RAM, 12.9 GB for the model on the GPU, 46 GB free on disk
fast qwen-3.5-4b 2.7 GB Small and quick to download, for 8 GB machines and up balanced qwen-3.5-9b 5.3 GB Everyday mid-size Qwen, for 16 GB machines and up quality qwen-3.5-9b 5.3 GB Everyday mid-size Qwen, for 16 GB machines and upA CPU-only machine works, just slower. On Apple Silicon the figures are unified memory, and macOS gives the GPU only part of it (12.9 GB of 16 GB on our Air). For the 27B in depth, see how to run Qwen 3.8 27B locally.
The easy way: the desktop app
- Download Atomic Agent for Mac, Windows or Linux and open it.
- Go to Settings › Models › Local models and pick a model that fits your memory (see the table above). Let it download while you are online.
- Turn on Offline mode in Settings › Privacy (Atomic Agent Desktop v0.0.9 and newer).
- Start a chat and give it a task in a folder you choose.
Step by step in the terminal
Step 1. Install Atomic Agent
curl -fsSL https://atomicagent.io/install | shOn Windows (PowerShell):
irm https://atomicagent.io/install.ps1 | iexCheck it landed with atomic-agent --version. You should see atomic-agent 0.8.0 or newer. If the command is not found, open a new terminal window.
Step 2. Let it pick a model, then download it
atomic-agent models recommendatomic-agent models pull qwen-3.5-9bUse the name recommend gives you. pull downloads the GGUF file from Hugging Face and resumes if the download breaks. This is the last step that needs the internet. atomic-agent models list shows the whole catalog, from qwen-3.5-2b (1.3 GB) to models over 20 GB.
Step 3. Make it active and start it
atomic-agent models use qwen-3.5-9batomic-agent models startuse picks the model and switches the agent to managed mode, where it runs the model server for you. start loads it. On our Air it took 14 seconds and printed:
chat: started pid 48709, healthy on port 19091, ... ~16 tok/s single streamRun atomic-agent models status to check. You want health: ok and a context size. The agent sized ours to 149,504 tokens by itself, so on 16 GB you no longer need to set it by hand.
Do not skip start. If the model is not running, the agent stops right away with: The local model isn't running. Start it with: atomic-agent models start.
Step 4. Turn on Offline mode
Pick one:
- For every run: open
~/.atomic-agent/config.json, find the"network"block and set"offline": true. - For one run only: start the agent with the environment variable:
ATOMIC_AGENT_OFFLINE=1 atomic-agent tuiIn the terminal UI you can also press o to switch Offline mode on and off. With it on, every outbound connection to a host other than your machine is refused, and local models keep working.
If you also want analytics off (it is on by default and never includes your messages, file paths or keys), set "analytics": { "enabled": false } in the same file, or type /privacy analytics off in the terminal UI.
Step 5. Give it a task
Go to the folder you want it to work in and start a chat:
cd ~/projects/my-notesatomic-agent tuiOr send one task and get the answer back, which is what we did:
echo "Merge the notes-*.txt files into todo.md as a checklist, sorted alphabetically, then commit it to git" | atomic-agent runLeave approvals on for your first runs. The agent asks before each file write and command, which is the quickest way to see exactly what it does.
Our test: a real task, zero outside connections
We gave the agent a small task in a fresh git folder: read three note files, merge them into todo.md as a sorted checklist and commit it. Setup: MacBook Air M4, 16 GB, Atomic Agent v0.8.0, qwen-3.5-9b, Offline mode on, analytics and the update check off, approvals off so it ran unattended. A script logged every network connection of the agent and model processes once a second.
| Result | |
|---|---|
| Task done | Yes: todo.md written, sorted correctly, committed as Add todo list |
| Time | 6.5 minutes (389 seconds) |
| Steps and tool calls | 6 steps, 10 tool calls, all succeeded |
| Model speed | ~16 tokens per second |
| Connections outside the laptop | 0. Every connection was to 127.0.0.1 |

The real run log on our MacBook Air, Offline mode on. Only the folder path is shortened to ~/notes-demo.
The file it wrote:
# Todo List
- [ ] buy groceries- [ ] call the dentist- [ ] meeting with design team6.5 minutes for three notes is slow next to a cloud model. Most of that is the model thinking on a fanless laptop at 16 tokens per second. Offline agents suit work you hand over and come back to. A Mac with more memory, or a GPU, is the biggest speedup.
Try it on your own files: download Atomic Agent, let models recommend pick a model while you are online, then switch on Offline mode and give it a folder.
What works offline and what does not
Works with no internet:
- Reading, writing and generating code and documents
- Running shell commands and reading their output
- Renaming and organizing files
- Git: status, diff, stage, commit, branch
- Memory across sessions, stored on your disk
Needs a connection, because the task does:
- Web search, fetching a URL, browsing live sites
- MCP servers that call a remote API
- Downloading a new model or updating the agent
Small quantized models are reliable at tool calls because Atomic Agent constrains their output with a grammar, so a call cannot come out malformed. How grammar-constrained tool calling works explains the mechanism. A small model still plans less well than a large cloud model, so check its work on anything that matters.
Comparing agents that run local models? See our open-source Claude Code alternatives and OpenClaw alternatives. For every agent you can run for $0, see our list of free AI agents.
Troubleshooting
”The local model isn’t running”
Cause: the model server is not started. Fix: atomic-agent models start, then atomic-agent models status until health is ok.
The agent refuses to start with a context warning
WARN context window too small for the agent prompt
Cause: the agent’s instructions include every tool definition, which takes tens of thousands of tokens before any work starts. On a small GPU the server can size the window below that. Fix: pin it and restart:
atomic-agent config set '{"localModels":{"managed":{"contextSize":65536}}}'atomic-agent models stop && atomic-agent models startThe machine slows to a crawl while the model loads
Cause: the model plus its context does not fit in memory. Fix: close heavy apps, switch to a smaller model with atomic-agent models use qwen-3.5-4b, or lower contextSize to 32768.
Each step takes a minute or more
Cause: normal for local models on a laptop, not a fault. Fix: a smaller model answers faster, and more memory or a GPU helps most. Give the agent a batch of work and come back later.
Something still reaches the network
Cause: Offline mode is off, or a shell command you asked for went out (Offline mode does not isolate shell commands). Fix: check that network.offline is true in config.json (or that you started with ATOMIC_AGENT_OFFLINE=1), and turn Wi-Fi off for a hard guarantee.
Bottom line
An offline AI agent is now a ten-minute setup on a normal laptop: install, let models recommend pick a model, download it, start it, switch on Offline mode. On a 16 GB MacBook Air it finished a real file-and-git task in 6.5 minutes without a single connection leaving the machine. It is slower than the cloud and needs memory, but there is no API key, no bill and nothing to leak. Download Atomic Agent and try it on a folder of your own.


