Skip to content

Linux: model download paths containing "~" are not expanded, causing imports to create invalid nested paths #573

@cbspace

Description

@cbspace

Summary

When configuring LM Studio on Linux with a model path ("downloadsFolder" key in settings.json) that contains ~, the path is not expanded to the user's home directory. Instead, it appears to be treated as a relative path and appended to another model directory, resulting in invalid nested paths and models not being indexed.

Environment

  • LM Studio version: CLI commit: efce996
  • OS: Kubuntu 26.04
  • Installation method: LM Studio CLI (lms) and LM Studio Server

Steps to Reproduce

  1. Configure the model directory in settings.json using a path containing ~, for example:
~/.lmstudio/models
  1. Import a model:
lms import LFM2-8B-A1B-Q4_K_M.gguf
  1. Observe the resulting directory structure.

Expected Behaviour

The ~ should be expanded to the user's home directory:

/home/me/.lmstudio/models/LiquidAI/LFM2-8B-A1B-GGUF

Actual Behaviour

A path containing the literal ~ is created and appended to another model directory, resulting in a malformed nested path such as:

~/.lmstudio/models/liquid/LFM2-8B-A1B-Q4_K_M/~/.lmstudio/models/LiquidAI/LFM2-8B-A1B-GGUF

The model is not correctly indexed and does not appear in lms ls.

Workaround

Replacing ~ with the full absolute path in settings.json fixes the issue:

/home/me/.lmstudio/models

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