feat: add local HuggingFace Transformers embeddings node#6604
Open
mariazuheros wants to merge 1 commit into
Open
feat: add local HuggingFace Transformers embeddings node#6604mariazuheros wants to merge 1 commit into
mariazuheros wants to merge 1 commit into
Conversation
Adds a HuggingFace Transformers Embedding node that generates embeddings locally using @huggingface/transformers, without requiring an API key. FastEmbedEmbeddings (requested in FlowiseAI#3620) was removed from @langchain/community in v1, so this implements the same capability (local, API-less embeddings) via HuggingFaceTransformersEmbeddings, following the existing embeddings node pattern (e.g. OllamaEmbedding). Addresses FlowiseAI#3620
Contributor
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
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.
Description
Adds a new HuggingFace Transformers Embedding node under the Embeddings category that generates text embeddings locally, using
@huggingface/transformers(transformers.js) — no API key required.This addresses #3620 (local, API-less, free embeddings). The issue originally referenced
fastembed, butFastEmbedEmbeddingswas removed from@langchain/communityin v1. This implements the same capability (local, free embeddings) viaHuggingFaceTransformersEmbeddings, which is already available in the pinned@langchain/community@1.1.12.Implementation
OllamaEmbedding) — no credential, since the model runs locally.Model Name(defaultXenova/all-MiniLM-L6-v2), plus optionalBatch SizeandStrip New Linesunder additional params.@huggingface/transformers@^3.5.2topackages/components(the optional peer dependency of@langchain/community).Verification
pnpm buildpasses (typecheck + gulp).Notes for maintainers
I noticed Flowise currently handles local models via external servers (Ollama, LocalAI) rather than bundled runtimes. This node bundles
@huggingface/transformersto run the model in-process. Happy to adjust the approach (or drop the bundled dependency in favour of a server-based option) if you'd prefer a different direction.