Skip to main content

Embeddings

Embedding models create a vector representation of a piece of text.

This page documents integrations with various model providers that allow you to use embeddings in LangChain.

Pick your embedding model:

Install dependencies

yarn add @langchain/openai
OPENAI_API_KEY=your-api-key
import { OpenAIEmbeddings } from "@langchain/openai";

const embeddings = new OpenAIEmbeddings({
model: "text-embedding-3-large"
});
await embeddings.embedQuery("Hello, world!");
NameDescription
Alibaba TongyiThe AlibabaTongyiEmbeddings class uses the Alibaba Tongyi API to gene...
Azure OpenAI[Azure
Baidu QianfanThe BaiduQianfanEmbeddings class uses the Baidu Qianfan API to genera...
Amazon BedrockAmazon Bedrock is a fully managed
Cloudflare Workers AIThis will help you get started with Cloudflare Workers AI [embedding
CohereThis will help you get started with CohereEmbeddings [embedding
DeepInfraThe DeepInfraEmbeddings class utilizes the DeepInfra API to generate ...
FireworksThis will help you get started with FireworksEmbeddings [embedding
Google Generative AIThis will help you get started with Google Generative AI [embedding
Google Vertex AIGoogle Vertex is a service that
Gradient AIThe GradientEmbeddings class uses the Gradient AI API to generate emb...
HuggingFace InferenceThis Embeddings integration uses the HuggingFace Inference API to gen...
IBM watsonx.aiThis will help you get started with IBM watsonx.ai [embedding
JinaThe JinaEmbeddings class utilizes the Jina API to generate embeddings...
Llama CPPOnly available on Node.js.
MinimaxThe MinimaxEmbeddings class uses the Minimax API to generate embeddin...
MistralAIThis will help you get started with MistralAIEmbeddings [embedding
Mixedbread AIThe MixedbreadAIEmbeddings class uses the Mixedbread AI API to genera...
NomicThe NomicEmbeddings class uses the Nomic AI API to generate embedding...
OllamaThis will help you get started with Ollama [embedding
OpenAIThis will help you get started with OpenAIEmbeddings [embedding
PineconeThis will help you get started with PineconeEmbeddings [embedding
Prem AIThe PremEmbeddings class uses the Prem AI API to generate embeddings ...
Tencent HunyuanThe TencentHunyuanEmbeddings class uses the Tencent Hunyuan API to ge...
TensorFlowThis Embeddings integration runs the embeddings entirely in your brow...
TogetherAIThis will help you get started with TogetherAIEmbeddings [embedding
HuggingFace TransformersThe TransformerEmbeddings class uses the Transformers.js package to g...
Voyage AIThe VoyageEmbeddings class uses the Voyage AI REST API to generate em...
ZhipuAIThe ZhipuAIEmbeddings class uses the ZhipuAI API to generate embeddin...

Was this page helpful?


You can also leave detailed feedback on GitHub.