LM Studio: local AI with a window instead of a terminal
Use LM Studio to find, run and serve open models on your own computer — then fix the two settings that quietly decide whether it works: context length and who can reach the server.
LM Studio is a free desktop app for running open-weight language models on your own computer. You search for a model inside the app, it tells you whether the model fits your machine, you download it, and you chat with it in a normal window. A switch on the Developer page turns the same models into a local API server that other tools can call as if it were OpenAI. LM Studio is free for personal use and, since its terms changed, for use at work too — no form or commercial licence needed.
If Ollama is local AI for people who like the terminal, LM Studio is local AI for people who would rather click. The traps are similar, though: the model can silently see less text than you think, and a server setting can expose it to more people than you meant. This note covers when to pick LM Studio, how to set it up, and the two settings to fix before you trust it with real work.
LM Studio or Ollama?
Both are free, both run models on your machine, and both give other tools an OpenAI-compatible address. The difference is how you work with them.

You can install both. They use different ports (1234 and 11434), so they do not collide — but each keeps its own copy of every model, so watch your disk.
Pick LM Studio if you want to compare models side by side before committing, if you share the machine with someone who will never open a terminal, or if you are on an Apple Silicon Mac: LM Studio runs models in Apple’s MLX format as well as the common GGUF format, and MLX versions often run faster on those machines. Stay with Ollama if your setup is scripts, containers or a server without a screen. When the GGUF is already a file and you want the flags on the command, use llama.cpp’s server on port 9931.
Set it up in four steps
- Install the app for macOS, Windows or Linux from the official site.
- Find a model in the search tab. Before downloading, look at the size and the memory hint LM Studio shows next to each file. A model that does not fit in your GPU memory (or system RAM on machines without a separate GPU) spills over and becomes painfully slow. Start with a small or mid-size model; you can always try a bigger one later.
- Load it and chat. Pick the model at the top of the Chat tab. Ask a question you know the answer to, to check the speed and the quality.
- Turn on the server if another tool should use it: open the Developer page and switch on the server, or run
lms server startfrom a terminal. By default it listens athttp://localhost:1234.
The lms command-line tool comes with the app and is worth learning even if you prefer the window, because it makes the important settings explicit:
lms get <model> # download a model
lms ls # models on disk
lms load <model> --estimate-only --context-length 16384 # memory needed, without loading
lms load <model> --context-length 16384 # load with a bigger context window
lms unload --all # free the memory
lms server start # start the local API server
The --estimate-only flag is the cheap way to find out whether a model and the context length you want will fit, before you wait for a large load to fail.
Fix 1: give the model enough context — in the place every load uses
The context length is how much text the model can see at once: your question, any document you attach, and the chat so far. LM Studio loads models with a modest default context length — often only a few thousand tokens — because a bigger window needs more memory. Paste a long report into a model loaded that way and the start of the report simply never reaches it. There is no error; you just get a confident answer about the part it saw.
The fix is easy, but where you change it matters. LM Studio can load the same model from three places: the Chat tab, the lms load command, and the API server when a tool asks for a model that is not loaded yet (LM Studio calls this just-in-time loading). If you raise the context only in the Chat tab’s load dialog and do not save it, that bigger window applies to that one load. The next time your editor plugin triggers a load through the API, the model comes up with its saved default again.

The quick test for any tool: send a long file and ask what its first line says. A wrong answer means the start never arrived.
So set it once as a per-model default: open My Models, click the gear icon next to the model, set the context length, and save. LM Studio’s docs say those defaults are used whenever the model is loaded anywhere in the app, including through lms load. Raise it only as far as your documents need. Doubling the context costs memory and speed, and a window bigger than your machine can hold pushes the model off the GPU.
Fix 2: decide who can reach the server
Out of the box, LM Studio’s server listens only on your own computer and does not ask for any password. That is fine as long as it stays on localhost: only programs on your machine can use it.
Two settings in the server settings change that picture:
- Serve on Local Network lets other devices on the same network use your models — handy for a laptop calling a desktop with a big GPU. It also means anyone else on that network can, too: on office Wi-Fi, in a café, or in a shared flat.
- Require Authentication makes every client send an API token, which you generate on the Developer page and pass as
Authorization: Bearer <token>.

The token is a password for your models. Keep it out of shared config files and repositories, and make a new one if it leaks.
The rule is simple: never turn on network serving without authentication, and never open port 1234 on your router or a cloud firewall. The same goes double if you use MCP tools (plug-ins that let a model read files or call services). LM Studio can let API clients use the MCP servers in your mcp.json, and because those may reach your files or private data, its docs only allow that option when authentication is switched on.
Connect your editor and scripts
Most tools that accept an “OpenAI-compatible” or “custom” provider work with LM Studio:
- Base URL:
http://localhost:1234/v1 - API key: your LM Studio token if authentication is on; otherwise any text the tool insists on
- Model: the exact identifier LM Studio shows for the loaded model
Test from a terminal before you blame the tool:
curl http://localhost:1234/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LM_API_TOKEN" \
-d '{"model": "<model-identifier>", "messages": [{"role": "user", "content": "Reply with one word: ready"}]}'
If the terminal works and the tool does not, the tool is almost always using a different model name or the wrong port. Open-source agents such as Cline can use LM Studio as their provider; our free AI coding plans board explains when that beats a hosted free tier. Give local models smaller jobs than you would give a hosted frontier model — one function, one section of a document — and see local models for private repos for deciding which tasks are worth keeping on the machine.
Common mistakes
- Judging a model on a long document with the default context. It never saw the beginning. Raise the per-model default, reload, and test again.
- Changing the context in the Chat tab only. The API’s on-demand load will not use it unless you saved it as the model’s default.
- Downloading the biggest file that the search shows. Check the memory hint first; a model that does not fit is slower than a smaller one that does.
- Turning on “Serve on Local Network” for a quick test and forgetting it. Pair it with Require Authentication, or switch it off again.
- Keeping every model you ever tried. Each one takes gigabytes. Delete the ones you stopped using from My Models.
Bottom line
LM Studio is the friendliest way to run open models on your own computer: search, check the fit, download, chat, and serve them to your other tools — free at home and at work. Before you rely on it, set the context length as a per-model default so every load uses it, and keep the server on localhost unless authentication is on. With those two settings right, it does what you installed it for: useful AI on data that stays on your machine.
Share