qwen3.5:4b vs 9b with OpenCode: a real test on a 16 GB laptop

Which local model should you run with OpenCode on an ordinary laptop? I gave qwen3.5:4b and qwen3.5:9b the same question about a real project on a 16 GB Windows laptop with no graphics card. One read the code and got it right. The other never opened a file.

You’ve set up OpenCode with Ollama on your laptop. Now the real question: which model should you run?

Most “best model” lists are tested on desktops with big graphics cards. So I tested the two models most people with an ordinary laptop will try first, qwen3.5:4b and qwen3.5:9b, on my own 16 GB laptop, on a real project, with the same question.

The short version: the 9b read the project and gave an accurate, complete answer. The 4b answered faster, but it never opened a single file. It guessed.

New to the pieces? What is OpenCode explains the agent, and OpenCode vs Ollama explains how the two fit together.

The short answer

Your laptop Run Why
16 GB memory qwen3.5:9b Reads your files before answering, and its answers were accurate. Slow on a laptop without a graphics card, but right.
8 GB memory qwen3.5:4b The one that fits. In my tests it didn’t read files even when told to, so use it for questions about code you show it, and check every answer.

My setup

Laptop HP Pavilion Aero 13, AMD Ryzen 7 7735U
Memory 16 GB (15.2 GB usable)
Graphics Integrated AMD Radeon only, so Ollama ran on the CPU
OS Windows, PowerShell
Ollama 0.40.19
OpenCode 1.19.6
Context length 32,768 tokens
Models qwen3.5:4b (3.3 GB download), qwen3.5:9b (6.6 GB download)

No graphics card is the important line. Most people’s laptops look like this, and everything below runs on the processor alone. A laptop with a graphics card, or an Apple silicon Mac, will be several times faster.

First, the error you’ll probably hit

The first time I asked OpenCode a question, it failed straight away with:

The prompt is longer than the context length available

Here’s why. OpenCode sends about 12,000 tokens before you even type: its own instructions plus the list of tools the model can use. My 4b session below used 12,195 tokens without reading a single file. But on a laptop without a graphics card, Ollama sets the context length to just 4,096 tokens by default. The startup log even says so: vram-based default context total_vram="0 B" default_num_ctx=4096. The prompt simply doesn’t fit.

The fix: stop every Ollama process (including the tray app), then start the server yourself with a bigger context. In PowerShell, Terminal 1:

Get-Process ollama* -ErrorAction SilentlyContinue | Stop-Process -Force
$env:OLLAMA_CONTEXT_LENGTH="32768"
ollama serve

Leave that window open. In the server config line near the top of the log, check that it says OLLAMA_CONTEXT_LENGTH:32768. Then in Terminal 2:

cd mcp-studio
ollama launch opencode

On Command Prompt, use set OLLAMA_CONTEXT_LENGTH=32768 instead of the $env: line. On macOS or Linux, quit the Ollama app and run OLLAMA_CONTEXT_LENGTH=32768 ollama serve. The laptop guide has the full setup, and how to make the setting permanent.

ollama launch opencode shows a model picker. Choose your local model there, not one of the :cloud ones at the top, which run on Ollama’s servers.

The ollama launch opencode model picker in a terminal. A Recommended list shows three cloud models, then qwen3.5:4b selected with the arrow, gemma4:12b about 11 GB not downloaded, and qwen3.8:27b about 28 GB not downloaded. Under More are gemma3:4b, gemma4:e2b and qwen3.5:9b.
ollama launch opencode lets you pick the model. Local models are the ones without :cloud.

Test 1: raw speed

Before OpenCode, I timed each model on a plain chat question with thinking switched off:

ollama run qwen3.5:4b --verbose --think=false "Explain what a Java interface is in 3 sentences."
ollama run qwen3.5:9b --verbose --think=false "Explain what a Java interface is in 3 sentences."

The number that matters is eval rate: how many tokens per second the model writes.

qwen3.5:4b qwen3.5:9b
Writing speed (eval rate) 9.5 tokens/s 5.8 tokens/s
Time to load into memory (first run) already loaded 19.8 s
Terminal output of ollama run qwen3.5:4b with verbose and think false. The model explains a Java interface in three sentences. Below, the stats show total duration 13.4 seconds, eval count 94 tokens and eval rate 9.53 tokens per second.
qwen3.5:4b on CPU: about 9.5 tokens per second.
Terminal output of ollama run qwen3.5:9b with verbose and think false. The model explains a Java interface. Below, the stats show total duration 35 seconds, load duration 19.8 seconds, eval count 83 tokens and eval rate 5.79 tokens per second.
qwen3.5:9b on CPU: about 5.8 tokens per second, plus 20 seconds to load the first time.

The 4b writes about 1.6 times faster. A comfortable reading speed is around 5 to 10 tokens per second, so both are usable for chat. A coding agent is a different story, as the next test shows.

Test 2: the real job in OpenCode

I opened my open-source project, MCP Studio, in OpenCode and asked both models the same question, each in a fresh session:

explain about this mcp-studio project, and list the features it does have.

To answer this well, the model has to look: list the folders, read the README and package.json, and only then explain.

qwen3.5:9b: it read the project

The 9b did exactly what a good teammate would do. It listed the top-level folders, read README.md and package.json, listed the apps folder, and only then wrote its answer.

OpenCode with qwen3.5:9b. After the question, it thinks for 24.4 seconds, runs Get-ChildItem on the project folder and lists .github, .idea, apps, docs, frontend, packages, scripts, target, .gitignore and LICENSE. It thinks for 16.1 seconds, reads README.md and package.json, thinks for 22.3 seconds, then lists all folders under apps. The side panel shows 15,686 tokens of context, 48 percent used.
qwen3.5:9b uses OpenCode's tools: it lists folders and reads README.md and package.json before answering.

The answer was accurate and complete: it explained that MCP Studio teaches you to build an MCP server, client and host in the browser, named the three course chapters, the MCP methods the core package implements, the four blueprints (Hello World, Database, File Server, GitHub), the coach, and the dev setup (Vitest, TypeScript, Node 20+, deploys to Vercel). Everything it said was true.

The end of qwen3.5:9b's answer in OpenCode. It lists the four blueprints Hello World, Database, File Server and GitHub, the Coach, action support, additional features like browser storage, export and official SDK downloads, development tools Vitest, TypeScript and Node 20 plus, and a Quick Start with npm install and npm run dev. The status line reads Build, qwen3.5:9b, 14m 58s.
Accurate and detailed, but it took 14 minutes 58 seconds on CPU.

The catch is time: 14 minutes 58 seconds. With 15,000 tokens of context to work through, its writing speed dropped from 5.8 tokens/s in plain chat to about 3 tokens/s. The final answer alone (922 tokens) took about 5 minutes.

qwen3.5:4b: it guessed

The 4b thought for 7 seconds and answered. It didn’t list a folder or read a single file. Look at its wording: the project “appears to be”, it “likely serves as”, key features “typically include”. It was guessing from the folder name.

OpenCode with qwen3.5:4b. After the question it thinks for 7.3 seconds and answers with no tool calls: mcp-studio appears to be a development project related to MCP, likely a workspace, dashboard or IDE extension for managing MCP servers. It lists generic features: server management, configuration UI, debugging tools, multi-server support and integration hooks. The status line reads Build, qwen3.5:4b, 5m 41s. Context shows 12,195 tokens, 37 percent used.
qwen3.5:4b answers without opening any file. The features it lists are generic guesses, not what MCP Studio does.

The features it listed (server management, a configuration UI, debugging tools) sound reasonable, but they aren’t what MCP Studio does. And it still took 5 minutes 41 seconds, because even with no files read, it had to work through OpenCode’s 12,000-token starting prompt on the CPU.

Side by side

qwen3.5:4b qwen3.5:9b
Opened files with tools? No Yes: listed folders, read README.md and package.json
Answer Generic guesses, mostly wrong Accurate and complete
Total time 5 min 41 s 14 min 58 s
Context used 12,195 tokens (37% of 32K) 15,686 tokens (48% of 32K)

Test 3: telling them exactly which files to read

Maybe the 4b just needed clearer instructions? I started a fresh session for each model and gave them both the same, more direct prompt:

Read README.md and package.json, then explain..

qwen3.5:4b: it said it would read them, then didn’t

The 4b replied “I’ll read both files to help you understand the project structure.” and stopped. There’s no Read line under it: it described the tool call instead of making it. When I typed explain, it answered “Based on these files, this is an MCP Studio project…”, but it had never opened them.

The context counter gives it away: 12,099 tokens, the same as OpenCode’s starting prompt on its own. If a README had been read, that number would have gone up.

OpenCode with qwen3.5:4b. The prompt says Read README.md and package.json, then explain. After 3.8 seconds of thought it replies I'll read both files to help you understand the project structure, with no tool calls, after 5 minutes 4 seconds. The next prompt says explain; after 3.4 seconds of thought it says Based on these files, this is an MCP Studio project that creates Model Context Protocol server applications, a Node.js TypeScript project, after 15.1 seconds. The side panel shows 12,099 tokens of context, 37 percent used.
qwen3.5:4b promises to read the files but never calls the Read tool. The context stays at about 12,100 tokens: nothing was read.

This is the most common way small models fail as agents: they talk about using a tool instead of using it.

qwen3.5:9b: it read both files and got it right

Same prompt, the 9b went straight to work: Read README.md, Read package.json, then an answer that was accurate down to the details: the live site, the MCP spec version it implements, the MIT license, the server, client and host it teaches, the folder structure, and the commands to run it locally. Its context grew to 14,687 tokens, because the two files were really read.

OpenCode with qwen3.5:9b. The prompt says Read README.md and package.json, then explain. After 20.8 seconds of thought it reads README.md and package.json, thinks for 4.3 seconds, then writes an MCP Studio overview: a free open-source project that teaches MCP by building it in the browser, live at mcp.kagitha.com, spec 2026-07-28, MIT license, the server, client and host you build, the repository structure and how to run it locally. The side panel shows 14,687 tokens of context, 45 percent used.
qwen3.5:9b reads both files, and the context grows to 14,687 tokens. Every detail in the answer is correct.
Same direct prompt qwen3.5:4b qwen3.5:9b
Read the files? No, only said it would Yes, both
Context afterwards 12,099 tokens (unchanged) 14,687 tokens
Answer Vague, and claims to be “based on these files” Accurate and detailed

Why it sits silent for minutes before thinking

On both models, every first prompt in a session sat for minutes before “Thinking…” even appeared. The 4b’s first reply above took 5 minutes 4 seconds, but only 3.8 seconds of that was thinking.

The rest was the model reading the prompt. Before it can write a single word, it has to process everything OpenCode sends: about 12,000 tokens of instructions and tool descriptions. On my CPU the 9b reads roughly 22 to 30 tokens a second, so that’s several minutes of silence before anything happens.

Now look at the second prompt in the same session: 15.1 seconds. Ollama keeps what it has already read (the KV cache), so the second time it only had to read the one new word, explain.

Time Thinking
First prompt in the session 5 min 4 s 3.8 s
Second prompt, same session 15.1 s 3.4 s

Three things make you pay that first-prompt cost again:

  • Starting a new session (/new). Everything is read from scratch. Keep related questions in one session.
  • The model unloading. Ollama unloads a model after 5 idle minutes by default. Start the server with $env:OLLAMA_KEEP_ALIVE="-1" (next to the context setting) to keep it loaded until you stop the server.
  • Restarting Ollama. The cache lives in memory, so it’s gone after a restart.

What this means for you

On 16 GB, use the 9b. A wrong answer in 6 minutes is worse than a right one in 15, because you’d have to check everything the 4b says yourself. Start the task, go make a cup of tea, and come back to an answer you can trust.

On 8 GB, the 4b is the one that fits, but go in with low expectations. The 9b’s 6.6 GB download plus a 32K context and Windows itself is too much for 8 GB. The 4b, at 3.3 GB, leaves room. But in my tests it didn’t read files on its own, and it didn’t read them when I named them either. Use it as a helper for code it can see: questions about a file you have open, explaining an error you paste in, writing a small function. For anything that needs the agent to explore your project, you need the 9b or bigger, or a cloud model.

Watch for the warning signs of guessing. If an answer has no tool calls above it (no Read, no listed folders) and is full of “appears to”, “likely” and “typically”, the model didn’t look. Another quick check: the context number in OpenCode’s side panel. If it didn’t grow, nothing was read.

Want it faster? A machine with a graphics card or an Apple silicon Mac makes a big difference. On my laptop, the Ollama log also said it had skipped the integrated Radeon graphics (dropping integrated GPU; to enable, set OLLAMA_IGPU_ENABLE=1). I haven’t tested that setting yet; it’s next on my list.

Common questions

Why does OpenCode need such a big context when my question is short? Because your question is the smallest part. OpenCode adds its instructions and its tool list (about 12,000 tokens) to every request, then every file the model reads, then the conversation so far. My 9b session reached 15,686 tokens from one question.

Is 32,768 tokens enough? For one question like this, yes: the 9b used under half of it. For longer sessions with several files, Ollama recommends 64,000 or more if your memory allows. On 16 GB without a graphics card, 32K is a sensible start.

Why didn’t the 4b use the tools? Small models are weaker at using tools. It had the same tools as the 9b, but it answered from what it already “knew”, and even when I named the files, it only said it would read them. That’s the main reason to pick the 9b if you have 16 GB.

Why is the first prompt so slow, and the next one fast? The first prompt has to read OpenCode’s whole 12,000-token setup; later prompts in the same session reuse it. In my test: 5 minutes for the first reply, 15 seconds for the next. Stay in one session, and set OLLAMA_KEEP_ALIVE=-1 so the model doesn’t unload.

Should I try other models? Yes, if you have the memory. On 16 GB, gemma4:12b (shown as about 11 GB in the picker) is worth a try next. Check for the tools badge on ollama.com first: without it, OpenCode can’t use the model.

Key takeaways

  • Raise the context first. OpenCode needs about 12,000 tokens before you type, and Ollama gives a laptop without a graphics card only 4,096. Start ollama serve with OLLAMA_CONTEXT_LENGTH=32768.
  • 16 GB: qwen3.5:9b. It read the project and was right. On CPU, expect minutes, not seconds.
  • 8 GB: qwen3.5:4b. It fits, but it didn’t read files even when told to. Use it for code it can see, and check its answers.
  • The first prompt is the slow one. 5 minutes, then 15 seconds for the next one in the same session. Don’t /new for every question.
  • Check for tool calls. No Read in the transcript means the answer is a guess.

Next: the full setup, step by step, in OpenCode + Ollama on your own laptop, or learn the agent itself in the OpenCode beginner’s tutorial.

Comments

LEAVE A COMMENT
No sign-up. Comments appear after a quick review.