Skip to content

How-ToGPU

How to Run LM Studio Headless With llmster (No GUI Needed)

How to run LM Studio as a background service without its window: install the llmster daemon, start it with lms daemon up, load models and start the server, or run the desktop app's server on login, plus JIT loading.

By , Systems & Technical Editor

3 min read

How to Run LM Studio Headless With llmster (No GUI Needed)

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.

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:

  1. Open the app settings with Ctrl+, (Cmd+, on a Mac).

  2. 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.

The bottom line

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.

Sources

  1. 01LM Studio: Run LM Studio as a service (headless)
  2. 02LM Studio: lms — LM Studio's CLI

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

How to Use Text-to-Speech in Ollama With the Phonon Model

How-To

How to Use Text-to-Speech in Ollama With the Phonon Model

How to use Ollama's text-to-speech feature with the Phonon model: update to v0.40.9 or later, pick a voice, read a chat model's answers aloud, save WAV files and call the OpenAI-compatible speech API.

Marcus Thorne3 min

How to Run Ollama in Docker With NVIDIA or AMD GPU Support

How-To

How to Run Ollama in Docker With NVIDIA or AMD GPU Support

How to run Ollama in Docker on Linux using Ollama's official commands: CPU only, NVIDIA GPUs via the NVIDIA Container Toolkit, AMD GPUs with the ROCm image, Vulkan, then running a model and connecting other apps.

Marcus Thorne3 min

How to Update the Intel NPU Driver on a Core Ultra PC

How-To

How to Update the Intel NPU Driver on a Core Ultra PC

How to update the Intel NPU (AI Boost) driver on a Core Ultra PC: which processors and Windows 11 versions Intel supports, how to check your version, installing 32.0.100.5600 and rolling back if an AI app misbehaves.

Marcus Thorne2 min