How to Use LM Studio to Run Local AI Models: A Complete Guide
LM Studio is a desktop application that lets you download, run, and chat with large language models entirely on your own computer. In this tutorial you will learn how to install LM Studio, download a model that fits your hardware, run a local chat, and expose an OpenAI-compatible server that any app can call.
What Is LM Studio?
LM Studio wraps local inference engines behind a friendly graphical interface. It handles model discovery, quantization selection, GPU offloading, and chat templates, so you do not need to touch the command line. Because everything runs locally, your prompts and data never leave your machine.
Step 1: Install LM Studio
Download the installer for Windows, macOS, or Linux from the LM Studio website and run it. On first launch the app asks where to store models; choose a drive with plenty of free space, since a single model can be several gigabytes.
Step 2: Find and Download a Model
Click the magnifying glass icon in LM Studio to open the model search. Filter by model family and check the compatibility badge the app shows for your hardware. Prefer a quantized build (for example a 4-bit quantization) when memory is limited, and a larger quantization when you have a powerful GPU and want higher quality.
- Open the Discover tab.
- Search for a model family you want to try.
- Read the size and quantization labels.
- Click Download and wait for it to finish.
Step 3: Load the Model and Chat
Switch to the chat tab in LM Studio, select your downloaded model from the dropdown, and wait for it to load. Configure GPU offload so as many layers as possible run on your graphics card; the app shows estimated memory usage and warns you if the configuration will not fit. Then type a message and start chatting.
Step 4: Tune Inference Settings
Open the settings panel in LM Studio to adjust temperature, top-p, repetition penalty, and context length. Lower temperature produces more deterministic answers for coding and factual work, while a higher value encourages creative writing. Increasing context length lets the model remember more of the conversation but consumes more memory.
Step 5: Serve a Local API
Go to the developer tab in LM Studio and start the local server. It exposes an OpenAI-compatible endpoint on localhost, which means existing libraries that speak the OpenAI API can point at your machine by changing only the base URL. This is the fastest way to give a local model to scripts, agents, or IDE extensions.
- Start the local server on the default port.
- Copy the base URL and the placeholder API key.
- Point your SDK at that base URL.
- Send a chat completion request to confirm it works.
Step 6: Manage Performance and Storage
If generation feels slow, offload more layers to the GPU, reduce the context length, or switch to a smaller quantization. If you run out of disk space, delete models you no longer use from the LM Studio library. Keeping only two or three well-chosen models usually beats hoarding dozens.
Best Practices
- Match model size to available VRAM before downloading.
- Keep a small fast model for quick tasks and a larger one for hard ones.
- Use the local server instead of copy-pasting text between apps.
- Back up your downloaded models if bandwidth is limited.
Conclusion
LM Studio turns your laptop into a private AI workstation in a few clicks. Install it, download a model that fits your hardware, tune the settings, and start the built-in server. You then have a free, offline, OpenAI-compatible endpoint for every experiment you want to run.
