# Set up LM Studio on Windows

This guide walks you through the main steps of setting up [LM Studio](https://lmstudio.ai/) for [use in GPT for Word](https://autosheet.com/docs/gpt-for-word/setup/manage-models/connect-to-api-endpoints) on Windows.

This guide assumes that you use GPT for Word on the same machine that hosts LM Studio.

**Prerequisites**

- [System requirements](https://lmstudio.ai/docs/app/system-requirements)

- Windows user account with administrator privileges

- Installed software:

  - [curl](https://curl.se/windows/) (ships with Windows)
  - [PowerShell 7](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows)

To set up LM Studio on Windows:

1. [Install LM Studio and download a model.](https://autosheet.com/docs/gpt-for-word/setup/manage-models/connect-to-api-endpoints/set-up-lm-studio-on-windows#install-lm-studio-and-download-a-model)
2. [Start and configure the LM Studio server.](https://autosheet.com/docs/gpt-for-word/setup/manage-models/connect-to-api-endpoints/set-up-lm-studio-on-windows#start-and-configure-the-lm-studio-server)

## Install LM Studio and download a model

1. Download and run the [Windows installer](https://lmstudio.ai/download). Follow the on-screen instructions to complete the installation.

   The installer sets LM Studio to start automatically as a background service on system boot.

2. Run LM Studio.

3. On the welcome screen, click **Skip**.

4. In LM Studio, in the sidebar, select **Discover**.

5. Find and select the model you want to use, and click **Download**. For example, to get started with a small model, select [Llama 3.2 3B](https://huggingface.co/hugging-quants/Llama-3.2-3B-Instruct-Q8_0-GGUF).

   ![Selecting a model to download in LM Studio](https://autosheet.com/docs/article-images/servers/lm-studio-model-download.png)

   After the download completes, the model is available for prompting in LM Studio.

You have installed LM Studio and downloaded your first model. For more information about working with models, see the [LM Studio documentation](https://lmstudio.ai/docs/app/basics).

## Start and configure the LM Studio server

1. In LM Studio, in the sidebar, select **Developer**.

2. Click the **Status** toggle to change the status from **Stopped** to **Running**. You have started the LM Studio server.

   ![Starting the LM Studio server](https://autosheet.com/docs/article-images/servers/lm-studio-server-start.png)

3. Click **Settings**.

   ![Open LM Studio server settings](https://autosheet.com/docs/article-images/servers/lm-studio-server-settings.png)

4. Click the **Enable CORS** toggle to enable the setting.

   ![Enable CORS for the LM Studio server](https://autosheet.com/docs/article-images/servers/lm-studio-server-settings-cors.png)

   > **Info**
   >
   > By default, the LM Studio server only accepts [same-origin requests](https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Same-origin_policy). Since GPT for Word always has a different origin from the LM Studio server, you must enable [cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS) for the server.

5. To verify that the `/v1/models` endpoint of the LM Studio server works, open <http://127.0.0.1:1234/v1/models>.

   GPT for Word uses the endpoint to fetch a list of models installed on the server. If the endpoint works, the server returns a JSON object with a `data` property listing all currently installed models:

   ![LM Studio /v1/models endpoint over HTTP in the browser](https://autosheet.com/docs/article-images/servers/lm-studio-models-endpoint-browser-http.png)

You have started and configured the LM Studio server.

> **What's next**
>
> You have completed the setup required to access LM Studio from GPT for Word on the same machine. You can now set `http://127.0.0.1:1234` as the [endpoint URL in GPT for Word](https://autosheet.com/docs/gpt-for-word/setup/manage-models/connect-to-api-endpoints#set-up-an-api-endpoint).
