Skip to main content

Embedding models

important

In Langflow version 1.5, the singular Embedding model component replaces many provider-specific embedding models components. Any provider-specific embedding model components that weren't incorporated into the singular component were moved to Bundles.

Embedding model components in Langflow generate text embeddings using the selected Large Language Model (LLM). The core Embedding model component supports many LLM providers, models, and use cases. For additional providers and models not supported by the core Embedding model component, see Bundles.

The core Language Model and Embedding Model components are adequate for most use cases.

Use an Embedding Model component in a flow

Create a semantic search system with the Embedding model component.

  1. Add the Embedding model component to your flow. The default model is OpenAI's text-embedding-3-small, which is a balanced model, based on OpenAI's recommendations.
  2. In the OpenAI API Key field, enter your OpenAI API key.
  3. Add a Split text component to your flow. This component splits your input text into smaller chunks to be processed into embeddings.
  4. Add a Chroma DB vector store component to your flow. This component stores your text embeddings for later retrieval.
  5. Connect the Text Splitter component's Chunks output to the Chroma DB component's Ingest Data input.
  6. Connect the Embedding model component's Embeddings output to the Chroma DB component's Embeddings input.

This flow loads a file from the File loader, splits the text, and embeds the split text into the local Chroma vector store using the text-embedding-3-small model.

Embeddings connected to Chroma DB vector store with a file loader and a split text component

To query the vector store, include Chat Input and Chat Output components.

  1. Connect a Chat Input component to the Search Query input of the Chroma DB vector store.
  2. Connect a Chat Output component to the Search Results port of the Chroma DB vector store.

Your flow looks like the following: A simple semantic search flow using Embedding model

  1. Open the Playground and enter a search query. The Playground returns the most semantically similar text chunks.
Parameters

Inputs

NameDisplay NameTypeDescription
providerModel ProviderDropdownSelect the embedding model provider.
modelModel NameDropdownSelect the embedding model to use.
api_keyOpenAI API KeySecretStringThe API key required for authenticating with the provider.
api_baseAPI Base URLStringBase URL for the API. Leave empty for default.
dimensionsDimensionsIntegerThe number of dimensions for the output embeddings.
chunk_sizeChunk SizeIntegerThe size of text chunks to process. Default: 1000.
request_timeoutRequest TimeoutFloatTimeout for API requests
max_retriesMax RetriesIntegerMaximum number of retry attempts. Default: 3.
show_progress_barShow Progress BarBooleanWhether to display a progress bar during embedding generation.
model_kwargsModel KwargsDictionaryAdditional keyword arguments to pass to the model.

Outputs

NameTypeDescription
embeddingsEmbeddingsAn instance for generating embeddings using the selected provider.

Embedding models bundles

If your provider or model isn't supported by the core Embedding model component, see Bundles for additional language model and embedding model components developed by third-party contributors.

Search