←  Blog How-to

How to Run an AI Agent Offline (No API Key, No Token Bill)


Yes, you can run a capable AI agent fully offline. The model weights live on your disk, inference runs on your own CPU or GPU, and no request leaves the machine. No API key, no token bill, no cloud provider. Atomic Agent talks to a local llama.cpp server on 127.0.0.1 and drives real multi-step tasks with Wi-Fi off.

Why would you run an AI agent offline?

Cloud agents are convenient until the bill arrives, the API rate-limits you, or your data has to leave your laptop to get anything done. Offline flips all three: no metered tokens, no vendor account, and nothing sent anywhere unless a tool you can see sends it.

Offline used to mean “toy.” A small model on your laptop hallucinated tool calls and stalled on anything real. That has changed, and the how-to below is short. First, the honest picture of what “offline” buys you.

What does “fully offline” actually mean here?

It means the whole reasoning loop runs on your hardware. The weights are a file on disk. Inference happens locally. No inference request crosses the network, and you need no API key for the agent to function.

The agent still drives your files, shell, and git with the network off. It reads and writes code, runs commands, and commits work without ever phoning home.

Data only leaves your machine when a tool you can watch makes it leave. Memory is a plain local SQLite file on your disk, not a cloud account. You can see exactly what the agent does.

This is what a local AI agent is built for: the model, the tools, and the memory all sit on one machine you control.

Does a local model really work well enough?

Yes, and there’s a number behind that claim. On GAIA Level 1, a benchmark of 53 real multi-step agent tasks, Atomic Agent scored 69.8% running on a local quantized model. That is evidence “offline” no longer means “toy.”

The trick is grammar-constrained decoding. Atomic Agent uses a GBNF grammar that makes it structurally hard for the model to emit an invalid tool call. The model can’t wander off format, so small local models became reliable agents almost overnight.

Be clear-eyed, though: a local quantized model is not a frontier cloud model. It is smaller and less broadly knowledgeable. But with grammar-constrained tool calls guiding every step, it reliably drives real tasks instead of drifting.

Prerequisites

  • macOS today. Linux and Windows are coming.
  • A few GB of free disk for the model weights (GGUF files).
  • A CPU works. A GPU is faster but not required.
  • No API key and no internet needed to run the agent itself.

How do I run an AI agent offline, step by step?

Managed mode is the recommended path. Atomic Agent downloads the llama.cpp binary and a GGUF model for you, picks a GPU if one is available, and starts the local daemon. You don’t wire anything up by hand.

  1. Install Atomic Agent. Follow the installation guide to get the atomic-agent command on your machine. This is the only step that needs the internet, since it fetches the binary and, in the next step, the model weights.

  2. Pull and select a local model. List what’s available, then download a model. pull is idempotent, so you can safely run it again.

    Terminal window
    atomic-agent models list
    atomic-agent models pull qwen-3.5-4b
    atomic-agent models use qwen-3.5-4b

    pull downloads the GGUF weights to your disk. use makes that model active for the agent. See model management for more options.

  3. (Optional) Confirm no cloud provider is configured. By default Atomic Agent talks to a local llama-server on 127.0.0.1 with no API key involved. If you want to be sure, check your config. It lives at <stateDir>/config.json, where the default state directory is ~/.atomic-agent. For local inference you want localModels.mode set to "managed" and localModels.url pointing at your local server, for example http://localhost:8000.

    {
    "localModels": {
    "mode": "managed",
    "url": "http://localhost:8000"
    }
    }

    You can override the URL with the environment variable ATOMIC_AGENT_LLAMA_URL if your local server runs somewhere else. As long as this points at localhost and no cloud key is set, nothing goes to the cloud.

  4. Pull the network plug (or turn on airplane mode). Now prove it. Disconnect Wi-Fi, unplug the Ethernet cable, or flip on airplane mode. The weights are already on disk and the local server is already running, so the agent has everything it needs. This is the moment that separates a real local agent from a cloud wrapper. If it were secretly calling an API, it would break here. It doesn’t.

  5. Run a task. Launch the terminal UI and give it something real to do.

    Terminal window
    atomic-agent tui

    Ask it to rename files across a folder, refactor a function, summarize a local document, or stage and commit your changes. It reasons locally and uses local tools, all with the network still off.

Do I need a GPU to run a local AI agent?

No. A CPU works fine for the small quantized models Atomic Agent runs in managed mode. Inference is slower than on a GPU, but it runs.

A GPU makes responses faster and lets you comfortably run larger models. In managed mode, Atomic Agent picks a GPU automatically if it finds one, so you get the speedup without configuring anything.

Does an AI agent really work with Wi-Fi off?

Yes, for anything that doesn’t inherently need the web. The agent’s reasoning, plus file, shell, and git tools, all run with the network off because the model and its memory are local.

The one honest caveat: a task that inherently needs the internet still needs a connection for that specific tool. If you ask the agent to “search the web,” that step needs Wi-Fi. Browser automation follows the same rule, needing the internet only when the task itself needs the web.

Everything else, from code edits to shell commands to git commits, keeps working in airplane mode. The internet is a tool the agent reaches for only when a task demands it, not a dependency for the agent to think.

What can an AI agent do offline?

Plenty. Edit and generate code, run shell commands, navigate and modify your filesystem, and manage git, all driven by local reasoning. Its memory persists in a local SQLite file between runs, so context carries over without a cloud account.

Because tool calls are grammar-constrained, the agent chains these steps reliably instead of fumbling the format. That reliability is exactly what lets a 4B model handle multi-step work offline.

The short version

  • You can run a capable AI agent fully offline: weights on disk, inference on your CPU or GPU, no API key, no token bill.
  • Install, models pull and models use a local model, optionally confirm no cloud provider is set, disconnect, then run a task in atomic-agent tui.
  • Grammar-constrained tool calls make small local models reliable, and 69.8% on GAIA Level 1 proves offline isn’t a toy.
  • The only thing that needs the internet is a task that inherently needs the web. The agent’s reasoning and local tools work with the network off.

Ready to try it? Follow the quickstart guide and run your first task offline in a few minutes.

Run your local agent
in one click

$curl -fsSL https://api.atomicbot.ai/agent-install | sh