Local AI Coding in VS Code: Ollama + Continue on an M1 Mac

A field report from someone who wanted their code to stay on their laptop.


What is the spec and machine I’m using

Nothing exotic, but the memory matters more than the CPU here:

ComponentSpec
MachineApple M1 Mac
Memory64 GB unified
EditorVS Code
Local inferenceOllama
VS Code extensionContinue
OS-level noteApple Silicon, so unified memory is shared between CPU and GPU — the GPU can address all 64 GB

That last row is the whole reason this works. On a discrete-GPU PC you’d be shopping for a 24 GB card. On Apple Silicon, your “VRAM” is just your RAM, which means models in the 20–30B range fit comfortably with room for context left over.

What it is not is a speed machine. More on that later, because it shaped every decision here.

What was I trying to do

The goal was simple: get a usable coding assistant inside VS Code where no code leaves my machine. Not as a novelty — as something I’d actually reach for instead of a cloud assistant.

That meant clearing three bars:

  1. Chat about code — “explain this function”, “why is this failing”
  2. Inline edits — select a block, describe a change, get a diff
  3. Tab autocomplete — the thing you stop noticing until it’s gone

I started where most people start: the native VS Code chat panel. I installed the official Ollama extension, opened Chat, and… found no model dropdown at the bottom.

This is where the first few hours went. The panel in the screenshot was VS Code’s native Copilot Chat view, not Continue’s sidebar — two completely separate surfaces. And the thing labelled Auto | Balance was the model picker, sitting there saying “Auto” because auto-selection was on.

Beyond that, native chat in Agent mode only surfaces models it detects as tool-capable. deepseek-r1:32b doesn’t support tool calling at all, so it was never going to appear there. Meanwhile Continue — which I’d installed almost as an afterthought — talks to Ollama directly, has none of that model-picker ceremony, and gives you autocomplete too.

Lesson one: pick one plugin and commit to it. Continue won.

Using the Continue plugin (focus on this)

Continue is the closest thing to a local Copilot, and the reason is architectural rather than cosmetic: it doesn’t route through VS Code’s model layer at all. It reads a YAML file, connects straight to http://localhost:11434, and lets you assign different models to different jobs.

That last point is the whole feature. A cloud assistant gives you one model for everything. Continue lets you say:

  • a small, fast model does autocomplete (latency is everything)
  • a big, smart model does chat and edits (quality is everything)

Doing that with a single model is a losing trade in both directions.

The other thing Continue gets right is transparency. Every setting lives in a plain-text file you can read, diff, and version. No settings UI hunting.

How is this setup

VS Code
  └── Continue extension
        └── HTTP → localhost:11434
              └── Ollama
                    └── models on disk (~90 GB of them)

Continue never proxies through a cloud service. The request path is entirely loopback.

Setting up the Ollama models

Here’s what accumulated on disk, and my honest read on each:

ModelSizeTypeVerdict
qwen3-coder:30b19 GBMoE, 3B activeDaily driver — purpose-built for coding, 262K context, no thinking overhead
qwen3.8:27b-mlx18 GBDense 27BBest reasoning — great for “think hard about this file”
gemma4:31b-mlx19 GBDense 31BStrong planner, 256K context, but slow
qwen3:30b18 GBMoE, 3B activeFast chat, one generation old
gpt-oss:20b13 GBMoE, 3.6B activeQuick edits, rough with coding extensions
deepseek-r1:32b19 GBDense reasoning❌ No tools — delete it
qwen2.5-coder:1.5b~1 GBSmall FIMAutocomplete only

The MoE insight that changed everything

Dense and MoE models behave completely differently on Apple Silicon, and this is not intuitive until you measure it.

Memory bandwidth is the bottleneck. A dense 30B model must stream all 18 GB of weights through the memory controller for every single token. An MoE model with 30B total but only 3B active streams about 2 GB per token.

Model typeWeights read / tokenRealistic speed on M1 64 GB
Dense 27–31B~18–19 GB8–14 tok/s
MoE 30B (3B active)~2 GB40–58 tok/s

That’s a ~4× gap, and it’s architectural — no amount of tuning closes it. It means a dense model is fine for chat but painful inside an agent loop doing six round trips.

So qwen3-coder:30b is the interesting one: MoE speed with coding-specific training. On this hardware it beats the bigger dense models for actual day-to-day work.

The num_ctx trap

This one cost me the most confusion. Ollama ships models with a small default context — around 4K on current builds — regardless of what the model actually supports. Continue’s system prompt plus a couple of open files blows through that instantly, and the model silently truncates. It doesn’t error. It just starts “forgetting” what it was doing.

Fix it with a Modelfile:

bash

printf 'FROM qwen3-coder:30b\nPARAMETER num_ctx 32768\n' > Modelfile.coder
ollama create qwen3-coder-30b-32k -f Modelfile.coder

printf 'FROM qwen3.8:27b-mlx\nPARAMETER num_ctx 32768\n' > Modelfile.q38
ollama create qwen3.8-27b-32k -f Modelfile.q38

Then point Continue at the -32k tags. Don’t just max it out — KV cache grows with context, roughly 1 GB per 32K tokens on top of the weights. With 64 GB there’s headroom for 64K, but 32K is the sane default.

Stop the model juggling

Five or six models totalling ~90 GB means Ollama will try to keep several resident and thrash memory. I capped it:

bash

launchctl setenv OLLAMA_MAX_LOADED_MODELS 1
launchctl setenv OLLAMA_KEEP_ALIVE 10m

My example config.yaml

Located at ~/.continue/config.yaml:

yaml

name: Local
version: 0.0.1
schema: v1

models:
  # --- Primary coding model: agentic, fast MoE, 262K native context ---
  - name: Qwen3 Coder 30B (32K ctx)
    provider: ollama
    model: qwen3-coder-30b-32k
    apiBase: http://localhost:11434
    roles: [chat, edit, apply]
    capabilities: [tool_use]
    defaultCompletionOptions:
      contextLength: 32768
      maxTokens: 8192
      temperature: 0.2
      keepAlive: 1800

  # --- Secondary: dense 27B for reasoning-heavy work ---
  - name: Qwen3.8 27B (32K ctx)
    provider: ollama
    model: qwen3.8-27b-32k
    apiBase: http://localhost:11434
    roles: [chat]
    capabilities: [tool_use]
    defaultCompletionOptions:
      contextLength: 32768
      maxTokens: 8192
      temperature: 0.3

  # --- Fast chat: 3B active params ---
  - name: Qwen3 30B (fast chat)
    provider: ollama
    model: qwen3:30b
    apiBase: http://localhost:11434
    roles: [chat]
    requestOptions:
      extraBodyProperties:
        think: false

  # --- Tab autocomplete: small FIM model ---
  - name: Qwen2.5 Coder 1.5B (autocomplete)
    provider: ollama
    model: qwen2.5-coder:1.5b
    apiBase: http://localhost:11434
    roles: [autocomplete]
    autocompleteOptions:
      debounceDelay: 250
      maxPromptTokens: 1024
      onlyMyCode: true
    defaultCompletionOptions:
      temperature: 0.3
      maxTokens: 256
      stop:
        - "\n\n"

A few notes on the non-obvious lines:

  • capabilities: [tool_use] — Continue usually autodetects this, but declaring it explicitly is the fix when Agent mode refuses to engage.
  • contextLength: 32768 — this tells Continue how much to send. It’s separate from Ollama’s num_ctx, which tells Ollama how much to hold. You need both.
  • think: false — qwen3:30b is a thinking model. Disabling reasoning makes it usable for quick questions.
  • keepAlive: 1800 — seconds before Ollama unloads the model. 30 minutes keeps it warm during a work session.

The deployment footgun: the -32k tags must actually exist. If they don’t, Continue fails silently — no model in the dropdown, and a 404 buried in the Continue output channel. Run ollama list | grep 32k before filing a bug.

Using continue

Day to day, it breaks down into three interactions:

Chat (⌘L) — questions, explanations, architecture. This is where the dense 27B earns its keep; it’s noticeably better at “why did this break” reasoning even if it’s slower.

Inline edit (⌘I) — select a block, describe the change, review the diff. This is where Qwen3 Coder shines. An edit that takes 15–25 seconds on a dense model lands in about 5 on the MoE.

Tab autocomplete — flows from the 1.5B model and does exactly what you want: fast, low-stakes, ignorable when wrong. A 30B model here would mean 1–2 seconds per keystroke, which is worse than nothing.

Important gotcha: multiple models can share a role, and Continue uses whichever you’ve selected in the UI — not the first one in the file. Click the cube icon above the chat input and set each role’s dropdown explicitly. I set edit/apply to Coder and chat to whichever I’m in the mood for.

Final thoughts

On the plugin choice. The native VS Code chat integration is fine but fiddly in Agent mode — model visibility depends on tool-calling detection, and you’ll spend time in the Language Models editor wondering why a model isn’t showing. Continue’s direct HTTP path removes an entire layer of that. If your goal is “working local assistant today,” skip the debugging and use Continue.

On model selection. The instinct is to pick the biggest/best model. On Apple Silicon, pick the right architecture. An MoE with 3B active parameters is the difference between a tool you use and a tool you abandon. qwen3-coder:30b is the sweet spot here — coding-tuned and fast.

On the honest trade-off. A local 30B is not a frontier model. It’s genuinely good at scoped, single-file work and noticeably weaker at sprawling multi-file refactors with deep cross-file context. Local wins on cost, privacy, and availability; cloud still wins on the hardest tasks.

Which, honestly, is the point. The code I care most about — the proprietary, the half-written, the messy — is exactly the code I don’t want to paste into a chat box. Having a decent assistant that never leaves the machine is a different category of useful from a brilliant one that does.

Three things I’d tell anyone starting this today:

  1. Run ollama list and check which models actually support tool calling before you debug a model picker
  2. Build a custom num_ctx Modelfile immediately — the 4K default will waste hours of your time
  3. Use a small model for autocomplete; use an MoE for editing; use a dense model for reasoning

The whole setup took an evening of tinkering, most of it spent on problems that had nothing to do with Ollama being slow or the models being bad. Now it’s just there, offline, free, and private.

You may also like...

Leave a Reply

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