Skip to content

feat(adapters): add LM Studio adapter with auto model selection#60

Merged
unohee merged 1 commit into
mainfrom
feat/lmstudio-adapter
Jun 3, 2026
Merged

feat(adapters): add LM Studio adapter with auto model selection#60
unohee merged 1 commit into
mainfrom
feat/lmstudio-adapter

Conversation

@unohee
Copy link
Copy Markdown
Owner

@unohee unohee commented May 26, 2026

Summary

  • Adds a dedicated LmStudioAdapter targeting LM Studio's OpenAI-compatible local server (LMSTUDIO_BASE_URL, default http://localhost:1234).
  • When LMSTUDIO_MODEL is unset, the adapter queries /v1/models and auto-selects the currently loaded model so users do not have to hard-code a model name that depends on whatever LM Studio happens to be running.
  • Supports an optional LMSTUDIO_API_KEY for protected endpoints.
  • Vitest coverage for both the availability check and the auto-selection path (mocks /v1/models and /v1/chat/completions).
  • README and config.example.yaml mention the new adapter.

Closes INT-1340.

Test plan

  • npx vitest run src/adapters/lmstudio.test.ts (4 tests pass).
  • Manual smoke against a real LM Studio server with no LMSTUDIO_MODEL set — confirm the adapter picks up whatever model is loaded.
  • Manual smoke with LMSTUDIO_MODEL=<id> — confirm the override still wins.
  • Manual smoke with LMSTUDIO_API_KEY=... against a protected endpoint.

- New LmStudioAdapter targets a dedicated LM Studio endpoint
  (LMSTUDIO_BASE_URL, default http://localhost:1234) with optional
  LMSTUDIO_API_KEY and LMSTUDIO_MODEL overrides.
- When LMSTUDIO_MODEL is unset, the adapter auto-selects the first
  loaded model via /v1/models, so users do not have to hard-code a
  model name that depends on what LM Studio currently has loaded.
- Adds vitest coverage for availability and auto-selection paths.
- Documents the new adapter in README and config.example.yaml.
@unohee unohee merged commit 3e2d6d6 into main Jun 3, 2026
9 checks passed
@unohee unohee deleted the feat/lmstudio-adapter branch June 3, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant