Topic 3 of 6 · 5 min read
Exploring models in LM Studio
Goal: Load a model in LM Studio with a chosen offload and context setting and start its local server.
LM Studio is a desktop app that lets you find, download and load models with visible settings, and then serve the loaded model as a local API.
Check yourself · 1 of 3
In LM Studio, what does the GPU offload setting control?
Why it matters
When you do not yet know which model or settings suit your task, seeing the controls beats guessing flags. LM Studio also shows how much memory a model needs before you load it, so you avoid loading something that will not fit.
How to do it
- Search and download. Use the model search. Results list the model family, parameter count and file variants (quantizations). Pick a file the app marks as likely to fit your memory. On a Mac, you can also choose MLX builds, which run on Apple silicon; elsewhere you use GGUF.
- Load with settings. Before loading, set:
- GPU offload, the number of layers placed on the GPU. Maximum offload is fastest if the model fits in VRAM. If it does not, lower it; the rest runs on the CPU and is slower.
- Context length, in tokens. Bigger windows use more memory. Match it to your task.
- Chat to test. Send a real prompt from your work, not "hello". Watch the speed shown after the reply.
- Start the server. In the developer view you can start the local server, which is OpenAI-compatible and defaults to port 1234. The
lmscommand-line tool does the same from a terminal (lms server start).
Then point a client at it:
curl http://localhost:1234/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "your-loaded-model", "messages": [{"role": "user", "content": "Say ok"}]}'
The model name must match the one you loaded. If it does not, the request fails or loads something else.
Before and after
Weak: downloading the largest quantization on a 16 GB laptop, loading it with default offload, and finding that the chat crawls and the fan screams.
Better: choose a smaller quantization the app says fits, set offload to maximum, check the speed on a real prompt, and only then raise the context length step by step.
What goes wrong
- Offload set too high for the VRAM. The load fails or the system starts swapping, which makes everything slow.
- App settings forgotten. A per-model setting you changed in the UI does not carry to a script that calls the server; the loaded configuration applies.
- Server left running. The server holds the model in memory until you stop it, so other apps may starve.
Examples
Load from the terminal
lms ls # list downloaded models
lms load qwen2.5-7b-instruct --gpu max --context-length 8192
lms server start
The same choices as the app's sliders, written so you can repeat them. Flags can change between versions, so check lms load --help.
Fixing a slow load
A 24 GB model on a 12 GB GPU is set to full offload and stalls. Lower the offload so the layers that fit stay on the GPU, or pick a smaller quantization. Compare the speed shown after a reply, not the first impression.
Key points
- Check the memory estimate before you load, and prefer a quantization the app says fits.
- GPU offload is the number of layers on the GPU: maximum when it fits, lower when it does not.
- On Apple silicon you can run MLX builds; on other machines models are GGUF files.
- The built-in server is OpenAI-compatible and defaults to port 1234; the client's model name must match the loaded one.
- Stop the server when you finish, since it keeps the model in memory.
Common mistakes
- Loading the largest file because bigger sounds better.
- Setting the context length to the maximum before measuring what the task needs.
- Calling the server with a model name that is not the one loaded.
- Leaving the server on with a big model loaded while other work needs the memory.
Check yourself · 2 of 3
You start LM Studio's server and want to test it. Which request target is right by default?
Check yourself · 3 of 3
A model loads with full offload but the chat is very slow and the system is swapping. What is the best next step?
Practice items, not counted towards your mastery.
Start here
- Ollama documentation (opens in a new tab)DocsFree
Install steps, the Modelfile format, context length and the local API in one place.
- LM Studio docs (opens in a new tab)DocsFree
How the desktop app downloads models, sets GPU offload and serves a local API.
- llama.cpp (opens in a new tab)ToolFree
The reference runtime for GGUF files: build options, llama-cli and llama-server flags.
More for this topic
- LM Studio local server (opens in a new tab)DocsFree
Starting the OpenAI-compatible server and calling it.