Cline with a local model: setup for Ollama, LM Studio or llama.cpp
Cline is an open-source (Apache-2.0) coding agent that runs as an extension in VS Code, Cursor, Windsurf and JetBrains IDEs, with a separate terminal CLI. It has built-in Ollama and LM Studio providers and a Compact Prompt option for local inference, which suits people who want an agent inside their editor.
At a glance
- Type
- vscode-extension, cli
- Licence
- Apache-2.0
- Latest release
- 4.1.25 (extension); 3.0.73 (CLI) (2026-10-17)
- Status
- Maintained
- Local backends
- ollama, lmstudio
- Needs native tool calling
- Not verified
- MCP support
- Yes
- Recommended minimum context
- 32,000 tokens
- Start-up prompt
- Not measured
- GitHub stars
- 67.6k (2026-10-19)
How to set it up with a local model
Pick your backend. Each command has its own Copy button. Where a step uses an example model, swap in the one you run; the table below lists the ones that fit your machine.
Install it in VS Code: Extensions view → search "Cline" → Install.
Start Ollama with a 32k context window (or set the context slider in the Ollama app's settings).
OLLAMA_CONTEXT_LENGTH=32768 ollama serveIn a second terminal, pull a tool-capable coding model (replace qwen3-coder:30b with any model you prefer).
ollama pull qwen3-coder:30bIn Cline Settings, set API Provider to Ollama and Base URL to http://localhost:11434.
Select your model from the dropdown, or type it (e.g. qwen3-coder:30b).
Set Context Window to at least 32K tokens in the same settings panel.
Enable Use Compact Prompt under Settings → Features.
Other ways to install
JetBrains: Settings → Plugins → Marketplace → search "Cline" → Install
CLI (npm, Node.js 20+)
npm install -g clineCheck that it works
Start a new task asking Cline to list the files in your workspace. If the connection fails, check that the server answers at its base URL and that a model is loaded; in the CLI, `cline config` shows the current configuration.
cline configWhich local models fit, by machine
Checked by this site's engine at the context Cline needs, with 32 GB of system RAM for MoE offload. A Mac counts three quarters of unified memory as usable.
| Machine | Model | Quant | Context | Fit | Ollama |
|---|---|---|---|---|---|
| 12 GB GPU | Qwen 3.5 9B | Q4_K_M | 32,768 | Comfortable (7.4 GB of 12 GB) | qwen3.5:9b |
| Qwen 3.6 35B-A3B | Q4_K_M | 32,768 | With CPU offload (MoE) (22.7 GB of 12 GB) | qwen3.6:35b-a3b | |
| 16 GB GPU | Qwen 3.5 9B | Q4_K_M | 32,768 | Comfortable (7.4 GB of 16 GB) | qwen3.5:9b |
| Qwen 3.6 35B-A3B | Q4_K_M | 32,768 | With CPU offload (MoE) (22.7 GB of 16 GB) | qwen3.6:35b-a3b | |
| 24 GB GPU | Qwen3.8 27B | Q4_K_M | 32,768 | Comfortable (19.9 GB of 24 GB) | qwen3.8:27b |
| Qwen 3.6 27B | Q4_K_M | 32,768 | Comfortable (19.9 GB of 24 GB) | qwen3.6:27b | |
| Devstral Small 2 24B | Q4_K_M | 32,768 | Comfortable (20.7 GB of 24 GB) | devstral-small-2:24b | |
| Qwen 3.6 35B-A3B | Q4_K_M | 65,536 | Tight (23.3 GB of 24 GB) | qwen3.6:35b-a3b | |
| 32 GB GPU | Qwen3.8 27B | Q4_K_M | 32,768 | Comfortable (19.9 GB of 32 GB) | qwen3.8:27b |
| Qwen 3.6 27B | Q4_K_M | 32,768 | Comfortable (19.9 GB of 32 GB) | qwen3.6:27b | |
| Devstral Small 2 24B | Q4_K_M | 32,768 | Comfortable (20.7 GB of 32 GB) | devstral-small-2:24b | |
| Qwen 3.6 35B-A3B | Q4_K_M | 65,536 | Comfortable (23.3 GB of 32 GB) | qwen3.6:35b-a3b | |
| Qwen3-Coder 30B-A3B (MoE) | Q4_K_M | 65,536 | Comfortable (25.7 GB of 32 GB) | qwen3-coder:30b | |
| Mac, 64 GB | Qwen 3.6 35B-A3B | Q8_0 | 131,072 | Comfortable (40.7 GB of 48 GB) | — |
Your exact machine: filter the matrix or check any model in the analyzer.
Common problems with local models
- Ollama's Cline guide asks for a context window of at least 32K tokens for coding.
- Cline's local-model guide recommends Use Compact Prompt, focused tasks, and starting a new task when the context gets too large.
- LM Studio must have a model loaded and its server running before Cline can list models.
Other coding agents
How they rank for local models: the best agent harness for local LLMs.
- OpenCode
- Qwen Code
- Codex CLI
- Kilo Code
- Aider
- Pi coding agent
- Claude Code
- Crush
- Goose
- OpenHands
- Zed agent
- GitHub Copilot BYOK
- Continue (discontinued)
- Roo Code (discontinued)
- Void (discontinued)
Sources (8), checked 2026-10-20
- docs.cline.bot/running-models-locally/overview
- docs.cline.bot/getting-started/installing-cline
- docs.cline.bot/provider-config/openai-compatible
- docs.cline.bot/cli/cli-reference
- docs.ollama.com/integrations/cline
- docs.ollama.com/context-length
- lmstudio.ai/docs/cli/local-models/load
- github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md