Use llmster to serve an LM Studio model from a Mac without opening the graphical application. Start the daemon, load a downloaded chat model, and start the HTTP listener on loopback. Verify the setup with a chat request that has an expected answer. Closing the testing Terminal and stopping the HTTP listener are different actions, so finish by checking the process state you intend to leave behind.

This walkthrough uses one Apple Silicon Mac, one macOS user account, and port 1234. It assumes you already have a compatible text chat model or can download one during setup. The exercise keeps requests on the same Mac. Its test is a two-line fictional workshop note, which makes it safe to inspect request and response data while learning where each command fits.

Install the current command line tools

The LM Studio headless guide gives the current installation instructions for macOS and the supported system requirements. Follow those instructions from the vendor’s site, then open a new Terminal window so it picks up any path changes made by the installer. Check whether the shell resolves the command and whether your version shows the daemon and server subcommands. LM Studio headless mode.

command -v lms
lms --help
lms daemon --help

If the shell reports that the command cannot be found, compare the installation output with its path instructions before proceeding. This is a shell discovery problem. The listener and model have not been involved yet. If the command works but has no daemon group, compare its version with the documented headless requirements. A previous desktop installation can leave an older CLI available earlier on the search path. Capture the actual path once so that a later Terminal window can be checked against it.

Quit the LM Studio desktop app through its application menu before the first headless exercise. LM Studio documents the separation between the GUI, the headless daemon, and the CLI which can control them. Leaving both modes in the picture makes it hard to attribute a listening port or a loaded instance. If a real client is using the existing GUI service, wait until its work finishes before quitting it. LM Studio, llmster, and lms.

Start the daemon and choose the exact model

Run the daemon commands as your regular macOS user. The first command requests a running daemon, and the second reports whether the daemon is running. The third checks which downloaded model artifacts the CLI can see. Each provides a separate clue. A running daemon is a process state. A model in the local listing is a file available to load.

lms daemon up
lms daemon status
lms ls

Choose one text instruction or chat model that you recognize. Record the identifier beside the intended artifact and any filename or quantization that helps you distinguish it from adjacent entries. If a model you used in the desktop app is missing, inspect the directory and macOS account you used in the earlier session. Use the headless guide’s model acquisition steps if you need to populate the current environment. Wait until the download is complete before trying to load it.

Then load the artifact, using the exact name accepted by the CLI. The load documentation describes a name argument and options for modifying an instance. Keep the model at its default settings for this short exercise. The aim is a working text path, which also makes it easier to interpret a loading error. LM Studio model load command.

lms load 'REPLACE_WITH_DOWNLOADED_MODEL'
lms ps

Keep a copy of the loaded listing. If the command identifies several variants from a short name, narrow it to the intended single artifact. If loading fails while the downloaded file still appears, its presence confirms only that the underlying file is available. Review the runtime’s error and choose a compatible, manageable artifact before touching the API settings. If the loaded listing unexpectedly contains multiple instances, establish who is using them before making changes to their state.

Start a same-Mac listener

Explicitly bind to the loopback address. The start command lets you specify both a bind address and a port. Use the same address in the API request and in any subsequent client settings. Server status represents the HTTP listener. Daemon status represents the underlying headless process. LM Studio start server command.

lms server start --bind 127.0.0.1 --port 1234
lms server status
curl -sS --connect-timeout 2 http://127.0.0.1:1234/v1/models

The listing should be a JSON API response. Copy the model identifier from an entry corresponding to the intended loaded model. The API can advertise models that are visible under its current settings, so keep the earlier loaded listing as corroboration. When you see a connection refusal, start with server status and the exact port. If the server reports an address in use, resolve the ownership of that port or deliberately choose a different loopback port, then update every example URL together.

If a local access token is required in your setup, include its bearer header in both API requests. Keep the token out of the command text and screenshots. For the synthetic exercise on a loopback listener with authentication disabled, the sample commands omit that header. The destination is visible in every command, which makes it straightforward to audit where this particular request goes.

Verify one complete inference

Replace the placeholder in the request with the identifier you just read back. The answer should name the time associated with the calibration bench. Making two times appear in the same prompt catches a reply that merely echoes the last number. Use this exercise before opening any existing prompts or changing an app’s provider.

curl -sS --max-time 60 http://127.0.0.1:1234/v1/chat/completions \
    -H 'Content-Type: application/json' \
    -d '{
      "model":"REPLACE_WITH_API_ID",
      "messages":[{"role":"user","content":"Workshop note: Calibration bench opens at 08:40. Storage check starts at 09:10. Reply with the calibration bench time only."}],
      "max_tokens":40,
      "stream":false
    }'

In the response, read the content of the first chat choice. Accept the exact value 08:40, ignoring surrounding whitespace. If the model includes extra wording, the request still demonstrates that inference is returning text, while the output fails the stricter formatting check. If a reasoning-capable model finishes with empty visible content under this cap, increase the budget for this test or use a small instruction model with straightforward output. Record that setting before comparing the second run.

Run a second version with the bench moved to 10:25 and the storage check unchanged. A response that updates to 10:25 provides a better check than repeating the identical request with a familiar timestamp. A status error, missing choice, or output length finish requires a look at the actual JSON body. Preserve the error message until you have matched it to a particular layer. The HTTP API is the first layer, the named instance is the second, and the wording in the reply is the final behavior you are examining. LM Studio chat completions reference.

Stop the layer you intended to stop

At the end of a working session, stop the HTTP listener if clients should stop connecting. Then check listener and daemon state separately. An interactive shell can return to its prompt while a background service continues to run. Verifying both states is clearer than relying on what happened to the Terminal window.

lms server stop
lms server status
lms daemon status

Repeat the short model-list request. With the listener stopped and the port unused, the expected result is a connection error. If a response still comes back, identify the responding service before running shutdown commands. The ability to reach the same port is a networking observation and on its own cannot name the process. LM Studio stop server command.

To stop your headless session completely, use the daemon shutdown command after clients have finished. The vendor specifically describes it as controlling llmster. The graphical app has its own quit action. Once the daemon reports stopped, the model artifacts remain available for a future session, and the next invocation can verify its own loaded state. LM Studio daemon shutdown.

lms daemon down
lms daemon status

Record how to bring the session back

Keep a short run note with the daemon start command, the downloaded model name, the API model ID, and the explicit loopback address. A future terminal command or client setting should refer to the same port. Record which user account owns the session if you have multiple accounts on the Mac. That makes it possible to diagnose a missing model without downloading another copy into the wrong home directory.

After restarting for a new work session, repeat the short listing and completion checks. If the downloaded artifact is present but the model is absent from the loaded listing, explicitly load it again. If the API answers but a consumer cannot reach it, use its running environment and target address as the next clues. In particular, a tool running on a separate host interprets its own loopback independently. This setup is for a consumer on the host where you ran llmster.

There is also a useful order for investigating a session that worked yesterday. Check the daemon before checking the port. Check the port before checking the server’s reported models. Check the live model identifier before interpreting the model’s answer. For example, after installing another local server, a match on the port by itself tells you little about which process answered. Matching the listener status, the model identifier, and the changed workshop test gives you independent observations of the intended host and its inference path.

When sharing the run note with a teammate, include the part of the exercise they can reproduce under their own macOS account. Model listing paths can include your personal directory, and any authorization header belongs outside the note. In a shared record, replace a local path with the model’s public repository and filename when that still identifies the artifact. The colleague can then record their selected path, inspect their own loaded listing, and compare their result against the same expected workshop time without inheriting your entire environment.

Rehearse the distinction between daemon and listener state

After the first successful request, stop the listener while leaving llmster up. Check both statuses and repeat the model listing with the short connect timeout. A refusal from the listener can coexist with a running daemon. In that case, the HTTP client has lost its network path even if the active model still appears in the runtime listing. This is a useful practice check when switching from an app-based setup that exposes most of its state in one window.

Start the listener again on the same loopback port and check the runtime listing before repeating the workshop request. If the same instance is still loaded, use its observed identifier. If the runtime changed its active state, confirm the loaded model and its ID rather than assuming that reopening a port restored everything. Reusing the second workshop time makes it easier to confirm you submitted a fresh request after the restart.

If you encounter startup failures on a later Mac account, record both the running daemon state and the command path resolved in that account. A shell that locates a different CLI or a background process whose service did not start under the current user can lead to similar-looking test failures. The two statuses and exact address give you a short set of observations to compare before you copy further settings from the earlier account.