---
title: "Cline + LM Studio: Use OpenAI Compatible Provider"
aliases: [cline-lm-studio, lm-studio-cline-setup, cline-local-llm]
tags: [cline, lm-studio, local-llm, gotcha, ai-tools]
sources:
  - "daily/2026-04-30.md"
created: 2026-04-30
updated: 2026-04-30
---

# Cline + LM Studio: Use OpenAI Compatible Provider

Cline's native LM Studio provider uses `/api/v0/chat/completions`, which does not handle Cline's multi-part content-block message format. This causes a silent retry loop. The fix is to select the **OpenAI Compatible** provider pointing at `/v1/chat/completions` — same LM Studio server, different endpoint.

## Key Points

- Cline's built-in "LM Studio" provider uses `/api/v0/chat/completions` — does NOT support multi-part content blocks
- Symptom: Cline sends 3 identical requests, then times out silently — no error message
- Fix: use **OpenAI Compatible** provider in Cline settings → point to `http://localhost:1234/v1`
- Default model load context (4096 tokens) is too small for Cline's system prompts — load model at 32k or 128k context
- Cursor Free plan blocks custom model selection entirely — only "Auto" is available on free tier; LM Studio via Cline is the practical alternative

## Details

### The Silent Retry Loop

When configured with the native LM Studio provider, Cline's multi-part content blocks (used for tool results, images, complex system prompts) are sent in a format the `/api/v0` endpoint doesn't understand. The server returns an error or empty response; Cline retries 3 times silently, then fails with a timeout.

### Correct Cline Configuration

In Cline extension settings:
1. **Provider**: OpenAI Compatible (NOT "LM Studio")
2. **Base URL**: `http://localhost:1234/v1`
3. **API Key**: any non-empty string (LM Studio doesn't validate it)
4. **Model**: the model ID shown in LM Studio (e.g., `lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF`)

### Context Window Requirement

Cline's system prompt is large (several thousand tokens). Load models in LM Studio with:
- **Minimum**: 32,768 tokens context
- **Recommended**: 131,072 tokens (128k) for complex codebases

LM Studio UI: Settings → Context Length → set before loading the model.

### Cursor Free Plan Limitation

Cursor's free plan locks model selection to "Auto" — you cannot specify a local or custom model. This makes Cursor Free unsuitable for LM Studio integration. Cline (VS Code extension) has no such restriction.

### Endpoint Comparison

| Provider setting | Endpoint | Multi-part content | Works with Cline |
|-----------------|----------|--------------------|-----------------|
| LM Studio (native) | `/api/v0/chat/completions` | No | No |
| OpenAI Compatible | `/v1/chat/completions` | Yes | Yes |

## Related Concepts

- [[wiki/concepts/claude-code-plugin-marketplace]] — Claude Code plugin system for extending AI tool integrations
- [[wiki/claude-code/_index]] — Claude Code local LM Studio setup reference

## Sources

- [[daily/2026-04-30.md]] — Session 18:33, Cline silent retry loop with LM Studio native provider
