A loaded model keeps its memory until something unloads it. If you loaded a model from the terminal, unload it from the terminal too — closing the chat window does not necessarily free the memory. The CLI documentation lists lms unload as the command that unloads a model, with the form lms unload [--all].
Related guide: Related Local AI guide
Unload one model, or all of them
lms ps
lms unload lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF
lms unload --all
Run lms ps first to see what is actually loaded and copy the model key exactly. lms unload with a key unloads that model; lms unload --all unloads every loaded model at once. If you run lms unload with no key, some versions show an interactive list to pick from — that is UNTESTED here, so pass the key explicitly in scripts.
Confirm the memory is free
Run lms ps again: the list should be empty, or should no longer contain the model you unloaded. If the model is still listed, the unload did not reach the LM Studio instance that owns it — check that lms is talking to the same instance (the desktop app and the headless daemon are different targets) and try again. To avoid doing this by hand, load with --ttl next time so the model unloads itself after a period of inactivity.
Expected result. We checked the LM Studio CLI docs for lms unload and the –all flag, and the linked LM Studio guide for the same commands. 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
Unloading a model ends any chat that was using it, and the next request for that model pays the full load time again. The interactive no-key form of lms unload is UNTESTED — pass the key explicitly. We did not run lms ourselves.
Sources
- LM Studio CLI docs — lms unload unloads a model; lms unload [–all]; lms ps lists the models currently loaded in memory
- Running LLMs locally: LM Studio — lms unload
unloads a model; lms unload –all unloads all models; lms ps lists loaded models
Checked 2026-11-28.
