Skip to content

Environment support for multiple hosts or ports - Redo#280

Draft
rugvedS07 wants to merge 3 commits intomainfrom
rugved/envs
Draft

Environment support for multiple hosts or ports - Redo#280
rugvedS07 wants to merge 3 commits intomainfrom
rugved/envs

Conversation

@rugvedS07
Copy link
Copy Markdown
Member

@rugvedS07 rugvedS07 commented Jul 29, 2025

Overview

Instead of specifying --host --port to make a request to a LM Studio running on other address and to make lms easy to use with multiple lmstudio instances in general, this PR brings in a new feature of 'environments' which are pretty similar to docker context

What commands does it bring?

lms env add <name> --host <host> --port <port> [--description <desc>] - Add a new environment
lms env remove <name> - Remove an environment
lms env ls- List all environments (shows current with *)
lms env use <name>- Switch to an environment
lms env current - Show current environment details
lms env inspect <name> - Show detailed information about a specific environment

Breaking Changes

Removes the --host and --port argument

How does it work?

It creates a new folder - .lmstudio/lms which has two things

  1. current-env: store the name of the current environment
  2. environments: store all the environment JSON files

Example JSON file for an environment

{
  "name": "remote",
  "host": "localhost",
  "port": 5678,
  "description": "A remote instance of LM Studio"
}

Screenshots of how it works

  1. Using the default local environment
image
  1. Switching the a dummy remote instance of LM studio running on some other port
image
  1. Removing a env
image
  1. LMS_ENV support
image
  1. Inspect Command
image

@github-actions github-actions bot added the CLA signed Indicates if all contributors have signed the CLA label Jul 29, 2025
Copy link
Copy Markdown
Member

@yagil yagil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please restore the PR description from the reverted PR
  2. Please add tests for existing lms functionality before merging this, specifically for command syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA signed Indicates if all contributors have signed the CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants