LM Studio is best known as a desktop app for running AI models on your own PC, but it can also run as a background service with no window open. LM Studio says llmster can run on Linux boxes, cloud servers, GPU rigs or your own machine. This guide follows LM Studio's official headless and CLI documentation.
LM Studio describes two ways to do it: llmster, a standalone daemon that LM Studio recommends, and the desktop app in headless mode.
Option 1: llmster (recommended)
LM Studio says llmster is the core of the desktop app, packaged to be server-native without relying on the GUI. It can run on Linux machines, cloud servers, GPU rigs or your own PC. LM Studio points to its 0.4.0 release post for more details.
Step 1: Install llmster
On Linux or macOS, LM Studio's install command is:
curl -fsSL https://lmstudio.ai/install.sh | bash
On Windows, run this in PowerShell:
irm https://lmstudio.ai/install.ps1 | iex
As with any script you pipe into a shell, it's worth opening the URL first to see what it does.
Step 2: Start the daemon
lms daemon up
The lms daemon commands also include status, down and update. LM Studio also has a separate guide to running llmster as a startup task on Linux.
Step 3: Download and load a model
The lms command-line tool handles models. lms get searches for and downloads models, lms ls lists the models on disk and lms ps shows what's loaded in memory. To load a model with GPU offload, LM Studio's example is:
lms load openai/gpt-oss-20b --identifier="my-model-name"
You can add --gpu=max, auto or a value from 0.0 to 1.0, and --context-length. LM Studio says --gpu=1.0 attempts to offload 100% of the computation to the GPU. For more on offload, see how to set GPU offload in LM Studio, and for a fuller tour of the tool, see how to use the lms CLI.
Step 4: Start the server
lms server start
Check it with lms server status, and stop it with lms server stop. Apps can then use LM Studio's REST API or its OpenAI-compatible endpoints; see how to use LM Studio's server.
Option 2: The desktop app in headless mode
If you already use the desktop app on Windows, macOS or Linux with a desktop, LM Studio says you can make it run as a service instead:
Open the app settings with Ctrl+, (Cmd+, on a Mac).
Tick the option to run the LLM server on login.
With that setting on, LM Studio says closing the app minimises it to the system tray, and the LLM server keeps running in the background. Your last server state is saved and restored when the app or service starts.
Just-in-time model loading
Both options support just-in-time (JIT) loading for the REST endpoints. LM Studio explains the difference:
JIT on: the OpenAI-compatible /v1/models endpoint lists all downloaded models, and a request to a model that isn't loaded loads it automatically.
JIT off: /v1/models lists only loaded models, and you have to load a model before using it.
LM Studio says JIT-loaded models are unloaded automatically after a period of inactivity by default, which frees memory on a shared machine. If you'd rather keep a model in memory, adjust the idle time-to-live settings described in LM Studio's documentation.
Tips
Run lms once after installing to check it works. LM Studio's CLI page says lms ships with LM Studio and that you need to run LM Studio at least once before you can use it.
If other devices on your network will use the server, think about security before exposing the port.
Not sure whether LM Studio or Ollama suits a headless setup better? See Ollama vs LM Studio.
Our verdict
For a dedicated AI box, llmster is the cleaner choice: install it, run lms daemon up, load a model and start the server. If you already use the desktop app, turning on "run the LLM server on login" gives you much the same result, and JIT loading means other apps can call any downloaded model without you loading it first.