feat: Add LMStudio provider support #20
Merged
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.
This commit introduces support for the LMStudio provider, allowing users to interact with locally hosted LLMs.
Key Changes:
lmstudio.nimmodule has been created to handle the specific API interactions for LMStudio.README.md: Updated to include LMStudio in the list of supported providers and added a configuration example for LMStudio.src/seance/config.nim:endpointtoProviderConfig.loadConfigto handle theendpointand to not require an API key for LMStudio.createConfigWizardto prompt for an LMStudio endpoint if selected.src/seance/defaults.nim: AddedDefaultLMStudioEndpointand a default model for LMStudio.src/seance/providers.nim:LMStudioProvider.newProviderto correctly instantiateLMStudioProviderand handle its specific configuration (e.g., no API key required, optional endpoint).getRequestHandlertoChatProviderinterface and implementations for passing it down.src/seance/providers/common.nim: AddeddefaultHttpGetHandlerfor providers that might need it.LMStudioProviderinsrc/seance/providers/lmstudio.nimimplements the chat functionality, including:/v1/chat/completionsendpoint./v1/modelsendpoint to check model loading status (with basic interactive prompts if not loaded).tests/t_providers_lmstudio.nimto verify the LMStudio provider's functionality, including request formatting, header inclusion, custom endpoint usage, and error handling.This enhancement significantly expands Séance's utility by enabling local LLM deployments.