
Node Details
- Name: HuggingFaceInferenceEmbeddings
- Type: HuggingFaceInferenceEmbeddings
- Version: 1.0
- Category: Embeddings
Parameters
Credential
- Label: Connect Credential
- Name: credential
- Type: credential
- Credential Names: huggingFaceApi
Inputs
-
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
-
Endpoint
- Label: Endpoint
- Name: endpoint
- Type: string
- Description: The URL of your custom inference endpoint, if using one.
- Placeholder: https://xyz.eu-west-1.aws.endpoints.huggingface.cloud/sentence-transformers/all-MiniLM-L6-v2
- Optional: Yes
Initialization
The node initializes by creating an instance ofHuggingFaceInferenceEmbeddings
with the following steps:
- Retrieves the HuggingFace API key from the provided credentials.
- Sets up the configuration object with the API key.
- If a model name is provided, it’s added to the configuration.
- If a custom endpoint is provided, it’s added to the configuration.
- 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