Terminal chat 7
| Command | What it does |
|---|---|
lms chat | Start interactive chatAsks which model to use when the command names none. |
lms chat MODEL | Chat with a named modelSkips the model picker and opens the session with that model. |
lms chat MODEL -p PROMPT | Send one prompt and exitWrites the reply to stdout without opening a session; put a prompt with spaces in quotes. |
lms chat MODEL -s PROMPT | Set the system promptThe short form of --system-prompt; the text applies to the whole chat. |
lms chat MODEL --ttl 600 | Keep model loaded after chatThe number is seconds to stay in memory once the chat ends; the default is 3600. |
cat FILE | lms chat -p PROMPT | Pipe a file into a promptStandard input becomes content for the prompt, so any command's output can feed the model. |
| Ctrl+C | Interrupt the responseStops a prediction that is still being generated inside the terminal chat. |
Downloading and importing models 12
| Command | What it does |
|---|---|
lms get | Browse staff picksWith no model name the command lists recommended models to choose from. |
lms get MODEL | Download a modelSearches online repositories for the name and saves the result in the LM Studio models directory. |
lms get llama-3.1-8b@q4_k_m | Download a chosen quantizationAdd @ and the quantization name after the model to pick one variant. |
lms get --mlx | Search MLX models onlyLimits results to MLX builds; with no format flag, results follow the installed runtimes. |
lms get --gguf | Search GGUF models onlyLimits results to GGUF files, the format the llama.cpp runtime loads. |
lms get --limit 5 | Limit search resultsCaps how many model options are listed; -n is the short form. |
lms get --always-show-all-results | Always list search resultsAsks you to choose even when the name matches one model exactly. |
lms get --always-show-download-options | Always ask for quantizationShows the quantization choices even when a match would be picked automatically; -a for short. |
lms import MODEL.GGUF | Import a model fileMoves the file into the models directory unless a copy or link flag is added. |
lms import MODEL.GGUF --copy | Import and keep originalCopies rather than moves, so the source file stays where it was. |
lms import MODEL.GGUF --user-repo my-user/custom-models | Import into a chosen folderNames the user/repo folder directly and skips the categorization questions. |
lms import MODEL.GGUF --dry-run | Preview an importReports what would be done and leaves the file untouched. |
Listing models 10
| Command | What it does |
|---|---|
lms ls | List downloaded modelsShows each model's parameter count, architecture and size on disk. |
lms ls --llm | List only LLMsLeaves embedding models out of the list. |
lms ls --embedding | List only embedding modelsHides the chat models and shows just the embedding entries. |
lms ls --detailed | List with full details |
lms ls --json | List models as JSONPrints the list in a form that scripts can parse. |
lms ls --variants | List model variantsExpands multi-variant models to show every variant; added in LM Studio 0.3.29. |
lms ls --host HOST | List models on a remote hostThe other LM Studio instance must be running and reachable, for example on the same subnet. |
lms ps | List loaded modelsShows identifier, type, path, size and architecture for each model in memory. |
lms ps --json | Loaded models as JSONAlso reports each model's generation status and how many prediction requests are queued. |
lms ps --host HOST | Loaded models on a remote host |
Loading and unloading models 13
A model loaded with lms load has no TTL unless --ttl is given, so it stays in memory until it is unloaded by hand.
| Command | What it does |
|---|---|
lms load MODEL_KEY | Load a modelMODEL_KEY is the name that lms ls prints for a downloaded model. |
lms load MODEL_KEY --identifier IDENTIFIER | Load under a custom identifierAPI calls can then name the model by that identifier in their model parameter. |
lms load MODEL_KEY --context-length 4096 | Set context length on loadThe number is how many tokens the model keeps in view while generating. |
lms load MODEL_KEY --gpu max | Use full GPU offloadSends every layer to the GPU; without --gpu, LM Studio picks the level itself. |
lms load MODEL_KEY --gpu 0.5 | Offload half the layersAny value from 0 to 1 sets the share of layers placed on the GPU. |
lms load MODEL_KEY --gpu off | Load without GPU offloadThe opposite of max: no layers are placed on the graphics card. |
lms load MODEL_KEY --ttl 3600 | Auto-unload after idle timeThe value is seconds without use before the model is removed; 3600 is one hour. |
lms load --estimate-only MODEL_KEY | Estimate memory without loadingPrints estimated GPU and total memory, taking --context-length and --gpu into account. |
lms load MODEL_KEY --host HOST | Load on a remote instanceTargets LM Studio on another machine, which has to be running and reachable from yours. |
lms unload | Unload a modelWith no model key it asks which loaded model to remove. |
lms unload MODEL_KEY | Unload one named model |
lms unload --all | Unload all modelsFrees every model currently held in memory. |
lms unload MODEL_KEY --host HOST | Unload on a remote instance |
Local server 10
Any bind address other than 127.0.0.1 exposes the server beyond localhost; LM Studio recommends enabling authentication before doing that.
| Command | What it does |
|---|---|
lms server start | Start the serverLaunches the local HTTP API so that loaded models can answer requests. |
lms server start --port 3000 | Start on a chosen portWithout --port the server reuses the port it ran on last. |
lms server start --cors | Start with CORS enabledFor web apps and some VS Code extensions; LM Studio flags it as a security risk. |
lms server start --bind 0.0.0.0 | Serve on the local networkListens on all IPv4 interfaces in place of the default 127.0.0.1. |
lms server status | Check server statusSays whether the server is running and on which port. |
lms server status --json --quiet | Server status as JSONPrints only a JSON object holding the running flag and the port. |
lms server status --verbose | Status with detailed loggingOnly one of --verbose, --quiet and --log-level is accepted per call. |
lms server status --log-level debug | Status at a set log levelThe level is info when the flag is absent. |
lms server stop | Stop the serverAny request still in progress is cut off. |
curl http://localhost:1234/v1/models | Test that the API answersAsks a server on port 1234 for its model list. |
Streaming logs 7
| Command | What it does |
|---|---|
lms log stream | Stream model input and outputShows the exact strings sent to and received from models; model is the default source. |
lms log stream --source server | Stream server logsServer logs joined this command in LM Studio 0.3.26. |
lms log stream --source model --filter input | Show only formatted inputPrints the user input after the prompt template has shaped it. |
lms log stream --source model --filter output | Show only model outputEach output appears after its message has finished. |
lms log stream --source model --filter input,output | Show both directions |
lms log stream --source model --filter input,output --json | Emit logs as JSONWrites newline-separated JSON for other tools to read. |
lms log stream --source model --filter output --stats | Add prediction statsStatistics are printed with the output whenever they are available. |
Headless daemon and setup 10
| Command | What it does |
|---|---|
lms --help | Show CLI helpA quick check that lms is installed; LM Studio must have been run once first. |
irm https://lmstudio.ai/install.ps1 | iex | Install llmster on WindowsRuns the PowerShell install script; llmster is the headless daemon and needs no desktop app. |
curl -fsSL https://lmstudio.ai/install.sh | bash | Install llmster on Mac or LinuxOne curl install script serves both macOS and Linux. |
lms daemon up | Start the daemonStarts llmster and prints its PID, or reports the status when it already runs. |
lms daemon up --json | Start daemon, JSON resultReturns status, PID and version as JSON for scripts. |
lms daemon status | Check daemon statusTells you whether the llmster process is up. |
lms daemon status --json | Daemon status as JSONGives status and PID when running, or a not-running status otherwise. |
lms daemon down | Stop the daemonStops llmster only; LM Studio running as a desktop app is left alone. |
lms daemon update | Update the daemonInstalls the latest stable llmster; stop the daemon first and start it again afterwards. |
lms daemon update --beta | Update to beta channelInstalls the newest beta release in place of the stable one. |
Inference runtimes 5
| Command | What it does |
|---|---|
lms runtime ls | List installed runtimesRuntimes are the inference engines; these commands manage them without opening the app. |
lms runtime get | Download a runtime |
lms runtime select | Switch the active runtimeInteractive prompts let you choose which version becomes active. |
lms runtime update | Update a runtime |
lms runtime remove | Uninstall a runtime |
LM Link 7
| Command | What it does |
|---|---|
lms link enable | Enable LM LinkNeeds an LM Studio account, so sign in first; the CLI then waits for a connection. |
lms link status | Check LM Link statusShows the device name, connection state and connected peers with their loaded models. |
lms link status --json | LM Link status as JSON |
lms link set-device-name NAME | Rename this deviceThe new name reaches connected peers at once; quote a name that contains spaces. |
lms link set-preferred-device | Pick preferred deviceLists the connected devices and lets you choose one. |
lms link set-preferred-device IDENTIFIER | Set preferred device by IDSkips the prompt; identifiers appear in the link status output. |
lms link disable | Disable LM LinkThe device stops connecting to the link and is hidden from the other devices. |
Hub publishing and plugins 8
| Command | What it does |
|---|---|
lms login | Sign in to LM Studio HubOpens a browser window to authenticate; a printed URL is the fallback. |
lms clone OWNER/NAME | Clone a Hub artifactMakes a folder named after the artifact in the current directory. |
lms clone alice/sample-plugin ./my-folder | Clone into a chosen folderThe second argument is the destination; the command quits when that path already exists. |
lms push | Publish current folderRun inside a plugin, preset or model.yaml project to upload a new revision. |
lms push -y --write-revision | Publish without promptsSuppresses confirmations and records the returned revision number in manifest.json. |
lms push --private | Publish as privateKeeps the plugin private, provided the account supports private plugins. |
lms dev | Run plugin dev serverRebuilds and reloads the plugin whenever its files change. |
lms dev --install | Install the local pluginPuts the plugin into LM Studio without starting the dev server. |
API endpoints 12
| Command | What it does |
|---|---|
GET /v1/models | List models (OpenAI format)Returns the models visible to the server, which can include every download when just-in-time loading is on. |
POST /v1/chat/completions | Chat completionsTakes a message history; the prompt template is applied automatically for chat-tuned models. |
POST /v1/responses | Responses APISupports streaming, reasoning, stateful follow-ups and optional remote MCP tools. |
POST /v1/embeddings | Create embeddingsTurns input text into embedding vectors. |
POST /v1/completions | Legacy text completionsNo prompt template is applied, so base models suit it better than chat-tuned ones. |
POST /v1/messages | Anthropic Messages APIThe Anthropic-compatible route, which lets Claude Code run against a local model. |
POST /api/v1/chat | Native chat endpointLM Studio's own v1 REST API, with stateful chats and MCP support. |
GET /api/v1/models | List models (native API)Covers the LLMs and the embedding models available on the system. |
POST /api/v1/models/load | Load a model over HTTPThe request body names the model and can set options such as context_length. |
POST /api/v1/models/unload | Unload a model over HTTPThe request body names the model instance to remove. |
POST /api/v1/models/download | Start a model downloadReturns a job id that the download status route accepts. |
GET /api/v1/models/download/status/:job_id | Check a download jobThe path ends with the job id returned when the download started. |
No row on this page matches that filter.
Notes
In the app
Ctrl + N starts a new chat and Ctrl + Shift + N a new chat folder. Ctrl + L opens the model loader, Ctrl + 2 and Ctrl + 3 jump to the Discover and My Models tabs, and Ctrl + , opens Settings from any screen. Ctrl + K, T is a two-step sequence for the theme selector, and Ctrl + Shift + R opens the runtime manager for the llama.cpp and MLX engines. On macOS each of these uses Cmd in place of Ctrl, and the macOS list gives them in full. The docs print no keys for sending a message or clearing a chat.
Running a local server
lms server start starts the API server and lms server status confirms the port. The CLI ships with the app, which has to be run once before lms works. lms ls lists downloaded models, lms ps the ones in memory; lms load MODEL_KEY loads one, with optional flags for context length, GPU offload and an idle timeout, and lms unload --all frees them. lms server stop shuts the server down. On a machine without a display, install llmster and use lms daemon up instead of the desktop app; the app's Developer tab has a switch that starts the same server.
Talking to it
The server speaks the OpenAI wire format, so a client that accepts a custom base URL works unchanged. GET /v1/models lists the models the server can see, POST /v1/chat/completions is the chat endpoint that takes a messages array and streams if asked, POST /v1/responses adds stateful follow-ups, and POST /v1/completions is the older plain-prompt form. POST /v1/messages does the same for Anthropic clients. Point an OpenAI SDK at http://localhost:1234/v1; an API token is only needed once Require Authentication is switched on in the server settings.
Questions
Which key opens the model loader in LM Studio?
Ctrl + L on Windows and Linux, Cmd + L on a Mac. The loader lists the models you have downloaded and lets you set load parameters before loading one.
How do I start the server without opening the app window?
Run lms server start from a terminal. The lms CLI is installed alongside the app, which must have been run at least once. On a machine with no display, install llmster and start it with lms daemon up first.
Can I use the OpenAI Python library with LM Studio?
Yes. Set base_url to http://localhost:1234/v1 and the rest of the code stays the same; POST /v1/chat/completions and POST /v1/responses are both supported.
How do I see which model is loaded?
lms ps lists the models currently in memory with their identifier, size and architecture. lms ls lists everything downloaded, loaded or not.
How do I make a model unload itself when it is idle?
Load it with a TTL, for example lms load MODEL_KEY --ttl 3600 for one hour. Without the flag a model loaded from the CLI stays in memory until you run lms unload.
Sources and checks
- LM Studio Docs — lms, LM Studio's CLI Overview of the lms command-line tool and its help command
- LM Studio Docs — full documentation text (llms-full.txt) App guides with the keyboard shortcuts, every lms command page, headless daemon, LM Link and REST API pages in one file
- LM Studio Docs — OpenAI Compatibility Endpoints Table of supported OpenAI-compatible endpoints
- LM Studio Docs — LM Studio API (REST v1) Table of native /api/v1 endpoints
Every row on this page was matched to a line in the documentation above on . A binding that could not be found there is not listed.
5 rows from the earlier version of this page were removed in that check: duplicates, and bindings the documentation does not list or lists differently.
Found a wrong or missing key? Tell us and it gets checked against the source. How we verify describes the process and its limits.