LM Studio CLI Cheatsheet - lms Model Management Full Reference

The value of the lms command is that it turns LM Studio desktop model management into a scriptable interface. When it earns its place: preparing a model, starting a server or running an evaluation from CI or an automation script, where the desktop GUI becomes an obstacle. If you are only chatting locally, the graphical interface is faster and this detour is unnecessary. The sheet lays out install and status, model management, and service and chat, chaining ls, ps, get, import, load, unload, server and chat into one workflow. The detail most often missed is the difference between ls and ps: ls lists what is downloaded on disk, ps lists what is currently loaded into memory, and the gap between them is where your VRAM goes. Reach for this sheet when you hit an out-of-memory error despite having downloaded only one model, or when you need to point any OpenAI-compatible client at a local model.

AI CLI·20 commands·Last updated 2026-09-10
lmstudiolmslocal-llmmodel-managementcliggufinference

Install and Status 4

lms
Run lms for the overview
lms --help
List all commands
lms status
Show LM Studio status
lms version
Show CLI version

Model Management 9

lms ls
List downloaded models
lms ls --json
List models as JSON
lms ps
List models loaded in memory
lms get llama-3
Search and download a model
lms import /path/to/model.gguf
Import a local model file
lms load llama-3-8b-instruct
Load a model into memory
lms load llama-3-8b-instruct --gpu=max
Load with max GPU offload
lms load llama-3-8b-instruct --context-length=8192
Load with a context length
lms unload --all
Unload all loaded models

Serve and Chat 7

lms server start
Start the local API server
lms server stop
Stop the API server
lms server status
Show server status
lms chat
Start interactive terminal chat
lms chat --model llama-3-8b-instruct
Chat with a named model
lms runtime survey
Print GPU info
lms log stream
Stream request logs live

Tips

  • lms ships with the LM Studio desktop app; run the desktop app once to initialize before using lms.
  • lms server start exposes an OpenAI-compatible server; point a client base_url at port 1234.
  • --gpu=max offloads compute to GPU; use --gpu=0 for pure CPU.

FAQ

Does lms need a separate install?

No, it ships with the LM Studio desktop app; or install it alone via npx lmstudio install-cli.

What is the default API port?

Default 1234, chat and completion use the OpenAI-compatible /v1 endpoints.

Official References

Each command links to its official documentation below, so you can verify the latest usage and read deeper.

Maintained by LaoHand

Publicly updated on Sep 10, 2026, continuously proofread against official docs.

Contact Us

Wrong command or description? Send us corrections, business inquiries or product feedback by email.

Contact Us