Open Weight Thoughts
All articles

· 8 min read

Set Up a Fully Local AI Coding Assistant With Cline

By M. Smith

  • guides

To set up a fully local AI coding assistant with Cline, install the Cline IDE extension, run a local model server such as Ollama or LM Studio on the same machine, and select that local provider in Cline’s settings. For the simplest path, use Ollama at http://localhost:11434, pull a model that fits your hardware, enable Compact Prompt, and keep the agent’s tool permissions manual while you validate the setup.

“Fully local” should mean more than avoiding an API key: model inference, prompts, source files, tool output, and command execution should remain on your computer. This guide uses the Cline extension plus Ollama because it is a straightforward local HTTP setup, then shows where the boundary can leak—web browsing, remote MCP servers, package installs, Git remotes, and editor extensions can still make network requests if you enable them.

What You Need for a Fully Local AI Coding Assistant

You need four pieces: an editor, the Cline extension, a local inference runtime, and a downloaded model. The editor can be VS Code or another supported IDE, but VS Code is the least surprising starting point. Cline runs as an agent inside the editor: it can inspect files, propose and apply edits, and run terminal commands after you approve them. Ollama supplies the local model server that receives those agent requests on loopback rather than sending them to a hosted model API.

  • A supported editor, ideally a current VS Code installation.
  • The Cline extension, installed from your editor’s extension marketplace.
  • Ollama for the command-line-first path, or LM Studio if you prefer a graphical model downloader and server UI.
  • Enough disk space for model weights and enough RAM or VRAM for the chosen quantization.
  • A Git repository or disposable sample project for the first run—do not give an unfamiliar agent write access to your only uncommitted worktree.

Hardware determines the experience more than the extension does. Cline’s local-model guidance groups 16–32 GB RAM with small or quantized models, 32–64 GB with mid-size coding models, and 64 GB or more with larger models and wider context windows. Those are planning ranges, not guarantees: available GPU memory, quantization, context length, concurrent applications, and CPU versus GPU inference all matter. Start smaller and establish that tool calls work before downloading a huge model.

How to Install Cline in VS Code

Open Extensions with Ctrl/Cmd+Shift+X, search for Cline, install it, and open its sidebar icon. You do not need to select a paid model provider or enter a cloud API key for the local route. The important next step is configuring a local provider after the model server is live.

Before giving the assistant a real repository, create a safety baseline. Make sure Git is initialized, inspect git status, and commit or stash existing work. Leave command execution and file changes subject to approval at first. A local model is not automatically safe: it can still misunderstand a request, issue a destructive shell command, alter generated files, or expose a secret to any networked tool you have connected.

How to Run a Local Coding Model With Ollama

Install Ollama for your operating system, then download a model from its catalog. The exact model name is your choice; select an instruction-tuned model that your machine can run comfortably and that behaves well with code and tool-use prompts. Avoid choosing only by parameter count. A smaller model that returns usable output promptly is more useful for interactive coding than a larger one that exhausts memory or produces a token every few seconds.

# Replace <model-name> with the tag you chose from the Ollama catalog
ollama pull <model-name>
ollama run <model-name>

# In another terminal, verify that the local server can see it
ollama list

The initial ollama run both proves the weights can load and gives you a quick opportunity to ask a basic coding question. Once Ollama is running, its local API is normally available at http://localhost:11434. On Linux, start ollama serve if the service is not already running. Do not expose this port to your LAN or the public internet merely to make configuration easier; localhost is the right default for a single-machine assistant.

How to Connect Cline to Ollama

In the Cline sidebar, open Settings and select Ollama as the provider. Set the base URL to http://localhost:11434, then choose the downloaded model from the model selector. If the selector is empty, first confirm ollama list shows the model and that the Ollama server is running; a connection failure nearly always means the process is stopped, the address was changed, or a firewall or proxy is intercepting local traffic.

  1. Open Cline Settings.
  2. Choose Ollama as the API provider.
  3. Enter http://localhost:11434 as the base URL.
  4. Select the locally downloaded model.
  5. In Features, enable Use Compact Prompt.
  6. Open a small repository and begin a new, focused task.

Compact Prompt matters because an agent prompt contains more than your one-line request: it also contains tool definitions, instructions, file excerpts, shell output, and conversation history. Local inference has finite memory and lower throughput than a hosted frontier model, so reducing repeated scaffolding gives it more usable context and usually improves responsiveness. If a task becomes sprawling, start a new task instead of asking the model to remember every earlier detour.

How to Use LM Studio Instead of Ollama

LM Studio is a good alternative when you want a desktop interface for finding, downloading, loading, and serving local models. Download a model in its Discover view, load it, then start the server from its Developer tab. Its default local endpoint is http://localhost:1234; in Cline, choose LM Studio as the provider, retain that base URL, and select the loaded model.

The architectural distinction is minor: Cline remains the agent harness, while Ollama or LM Studio performs local inference. Choose the runtime that makes model management easiest for your environment. Do not run both unless you have a reason to compare them—the extra server is another moving part and can compete for the same CPU, GPU, and memory.

How to Verify That the Setup Is Actually Local

Use a harmless, observable task first: “Read the repository structure and describe the entry point. Do not edit files or run commands.” The model should respond after Cline reads local files and sends the context to the loopback model server. Then try: “Propose a plan to add a unit test. Do not make changes yet.” This tests repository reading, planning, and context handling without granting write access.

  • Confirm the provider is Ollama or LM Studio—not a hosted API provider—and that the endpoint is a localhost or 127.0.0.1 address.
  • Disconnect the machine from the internet after the extension, runtime, and model are installed; ordinary local inference should still work.
  • Do not enable web-search tools, remote MCP servers, cloud storage connectors, or remote development sessions if your requirement is no data leaving the machine.
  • Review terminal commands before approving them. Local inference does not constrain what an approved shell command can do.
  • Inspect model-runtime logs and your operating system’s network monitor if you need an auditable privacy posture.

One important nuance: a local model configuration prevents normal model prompts from going to a cloud inference endpoint, but it does not turn the operating system into an air-gapped environment. Installing extensions and models requires downloads; dependency commands can contact registries; git fetch and git push contact remotes; and a browser-capable agent can navigate to external sites. Treat “local” as a data-flow policy you verify across the entire toolchain, not a checkbox beside a model name.

Why Is My Local Coding Assistant Slow or Forgetful?

Slowness usually comes from an oversized model, a long context window, CPU fallback, memory pressure, or verbose tool output. First reduce scope: ask for one bug investigation or one small refactor, exclude dependency directories and build output from context, and restart the task when its history has become irrelevant. Next, use a smaller or more aggressively quantized model. Faster generation makes the whole agent loop faster because each tool call often requires another model turn.

Forgetfulness is usually a context problem, not a personality defect. Coding agents must fit instructions, repository material, tool descriptions, command results, and chat history into the model’s context window. Give the assistant a crisp goal, acceptance criteria, relevant files, and constraints. Keep durable project conventions in repository documentation or agent rules rather than relying on a long conversation to preserve them.

What Should You Let a Local Coding Agent Do?

Begin with read-only analysis, then permit edits in a branch, then allow selected test commands. Keep high-impact operations—deleting files, modifying infrastructure, publishing packages, changing credentials, or pushing commits—manual. The right approval policy is based on blast radius, not whether the model is local. A local agent can be excellent at repetitive multi-file work and still be wrong about a migration, a security boundary, or a command’s side effects.

For a practical daily workflow, ask it to explain the codebase, locate likely change points, write a plan, implement the smallest coherent patch, run the narrowest relevant test, and show the diff. Review that diff as you would a colleague’s pull request. This retains the speed advantage of an agent while preserving engineering accountability.

Use Cline When You Want the Local Model to Act on Code

Cline is an open-source coding-agent runtime and set of applications for developers who want an agent in an editor, terminal, desktop app, or embedded workflow. Its local-provider support is directly relevant here: it can use Ollama, LM Studio, or Atomic Chat, while giving the agent tools to read and edit project files and run commands with approvals. That makes it the layer between a raw local model server and a usable coding workflow.

For this fully local setup, you can bring your own local runtime and model weights, so there is no per-request model charge beyond your hardware and electricity. Cline also offers optional cloud access: pay-as-you-go credits through its Cline provider and ClinePass at $9.99 per month, but neither is required for the local route. Explore the editor, terminal, desktop, and SDK options at https://cline.bot.

Sources & citations

  1. [1]Cline documentation: Local models
  2. [2]Cline documentation: Installing Cline
  3. [3]Cline documentation: Cline overview
  4. [4]Ollama documentation: Quickstart
  5. [5]Ollama documentation: API introduction
  6. [6]Cline documentation: ClinePass pricing
  7. [7]Cline documentation: usage-billing