> For the complete documentation index, see [llms.txt](https://www.techwithtyler.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.techwithtyler.dev/ai/running-llms-locally/lm-studio.md).

# LM Studio

## Overview

* LM Studio provides a way to run LLMs locally on your machine
* It's similar to [Ollama](/ai/running-llms-locally/ollama.md)but provides a GUI interface making it more user-friendly and also similar in style to ChatGPT

***

## Installation

{% code overflow="wrap" %}

```bash
brew install lm-studio
```

{% endcode %}

***

## Running LM Studio

{% hint style="warning" %}
These models are loaded into your system's memory (RAM) when in `READY` state so be cognizant of usage
{% endhint %}

* Open the app and hit `CMD + L` to select a model to use
* Then wait for the model to load i.e., `READY` state

<figure><img src="/files/0WvZ4N1lnUZq7ZA7ohYh" alt=""><figcaption></figcaption></figure>

* Click the `Eject` button (seen above) to unload the model from memory

***

## Discovering and Downloading Models

* Models are downloaded from [Hugging Face](https://huggingface.co/)
* Models are downloaded here `~/.lmstudio/models/`
* Open the app and hit `CMD + SHIFT + M`&#x20;

<figure><img src="/files/xODlVCBPWpIgbG70n7ce" alt=""><figcaption></figcaption></figure>

* By selecting the below option, we can ensure models will fit on our device (based on memory)

<figure><img src="/files/uhjl8OQaLvR5s5KleIGI" alt=""><figcaption></figcaption></figure>

***

## Integrating with VS Code

### Start LM Studio Server

<figure><img src="/files/zizaSdjYLmrxbeedFO3b" alt=""><figcaption></figcaption></figure>

***

### Install VS Code Extension, Continue

* The most straightforward way I've found is by installing the [VS Code extension, continue](https://marketplace.visualstudio.com/items?itemName=Continue.continue)&#x20;
* While this is a 3rd-party coding assistant, the extension is open-source and we can entirely leverage our local LLMs without signing up for this service

<figure><img src="/files/0uCX0bRnte7VPyGm5bVO" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/XkKRXL3okC0M0tbbinMv" alt=""><figcaption></figcaption></figure>

* Open up a file e.g. `main.tf` and hit `CTRL + I`&#x20;
* This opens the chat window on the side where you can type in what you want the LLM to write for you

<figure><img src="/files/qyktMtT8SIXUp76VLGVo" alt=""><figcaption></figcaption></figure>
