Node Details

  • Name: HuggingFaceInferenceEmbeddings
  • Type: HuggingFaceInferenceEmbeddings
  • Version: 1.0
  • Category: Embeddings

Parameters

Credential

  • Label: Connect Credential
  • Name: credential
  • Type: credential
  • Credential Names: huggingFaceApi

Inputs

  1. Model

    • Label: Model
    • Name: modelName
    • Type: string
    • Description: The name of the HuggingFace model to use for embeddings. Leave blank if using a custom inference endpoint.
    • Placeholder: sentence-transformers/distilbert-base-nli-mean-tokens
    • Optional: Yes
  2. Endpoint

Initialization

The node initializes by creating an instance of HuggingFaceInferenceEmbeddings with the following steps:

  1. Retrieves the HuggingFace API key from the provided credentials.
  2. Sets up the configuration object with the API key.
  3. If a model name is provided, it’s added to the configuration.
  4. If a custom endpoint is provided, it’s added to the configuration.
  5. Creates and returns a new HuggingFaceInferenceEmbeddings instance with the configured parameters.

Usage

This node is typically used in workflows where text needs to be converted into numerical vector representations. Common use cases include:

  • Text similarity comparisons
  • Document clustering
  • Input preparation for machine learning models
  • Semantic search implementations

By leveraging HuggingFace’s pre-trained models or custom-deployed endpoints, users can easily generate high-quality embeddings for a wide range of natural language processing tasks.