> For the complete documentation index, see [llms.txt](https://modelmesh.gitbook.io/cline-zhong-wen-ban-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://modelmesh.gitbook.io/cline-zhong-wen-ban-docs/lm-studio.md).

# LM Studio

### 🤖 Setting Up LM Studio with Cline <a href="#setting-up-lm-studio-with-cline" id="setting-up-lm-studio-with-cline"></a>

Run AI models locally using LM Studio with Cline.

#### 📋 Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* Windows, macOS, or Linux computer with AVX2 support
* Cline installed in VS Code

#### 🚀 Setup Steps <a href="#setup-steps" id="setup-steps"></a>

**1. Install LM Studio**

* Visit [lmstudio.ai](https://lmstudio.ai/)
* Download and install for your operating system

![](https://docs.cline.bot/~gitbook/image?url=https%3A%2F%2F3321249260-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff8Oh1Lcy6yWYq1caYESV%252Fuploads%252FRvFLNS5tw6DaSvy8zXTs%252Fimage.png%3Falt%3Dmedia%26token%3D2ed4ec25-6d07-4473-8651-9147d95e2ddc\&width=768\&dpr=4\&quality=100\&sign=29051378\&sv=2)

**2. Launch LM Studio**

* Open the installed application
* You'll see four tabs on the left: **Chat**, **Developer** (where you will start the server), **My Models** (where your downloaded models are stored), **Discover** (add new models)

![](https://docs.cline.bot/~gitbook/image?url=https%3A%2F%2F3321249260-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff8Oh1Lcy6yWYq1caYESV%252Fuploads%252FbSblxWvzuHLvMxJNM5M2%252Fimage.png%3Falt%3Dmedia%26token%3D9d75c1e0-dabb-4df1-85fc-273613583569\&width=768\&dpr=4\&quality=100\&sign=47537a1e\&sv=2)

**3. Download a Model**

* Browse the "Discover" page
* Select and download your preferred model
* Wait for download to complete

![](https://docs.cline.bot/~gitbook/image?url=https%3A%2F%2F3321249260-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff8Oh1Lcy6yWYq1caYESV%252Fuploads%252Fg9uhK6FRszeSiD0dhsrs%252Flm-studio-download-model.gif%3Falt%3Dmedia%26token%3Dce3559a3-6e71-4b02-a13a-accbfebb145d\&width=768\&dpr=4\&quality=100\&sign=57d2f15f\&sv=2)

**4. Start the Server**

* Navigate to the "Developer" tab
* Toggle the server switch to "Running"
* Note: The server will run at `http://localhost:1234`

![](https://docs.cline.bot/~gitbook/image?url=https%3A%2F%2F3321249260-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff8Oh1Lcy6yWYq1caYESV%252Fuploads%252FXrW4ISm1n2YUizKATv8s%252Flm-studio-starting-server.gif%3Falt%3Dmedia%26token%3D95b00607-954b-422b-a5d5-463d29619323\&width=768\&dpr=4\&quality=100\&sign=1cb44155\&sv=2)

**5. Configure Cline**

1. Open VS Code
2. Click Cline settings icon
3. Select "LM Studio" as API provider
4. Select your model from the available options

![](https://docs.cline.bot/~gitbook/image?url=https%3A%2F%2F3321249260-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff8Oh1Lcy6yWYq1caYESV%252Fuploads%252F1uiE7q2OruZAd3jx9Oi1%252Flm-studio-select-model-cline.gif%3Falt%3Dmedia%26token%3D87045a08-f6f0-4291-aefb-3b10dbc0f0e7\&width=768\&dpr=4\&quality=100\&sign=adfb72\&sv=2)

#### ⚠️ Important Notes <a href="#important-notes" id="important-notes"></a>

* Start LM Studio before using with Cline
* Keep LM Studio running in background
* First model download may take several minutes depending on size
* Models are stored locally after download

#### 🔧 Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

1. If Cline can't connect to LM Studio:
2. Verify LM Studio server is running (check Developer tab)
3. Ensure a model is loaded
4. Check your system meets hardware requirements


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://modelmesh.gitbook.io/cline-zhong-wen-ban-docs/lm-studio.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
