Skip to content

Feature request: lms remove command to delete downloaded models #579

@hwrdprkns

Description

@hwrdprkns

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:

lms remove [modelKey]
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions