feat: support LM Studio embeddings#6424
Conversation
Adds support for LM Studio embeddings by wrapping the OpenAIEmbeddings provider with defaults tailored for local LM Studio instances. Resolves FlowiseAI#1277
There was a problem hiding this comment.
Code Review
This pull request introduces support for LM Studio local embeddings by adding a new credential type and a dedicated embedding node that utilizes the OpenAI-compatible API. The review feedback suggests implementing validation for the 'modelName' and 'basePath' parameters to prevent unintended fallbacks to OpenAI's production services if these fields are left empty. Additionally, it was recommended to simplify a redundant type intersection in the initialization logic to improve code clarity.
- Add validation to ensure modelName and basePath are provided to prevent unexpected fallbacks to production OpenAI APIs. - Simplify OpenAIEmbeddingsParams typing intersection.
|
@gemini-code-assist please review the latest commit |
There was a problem hiding this comment.
Code Review
This pull request introduces support for LM Studio by adding a new credential definition and an embedding node that utilizes the OpenAI-compatible API. Feedback was provided to ensure versioning consistency by using integers instead of floats. Additionally, the initialization of the embedding model should be updated to use the 'apiKey' property and simplified by removing redundant checks and fallback values for the API key.
- Ensure versioning consistency by using integers instead of floats - Simplify OpenAIEmebeddingsParams initialization by using inline apiKey and configuration
|
@gemini-code-assist please review the latest commit |
There was a problem hiding this comment.
Code Review
This pull request introduces support for LM Studio local embeddings. It adds a new credential type LMStudioApi for handling optional API keys and a new embedding node LMStudioEmbedding that utilizes the LangChain OpenAI integration to connect to local LM Studio instances via a configurable base path and model name. I have no feedback to provide.
Description
Adds support for LM Studio embeddings, resolving #1277.
This integration follows the established pattern of wrapping the OpenAI Embeddings provider and configuring the default base URL to point to the local LM Studio instance (
http://localhost:1234/v1). A new credential type was also added so users can optionally pass an API key if their custom setup requires one.Resolves #1277.