Skip to main content
View source

Transformer

View as Markdown

A RocketRide embedding node that turns document chunks and questions into local sentence-transformer vectors; choose it when text must stay in the model runtime rather than use an external embedding API.

About Hugging Face

Hugging Face develops open-source libraries and repositories for machine-learning models. Sentence Transformers is a model interface for creating sentence and passage embeddings used in semantic retrieval.

What it does

The node embeds the documents and questions lanes, storing each result as a float list and recording the producing model. Choose it over embedding_openai when using a locally loaded sentence-transformer model and over the image or video embedders for text. Documents are buffered in groups of 64 and remaining documents flush when the input closes, while questions are encoded immediately.

Lanes

Lane inLane outDescription
documentsdocumentsEmbeds document chunks.
questionsquestionsEmbeds questions for vector retrieval.

Profiles

Default: miniLM - General use embeddings, good performance (miniLM).

ProfileModelContext
miniLM (default)sentence-transformers/multi-qa-MiniLM-L6-cos-v1Default model.
miniAllsentence-transformers/all-MiniLM-L6-v2Alternative model.
mpnetsentence-transformers/multi-qa-mpnet-base-cos-v1Alternative model.
customUser-providedEnter a compatible Hugging Face model identifier.

Configuration

Start with miniLM; its vector size and maximum token count are read from the loaded model. Custom settings are relevant only when the model expects a different retrieval format or output shape.

Model

Custom model names are passed to SentenceTransformer. Change the model only with a compatible downstream vector index, because the node writes the model’s vectors directly to documents and questions.

Truncate dimensions

truncate_dim is passed to the model as truncate_dim; zero preserves its normal dimensionality. Set a positive value only when the selected model supports shorter embeddings and the vector store was created for that dimension; otherwise leave it at zero to avoid incompatible vectors.

Document and query prefixes

The node prepends document_prefix to every document and query_prefix to every question before encoding. Leave both empty for models that do not require a role marker. For a model trained with separate passage and query prefixes, set the matching pair consistently during ingestion and retrieval; applying a prefix on only one side changes the representations being compared.

Requirements

The node declares GPU capability. It loads a SentenceTransformer through the model provider; the source does not specify a CPU-only fallback, so provision the compatible model runtime.

Upstream docs

Schema

FieldTypeDescriptionDefault
embedding.document_prefixstringDocument prefix
Prefix prepended to document text before encoding (e.g. 'search_document: ', 'passage: ')
embedding.modelstringModel name
Hugging face model to use for embedding
embedding.preprocessor"preprocessor_langchain"
embedding.profilestringModel
Embedding model
"miniLM"
embedding.query_prefixstringQuery prefix
Prefix prepended to query text before encoding (e.g. 'search_query: ', 'query: ')
embedding.truncate_dimnumberTruncate dimensions
Truncate embeddings to this dimensionality (0 = use model default)

Dependencies

  • numpy