Skip to main content
This guide shows how to connect Cline to local large language models (LLMs) so you can run models on your own machine instead of relying on hosted services. Running local LLMs is useful for experimenting with custom models from sources like Hugging Face, reducing API costs, and keeping data on-premises for privacy or compliance. We cover two common local runtimes: LM Studio and Ollama. Each section shows the configuration steps in Cline, example requests, and troubleshooting tips.

LM Studio — load and call a local model

LM Studio provides a GUI for running LLMs locally and exposes a simple HTTP API. In Cline you select Local LLMs as the provider and point the app at LM Studio’s base URL. Steps to use LM Studio with Cline:
  1. Install and open LM Studio on your machine.
  2. Load the model you want to run (for example, Gemma 3 27B — the UI shows context length, GPU settings, and a Load Model button).
  3. Start LM Studio’s server and copy the server Base URL into Cline’s Local LLMs settings.
  4. Start Cline’s developer server (recommended) so you can view logs while testing requests.
A dark-mode app window (LM Studio) with a modal for loading the "Gemma 3 27B Instruct QAT" model, showing context length and GPU settings and a highlighted "Load Model" button. The main pane shows a purple robot icon with the text "No chat selected" and a "Create a New Chat" button.
Typical LM Studio connection details:
Base URL:
http://127.0.0.1:1234

Example model IDs:
meta-llama-3-1-8b-instruct
gemma-3-27b-it-qat
Example local workflow in Cline
  • User prompt:
Create a "Hello World" script in Python.
  • Cline sends the request to the LM Studio API and returns a proposed file. Example result saved by Cline:
# hello.py
print("Hello, world!")
Because the model runs on your machine, no external API calls are involved. Why run models locally?
  • Experiment with custom checkpoints from Hugging Face or other model repos.
  • Reduce development costs by avoiding paid hosted APIs while prototyping.
  • Keep source code and prompts on-premises for privacy and compliance.
Running LLMs locally is a good option when organizational policies restrict sending code or data to hosted providers (like OpenAI or Anthropic). It also gives you full control over model versions and runtime settings.

Ollama — another local runtime option

Ollama is a popular local LLM runtime that exposes a server you can point Cline to. When you choose Ollama as the provider in Cline’s API settings, the UI will list models available in your local Ollama installation. Model behavior varies, so try a few models to find the best fit for Cline’s edit-and-suggest workflows. Below is an example showing a model selected in Cline (e.g., llama3.2:1b) and using it to apply an edit to an existing file.
A dark-themed app screenshot showing a left sidebar with recent chat history and a settings pane. The settings show API configuration for "Ollama" with the model set to "llama3.2:1b" and other fields like base URL and request timeout.
Example workflow with Ollama:
  1. Switch Cline’s API provider to Ollama and choose a model (for example, llama3.2:1b).
  2. Open hello.py in the editor or add it to the model context.
  3. Issue an edit request, for example:
User request:
Change "Hello, world!" to "Hello, Jeremy"
Cline shows a diff-style suggestion:
1- print("Hello, world!")
1+ print("Hello, Jeremy!")
After accepting and saving the suggestion, the file becomes:
# hello.py
print("Hello, Jeremy!")
Because the Ollama server runs locally, no outbound API cost is incurred. Quick comparison: LM Studio vs Ollama
FeatureLM StudioOllama
Access methodGUI with built-in HTTP APICLI/runtime with HTTP API
Best forVisual model management, GPU settingsLightweight local serving, model management via CLI
ProsEasy model load/UI, model details visibleQuick to deploy, integrates with local tooling
ConsGUI overhead, may require more resourcesModel compatibility varies, fewer GUI controls
Notes and troubleshooting
  • Model output format: Some local models return slightly different response formats; if Cline’s change suggestions look incorrect, try another model or refine the prompt.
  • Resource limits: Larger models require adequate GPU/CPU and memory. Monitor LM Studio/Ollama logs and system resources.
  • Logs: Run Cline in developer mode to inspect request and response logs for debugging.
  • Model compatibility: If edits are inconsistent, test different models (or smaller/larger variants) to find one that produces coherent edit suggestions.
Common issues and fixes
ProblemLikely causeFix
Cline shows no modelsIncorrect base URL or service not runningVerify LM Studio/Ollama server is running and use the correct base URL
Timeouts or slow responsesModel size or insufficient hardwareIncrease timeout in Cline settings, use a smaller model, or upgrade hardware
Incorrect suggestion formatModel response doesn’t match expected schemaTry a different model or add clearer instructions in the prompt
Running large models locally can consume significant GPU/CPU and memory. Ensure your machine meets the recommended requirements for the model you plan to run, and monitor logs and system resources to avoid crashes.

Summary

Connecting Cline to local LLMs (LM Studio, Ollama, etc.) gives you the flexibility to:
  • Experiment with custom or community models,
  • Reduce or eliminate API costs during development,
  • Keep sensitive code and data within your environment.
Set the API provider in Cline, point to the local base URL, choose a model, and invoke the model to create or edit files as you would with a hosted service — the main difference is that everything runs on your machine. Links and references

Watch Video