LM Studio headless server: lms, llmster and the local API (Linux, Windows, Mac)
Before you start
- 19 min read
- 27 to run in terminal
- 3 file contents
Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#
LM Studio can run without its window: a headless background service called llmster, driven by the lms command, serves your local models over an OpenAI-compatible API on port 1234, so your own scripts and apps can use them with no screen and no prompt leaving your machine.
Logo: the official LM Studio brand kit (lmstudio.ai/brand)
LM Studio is a desktop app for downloading and chatting with open models. Its maker also ships llmster, the same engine packaged as a daemon for Linux boxes, GPU rigs and machines where a GUI is not practical. This guide shows the headless route: install llmster, download a model, start the server, check the API, decide who may reach it, and keep it running after a reboot.
| Current version | LM Studio 0.4.27, Build 2, released October 2026 (changelog). The lms CLI ships with it |
| Time needed | About 30 minutes (our estimate; the model download time depends on the model) |
| Size on disk | Not documented for llmster; it depends on the models you download |
| Hardware | The docs recommend 16 GB+ RAM on Mac and Windows; Intel Macs are not supported; Windows x64 needs AVX2 |
| Ports | 1234 by default; --port changes it; the server listens on 127.0.0.1 unless you set --bind |
| Licence | The app is proprietary (personal and internal business use). The lms CLI is MIT |
| Official docs | lmstudio.ai/docs, read October 2026 |
At a glance:
- What you install: llmster (the headless daemon) and
lms(the command line). The desktop app is optional. - Where it listens:
http://localhost:1234by default. Other machines reach it only if you bind it to the network on purpose. - Which API: OpenAI-compatible at
/v1, plus LM Studio's native/api/v1and an Anthropic-compatible/v1/messages. - Models: downloaded with
lms get, loaded withlms loador on demand (JIT). JIT-loaded models unload after 60 minutes idle by default. - Platforms: Linux, Windows (PowerShell) and Mac (Terminal) all have an official llmster install command. Intel Macs are not supported by the app; llmster on Intel Macs is not documented.
- Not documented: a Docker image, token creation from the command line, TLS on the LM Studio server, llmster-only system requirements.
How it fits together#
Your app sends one request to the port. llmster checks the token if you turned that on, loads the model if it is not in memory, and answers. Everything runs on your computer.
Our diagram, drawn from the official LM Studio docs (server, authentication, JIT loading), read October 2026. Dashed boxes happen only when you turn an option on or the model is not loaded yet.
Before you start#
The hardware row above comes from the desktop app's requirements; the docs publish no separate llmster requirements.
Linux (x64 or ARM64): the desktop app needs Ubuntu 20.04 or newer; the docs call Ubuntu newer than 22 "not well tested". Check your version:
lsb_release -a
Windows (x64 or ARM): the x64 build needs AVX2 in the CPU. Check the Windows version and processor name:
Get-ComputerInfo -Property OsName, OsVersion, CsProcessors
The PowerShell command does not show AVX2; check that on the processor's specification page (our suggestion).
Mac (Apple Silicon): macOS 14.0 or newer and an M1 to M4 chip. Check with sw_vers.
Checklist before you install:
- [ ] Hardware matches the rows above
- [ ] Enough free disk space for the models you plan to download (the docs do not list sizes per model)
- [ ] Port 1234 is free, or you have picked another with
--port - [ ] You know who should reach the API: only this computer (the default), or your network (then turn on authentication first)
Tested on: not tested by DIY Lab Hub. We ran nothing for this page. Commands and values come from the official docs read in October 2026; example outputs are the docs' own and are labelled as such.
Step 1: Install llmster and the lms command#
llmster installs with a one-line script on Linux and Mac, and a PowerShell script on Windows. These are the docs' exact commands.
Linux#
curl -fsSL https://lmstudio.ai/install.sh | bash lms --help
Our advice: to read the script first, run curl -fsSL https://lmstudio.ai/install.sh -o install.sh, open it, then bash install.sh.
Windows (PowerShell)#
irm https://lmstudio.ai/install.ps1 | iex lms --help
Our advice: read the script first with irm https://lmstudio.ai/install.ps1 | more. Open a new PowerShell window before you run lms. If lms is not recognised, the official lms README suggests npx lmstudio install-cli.
Mac (Terminal)#
Same commands as Linux:
curl -fsSL https://lmstudio.ai/install.sh | bash lms --help
Check it worked. The docs show this as example output (your version will be newer):
lms is LM Studio's CLI utility for your models, server, and inference runtime. (v0.0.47) Usage: lms [options] [command]
Tip: Open a new terminal after the install. Most "command not found" problems are an old window that started before the PATH change.
Step 2: Start the daemon and check it#
lms daemon up starts llmster, and lms daemon status says whether it runs.
Linux#
lms daemon up lms daemon status --json
Windows (PowerShell)#
lms daemon up lms daemon status --json
Mac (Terminal)#
Same commands as Linux:
lms daemon up lms daemon status --json
Check it worked. The docs' example output when running:
{ "status" : "running", "pid" : 12345, "isDaemon" : true }
Tip:
lms daemon downstops llmster. It does not stop the desktop app, and it only works when llmster is running (docs). Keep the two apart when you troubleshoot.
Step 3: Download a model and load it#
lms get downloads a model into the LM Studio model folder. The docs use openai/gpt-oss-20b as the example. They do not list sizes, so read the size in the output before you rely on a large model.
Linux#
lms get openai/gpt-oss-20b lms load openai/gpt-oss-20b --ttl 3600 --identifier my-model lms ps
Windows (PowerShell)#
lms get openai/gpt-oss-20b lms load openai/gpt-oss-20b --ttl 3600 --identifier my-model lms ps
Mac (Terminal)#
Same commands as Linux:
lms get openai/gpt-oss-20b lms load openai/gpt-oss-20b --ttl 3600 --identifier my-model lms ps
What the flags do, from the docs:
--ttl 3600unloads the model after 3600 seconds without a request. Without it, a model loaded withlms loadstays in memory until you unload it.--identifiersets the name your apps use; the docs say it keeps the model identifier consistent.--gpu(max,auto, or 0.0 to 1.0) sets how much work goes to the GPU;--context-lengthsets the context size at load time.
Check it worked. lms ps lists the models in memory. The docs do not show its output, so look for your model in the list.
Tip: Set the context length when you load the model, not in every request. A report (issue 2533, open October 2026) describes a request with
context_lengththat reloaded the model on every call.
Step 4: Start the server on port 1234 and check it#
The server turns the loaded model into an API. Pin the port so your scripts always know where to connect.
Linux#
lms server start --port 1234 lms server status
Windows (PowerShell)#
lms server start --port 1234 lms server status
Mac (Terminal)#
Same commands as Linux:
lms server start --port 1234 lms server status
Check it worked. The docs' example output:
The server is running on port 1234.
Now ask the API which models it serves. On Linux and Mac:
curl http://localhost:1234/v1/models
On Windows PowerShell use curl.exe: the curl name there is an alias for a different PowerShell command.
curl.exe http://localhost:1234/v1/models
The docs show this command but not its output. You should see a JSON list that includes your model. If it is empty or the connection is refused, see Troubleshooting.
Tip: Without
--port, the server uses the last port you used, not always 1234 (docs). After a port change, check withlms server statusbefore you update your scripts.
Step 5: Send a first chat request#
The OpenAI-compatible chat endpoint is /v1/chat/completions. The model field takes the identifier you set, or a model id from /v1/models.
Linux#
curl http://localhost:1234/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "my-model", "messages": [{"role": "user", "content": "Say hello in five words."}]}'
Windows (PowerShell)#
$body = @{
model = "my-model"
messages = @(@{ role = "user"; content = "Say hello in five words." })
} | ConvertTo-Json -Depth 5
Invoke-RestMethod -Uri http://localhost:1234/v1/chat/completions -Method Post -ContentType "application/json" -Body $body
Mac (Terminal)#
Same commands as Linux:
curl http://localhost:1234/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "my-model", "messages": [{"role": "user", "content": "Say hello in five words."}]}'
Check it worked. You get a JSON reply with a choices list holding the model's message. The docs publish no sample reply; the shape is the standard OpenAI chat format.
For the official OpenAI Python library, the docs set the base URL to http://localhost:1234/v1. Their example also passes the key lm-studio; the docs do not say whether that value is checked when authentication is off.
Step 6: Decide who can reach it#
By default the server listens on 127.0.0.1: only this computer connects. To let other devices use it, bind it to all interfaces. The docs warn that any bind other than 127.0.0.1 "exposes the server beyond localhost; we recommend enabling authentication." Turn on authentication (Step 7) first.
Linux#
lms server stop lms server start --bind 0.0.0.0 --port 1234 lms server status
Windows (PowerShell)#
lms server stop lms server start --bind 0.0.0.0 --port 1234 lms server status
Windows Firewall may ask about the connection; allow it only on private networks you own.
Mac (Terminal)#
Same commands as Linux:
lms server stop lms server start --bind 0.0.0.0 --port 1234 lms server status
Check it worked. From a second device on the same network, replace <server-ip> with this computer's LAN address:
curl http://<server-ip>:1234/v1/models
If you did not turn on authentication, go back to the default with lms server stop, then lms server start --port 1234. The environment variable LMS_SERVER_HOST also sets the bind address (docs).
Step 7: Require an API token#
Authentication is off by default. The switch and the tokens live in the LM Studio app: Developer tab, then Server Settings. The docs describe no command-line way to create tokens.
Linux#
The docs only describe creating tokens in the app's interface, so this step needs the desktop app on some computer. Then:
- Open the Developer tab, then Server Settings.
- Turn on Require Authentication.
- Click Manage Tokens, then Create Token, and give it a name and permissions.
- Copy the token now; the docs say it is not shown again.
Test it:
export LM_API_TOKEN="<your-token>" curl http://localhost:1234/v1/models -H "Authorization: Bearer $LM_API_TOKEN"
Windows (PowerShell)#
The same four steps in the app, then:
$env:LM_API_TOKEN = "<your-token>" curl.exe http://localhost:1234/v1/models -H "Authorization: Bearer $env:LM_API_TOKEN"
Mac (Terminal)#
The same four steps in the app, then the same commands as Linux:
export LM_API_TOKEN="<your-token>" curl http://localhost:1234/v1/models -H "Authorization: Bearer $LM_API_TOKEN"
Check it worked. With the header the models list comes back; without it the request is refused. The docs do not show the error text or code, so do not rely on a specific code.
Tip: Give each app its own token with only the permissions it needs; the docs let you edit permissions per token. Keep tokens in an environment variable or a password manager, never in a shared script.
Step 8: Start it when the computer boots#
Linux#
The docs' systemd unit, saved as /etc/systemd/system/lmstudio.service. Replace YOUR_USERNAME:
[Unit] Description=LM Studio Server [Service] Type=oneshot RemainAfterExit=yes User=YOUR_USERNAME Environment="HOME=/home/YOUR_USERNAME" ExecStartPre=/home/YOUR_USERNAME/.lmstudio/bin/lms daemon up ExecStartPre=/home/YOUR_USERNAME/.lmstudio/bin/lms load openai/gpt-oss-20b --yes ExecStart=/home/YOUR_USERNAME/.lmstudio/bin/lms server start ExecStop=/home/YOUR_USERNAME/.lmstudio/bin/lms daemon down [Install] WantedBy=multi-user.target
Then enable it:
sudo systemctl daemon-reload sudo systemctl enable lmstudio.service sudo systemctl start lmstudio.service systemctl status lmstudio
The docs note you can leave the model out of ExecStartPre and rely on just-in-time loading.
Check it worked. systemctl status lmstudio shows the unit active, and curl http://localhost:1234/v1/models answers after a reboot.
Windows (PowerShell)#
Not documented for llmster on Windows. The documented route is the desktop app: enable the setting that runs the LLM server on login. The docs say closing the window then minimises the app to the system tray while the server keeps running.
Mac (Terminal)#
Not documented for llmster on Mac (the docs have no launchd example). Use the same desktop-app setting as on Windows.
Check it worked. After a restart, run lms server status and expect the port line.
Security and testing#
- Keep it local by default.
127.0.0.1is the safe bind. Change it only on purpose. - Authenticate before you bind. Turn on Require Authentication and create a token per app (Step 7). The settings also include a switch that lets API clients call the servers you defined for the app; the docs call it a security risk and require authentication for it.
- Do not publish it to the internet. The docs document no TLS and no proxy recipe for the LM Studio server. For access away from home, use a network and VPN you control; do not forward port 1234 on your router.
- Secrets: the only secret is the API token. If you save it in a file, make the file readable only by your user (
chmod 600 <file>on Linux and Mac; on Windows, restrict it in the file's properties). - Functionality test:
lms server statusnames port 1234,curl http://localhost:1234/v1/modelslists your model, and one chat request answers (Steps 4 and 5). - Logs:
lms log streamshows incoming requests;--source servergives HTTP logs (docs). Logs can contain prompts, so treat them as private.
What leaves your machine#
- Chats and documents: the offline page says nothing you enter into LM Studio when chatting with a model leaves your device, and documents you add for chat stay local.
- Local server: requests from your apps stay on your machine or network while you keep the server off the internet.
- Model downloads and search: these go over the internet, to Hugging Face and LM Studio's catalog. The privacy policy says the only usage data it receives comes from model search or download and update checks.
- Updates: the app checks for updates, and
lms daemon updatedownloads new versions. - Optional cloud features: Bionic cloud models and web search are separate features with their own data terms (pricing and privacy pages). This guide does not use them.
Common mistakes#
These come from the official warnings and from issues people opened on the LM Studio bug tracker. The last row is about AI assistants.
| Mistake | Why it happens | Do this instead |
|---|---|---|
Binding to 0.0.0.0 with no authentication | A test on the same machine hides the problem, so the network step feels finished too early | Turn on Require Authentication first, bind second, then test from another device. Re-check after each update: issue 2500 (open October 2026) reports LAN clients cut off after a server configuration change |
| Scripts that assume port 1234 | Without --port, the server uses the last port you used (docs) | Pin --port 1234 in the start command and check with lms server status |
Setting context_length in every request | Issue 2533 (open October 2026): each request reloads the model, and the name alternates between modelname and modelname:2 | Set the context at load time with lms load --context-length |
| Stopping LM Studio during a model download | Issue 2538 (open October 2026): after a restart the app treated a partial file as complete and tried to load it | Check the file size, delete the partial download, and download it again |
| Updating and assuming it still starts | Issue 2483 (open October 2026): 0.4.26 on Windows shows Rehydrated error - SyntaxError: Unexpected token; issue 2514 reports the updater and download list failing | Keep the installer of the version that worked, read the changelog, and test one model after each update |
| Running Windows x64 on a CPU without AVX2 | The docs require AVX2; issue 2515 (open October 2026) reports crashes with 0xc000001d on a pre-AVX2 CPU | Check the CPU before you install |
| Trying an Intel Mac | The docs say Intel-based Macs are not supported by the app | Use an Apple Silicon Mac |
| An AI assistant invents flags or a Docker image | Assistants guess --host or --api-key, or a Docker image the docs never mention. The docs list --bind, --port, --cors, LMS_SERVER_HOST, and no Docker image | Check lms server start --help and the server page. Treat any flag or image the docs do not mention as unverified |
Tip: Run
lms server statusafter every start or update. It is the one command that tells you the port and that the server runs.
Tip: Use
lms log streamwhen a request does not do what you expect. The docs call it useful for debugging prompts sent to the model.
Tip: Keep JIT loading on with a TTL, and let the idle timer unload models you have stopped using. The docs set JIT on by default and the idle TTL to 60 minutes.
Troubleshooting#
| Problem | Solution |
|---|---|
lms: command not found (Windows: not recognised) | Open a new terminal; if it still fails, run npx lmstudio install-cli (official lms README) or repeat the Step 1 install |
lms server status says the server is not running | Run lms daemon up first, then lms server start --port 1234 |
Connection refused on http://localhost:1234 | Check the port with lms server status; check the daemon with lms daemon status --json |
| Works on the computer, not from another device | The server still binds to 127.0.0.1. Restart with --bind 0.0.0.0 (Step 6), then check the firewall |
| The model reloads on every request | Remove context_length from the request and set it at load time |
| Start hangs on "Waking up LM Studio service..." | The docs show this as normal start-up output. If it stays for minutes, see issue 2485 below and try lms daemon down, then lms daemon up |
| The app does not start after an update | Known regression on 0.4.26 (issue 2483). Update to the current release or go back to the installer that worked |
| A downloaded model will not load | Check the file size; delete the partial download and run lms get <model> again (issue 2538) |
Crash with 0xc000001d or "No compatible runtimes" on Windows | The CPU lacks AVX2 (issue 2515) |
Exact error text#
Rehydrated error - SyntaxError: Unexpected token: the app fails to start on 0.4.26 on Windows (issue 2483). Update to the current release.
Waking up LM Studio service...: the docs' example output for lms server start. Normal in the first seconds.
Known bugs#
Open on the LM Studio bug tracker when we read it in October 2026. The pages we read give no fix; the workarounds come from the reports.
- Issue 2500 (Windows, Bionic 1.1.8): LAN clients lost access after the server switched to its own configuration. Workaround: after an update, re-check the bind from another device.
- Issue 2485 (macOS, Bionic 1.1.8): inference stuck on "changing ownership";
lms pstimed out when LM Studio was not installed. The reporter says a rollback to 1.1.7 fixed it. - Issue 2533 (per-request
context_length): reloads on each request. Workaround: set the context at load time. - Issue 2530 (0.4.26, Windows): the API rejected a native plugin even with
pluginUse: allowAll.
Most of these reports concern the desktop app and its Bionic variant, but they touch the same server.
Updates and backups#
Update. Stop llmster, update it, and start it again (the docs' steps, the same on all three systems):
lms daemon down lms daemon update lms daemon up
Use lms daemon update --beta only for the beta channel. Afterwards run lms server status, make a test chat request, and re-check the bind if you use the network.
Back up the models. The docs point to the models folder you set in the app's My Models tab but give no backup procedure. These commands are ours: they archive a folder you choose, with the date in the name. Replace <models-folder>.
mkdir -p ~/backups tar -czf ~/backups/lmstudio-models-$(date +%F).tar.gz -C "<models-folder>" .
New-Item -ItemType Directory -Force "$HOME\backups" | Out-Null Compress-Archive -Path "<models-folder>\*" -DestinationPath "$HOME\backups\lmstudio-models-$(Get-Date -Format yyyy-MM-dd).zip"
Mac (Terminal): same as Linux. Schedule the Linux or Mac command with cron at 03:00 (crontab -e), and the Windows command with a daily Task Scheduler task.
Restore test. Unpack one archive into an empty folder, point LM Studio at it, and run lms ls. The model should be listed. A partly copied model behaves like issue 2538, so compare file sizes.
Performance and resources#
The docs publish no llmster benchmark, and we measured nothing for this page. The controls the docs describe:
- GPU share and context:
lms load --gpuand--context-length. A larger context uses more memory. - Estimate first:
lms load --estimate-only <model>prints the estimated GPU and total memory (API changelog, 0.3.27). - Idle unload: JIT-loaded models unload after 60 minutes idle by default; Auto-Evict keeps one JIT-loaded model in memory at a time.
- Monitoring:
lms psandlms ps --jsonshow loaded models and their status;lms log stream --source model --statsadds tokens per second (API changelog, 0.3.26).
The docs recommend 16 GB RAM and at least 4 GB dedicated VRAM on Windows, and publish no figures for memory per model.
FAQ#
Does it need a GPU? No. The docs describe GPU offload as an option (--gpu), and recommend at least 4 GB of dedicated VRAM on Windows. CPU-only use is not described as a supported mode on the pages we read, so test with a small model first.
Is LM Studio open source? The app is not. Its terms give a non-exclusive licence for personal and internal business use, forbid modifying, reverse engineering and redistributing it, and forbid offering it as a service. The lms command-line tool is MIT licensed.
Is it free? The pricing page lists a Free plan that includes local model support, the Bionic agent and LM Link for up to 5 devices. Paid plans exist for cloud features. Read the current pricing page before you rely on a paid feature.
Can I use it for work? The app terms allow personal and internal business use, and forbid offering the software to others as a hosted service. Each model has its own licence, and the terms say third-party models come under their own provider agreement. Check the licence of every model you serve.
Why does the app appear under two names? The pricing page, the lms README and many bug reports say "Bionic", while the docs say "LM Studio". We followed the docs and did not confirm a rename. Check the name on the download page before you install.
Is there a Docker image? Not documented. The official pages we read describe none, so this guide does not give one.
Sources#
- LM Studio docs: lms CLI - read October 2026
- LM Studio docs: run as a service (headless) - read October 2026
- LM Studio docs: llmster as a Linux startup task - read October 2026
- LM Studio docs: local API server, server settings and serve on local network - read October 2026
- LM Studio docs: authentication and idle TTL and auto-evict - read October 2026
- LM Studio docs: OpenAI compatibility - read October 2026
- LM Studio docs: system requirements, offline operation and LM Studio, llmster and lms - read October 2026
- LM Studio API changelog and release 0.4.27 - read October 2026
- LM Studio app terms, privacy policy, pricing and brand kit - read October 2026
- lms command-line tool on GitHub (MIT licence and README) - read October 2026
- LM Studio bug tracker: issues 2483, 2485, 2500, 2514, 2515, 2530, 2533, 2538 - read October 2026
Checked against the official docs on 2026-10-30.