LM Studio Tutorial: Run a Local AI Model in 6 Steps
Most people who try to run an AI model on their own computer get stuck in the same two places: choosing which file to download, and figuring out why the thing is painfully slow once it loads. This LM Studio tutorial fixes both. You get a desktop window instead of a terminal, a model that actually fits your hardware, and the settings explained in plain English.
Six steps, start to finish: install, choose a model, load it, chat, tune it, and — if you want — turn it into a local API your own code can call.
What LM Studio is in one minute
LM Studio is a free desktop app for Windows, macOS, and Linux that downloads AI language models and runs them entirely on your machine. Nothing you type leaves your computer once the model is on disk. It wraps two things in a normal-looking app:
- A model browser that searches public model repositories (mostly Hugging Face) and downloads the file for you.
- An inference engine — the code that loads those weights and generates text. It uses llama.cpp for GGUF models, and Apple's MLX engine on Apple Silicon Macs.
The practical difference versus the command-line route: LM Studio shows you sliders, a chat window, and a warning when a model is too big for your machine. If you would rather type commands and script everything, my Ollama beginner's guide covers that path instead. They happily coexist — I'd keep both installed, because a graphical model browser is faster for browsing and a terminal is faster for repeat work.
New to the whole idea of local models? Start with my broader overview of running an AI chatbot locally, then come back here for the app itself.
Step 1: Install LM Studio
Download the installer from the official site, lmstudio.ai. There is no account to create and no API key.
- Windows: run the installer. You need a 64-bit machine; builds exist for both Intel/AMD and ARM processors.
- macOS: drag the app to Applications. Apple Silicon (M-series) is the supported target and uses the GPU automatically.
- Linux: download the AppImage, mark it executable, and run it.
Before you open it, know roughly how much memory you have to play with. On a dedicated graphics card, the number that matters is VRAM — the card's own memory, usually 8 GB, 12 GB, or 16 GB. On an Apple Silicon Mac or a laptop with integrated graphics, the GPU shares system RAM instead. Write that number down; the next step depends on it.
LM Studio also has an interface-mode switch, labeled something like User, Power User, and Developer. I'd leave it on the simplest mode for now; the advanced settings in Step 5 live in the higher modes.
Step 2: Pick a model that fits (where most people go wrong)
Open the search or Discover tab and you will see hundreds of models. The app shows a compatibility estimate next to each one — green for "this should fit," amber or red for "this will struggle." Trust it as a first filter.
How to read a model name
A typical GGUF download is named something like Llama-3.2-3B-Instruct-Q4_K_M.gguf. Each part tells you something:
| Part | Meaning | Why you care |
|---|---|---|
Llama-3.2 |
Model family and version | Different families have different strengths |
3B |
3 billion parameters | Bigger is smarter and slower |
Instruct |
Tuned to follow instructions | Always pick Instruct or Chat for conversation |
Q4_K_M |
4-bit quantization | Smaller file, slight quality loss |
Quantization is the key idea. The raw model stores each number at high precision; quantizing rounds those numbers down so the file shrinks. Q4_K_M is the usual sweet spot, Q5 and Q6 are a little better and a little bigger, and Q8 is near-lossless but rarely worth the memory on consumer hardware.
Rough sizing rule: a 4-bit model needs somewhere around 60-70% of its parameter count in gigabytes, plus headroom for context. A 7B model at Q4 lands near 4-5 GB. If you have 8 GB of VRAM, a 7B or 8B model at Q4 is comfortable. With 16 GB you can reach into the 13B-14B range. Under 8 GB, stay at 3B-4B and you will be much happier.
Sensible first downloads
- A 3B or 4B instruct model for fast, general chat on modest hardware.
- A 7B or 8B instruct model if you have 8 GB or more of VRAM — the best balance of quality and speed for most people.
- A small coding-tuned model if code is your main use. General models are weaker at code than models trained for it.
Pick one. I'd resist queuing up five downloads before you have chatted once.
Step 3: Load the model and send your first message
Go to the chat tab and select your downloaded model from the loader at the top. Loading reads the file into memory, which takes a few seconds to a minute depending on size and disk speed.
Then type something. My idea of a good first test is a prompt with a clear right answer and a clear format, like: "Explain what quantization means in two sentences, then give one analogy." You learn three things at once — whether the model follows instructions, how fast it generates, and whether it rambles.
Watch the tokens-per-second readout after each reply. Above roughly 15 tokens per second reads comfortably, like a person typing quickly. Below 5, you will feel it.
Step 4: The LM Studio settings that actually matter
Most sliders can stay at their defaults forever. These four cannot.
GPU offload (layers). A model is made of layers, and each one can run on your GPU or your CPU. GPU layers are far faster. Push this as high as it will go without running out of video memory. If a model fails to load or your machine stutters, bring it down a few layers. Maximum offload with a model that only just fits is the single most common cause of crashes.
Context length. How much conversation the model can see at once, in tokens (roughly three-quarters of a word each). Longer context eats memory fast. I'd start at 4,096 or 8,192 and raise it only when you are pasting long documents.
Temperature. Randomness. Around 0.7 is a sane conversational default. Drop to 0.1-0.3 for factual answers or code, and push toward 1.0 for brainstorming. If a model keeps going off the rails, lower this before you blame the model.
System prompt. The standing instruction the model sees before every message. This is the highest-leverage box in the whole app, and it is usually empty. I build chatbots with persistent memory, speech recognition and lip-synced animated characters, and the system prompt still does more heavy lifting than almost anything else. Something as plain as "You are a concise technical assistant. Answer in under 150 words unless asked for detail. Say you do not know rather than guessing." changes the character of every reply that follows.
LM Studio lets you save a model plus its settings and system prompt as a preset. Do that once you find a combination you like, so you are not rebuilding it from memory next week.
Step 5: Turn LM Studio into a local API server
This is the feature that makes LM Studio more than a chat toy. In the developer or local-server tab, load a model and start the server. It then listens on your own machine — port 1234 by default — and speaks the same request format as the OpenAI API, with endpoints like /v1/chat/completions and /v1/models.
Why that matters: most AI example code and many desktop tools already know how to talk to that format. Point them at http://localhost:1234/v1, give any placeholder string as the API key, and set the model name to the one you have loaded. Existing scripts generally work with a two-line change and no cloud bill — and that is the quickest way I know to prototype without signing up for anything. There is also a command-line companion (lms) for loading and unloading models from scripts.
Step 6: Housekeeping
Model files are big, and they add up quietly. A few habits that save pain later:
- Know where downloads live. Point the models-folder setting at a drive with room to spare, ideally an SSD, before you download much.
- Delete what you do not use. Two or three keepers beat a graveyard of experiments.
- Eject models you are finished with. Unloading frees memory immediately, which matters if you also game or run other GPU work.
- Update the app occasionally. Engine updates bring real speed improvements, and newer model formats sometimes need a newer runtime.
Common LM Studio problems and how to fix them
- The model fails to load, or the app closes abruptly. Almost always memory. Lower GPU offload layers, reduce context length, or pick a smaller quantization.
- Painfully slow, a word at a time. The model is running on your CPU. Raise GPU offload; if it will not go higher, the model is too big for your card.
- Replies cut off mid-sentence. Raise the maximum tokens setting for the reply, or ask for a shorter answer.
- The model repeats itself or loops. Lower the temperature a little and start a fresh chat. Long conversations near the context limit also cause this, because the earliest messages fall out of view.
- It answers a completely different question. Check that you downloaded an Instruct or Chat variant. Base models continue text rather than answering it.
- A download stalls. Cancel and restart it. Partial downloads resume; a stuck one rarely unsticks itself.
- Nothing responds on port 1234. Confirm the server is started and a model is loaded. The server runs happily with no model, and then every request fails.
Frequently Asked Questions
Is LM Studio free?
Yes — the app is free to download and use, with no account required. The company has also stated it is free for work use; if you are rolling it out across a business, read the licensing page on their site for the current terms.
Is LM Studio better than Ollama?
They solve the same problem with different ergonomics. LM Studio gives you a model browser, sliders, and a chat window, which makes it the better starting point for most people. Ollama is a command-line tool and a background service, better for scripting, servers, and automation. Both run GGUF models and both expose a local API.
Does LM Studio need a graphics card?
No. It runs on CPU alone, just slower — expect a few tokens per second on a small model. A GPU with 8 GB or more of VRAM, or an Apple Silicon Mac with plenty of unified memory, transforms the experience.
Does LM Studio send my chats anywhere?
Your conversations are processed locally by the model on your machine. The app does use the internet to search for and download models and to check for updates, so it is not air-gapped out of the box — but once a model is downloaded you can chat with the network switched off entirely.
Can LM Studio read my own documents?
Yes, you can attach files to a chat and ask questions about them. I'd keep documents short to start: everything you attach competes with the conversation for the same context window, and a long PDF can fill it on its own.
Where to go from here
My honest summary of this LM Studio tutorial: install it, download one model that comfortably fits your memory, write a real system prompt, and get the GPU offload right. Those four decisions account for nearly all of the difference between "this is impressive" and "this is unusable."
Once a local model feels normal, the interesting work starts. Flip on the local server, point a small script at http://localhost:1234/v1, and build something that runs entirely on your own hardware — a notes summarizer, a drafting helper, whatever you need. I don't chase every AI trend; I build things I'd actually want to use myself, and that is where a downloaded model stops being a demo and starts being a tool.