feat(adapters): add LM Studio adapter with auto model selection#60
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LmStudioAdaptertargeting LM Studio's OpenAI-compatible local server (LMSTUDIO_BASE_URL, defaulthttp://localhost:1234).LMSTUDIO_MODELis unset, the adapter queries/v1/modelsand 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.LMSTUDIO_API_KEYfor protected endpoints./v1/modelsand/v1/chat/completions).config.example.yamlmention the new adapter.Closes INT-1340.
Test plan
npx vitest run src/adapters/lmstudio.test.ts(4 tests pass).LMSTUDIO_MODELset — confirm the adapter picks up whatever model is loaded.LMSTUDIO_MODEL=<id>— confirm the override still wins.LMSTUDIO_API_KEY=...against a protected endpoint.