MacBook Pro running VS Code connected to local Ollama, Continue.dev, and Qwen 2.5 Coder for offline coding
Tutorials
Intermediate
23 min read Updated

Run Local Coding LLMs on Mac with VS Code (2026)

Set up a local coding LLM on Mac in VS Code using Ollama MLX, Continue.dev config.yaml, and Cline for fast offline completions and multi-file edits.

VS Code Apple Silicon Ollama Continue Cline Local LLM Apple MLX Coding Assistant

Running a local coding LLM on Mac in VS Code pairs a sub-25ms Fill-in-the-Middle autocomplete model with a 14B or 32B reasoning engine over Apple Silicon unified memory. On an M5 Max, Ollama’s Apple MLX runner with NVFP4 quantization reaches 1,810 tokens/s prefill and 112 tokens/s decode.

Engineers migrating from cloud copilots often hit keystroke lag, silent 4,096-token truncation, or cold model eviction delays inside Visual Studio Code. Our foundational guide to running AI on Mac with Apple Silicon covers system-wide hardware mechanics, while this guide locks in the VS Code extension architecture, config.yaml schemas, and MLX tuning parameters.

Key Takeaways

  • Decoupling inline tab autocomplete (qwen2.5-coder:1.5b-base) from multi-file reasoning (14B or 32B weights) prevents typing stutter inside Visual Studio Code on macOS.
  • Continue.dev now uses ~/.continue/config.yaml (schema: v1) with explicit roles arrays for chat, edit, apply, and autocomplete, replacing the legacy config.json format.
  • Ollama’s Apple Silicon MLX backend with NVFP4 quantization and prefix caching boosts prefill from 1,154 to 1,810 tokens/s and decode from 58 to 112 tokens/s on M5 Max hardware.
  • Pinning OLLAMA_MAX_LOADED_MODELS=2, OLLAMA_KEEP_ALIVE=-1, OLLAMA_FLASH_ATTENTION=1, and OLLAMA_KV_CACHE_TYPE=q8_0 via launchctl setenv keeps both coding models resident in unified RAM.

How Does Dual-Model VS Code Architecture Decouple Autocomplete from Reasoning?

A dual-model VS Code architecture separates latency-critical keystroke completions from heavy multi-file reasoning by routing Fill-in-the-Middle (FIM) suggestions to a 1.5B model while sending chat and refactoring tasks to a 14B or 32B checkpoint. Both models stay loaded concurrently inside Apple Silicon unified memory on localhost:11434.

Dual-lane VS Code architecture routing Continue.dev FIM autocomplete and Cline agent tasks to Ollama MLX on Apple Silicon Figure 1: Dual-lane VS Code architecture routing FIM tab autocomplete and Cline agent tasks to resident Apple Silicon MLX weights.

Routing every keystroke through a 32B parameter model creates a 200ms to 500ms stall before ghost text renders. Developers notice typing friction whenever inline completion latency crosses roughly 100ms, causing autocomplete suggestions to appear after the cursor has already moved two tokens ahead.

Why Fill-in-the-Middle Autocomplete Breaks on Large Models

Fill-in-the-Middle tab autocomplete relies on fast prefix-and-suffix token prediction rather than multi-step instruction following. According to the Qwen2.5-Coder Technical Report on arXiv, dedicated FIM checkpoints wrap editor context with <|fim_prefix|>, <|fim_suffix|>, and <|fim_middle|> special tokens so the model predicts only the missing span at your cursor.

A compact 1.5B FIM checkpoint (qwen2.5-coder:1.5b-base) occupies roughly 1.6 GB of unified memory and completes short inline spans in 18ms to 25ms on M3, M4, and M5 Macs. Using an instruct-tuned reasoning model for tab autocomplete also introduces conversational markdown fences or thinking tokens unless explicitly suppressed.

Keeping Both Models Resident with Ollama Memory Pinning

Running two separate models fails if Ollama evicts your autocomplete weights every time Cline starts a refactoring loop. By default, Ollama keeps models loaded for only five minutes (OLLAMA_KEEP_ALIVE=5m) and can swap weights out during idle stretches or memory spikes.

Setting OLLAMA_MAX_LOADED_MODELS=2 and OLLAMA_KEEP_ALIVE=-1 keeps both the 1.5B autocomplete model and your 14B or 32B reasoning checkpoint resident in RAM. You can confirm concurrent residency at any time with ollama ps, ensuring zero cold-reload delays when jumping from typing code to sidebar chat.

VS Code Workflow Lane Recommended Local Model Memory Footprint Target Latency / Speed Primary Extension
Inline FIM Autocomplete Qwen 2.5 Coder 1.5B Base (Q4) ~1.6 GB Unified RAM < 25 ms per trigger Continue.dev (autocomplete)
Sidebar Chat & Inline Edit Qwen 2.5 Coder 7B / 14B (Q4_K_M) ~5.8 GB to 10 GB 16 to 35 tokens/s Continue.dev (chat, edit)
Codebase Vector Indexing Nomic Embed Text (nomic-embed-text) ~0.3 GB Unified RAM < 15 ms per chunk Continue.dev (embed)
Autonomous Multi-File Agent Qwen 2.5 Coder 32B / Gemma 4 26B ~18 GB to 22 GB + KV 12 to 28 tokens/s Cline / Roo Code

Continue.dev vs. Cline vs. Roo Code: Which VS Code Extension Fits Local Models?

Continue.dev, Cline, and Roo Code connect to local Ollama endpoints over http://localhost:11434, yet they target completely different layers of local developer productivity. Continue.dev delivers inline FIM tab autocomplete and fast sidebar chat on 16GB Macs, whereas Cline and Roo Code execute autonomous file-editing and terminal agent loops best suited for 24GB to 64GB+ machines.

Light editorial decision flowchart matching 16GB, 24GB, and 32GB+ Mac RAM tiers to Continue.dev, Cline, and Roo Code Figure 2: Decision flowchart matching Mac unified memory capacity to VS Code extensions and quantized coding model tiers.

Comparing these three extensions requires separating inline code completion from multi-turn tool calling. Autocomplete extensions send small 1,024-token prefix/suffix slices, while agent extensions transmit repository trees, tool schemas, and multi-file diffs on every turn.

Continue.dev: Modular Chat and Tab Autocomplete

  • Verdict: Continue.dev is the most reliable daily-driver extension for running a local ai coding assistant mac stack across 16GB and 24GB laptops.
  • Best for: Inline Fill-in-the-Middle ghost text, targeted Cmd+I inline diffs, and localized sidebar Q&A backed by local embeddings.
  • Strengths: Native dual-model role routing inside config.yaml lets you pair a 1.5B autocomplete checkpoint with a larger chat model without cross-model interference.
  • Trade-offs: Continue.dev prioritizes human-in-the-loop editing and lacks Cline’s methodical multi-file bash test-and-repair execution loop out of the box.

Cline: Permission-Gated Multi-File Agent Loops

  • Verdict: Cline brings autonomous multi-file refactoring and command execution to local Ollama models, provided your Mac supplies at least 24GB of unified memory and a 32K context window.
  • Best for: Scaffolding multi-file features, running unit test suites, reading compiler tracebacks, and iterating on fixes with step-by-step approval.
  • Strengths: Specifications in the Cline Official GitHub Repository confirm that every filesystem write and terminal command pauses for explicit developer approval, while its Use Compact Prompt toggle cuts local system-prompt bloat by roughly 90%.
  • Trade-offs: Cline does not provide inline tab autocomplete, and models under 14B parameters often emit malformed tool-call JSON when navigating large repositories.

Roo Code: Multi-Mode Specialization and Local Hardware Trade-Offs

  • Verdict: Roo Code extends Cline’s agent loop with dedicated Architect, Code, Debug, and Ask personas for teams running 32B+ local models or hybrid cloud fallbacks.
  • Best for: Engineers on 36GB to 128GB M4/M5 Max workstations who separate high-level planning from code implementation via mode-specific system prompts.
  • Strengths: Granular .clinerules and custom mode permissions isolate read-only architecture planning from write-enabled refactoring loops.
  • Trade-offs: Switching personas increases prompt instruction overhead, causing 7B or 14B local checkpoints to stall more frequently than under Cline’s compact prompt profile.
Capability Continue.dev Cline Roo Code
Native Tab Autocomplete (FIM) Yes (Dedicated autocomplete role) No No
Autonomous Terminal & File Edits Limited (Experimental agent) Yes (Permission-gated loop) Yes (Mode-scoped permissions)
Configuration Format ~/.continue/config.yaml (schema: v1) VS Code Settings UI + .clinerules VS Code Settings UI + Custom Modes
Minimum Practical Local Model 1.5B FIM + 7B Chat 14B Instruct (Compact Prompt) 32B Instruct / MoE
Ideal Mac Unified RAM 16 GB to 24 GB+ 24 GB to 64 GB+ 32 GB to 128 GB

Which Local Coding Model Should You Run by Mac RAM Tier?

Your Mac’s unified memory capacity and memory bus bandwidth determine whether your VS Code setup supports a fast 7B chat pairing or a 32B autonomous coding agent. Because autoregressive decoding sweeps every model weight across the memory bus once per token, bandwidth caps tokens per second while RAM capacity caps model size and context depth.

To keep macOS responsive and avoid NVMe swap thrashing, reserve 4 GB to 8 GB of unified RAM for the operating system, VS Code extension hosts, language servers, and Docker containers. Our complete sizing reference on the best local LLMs for Mac by RAM details general model footprints, while the benchmarks below focus strictly on VS Code coding workloads.

Model Family Trade-Offs: Qwen 2.5 Coder vs. Phi-4 vs. Gemma 4

Selecting the right open-weights checkpoint depends on whether your daily tasks lean toward strict syntax generation, algorithmic debugging, or multimodal repository analysis:

  • Qwen 2.5 Coder (1.5B / 7B / 14B / 32B): Trained specifically across 80+ programming languages, the 32B Instruct tier reaches 92.7% HumanEval Pass@1, while the 14B and 7B variants reach 89.6% and 88.4% respectively. Browse available quantization tags in the Ollama Qwen 2.5 Coder Model Library.
  • Microsoft Phi-4 (14B) & Phi-4-mini: Built on synthetic reasoning datasets under an MIT license, Phi-4 14B consumes roughly 9 GB at 4-bit quantization and excels at logic-heavy bug triage and test assertions on 16GB to 24GB Macs.
  • Google Gemma 4 (12B / 26B MoE / 31B Dense): Released under Apache 2.0 with a 128K context window, Gemma 4 pairs strong structured output reliability with native multimodal inspection for UI screenshots and architectural specs.
  • DeepSeek-R1-Distill-Qwen-32B & Qwen3.5-35B-A3B (NVFP4): DeepSeek’s 32B distilled checkpoint brings step-by-step chain-of-thought verification to complex migrations, while active-parameter MoE models like Qwen3.5-35B-A3B deliver high decode throughput on MLX-enabled Macs.

Verified Apple Silicon Decode Speeds Across 16GB, 24GB, and 32GB+ Macs

Empirical Apple Silicon evaluations at 4-bit quantization (Q4_K_M or 4-bit MLX) illustrate how decode velocity scales from base M3/M4/M5 chips up to Max-tier memory controllers. On a 24GB M4 Pro or M5 Pro MacBook Pro, pairing qwen2.5-coder:1.5b-base with a 14B Q4 checkpoint hits the practical sweet spot for both Continue.dev and Cline.

Chip Tier & Unified RAM Qwen 2.5 Coder 7B Qwen 2.5 Coder 14B Qwen 2.5 Coder 32B Recommended VS Code Stack
M3 / M4 / M5 (16 GB) 22 to 26 tokens/s 10 to 12 tokens/s (tight) Out of memory (Swap) Continue.dev: 1.5B FIM + 7B Chat
M3 / M4 / M5 Pro (24 GB) 25 to 30 tokens/s 14 to 18 tokens/s 11 to 13 tokens/s (4K ctx max) Continue + Cline: 1.5B FIM + 14B / Phi-4
M3 / M4 Pro (32 GB) 28 to 35 tokens/s 16 to 20 tokens/s 12 to 15 tokens/s Continue + Cline: 1.5B FIM + 32B (Q8 KV)
M3 / M4 / M5 Max (36 GB to 64 GB+) 40 to 50 tokens/s 25 to 30 tokens/s 23 to 28 tokens/s Continue + Cline / Roo: 1.5B FIM + 32B / MoE

[!TIP] On a 24GB MacBook Pro, choose a 14B model (qwen2.5-coder:14b-instruct-q4_K_M or phi4:14b) with a 32K context window instead of squeezing a 32B model at 4K context. A 32B checkpoint leaves under 4GB for macOS and VS Code, causing severe swap stalls as soon as Cline opens three files.

Step-by-Step VS Code Setup: Ollama, Continue config.yaml, and Cline

Setting up your local VS Code stack requires installing Ollama, pulling dedicated FIM and reasoning weights, wiring Continue’s config.yaml with explicit roles, and compiling a 32K-context Modelfile for Cline. Follow these four steps in sequence to avoid silent truncation and configuration mismatches.

Installing Ollama and Pulling FIM and Reasoning Weights

Install Ollama via Homebrew or the official macOS application bundle, verify the local service is listening on port 11434, and pull the exact model tags matched to your Mac’s memory tier. Pulling nomic-embed-text alongside your coding models also enables local @codebase vector search inside Continue.

# 1. Install Ollama and start the background service
brew install ollama
brew services start ollama

# 2. Pull the sub-25ms Fill-in-the-Middle autocomplete model (~1.1 GB)
ollama pull qwen2.5-coder:1.5b-base

# 3. Pull the primary chat and refactoring model (14B for 16GB/24GB Macs)
ollama pull qwen2.5-coder:14b-instruct-q4_K_M

# Optional alternatives: Phi-4 14B for logic/debugging or 32B for 32GB+ Macs
# ollama pull phi4:14b
# ollama pull qwen2.5-coder:32b-instruct-q4_K_M

# 4. Pull a lightweight embedding model for local workspace RAG
ollama pull nomic-embed-text:latest

Run ollama list after downloading to verify the exact tag strings in your local registry. Mismatched model tags between ollama list and your extension configuration are the leading cause of 404 Model Not Found errors inside VS Code.

Configuring Continue.dev with config.yaml Schema v1

Continue.dev deprecated its legacy config.json format in favor of ~/.continue/config.yaml using schema: v1 and explicit roles arrays. Defining roles: [autocomplete] separately from roles: [chat, edit, apply] guarantees that keystrokes never hit your 14B or 32B reasoning checkpoint.

# ~/.continue/config.yaml
name: Mac Local Coding Stack
version: 0.0.1
schema: v1

models:
  # Lane 1: High-speed Fill-in-the-Middle tab autocomplete
  - name: Qwen 2.5 Coder 1.5B (Autocomplete)
    provider: ollama
    model: qwen2.5-coder:1.5b-base
    apiBase: http://localhost:11434
    roles:
      - autocomplete
    autocompleteOptions:
      debounceDelay: 250
      maxPromptTokens: 1024
      prefixPercentage: 0.5
      useCopyBuffer: true

  # Lane 2: Deep refactoring, inline edits, and chat (swap tag for 32k custom build below)
  - name: Qwen 2.5 Coder 14B 32K (Chat & Edit)
    provider: ollama
    model: qwen-coder-14b-32k
    apiBase: http://localhost:11434
    roles:
      - chat
      - edit
      - apply

  # Lane 3: Local codebase embedding index
  - name: Nomic Embed Local
    provider: ollama
    model: nomic-embed-text:latest
    apiBase: http://localhost:11434
    roles:
      - embed

If you test a thinking-capable model (such as a Qwen3 variant) for inline suggestions, disable chain-of-thought overhead under requestOptions.extraBodyProperties.think: false as documented in the Continue Autocomplete Model Roles Documentation. Click the Continue status bar icon in the bottom-right corner of VS Code to confirm Tab Autocomplete is enabled and reload the configuration.

Configuring Cline with Compact Prompt and 32K Context

Cline runs multi-step tool calls to read directories, edit files, and inspect compiler output inside your VS Code terminal. Without explicit local optimization, Cline’s default system prompt consumes thousands of tokens before your task even starts.

Open Cline Settings in the VS Code sidebar and apply these exact parameters from the Cline Local Models Configuration Guide:

  1. Set API Provider to Ollama and Base URL to http://localhost:11434.
  2. Select your compiled 32K model ID (qwen-coder-14b-32k or qwen-coder-32b-32k).
  3. Set Context Window explicitly to 32768 (or 65536 on 48GB+ Macs with Q8 KV caching).
  4. Open Cline Settings -> Features and enable Use Compact Prompt, which shrinks Cline’s system instructions to roughly 10% of the full prompt size so 14B and 32B local models parse tool schemas reliably.

Building a 32K Custom Ollama Modelfile

Ollama initializes many downloaded model tags with a 4,096-token default context buffer (num_ctx) to protect consumer machines from out-of-memory errors. For multi-file edits in Cline and Continue, 4,096 tokens overflows immediately and triggers silent history truncation.

Create a Modelfile.coder file to bake a 32,768-token context buffer and deterministic low-temperature coding sampling directly into a reusable model alias, following the Ollama Modelfile Parameter Reference.

# Modelfile.coder
FROM qwen2.5-coder:14b-instruct-q4_K_M

# Expand context window from 4K default to 32K for multi-file IDE agents
PARAMETER num_ctx 32768

# Offload all transformer layers to Apple Silicon Metal / MLX cores
PARAMETER num_gpu 99

# Keep syntax generation deterministic with minimal repetition
PARAMETER temperature 0.1
PARAMETER repeat_penalty 1.1

Compile and register the custom model with ollama create, then verify its active context parameter using ollama show.

# Build the 32K local coding alias
ollama create qwen-coder-14b-32k -f ./Modelfile.coder

# Verify num_ctx is locked to 32768
ollama show --modelfile qwen-coder-14b-32k | grep num_ctx

Once built, reference qwen-coder-14b-32k in both ~/.continue/config.yaml and Cline’s Model ID field so both extensions share the exact same weight cache in unified memory.

Tuning Apple Silicon MLX, KV Cache, and Unified Memory Caps

Default macOS and Ollama settings leave substantial throughput unused and artificially restrict GPU memory allocation during long coding sessions. Tuning Apple MLX execution, enabling quantized KV caching via launchctl, and adjusting the Metal wired memory ceiling unlock workstation-grade agent responsiveness.

How Ollama’s Native MLX Backend and NVFP4 Accelerate Prefill

Modern Ollama releases automatically route supported architectures like Qwen and Gemma models through Apple’s native MLX runner on Apple Silicon Macs rather than legacy CPU-shuffling paths. According to benchmarks published on the Ollama Apple Silicon MLX Engineering Blog, running qwen3.5:35b-a3b quantized to NVFP4 on an M5 Max increased prefill speed from 1,154 tokens/s (Ollama 0.18) to 1,810 tokens/s and nearly doubled decode velocity from 58 tokens/s to 112 tokens/s.

MLX compiles operations into fused Metal kernels and pairs with upgraded prefix prompt caching. Because Cline and Continue resend identical system prompts, tool definitions, and open-file headers on consecutive turns, prefix caching bypasses redundant prefill computation and cuts time-to-first-token (TTFT) across multi-step refactoring loops.

Teams wanting raw Python scripts or custom LoRA evaluation outside Ollama can also inspect the Apple MLX-LM Official GitHub Repository. For deeper runtime flags and server plist tuning, follow our guide to Ollama MLX on Mac speed tuning.

Enabling Flash Attention and Q8_0 KV Cache via launchctl

Setting export OLLAMA_FLASH_ATTENTION=1 inside ~/.zshrc affects only CLI commands launched inside that terminal tab and is completely ignored by the macOS Ollama background app. You must inject Ollama environment variables into launchd using launchctl setenv so the daemon inherits them on startup.

# Persist Ollama tuning flags for the macOS GUI/background daemon
launchctl setenv OLLAMA_FLASH_ATTENTION "1"
launchctl setenv OLLAMA_KV_CACHE_TYPE "q8_0"
launchctl setenv OLLAMA_MAX_LOADED_MODELS "2"
launchctl setenv OLLAMA_KEEP_ALIVE "-1"
launchctl setenv OLLAMA_HOST "127.0.0.1:11434"

After running these launchctl commands, quit Ollama completely from the macOS menu bar (or run brew services restart ollama if running via Homebrew) so the server reads the updated environment. Setting OLLAMA_KV_CACHE_TYPE=q8_0 compresses the 32K Key-Value attention cache from 16-bit floats down to 8-bit integers, cutting context RAM demand roughly in half with negligible coding accuracy loss.

Overriding the 75% Metal GPU Memory Cap (iogpu.wired_limit_mb)

macOS enforces a default Metal graphics ceiling (commonly around 75% of total unified memory) to reserve headroom for WindowServer and desktop applications. On a 32GB or 64GB Mac, this default cap can force Ollama to reject a 32B model at 32K context or spill layers onto slow CPU execution even while gigabytes of physical RAM sit idle.

Check your current Metal wired memory limit and raise it safely with sysctl iogpu.wired_limit_mb, always leaving 4 GB to 8 GB unallocated for macOS and VS Code:

# Inspect current Metal GPU wired ceiling (0 indicates default ~75% dynamic cap)
sysctl iogpu.wired_limit_mb

# Example for a 32GB Mac: allocate 28 GB (28672 MB) to GPU, leaving 4 GB for macOS
sudo sysctl iogpu.wired_limit_mb=28672
Mac Total Unified RAM Default macOS GPU Cap (~75%) Safe iogpu.wired_limit_mb Override Reserved macOS + VS Code Headroom
16 GB ~12 GB Leave at 0 (or 12288 max) 4 GB
24 GB ~18 GB 20480 (20 GB) 4 GB
32 GB ~24 GB 28672 (28 GB) 4 GB
48 GB ~36 GB 43008 (42 GB) 6 GB
64 GB ~48 GB 57344 (56 GB) 8 GB
128 GB ~96 GB 122880 (120 GB) 8 GB

Because sysctl changes apply immediately without a reboot and reset back to 0 after restarting your Mac, restart the Ollama daemon immediately after running the command so Metal detects the larger working set.

Air-Gapped Security: Isolating Proprietary Code and Secrets on Localhost

Running local coding models inside VS Code protects proprietary algorithms, database schemas, and .env credentials by keeping prompt payloads strictly inside Apple Silicon memory. Cloud coding assistants stream open editor buffers and diffs across external networks, whereas a properly bound local stack emits zero bytes over Wi-Fi or Ethernet.

Five-layer air-gapped security stack isolating VS Code, extension flags, loopback port 11434, and Apple Silicon RAM Figure 3: Five-layer loopback security boundary keeping source code, secrets, and completions inside Apple Silicon unified RAM.

Even when running inference locally, misconfigured network bindings or enabled editor telemetry can leak metadata or expose your inference port to untrusted devices on coffee-shop or office Wi-Fi networks. Locking down both the Ollama socket and VS Code extension settings closes these two gaps cleanly.

Binding Ollama Strictly to Loopback (127.0.0.1:11434)

Never set OLLAMA_HOST=0.0.0.0 on a portable MacBook Pro unless you intentionally serve models behind an encrypted mesh VPN. Binding Ollama strictly to 127.0.0.1:11434 blocks every inbound LAN request while keeping VS Code IPC instantaneous over the local loopback interface.

# Verify Ollama listens exclusively on localhost (127.0.0.1:11434)
lsof -nP -iTCP:11434 -sTCP:LISTEN

If lsof returns *:11434 instead of 127.0.0.1:11434, update OLLAMA_HOST via launchctl setenv and restart the Ollama daemon. Engineering teams that want one centralized headless box serving multiple laptops over encrypted WireGuard tunnels should review our dedicated Mac mini home AI server architecture instead of exposing a laptop port.

Disabling Extension Telemetry and Verifying Offline Execution

Complete your air-gapped posture by disabling anonymous telemetry in both VS Code and Continue before opening sensitive client repositories:

// ~/Library/Application Support/Code/User/settings.json
{
  "telemetry.telemetryLevel": "off",
  "continue.telemetryEnabled": false,
  "cline.telemetrySetting": "disabled"
}

Once configured, toggle macOS Wi-Fi off and trigger both a tab completion in Continue and a multi-file inspection prompt in Cline. Both lanes should return tokens cleanly with zero network connectivity, confirming deterministic offline operation.

Troubleshooting Common VS Code and Ollama Failures on Mac

Most local VS Code failures stem from silent 4K context truncation, background model eviction, or unapplied environment variables rather than broken model weights. Use the diagnostics below to isolate and resolve bottlenecks in minutes.

Fixing Cline Infinite Tool-Call Loops and Silent 4K Truncation

When Cline repeatedly reads the same file, prints malformed XML/JSON tool blocks, or forgets the user’s original prompt after four turns, Ollama has silently truncated conversation history at its 4,096-token default limit. Verify active context sizing by inspecting ~/.ollama/logs/server.log for num_ctx initialization lines.

Fix the loop by compiling a custom Modelfile with PARAMETER num_ctx 32768, selecting that custom alias inside Cline Settings, setting Cline’s Context Window to 32768, and toggling Use Compact Prompt on under Cline Features. If you run a 7B model and still observe malformed JSON arguments, upgrade to qwen2.5-coder:14b-instruct-q4_K_M or phi4:14b, which follow structured tool schemas far more reliably.

Eliminating Autocomplete Lag and 5-Minute Model Eviction

If tab autocomplete pauses for three to eight seconds after you finish reading documentation or running unit tests, Ollama evicted your 1.5B FIM weights after the default five-minute inactivity timeout. Alternatively, your config.yaml may accidentally assign a 14B or thinking-enabled model to the autocomplete role.

Confirm both models remain pinned by running ollama ps after triggering an autocomplete suggestion and a chat query. Both qwen2.5-coder:1.5b-base and your 14B/32B chat model should appear simultaneously with 100% GPU allocation; if either reloads from disk, verify OLLAMA_MAX_LOADED_MODELS=2 and OLLAMA_KEEP_ALIVE=-1 are active in launchctl getenv OLLAMA_KEEP_ALIVE.

Resolving 404 Model Not Found, Swap Thrashing, and Unapplied Env Vars

When Continue or Cline throws HTTP 404 Model Not Found, compare the exact model: string in ~/.continue/config.yaml against ollama list output. Even a missing :1.5b-base suffix or unbuilt custom alias triggers a 404 from localhost:11434.

If token generation suddenly collapses below 3 tokens/s and Activity Monitor shows heavy yellow or red Memory Pressure, your model weights plus 32K KV cache exceed your Mac’s physical Metal allocation and are paging to SSD. Drop from 32B to 14B weights, confirm OLLAMA_KV_CACHE_TYPE=q8_0 is loaded, or inspect our M5 Pro vs. M5 Max local AI benchmarks to match model footprints against Apple Silicon memory bandwidth tiers.

Symptom Root Cause Exact Diagnostic & Fix
Cline repeats file reads in a loop Ollama defaulted to num_ctx 4096 and dropped system history Build Modelfile.coder with num_ctx 32768 and enable Cline Use Compact Prompt
Tab autocomplete stalls for 4+ seconds OLLAMA_KEEP_ALIVE=5m evicted the 1.5B FIM model Run launchctl setenv OLLAMA_KEEP_ALIVE "-1" and OLLAMA_MAX_LOADED_MODELS "2"
404 Model Not Found in Continue Tag mismatch or unbuilt Modelfile alias Match model: in ~/.continue/config.yaml to exact output of ollama list
Decode drops below 3 tokens/s Unified RAM swap thrashing or Metal 75% cap hit Enable OLLAMA_KV_CACHE_TYPE=q8_0, raise iogpu.wired_limit_mb, or use 14B Q4
launchctl or .zshrc flags ignored GUI Ollama app ignores shell exports in .zshrc Use launchctl setenv and fully quit + reopen the Ollama app

Frequently Asked Questions

Can I run a local coding LLM in VS Code on Mac completely offline?

Pairing VS Code extensions like Continue.dev or Cline with Ollama bound to 127.0.0.1:11434 keeps all inference inside Apple Silicon unified memory with zero external network traffic. Once model weights are downloaded, inline completions, chat, and workspace edits continue working with Wi-Fi disabled.

What is the best local coding model for a 16GB or 24GB MacBook Pro?

On a 16GB Mac, run qwen2.5-coder:1.5b-base for sub-25ms tab autocomplete alongside qwen2.5-coder:7b for chat without triggering swap. On a 24GB MacBook Pro, qwen2.5-coder:14b-instruct-q4_K_M or Microsoft phi4:14b runs at 14 to 18 tokens/s while leaving headroom for a 32K context window.

How do I stop Continue.dev tab autocomplete from lagging on Mac?

Assign a dedicated 1.5B Fill-in-the-Middle model (qwen2.5-coder:1.5b-base) to the autocomplete role in ~/.continue/config.yaml instead of sharing your 14B chat model. Also set OLLAMA_MAX_LOADED_MODELS=2 and OLLAMA_KEEP_ALIVE=-1 via launchctl setenv so Ollama never evicts autocomplete weights between edits.

Why does Cline get stuck in tool-calling loops with local Ollama models?

Cline enters repetitive file-reading or JSON error loops when Ollama silently truncates workspace history at its 4,096-token default context limit. Set Cline’s Context Window to 32768, build a custom Modelfile with PARAMETER num_ctx 32768, and enable Use Compact Prompt under Cline Features.

Should I use Continue.dev, Cline, or Roo Code with local LLMs in VS Code?

Choose Continue.dev if you want a lightweight daily driver with fast Fill-in-the-Middle tab autocomplete and sidebar chat on 16GB to 24GB Macs. Choose Cline or Roo Code on 24GB to 64GB+ Macs when you need permission-gated multi-file editing, terminal test execution, and autonomous debugging loops.

How do I prevent macOS from capping Ollama GPU memory at 75 percent?

Run sudo sysctl iogpu.wired_limit_mb with a megabyte limit that leaves 4 GB to 8 GB free for macOS, such as 28672 on a 32GB Mac or 57344 on a 64GB Mac. Restart the Ollama app immediately afterward so Metal picks up the expanded wired memory allocation.

Does Ollama use Apple MLX automatically on Apple Silicon Macs?

Modern Ollama releases automatically route supported architectures such as Qwen and Gemma models through the native Apple MLX runner on Apple Silicon Macs. You can confirm active MLX acceleration and prefix cache reuse in ~/.ollama/logs/server.log or by pulling NVFP4-tagged model variants.

VS Code Apple Silicon Ollama Continue Cline Local LLM Apple MLX Coding Assistant

Found this helpful? Share it with others.

Raj, Founder, AI Agents Kit at AI Agents Kit

Raj

Founder, AI Agents Kit

Raj is the founder of AI Agents Kit, where he writes hands-on guides on AI agents, agent frameworks, Model Context Protocol (MCP), prompt engineering and developer tooling. He builds and tests the tools he covers and focuses on practical, working examples for developers and teams adopting agentic AI.

AI Agents LLMs Prompt Engineering Python TypeScript