Skip to content

fix: show LM Studio picker with base URL - #41367

Open
daveotero wants to merge 1 commit into
NousResearch:mainfrom
daveotero:fix-lmstudio-picker-base-url
Open

fix: show LM Studio picker with base URL#41367
daveotero wants to merge 1 commit into
NousResearch:mainfrom
daveotero:fix-lmstudio-picker-base-url

Conversation

@daveotero

@daveotero daveotero commented Jun 7, 2026

Copy link
Copy Markdown

What does this PR do?

Makes the built-in lmstudio provider appear in the model picker when LM Studio is configured with a local base URL but no API key.

Current behavior on main: if a user sets LM_BASE_URL for local LM Studio but does not set LM_API_KEY, the built-in LM Studio provider can be omitted from the /model picker unless LM Studio is already the active provider or the auth-gated path is satisfied.

That is wrong for the common local LM Studio setup: LM Studio typically runs on localhost and does not require an API key.

Related Issue

No separate issue filed. This came from a live Hermes model-picker configuration issue on a local LM Studio setup.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✅ Tests (adding or improving test coverage)

Changes Made

  • Update hermes_cli/model_switch.py so the built-in lmstudio provider is included in picker candidates when LM_BASE_URL is configured, even if LM_API_KEY is absent.
  • Preserve existing behavior when:
    • LM Studio is already the active provider
    • LM Studio auth is configured
    • other provider credential gates are evaluated
  • Add regression coverage in tests/hermes_cli/test_lmstudio_model_picker.py for the local no-auth LM Studio picker path.

Why this is the right scope

This is intentionally narrow: it does not add a new provider, change runtime routing, alter model resolution, or loosen auth requirements for remote providers.

It only fixes picker visibility for the existing built-in lmstudio provider when the existing local base URL configuration is enough to use it.

Typical affected configuration:

LM_BASE_URL=http://127.0.0.1:1234/v1
# no LM_API_KEY

Expected result: LM Studio appears in the model picker as an available local provider.

How to Test

Targeted regression test used before opening the PR:

/c/Users/daveotero/.hermes/hermes-agent/venv/Scripts/python.exe -m pytest tests/hermes_cli/test_lmstudio_model_picker.py -q -o 'addopts='

The test covers the bug directly: LM_BASE_URL is configured, LM_API_KEY is absent, and the picker still emits the built-in lmstudio provider row.

Platforms Tested

  • Native Windows 10
  • Python 3.11 Hermes environment
  • Local LM Studio base URL configuration

Duplicate Search

Searched open and closed issues/PRs for LM Studio picker visibility with LM_BASE_URL / missing LM_API_KEY and did not find an existing PR or issue covering this fix.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run the targeted regression test and it passes
  • I've added tests for my changes
  • I've tested on my platform: native Windows 10

Documentation & Housekeeping

  • Documentation update: N/A, bugfix only
  • cli-config.yaml.example update: N/A, no config keys added or changed
  • CONTRIBUTING.md / AGENTS.md update: N/A, no architecture/workflow change
  • Cross-platform impact considered: yes; this only affects provider-picker candidate selection
  • Tool descriptions/schemas update: N/A

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have labels Jun 7, 2026
@daveotero

Copy link
Copy Markdown
Author

Updated the PR description to more explicitly match CONTRIBUTING.md / the PR template: current-main behavior, affected local LM Studio config, narrow bug scope, testing, platform tested, and duplicate-search note. This is still mergeable and intentionally limited to the model-picker visibility bugfix.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused regression fix. Current main still has the reported gap: hermes_cli/model_switch.py:1646-1667 probes LM Studio when LM_BASE_URL is present, but the subsequent provider-row gate at hermes_cli/model_switch.py:1795-1853 only recognizes LM_API_KEY or another credential source, so the row is skipped. The proposed condition addresses that exact divergence, and the added test exercises the interactive-picker wrapper.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants