Skip to content

Running a Local Model Behind VS Code With Ollama

For people

Continue and Cline will both talk to Ollama on port 11434 instead of a vendor's API. Which jobs that is good for, how much memory it takes, and why autocomplete and chat want different models.

Editorial team 6 min read

Share X LinkedIn Reddit Bluesky Email

Ollama turns a downloaded model into a local HTTP service on port 11434, and both of the main open-source VS Code assistants, Continue and Cline, are listed in Ollama's own integrations and will talk to it instead of a vendor's API. The result is a coding assistant where no keystroke leaves the machine and no token is billed. Whether it is a good assistant depends almost entirely on which job you give it, and on how much memory the machine has.

What the Two Extensions Do With It

Continue is the broader of the two. It separates the chat model in the side panel from the autocomplete model that makes inline suggestions, and each is a model entry in its YAML configuration with provider: ollama and the model's Ollama name. If Ollama runs on another machine on the network you set apiBase to that host's address on port 11434 instead of localhost. Continue labels the older JSON configuration deprecated, so a tutorial showing config.json is describing a version you no longer have.

Cline is an agent. It reads files, edits them, runs terminal commands and iterates on the results. Its Ollama provider takes a base URL of http://localhost:11434 and a model picked from a list or typed by name, and Ollama's own Cline page says to raise the context window to at least 32K tokens for coding. That one setting is the difference between a Cline that functions and one that forgets the file it just opened: an agent's prompt carries the system instructions, the tool definitions, the files it has read and the history of the task, and a small window cannot hold all of that at once.

The Hardware Question

Cline's local-models documentation gives the honest shape of it: 16 to 32GB of RAM runs small or quantised models; 32 to 64GB is where mid-size coding models live; 64GB and above is for larger models and bigger context windows. It names no models and no quantisation levels, which is the right call for a page that has to stay true. Our own sizing guide gives the arithmetic behind those tiers: weights cost roughly parameters times bytes per parameter, so a 7B model at 4-bit is about 3.5GB and a 30B-class model at 4-bit about 15GB before headroom, which is why the guide files it under a 24GB machine. The key-value cache for a long context is charged on top of the weights, so a 32K-token agent session needs far more than the model's download size suggests.

A concrete failure: Continue's Ollama page warns that Continue may set a higher default context length than other Ollama tools, so a model that runs fine from the command line throws a "model requires more system memory" error the moment Continue sends a request. The fix is to lower contextLength under the model's defaultCompletionOptions, or to pull a smaller variant if that is not enough. People read the error as a broken install; it is a context setting.

Autocomplete Is a Different Model From Chat

The most common mistake is to point the autocomplete role at the same model used for chat. Continue's autocomplete documentation is unambiguous: the recommended local models are the small Qwen coder variants, 1.5B and 7B, because autocomplete models are trained with a highly specific prompt format for completing code in the middle of a file, and models that were not, including the leading commercial chat models, "won't generate useful completions". It also notes that most state-of-the-art autocomplete models are no more than 10B parameters and that going larger does not significantly improve performance. Thinking models are not recommended for the role because they generate more slowly, and a completion that arrives after you have typed the next line is worse than none. If you must reuse a model whose thinking can be switched, Continue shows how to turn thinking off for autocomplete.

This is the configuration that makes a laptop workable: a small completion model on autocomplete, which fits in a few gigabytes and answers in the few hundred milliseconds inline completion tolerates, and a larger general coder model on chat, where a two-second wait is fine. Loading both at once needs memory for both; on a 16GB machine you will generally pick one.

Why Local Autocomplete Is Fine and Local Agents Usually Are Not

Autocomplete is a short, local prediction: a few hundred tokens of prefix and suffix in, one or two lines out, scored by whether you press Tab. A 7B model trained for exactly that task is close enough to the hosted equivalents that the difference rarely decides anything, and it never costs a cent across the hundreds of invocations a working day produces.

Agentic editing is the opposite shape. A Cline task is a long conversation in which the model has to emit tool calls in the exact format the extension parses, keep track of several files, notice when a command failed, and decide what to do next. Each of those is a place a small model breaks, and the breakages compound over a long task. Cline's own advice for local models, to enable its compact prompt, keep tasks focused and start a new task when the context gets large, is sound, but it is also a description of the ceiling: you are working around the model's limits rather than extending them. Our editor guide draws the same line: explaining code, writing tests and small well-specified edits hold up locally; long multi-file reasoning across a repository is where hosted frontier models remain clearly ahead.

Follow the money too. A 30B-class coder model at 32K context on 64GB of unified memory is a machine most developers do not have, and buying one to avoid API fees for an agent you could run hosted is a poor trade unless the real reason is that the code cannot leave the building. That is a legitimate reason, and for regulated or client-confidential work it is the whole reason. For everyone else, the local setup that pays for itself is the small one.

A Sensible Starting Point

Install Ollama (our install guide covers each platform), pull a small Qwen coder variant for autocomplete and the largest general coder model your memory tier allows for chat, and configure Continue with those two models. Use it for a week. If you then want an agent, try Cline against the same chat model with the context window raised to Ollama's recommended 32K and tasks kept to a single file, and judge it honestly against the hosted version on the same task. The usual outcome is to keep the local autocomplete and go back to a hosted model for the agent; the people who keep both have the hardware and the confidentiality requirement.

More in VS Code and AI

All VS Code and AI guides →
VS Code and AI Guide · 7 min

Writing Instructions Files Every Assistant Reads

Claude Code, Copilot, Continue and Cline each read their own instructions file, but most of them now read AGENTS.md too. Write the content once, point the rest at it, and check that each harness actually loaded it.

VS Code and AI 7 min read 31 Oct 2026 For people

VS Code and AI Guide · 7 min

Where Your Code Goes: Keys, Telemetry and Data Retention Across AI Extensions

Every AI extension sends the code around your cursor to a model somewhere. What differs is where it goes, how long it is kept, and where the key that let it leave is stored — and the three common routes fail in three different ways.

VS Code and AI 7 min read 31 Oct 2026 For people

VS Code and AI Guide · 7 min

Using Claude Through GitHub Copilot Chat

What you get when you pick a Claude model inside GitHub Copilot in VS Code, where it quietly differs from using Claude directly, which plans include it, and how the AI Credits meter runs down faster on the heavier models and in agent mode.

VS Code and AI 7 min read 31 Oct 2026 For people

VS Code and AI Guide · 6 min

Qwen Models in VS Code: Cloud and Local

Three ways to run Qwen's coder models in VS Code — Alibaba's hosted API through Cline or Continue, a local Ollama or LM Studio runtime, or Qwen Code's own companion panel — and the memory, region and tool-calling mistakes that trip each one.

VS Code and AI 6 min read 31 Oct 2026 For people

Discussion 0

Use @handle to bring somebody in, and #tag to file it.

Nothing here yet. Ask a question, or say how you used it.

Sign in to join the discussion. Sign in