`lms`の紹介:LM StudioのCLI
本日、LM Studio 0.2.22と併せて、LM StudioのコンパニオンCLIツールである`lms`の最初のバージョンをリリースします。
`lms`を使用すると、モデルのロード/アンロード、APIサーバーの起動/停止、および生のLLM入力(出力だけでなく)の検査を行うことができます。これはGitHubで開発されており、コミュニティからのイシューやPRを歓迎しています。
`lms`はLM Studioに同梱されており、LM Studioの作業ディレクトリである~/.lmstudio/bin/
に存在します。LM Studioを更新すると、`lms`のバージョンも更新されます。開発者であれば、ソースから`lms`をビルドすることもできます。
`lms`を使用する前に、LM Studioを少なくとも一度は実行する必要があります。
その後、ターミナルを開き、お使いのOSに応じて以下のいずれかのコマンドを実行してください。
# Mac / Linux: ~/.lmstudio/bin/lms bootstrap # Windows: cmd /c %USERPROFILE%/.lmstudio/bin/lms.exe bootstrap
その後、新しいターミナルウィンドウを開き、`lms`を実行します。
これが現在表示される出力です。
$ lms lms - LM Studio CLI - v0.2.22 GitHub: https://github.com/lmstudio-ai/lmstudio-cli Usage lms <subcommand> where <subcommand> can be one of: - status - Prints the status of LM Studio - server - Commands for managing the local server - ls - List all downloaded models - ps - List all loaded models - load - Load a model - unload - Unload a model - create - Create a new project with scaffolding - log - Log operations. Currently only supports streaming logs from LM Studio via `lms log stream` - version - Prints the version of the CLI - bootstrap - Bootstrap the CLI For more help, try running `lms <subcommand> --help`
`lms`はMITライセンスであり、このGitHubリポジトリで開発されています。
https://github.com/lmstudio-ai/lms
lms server start lms server stop
lms ls
これは、アプリの📂 My Modelsタブで設定した現在のLM Studioモデルディレクトリを反映します。
lms ps
lms load [--gpu=max|auto|0.0-1.0] [--context-length=1-N]
`--gpu=1.0`は、「計算の100%をGPUにオフロードしようと試みる」という意味です。
lms load TheBloke/phi-2-GGUF --identifier="gpt-4-turbo"
これは、モデル識別子を一貫させたい場合に役立ちます。
lms unload [--all]
`lms log stream`を使用すると、モデルに渡される正確な入力文字列を検査できます。
これは、プロンプトテンプレートの問題やその他の予期せぬLLMの動作をデバッグするのに特に役立ちます。
$ lms log stream I Streaming logs from LM Studio timestamp: 5/2/2024, 9:49:47 PM type: llm.prediction.input modelIdentifier: TheBloke/TinyLlama-1.1B-1T-OpenOrca-GGUF/tinyllama-1.1b-1t-openorca.Q2_K.gguf modelPath: TheBloke/TinyLlama-1.1B-1T-OpenOrca-GGUF/tinyllama-1.1b-1t-openorca.Q2_K.gguf input: "Below is an instruction that describes a task. Write a response that appropriately completes the request. #### Instruction: Hello, what's your name? #### Response: "
`lms`は、LM Studioと対話するためにlmstudio.jsを使用します。
`lms`ができることや、それ以上のことができる独自のプログラムを構築できます。
`lmstudio.js`はプレリリース版のパブリックアルファです。GitHubでフォローしてください:https://github.com/lmstudio-ai/lmstudio.js。
`lms`と`lmstudio.js`に関するすべてを、LM Studio Discordサーバーの新しい`#dev-chat`チャンネルで議論してください。
Mac / Windows / Linux版LM Studioはhttps://lmstudio.dokyumento.jpからダウンロードできます。
LM Studio 0.2.22 AMD ROCm - テクノロジープレビューはhttps://lmstudio.dokyumento.jp/rocmで入手可能です。
LM StudioのTwitter:https://twitter.com/lmstudio