# Run OpenCode on a local model with QVAC: no cloud, no API key, works offline

> Source: <https://qvac.tether.io/blog/run-opencode-locally-with-qvac-a-coding-agent-with-no-cloud>
> Published: 2026-11-30 07:53:10+00:00

**Recommendation:** Route your coding agent to a local OpenAI-compatible endpoint like QVAC's server when code cannot leave the machine; the source ran Qwen3.6-35B-A3B offline for builds, repo explanation and bug fixes.
More in the playbook "Working with AI coding agents": <https://wpnews.pro/playbooks/coding-agents>

Run OpenCode Locally With QVAC: A Coding Agent With No Cloud

OpenCode is an open-source coding agent. With the QVAC plugin it runs a model on your own machine, so it needs no cloud or API key and keeps working offline. Setting it up for OpenCode 2 takes three steps.

T

Thomas Blanc

What OpenCode Is

OpenCode is an open-source coding agent. You give it a goal in plain language, and it plans, reads and writes files, runs commands, and reports back. It runs in your terminal, as a desktop app or in a browser. It works the way a teammate would: open the repo, make the change, run it, fix what broke.

The detail that matters for this guide is how OpenCode talks to a model. It speaks to any endpoint that exposes an OpenAI-compatible API. That means it is not tied to a single cloud vendor. You point it at whatever model endpoint you want, including one running on your own machine.

That is the whole idea here. OpenCode for the agent loop, a local model for the intelligence, both on hardware you control.

Why Local Is The Right Default For A Coding Agent

When a model only chats, where it runs is mostly a question of privacy. When a model drives a coding agent that reads your repository and runs commands, it becomes a question of control. The agent acts on your machine. If the model behind it lives in someone else's datacenter, every file it reads and every command it runs depends on a system you do not own: its uptime, its latency, its terms, and its access policy, any of which can change without notice.

Running the model locally changes the property, not just the policy:

Your code stays on the machine. The files the agent reads, the code it writes, the commands it runs: none of it leaves your disk to reach the model.

It works offline. Once the model is downloaded, you can disconnect entirely and keep working. Turn off the network and the agent still answers.

No per-token bill. A long coding session that would run up a metered API costs nothing locally.

No silent model swaps. The weights are a file on your disk. They do not change under you between sessions.

For a coding agent, that adds up to a simple property: the work, and the intelligence doing it, are both yours.

QVAC, And The Tools You Already Use

QVAC is the piece that makes the local half practical. It is an open-source SDK and CLI from Tether that runs models on your own device across every major GPU backend (NVIDIA, AMD, and Intel through Vulkan, and Apple Silicon through Metal), and it ships an OpenAI-compatible server. That server is the bridge a coding agent plugs into.

It is also not a one-tool trick. QVAC is a first-class local provider for OpenCode and OpenClaw, and because the server speaks the standard OpenAI API, it works with the other coding tools developers already use, including Cline, Aider, Continue, and Roo. For OpenCode specifically there is a dedicated plugin, @qvac/opencode-plugin, that wires the whole thing up from one line of config. You bring your own model, running locally, to the agent you already like. QVAC is Apache 2.0, with no API keys, no rate limits, and no per-token cost.

What It Looks Like

Running Qwen3.6-35B-A3B locally through QVAC (downloaded once, then with the network off), OpenCode handled three ordinary developer tasks back to back:

Build from a prompt. From one sentence, it wrote a self-contained page animating eight hundred glowing particles that drift and react to the cursor, then opened it in the browser. No libraries, every line generated on the machine.

Explain an unfamiliar repo. Asked what a repository does, it read the code and explained it: a solar-system simulation with planets orbiting on circular paths. Opening the page confirmed it.

Find and fix a bug. Handed a shopping cart whose total rendered as garbled text instead of a number, it located the cause, edited the file, and the total added up correctly.

All of it ran locally, on an open and free stack.

Which Model To Run

Coding agent work (reading a repo, generating a file, fixing a bug) asks more of a model than a chat does, so it pays to run a capable one. You select a model by its id in the plugin config, and that id flows straight through to OpenCode's model picker, where the default shows as qvac/qwen3.5-9b.

That id is a QVAC model reference, not a path to a file you supply. On first run, QVAC downloads that model once into its own local store and serves it locally from then on, with no network. Because it pulls QVAC's own copy, a .gguf you may already have from another tool is not reused.

Use case

Model

RAM

Disk

Config id

Recommended default, runs on most recent laptops

Qwen3.5-4B (4-bit)

~8 GB

~3 GB

qwen3.5-4b

Balanced, the plugin's out-of-box default

Qwen3.5-9B (4-bit)

~12 GB

~6 GB

qwen3.5-9b

Strongest coding, used in the demo

Qwen3.6-35B-A3B (4-bit)

~32 GB

~21 GB

qwen3.6-35b-a3b

The demo uses Qwen3.6-35B-A3B: 35 billion parameters of knowledge, only about 3 billion active per token, so it stays fast despite its size. For most laptops, Qwen3.5-4B or the 9B default is the better starting point.

The plugin also accepts gpt-oss-20b and gemma4-31b by short id. Any other QVAC chat model works by its full name, written like QWEN3_5_9B_MULTIMODAL_Q4_K_M, the full name of the 9B.

A GPU helps but is not required. QVAC uses Apple Metal on Apple Silicon and Vulkan on NVIDIA, AMD, and Intel; on a CPU-only machine it still runs, just slower. To check what your hardware supports before you start, run npx -y @qvac/cli doctor (no install needed).

Set It Up

These steps are for OpenCode 2. OpenCode loads the QVAC plugin from your project config, and the plugin starts a QVAC server on its own and points OpenCode at it.

Requirements:

OpenCode 2. The plugin uses OpenCode 2's plugin system and does not load in OpenCode 1 (see the note after step 3).

Node.js 22 or newer (run node --version, get it from nodejs.org). The plugin runs the QVAC server in a Node process.

Disk and RAM for the model: the default Qwen3.5-9B needs about 6 GB of disk and 12 GB of RAM; the demo's Qwen3.6-35B-A3B needs about 21 GB of disk and 32 GB of RAM.

1. Install OpenCode

```
npm install -g @opencode/cli
```

OpenCode's docs also list a one-line installer and desktop builds.

2. Add The QVAC Plugin To Your Project

In the folder you want to code in, create an opencode.json. The short version uses the plugin's default model, Qwen3.5-9B. To use another model, such as Qwen3.5-4B on a smaller laptop or Qwen3.6-35B-A3B to match the demo, name it in the plugin's options.

```
{
  "$schema": "https://opencode.ai/config.json",
  "plugins": ["@qvac/opencode-plugin"]
}
{
  "$schema": "https://opencode.ai/config.json",
  "plugins": [
    {
      "package": "@qvac/opencode-plugin",
      "options": { "model": "qwen3.6-35b-a3b" }
    }
  ]
}
```

The key is plugins, plural. Configs written for OpenCode 1 used plugin, and OpenCode 2 does not read that key.

3. Run OpenCode

```
opencode              # terminal interface
opencode run "..."    # one-shot prompt
opencode pair         # link to open OpenCode in the browser
```

On first run, OpenCode installs the plugin. The plugin downloads the model once and starts a QVAC server in the background. It registers that server as the local qvac provider and makes the model this project's default. There is no qvac serve to run and no provider block to write. The first answer waits for the model to finish loading; the turns after it run at the model's normal speed.

Several OpenCode windows share one QVAC server, so a second window does not load the model again. The QVAC server stops when OpenCode closes the project, after about an hour without activity, or when OpenCode itself shuts down. Closing a window does not stop it, and when you come back it starts again on its own.

Still on OpenCode 1? The plugin's 0.3 line is the version for OpenCode 1. Pin it in your existing config as @qvac/[email protected], or move to OpenCode 2 and use the steps above.

Test That It Is Really Local

Ask the agent whether it is running in the cloud or on your machine. Then turn off your network and ask again. It keeps answering, because nothing was being sent anywhere.

What To Try Next

From here, the same setup handles the rest of what a coding agent does. Point OpenCode at a project folder and have it read and edit code, generate a small app from a prompt, explain an unfamiliar repository, or track down a bug. The agent loop is identical to the cloud experience. The only thing that changed is that the model behind it is yours, on your hardware, with nothing leaving the machine.

Notes And Limits

A model that fits on your machine is not a frontier cloud model. Expect it to need clearer, more focused instructions, and give it single-goal tasks rather than long open-ended ones.

Local responses can take longer than a cloud API today. On a single local worker, a tool-using turn with the 35B model runs in roughly 20 to 30 seconds; a smaller model is snappier. That gap is closing fast as local hardware speeds up and small models improve.

One QVAC server runs per machine. If the OpenCode desktop app is open it can hold locks the terminal needs, so quit it when running opencode from the terminal.

Chambea won our Lima hackathon, where Peru's Ministry of Labor set a social impact challenge. A worker describes a normal day and the app turns it into a list of skills and the other jobs they open.

A custom Brick for Arduino App Lab, built on the QVAC SDK, lets an App's Python code ask a local language model a question with no API key. The example code is open source and ready to adapt.

Script, voice-over, captions and music usually come from cloud services that bill by the minute or by the character. Our creator toolkit demo, built with the QVAC SDK, makes all four with local AI on one laptop.

Chambea won our Lima hackathon, where Peru's Ministry of Labor set a social impact challenge. A worker describes a normal day and the app turns it into a list of skills and the other jobs they open.

A custom Brick for Arduino App Lab, built on the QVAC SDK, lets an App's Python code ask a local language model a question with no API key. The example code is open source and ready to adapt.

Script, voice-over, captions and music usually come from cloud services that bill by the minute or by the character. Our creator toolkit demo, built with the QVAC SDK, makes all four with local AI on one laptop.
