Introducing LMS: Command Line Tool for LM Studio
LM Studio has released a powerful command line tool known as lms
that integrates seamlessly into their ecosystem. Built with the robust lmstudio.js, lms
aims to enhance user interaction with LM Studio by providing a versatile command-line interface.
Installation
The installation of lms
is straightforward. It comes bundled with LM Studio version 0.2.22 or later. To install it, users need to execute the bootstrap
command. The installation steps vary slightly depending on the operating system:
-
For Windows Users:
Open a terminal and execute:
cmd /c %USERPROFILE%/.cache/lm-studio/bin/lms.exe bootstrap
-
For Linux/macOS Users:
Run the following command:
~/.cache/lm-studio/bin/lms bootstrap
After the bootstrap process is complete, users can open a new terminal window and type lms
to verify the installation.
Usage
The lms
tool comes with multiple subcommands that users can utilize to interact with LM Studio in various ways. Users can type lms --help
to get a comprehensive list of all available commands. Additionally, for detailed information about a specific subcommand, users can use lms <subcommand> --help
.
Below are some frequently used commands:
-
Check Status:
- Use
lms status
to view the current status of LM Studio.
- Use
-
Control Local API Server:
- To start the local API server, execute
lms server start
. - To stop it, use
lms server stop
.
- To start the local API server, execute
-
Manage Models:
- List all downloaded models with
lms ls
. - To view detailed information, use
lms ls --detailed
. - For machine-readable JSON format, the command
lms ls --json
is available. - View available models for inferencing using
lms ps
, and uselms ps --json
for a JSON format.
- List all downloaded models with
-
Model Operations:
- Load a model with maximum GPU acceleration using
lms load --gpu max
. - To skip confirmation while loading, use
lms load <model path> --gpu max -y
. - Unload a model with
lms unload <model identifier>
. - To unload all models, the command is
lms unload --all
.
- Load a model with maximum GPU acceleration using
-
Project Management:
- Start a new project using LM Studio SDK with
lms create
.
- Start a new project using LM Studio SDK with
-
Logging:
- Stream logs from LM Studio by executing
lms log stream
.
- Stream logs from LM Studio by executing
With lms
, managing and utilizing LM Studio becomes streamlined and efficient, granting users control and flexibility from the command line. Whether you're starting a new project or managing existing models, the lms
tool is equipped to support a wide range of tasks effortlessly.