Use case
lms can download models (lms get) but there's no first-class way to delete them. The current guidance is to manually delete files from the models folder (e.g. rm -r ~/.lmstudio/models/<publisher>/<repo>), which came up in #199 ("How do I remove a model using the CLI?") and #223. Models are large (often many GB each), so a safe, discoverable CLI command would be valuable.
Proposal
Add a remove (alias rm) subcommand under Local models, as the natural counterpart to get:
- No argument → interactive fuzzy picker of downloaded models (mirrors
lms unload).
- With a model key → target that model directly.
- Variants: if a model has multiple downloaded variants, prompt to remove a single variant or the entire model.
- Safety:
- Show the model (in the same table format as
lms ls) and its on-disk location, then ask for confirmation. A -y/--yes flag skips the prompt for scripting.
- Refuse to remove a model that is currently loaded (ask the user to
lms unload it first).
- Clean up now-empty publisher/repo folders after deletion.
Since the SDK/backend doesn't expose a delete RPC, removal is implemented as a filesystem delete of the model's path under the resolved models folder (settings.json downloadsFolder, falling back to the default) — the same approach as the manual workaround, just safe and built-in.
Notes
I've already implemented this and would be happy to open a PR (per CONTRIBUTING, flagging the issue first). Happy to adjust the command name/flags/behavior to match your roadmap.
Use case
lmscan download models (lms get) but there's no first-class way to delete them. The current guidance is to manually delete files from the models folder (e.g.rm -r ~/.lmstudio/models/<publisher>/<repo>), which came up in #199 ("How do I remove a model using the CLI?") and #223. Models are large (often many GB each), so a safe, discoverable CLI command would be valuable.Proposal
Add a
remove(aliasrm) subcommand under Local models, as the natural counterpart toget:lms unload).lms ls) and its on-disk location, then ask for confirmation. A-y/--yesflag skips the prompt for scripting.lms unloadit first).Since the SDK/backend doesn't expose a delete RPC, removal is implemented as a filesystem delete of the model's path under the resolved models folder (
settings.jsondownloadsFolder, falling back to the default) — the same approach as the manual workaround, just safe and built-in.Notes
I've already implemented this and would be happy to open a PR (per CONTRIBUTING, flagging the issue first). Happy to adjust the command name/flags/behavior to match your roadmap.