New Tool Radar

Local AI

How to Load a Model in LM Studio from the Command Line

Use lms load with a model key from lms ls to load a model into memory, with --gpu and --context-length to set how it loads.

Schematic diagram with three steps: list downloaded models with lms ls, load one with lms load, and confirm it is loaded with lms ps.

LM Studio is a desktop app, but it ships a command-line tool, lms, that can load a model without opening the window — useful in scripts and on machines you manage over SSH. The CLI documentation says lms ships with LM Studio, that you need to run LM Studio at least once before you can use it, and that lms load loads a model.

Related guide: How to Download a Model and Start Your First Chat in LM Studio

Load a model from the terminal

First list what is downloaded, because lms load takes a model key — the identifier shown by lms ls:

lms ls
lms load lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF --gpu max --context-length 8192

The docs show the load options as lms load [--gpu=max|auto|0.0-1.0] [--context-length=1-N], and say --gpu=1.0 means attempt to offload 100% of the computation to the GPU. You can also give the loaded model a stable identifier with --identifier="my-model-name", which keeps the name consistent for API clients. Adding --ttl 3600 tells LM Studio to unload the model after an hour of inactivity, freeing the memory for you.

Confirm it loaded

Run lms ps, which lists the models currently loaded in memory. If your model is not there, check the error from lms load: the usual causes are a wrong model key (copy it from lms ls) or a model too large for the memory available. Before loading a very large model, the CLI offers an estimate-only check — run lms load --help on your installed version to confirm the flag name, as flag names change between releases.

Expected result. We checked the LM Studio CLI docs for the lms load syntax, the –gpu and –context-length options, and lms ps, and the linked CLI guide for the –ttl option. We did not run this software ourselves for this guide, so no output here is a recorded result; steps marked UNTESTED were checked against the sources below, not run.

Limits

Flag names change between LM Studio releases — the docs and guides quoted here disagree on details, so run lms load –help on your installed version before scripting against it. Loading a model allocates its memory immediately, so a model that is too large will fail to load rather than running slowly. We did not run lms ourselves.

Sources

Checked 2026-11-28.

See all