LM Studio can keep its HTTP API available after a client has finished using a model. Stopping the LM Studio server closes that endpoint to new HTTP requests.

The HTTP server has a separate lifecycle from the llmster daemon and loaded models. Stopping it does not shut down the daemon, unload models, delete downloaded files, or disable native LM Studio SDK connections.

The lms CLI controls the LM Studio instance associated with the account running it. The starting point is an available lms command and an already running HTTP server, either in the desktop app or through llmster. The curl client tests whether the former HTTP endpoint still accepts connections.

Steps to stop the LM Studio server:

  1. Check the port of the running LM Studio HTTP server. Example output:
    $ lms server status
    The server is running on port 1234.

    The port shown here is 1234. If your server uses another port, that port replaces 1234 in the final request. A server that is already stopped needs no further stop action.

  2. Stop the LM Studio HTTP server.

    Stopping the server terminates active HTTP requests and interrupts API clients. If a response must finish, wait for it before stopping the server.

    $ lms server stop
    Stopped the server on port 1234.

    This stops the current listener without changing startup automation. A later lms server start command, including one in a startup task, can start it again.
    Related: LM Studio server stop reference

  3. Confirm that LM Studio reports the HTTP server as stopped. Example output:
    $ lms server status
    The server is not running.
  4. Confirm that a new request to the previous local HTTP endpoint fails, replacing 1234 with your server's port. Example output:
    $ curl --fail --silent --show-error \
      --max-time 5 \
      http://127.0.0.1:1234/v1/models
    curl: (7) Failed to connect to 127.0.0.1 port 1234 after 0 ms: Could not connect to server

    The connection failure confirms that the old endpoint no longer accepts requests. The timing and error wording vary. An HTTP response, including an authentication error, means a server is still accepting connections at that address. The five-second limit prevents a stalled check from waiting indefinitely.
    Related: How to install cURL on Ubuntu

Share this guide