Skip to content

feat: add local HuggingFace Transformers embeddings node#6604

Open
mariazuheros wants to merge 1 commit into
FlowiseAI:mainfrom
mariazuheros:feature/local-hf-transformers-embeddings
Open

feat: add local HuggingFace Transformers embeddings node#6604
mariazuheros wants to merge 1 commit into
FlowiseAI:mainfrom
mariazuheros:feature/local-hf-transformers-embeddings

Conversation

@mariazuheros

@mariazuheros mariazuheros commented Jul 8, 2026

Copy link
Copy Markdown

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, but FastEmbedEmbeddings was removed from @langchain/community in v1. This implements the same capability (local, free embeddings) via HuggingFaceTransformersEmbeddings, which is already available in the pinned @langchain/community@1.1.12.

Implementation

  • Follows the existing embeddings node pattern (e.g. OllamaEmbedding) — no credential, since the model runs locally.
  • Inputs: Model Name (default Xenova/all-MiniLM-L6-v2), plus optional Batch Size and Strip New Lines under additional params.
  • Adds @huggingface/transformers@^3.5.2 to packages/components (the optional peer dependency of @langchain/community).

Verification

  • pnpm build passes (typecheck + gulp).
  • Node loads and registers correctly in the Embeddings category with no credential.
  • Verified end-to-end locally: with the default model it downloads and generates a 384-dim embedding for a sample text, with no API key.
Screenshot 2026-07-08 at 13 49 51

Notes for maintainers

I noticed Flowise currently handles local models via external servers (Ollama, LocalAI) rather than bundled runtimes. This node bundles @huggingface/transformers to 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.

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
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

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