By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
Logic & LayersLogic & Layers
  • Tools
  • Earn with AI
  • Productivity
  • Automation
  • Guides
Logic & LayersLogic & Layers
  • Privacy Policy
  • About
Search
  • Tools
  • Earn with AI
  • Productivity
  • Automation
  • Guides
  • About
  • Contact
  • Blog
  • Privacy Policy
  • Complaint
  • Advertise
© 2026 Logic and Layers. Ruby Design Company. All Rights Reserved.
Laptop workspace in a remote mountain area representing coding without an internet connection
Guides

How to run an offline coding agent on your own laptop

Editorial Team
Last updated: October 29, 2026 2:16 pm
Editorial Team
Share
An offline coding agent keeps working when the Wi-Fi does not.

Wi-Fi dies mid-flight and your AI coding assistant goes with it. An engineer living in the Himalayan foothills got tired of that, so she built a fully offline coding agent that reads code, fixes bugs, and runs tests with the internet switched off. Her setup takes about an hour, and you can copy it tonight.

Contents
What an offline coding agent can actually doThe three-piece stackPicking a model size you can actually runSetting it up while you still have internet1. Install the tools2. Point OpenCode at your laptop3. Start Ollama locked to localhost4. Download the model5. Dry-run while onlineThe offline session: fixing a real bugRules that make offline sessions workWhere this setup hits its limitsTakeaway

The engineer is Rittika Jindal, a principal engineer at Thomson Reuters, and she documented the whole experiment in a writeup on Latent Space. Her conclusion after weeks of daily use: small tasks survive offline just fine. Big ones don’t, and knowing the difference is most of the trick.

What an offline coding agent can actually do

Here’s the part that surprised me. A project already sitting on your laptop gives the agent plenty to work with, even with zero connectivity.

An offline coding agent can explain a function you don’t recognize, dig into a failing test, or refactor a small module. It can even finish half-built code, as long as the model, your project’s dependencies, and the test tools live on your machine.

What it can’t do offline is anything that needs the outside world. Installing a new package fails. Looking up documentation online fails. So the prep work, downloading everything before you lose the connection, is where these setups are won or lost.

The three-piece stack

The whole thing is three free tools wired together:

  • OpenCode, an open-source coding agent that reads your files, proposes edits, and runs commands like your test suite. It asks permission before touching anything.
  • Ollama, the local model runner that serves an AI model on your own laptop.
  • Qwen 3.5, an open-weight model you download once and keep forever.

OpenCode handles the conversation with your project. Ollama handles the model. Your laptop handles everything, because there is no everything else.

Aider is the main alternative if you prefer a guided editing workflow, and it supports Ollama too. But OpenCode is what the tested setup uses, so that’s what this offline coding agent walkthrough sticks with here.

Picking a model size you can actually run

Qwen 3.5 comes in several sizes, and this choice decides whether the thing runs or crawls. Bigger scores better on coding benchmarks but eats RAM and disk.

Model Download size LiveCodeBench v6 BFCL-V4 (tool calling)
Qwen 3.5 4B 3.3-4.0 GB 55.8 50.3
Qwen 3.5 9B 6.6-7.6 GB 65.6 66.1
Qwen 3.5 27B 17-20 GB not listed not listed

The 9B version is the sweet spot for most laptops. It scores meaningfully higher on both code generation and tool calling, which matters because an agent lives or dies by calling tools with the right arguments. Budget 12-16 GB of memory for it, plus headroom for your editor and the agent’s context window.

Already got a machine dedicated to this stuff? Our guide to turning an old PC into a local AI server covers the bigger-iron version of the same idea.

Setting it up while you still have internet

Do all of this before you go offline. The setup below mirrors the one from the original walkthrough, which includes a GitHub repo with example projects and tests.

1. Install the tools

Get Ollama and OpenCode installed, then clone the example project. OpenCode 1.19.4 is the version the walkthrough used.

2. Point OpenCode at your laptop

OpenCode reads a project config file called opencode.json. Two settings matter: model picks Qwen 3.5 9B, and baseURL points at Ollama’s local address, http://127.0.0.1:11434/v1. The tested config also makes the agent ask before editing files or running shell commands, and blocks its web tools, since those would be useless offline anyway.

3. Start Ollama locked to localhost

This command keeps the model service on your machine and disables Ollama’s cloud features:

OLLAMA_HOST=127.0.0.1:11434 OLLAMA_NO_CLOUD=1 OLLAMA_CONTEXT_LENGTH=65536 ollama serve

4. Download the model

In a second terminal, run ollama pull qwen3.5:9b and wait. It’s a multi-gigabyte download, so maybe put the kettle on.

5. Dry-run while online

Open OpenCode from the project folder with opencode --pure, then give it a diagnostic prompt like “Read expense_total.py and run the tests. Explain the bug without editing any files.” If it answers, the plumbing works. Now kill your Wi-Fi.

The offline session: fixing a real bug

The example project ships with a broken expense calculator. It’s supposed to total five expenses, including a refund, and print 25.50. Instead it prints 8.00, because the function overwrites its total on every loop instead of adding.

First, run the existing tests yourself: python3 -m unittest -v. Three of five fail: decimal handling, refunds, and the sample data. Keeping those tests unchanged matters. They’re the independent judge of whether the agent actually fixed anything.

Then hand the bug to OpenCode. It reads the file, proposes a one-line fix, and asks permission before applying it. You review the diff, approve it, and rerun the tests. All five pass. On a laptop. In an airplane seat. That’s the whole loop, and it works offline because every piece, model included, never left your machine.

Want to try the exact same project she used? The full setup, examples, and test suites live in her opencode-qwen-local-setup repo on GitHub, free to clone.

Rules that make offline sessions work

The original write-up tested this offline coding agent repeatedly, and a few patterns separate smooth sessions from frustrating ones:

  • Prep the project, not just the model. Dependencies and any docs you’ll need go on disk before you disconnect.
  • Do one full dry-run online. Same command, same model, same config as the real thing.
  • Give the agent the exact test command. The test setup used unittest, but the agent initially suggested pytest. One sentence in your prompt saves a detour.
  • Keep tasks small and check the result. One bug, one review of the diff, one test run. Then the next task.
  • Watch your RAM. The model download isn’t the only cost. Big context windows and a browser full of tabs compete for the same memory.

Where this setup hits its limits

Honesty time. A 9B model on a laptop is not a frontier model in the cloud, and the benchmark gap shows in harder work. Big refactors across unfamiliar frameworks will disappoint. The research paper that benchmarked OpenCode found it solved 50% of hard terminal tasks with a strong cloud model, and burned roughly 40 times more tokens than a simpler agent to do it. On a laptop, with a smaller model, expect that success rate to drop on anything big.

There’s also a reason bigger local models keep showing up in the news. If you’d rather push a gaming GPU harder than a laptop CPU, our guide to running Qwen locally on a gaming PC with Strata is the next step up, and the local LLM on your phone guide shows how far down this rabbit hole goes.

None of that kills the use case. Flights, trains, cabin-in-the-woods weekends, insecure hotel networks: those are exactly the moments a local agent earns its keep.

Takeaway

Install Ollama, pull Qwen 3.5 9B, and connect OpenCode to it while you’ve still got internet. Then turn off your Wi-Fi and hand it one small, test-covered bug. Fixing real code at 35,000 feet changes how you think about what “needs the cloud” actually means.

You Might Also Like

Gemini Notebook uses that go way beyond summarizing PDFs
Run LLM locally laptop: Ornith 9B gives powerful AI to 16GB machines
SynthID Detector: check if an image is AI-made (free tool)
DeepSeek Harness: Build AI Agents Free with This Open-Source Framework
Nvidia bought Hugging Face: what it means for you
TAGGED:coding agentlocal AIOllamaqwen
Share
Previous Article Terminal window running Claude Code with a context usage bar above the prompt Claude Code mods that fix what the default version ignores
Next Article ChatGPT app icon on a purple background representing the OpenAI platform How to use the OpenAI Playground without touching code
1 Comment
  • Pingback: Build an app with Codex: a playbook that actually shipped

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

banner banner
Create an Amazing Newspaper
Discover thousands of options, easy to customize layouts, one-click to import demo and much more.
Learn More

Latest News

Gemini 4 Hydrogen key art from Google's launch announcement
Gemini 4 Hydrogen: Google’s new fast AI model explained
Tools
Coordinator chat directing parallel AI worker threads on separate branches
Claude Code Projects just learned to run AI workers for you
Tools
smart home hub device standing on a living room shelf next to decor
UGREEN HomeAgent: local AI for your whole smart home
Automation
Hands-on test of Alibaba Qwen4-Max on real user tasks
Qwen4-Max: the $4.43 AI task now costs $1.67
Tools

Recent Posts

  • Gemini 4 Hydrogen: Google’s new fast AI model explained
  • Claude Code Projects just learned to run AI workers for you
  • UGREEN HomeAgent: local AI for your whole smart home
  • Qwen4-Max: the $4.43 AI task now costs $1.67
  • Amazon World Product Graph: what it means for sellers

Recent Comments

  1. Gemini 4 Hydrogen: Google's new fast AI model explained on Gemini 4 Argon vs GPT-6: which one deserves your money?
  2. Claude Code Projects just learned to run AI workers for you on Claude Code cross-session messaging: stop copy-pasting between sessions
  3. UGREEN HomeAgent: local AI for your whole smart home on Notion AI data breach: what leaked and what to do
  4. Qwen4-Max: Alibaba's AI teammate that costs 62% less on Ollaya decision models: run Jev-style triage locally
  5. Amazon World Product Graph: what it means for sellers on Google Universal Cart: how the AI shopping cart works

You Might also Like

A hand unlatching a PCIe retention clip on a graphics card slot inside a desktop PC
Tools

AI accelerator card: the GPU-shaped upgrade nobody talks about

Editorial Team
Editorial Team
8 Min Read
How to Use Google Gemini 3.5 Flash Search featured image
Guides

How to use Google Gemini 3.5 Flash Search: A complete beginner guide

Editorial Team
Editorial Team
13 Min Read
Person using a laptop with AI tools at the office
Guides

Shadow AI: what it is and how to use AI at work safely

Editorial Team
Editorial Team
10 Min Read
//

We influence 20 million users and is the number one business and technology news network on the planet

Quick Link

  • PRIVACY NOTICE
  • YOUR PRIVACY RIGHTS
  • INTEREST-BASE ADSNew
  • TERMS OF USE
  • OUR SITE MAP

Support

  • ADVERTISE
  • ONLINE BESTHot
  • CUSTOMER
  • SERVICES
  • SUBSCRIBE

Categories

  • Tools
© 2026 Logic and Layers. All Rights Reserved.