Embedding models
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.
- OpenAI
- Azure
- AWS
- HuggingFace
- Ollama
- Cohere
- MistralAI
- Nomic
- NVIDIA
- Fake
pip install -qU langchain-openai
import getpass
os.environ["OPENAI_API_KEY"] = getpass.getpass()
from langchain_openai import OpenAIEmbeddings
embeddings = OpenAIEmbeddings(model="text-embedding-3-large")
pip install -qU langchain-openai
import getpass
os.environ["AZURE_OPENAI_API_KEY"] = getpass.getpass()
from langchain_openai import AzureOpenAIEmbeddings
embeddings = AzureOpenAIEmbeddings(
azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
azure_deployment=os.environ["AZURE_OPENAI_DEPLOYMENT_NAME"],
openai_api_version=os.environ["AZURE_OPENAI_API_VERSION"],
)
pip install -qU langchain-google-vertexai
from langchain_google_vertexai import VertexAIEmbeddings
embeddings = VertexAIEmbeddings(model="text-embedding-004")
pip install -qU langchain-aws
from langchain_aws import BedrockEmbeddings
embeddings = BedrockEmbeddings(model_id="amazon.titan-embed-text-v2:0")
pip install -qU langchain-huggingface
from langchain_huggingface import HuggingFaceEmbeddings
embeddings = HuggingFaceEmbeddings(model="sentence-transformers/all-mpnet-base-v2")
pip install -qU langchain-ollama
from langchain_ollama import OllamaEmbeddings
embeddings = OllamaEmbeddings(model="llama3")
pip install -qU langchain-cohere
import getpass
os.environ["COHERE_API_KEY"] = getpass.getpass()
from langchain_cohere import CohereEmbeddings
embeddings = CohereEmbeddings(model="embed-english-v3.0")
pip install -qU langchain-mistralai
import getpass
os.environ["MISTRALAI_API_KEY"] = getpass.getpass()
from langchain_mistralai import MistralAIEmbeddings
embeddings = MistralAIEmbeddings(model="mistral-embed")
pip install -qU langchain-nomic
import getpass
os.environ["NOMIC_API_KEY"] = getpass.getpass()
from langchain_nomic import NomicEmbeddings
embeddings = NomicEmbeddings(model="nomic-embed-text-v1.5")
pip install -qU langchain-nvidia-ai-endpoints
import getpass
os.environ["NVIDIA_API_KEY"] = getpass.getpass()
from langchain_nvidia_ai_endpoints import NVIDIAEmbeddings
embeddings = NVIDIAEmbeddings(model="NV-Embed-QA")
pip install -qU langchain-core
from langchain_core.embeddings import DeterministicFakeEmbedding
embeddings = DeterministicFakeEmbedding(size=4096)
embeddings.embed_query("Hello, world!")
All embedding models
Name | Description |
---|---|
AI21 | This will help you get started with AI21 embedding models using LangC... |
Aleph Alpha | There are two possible ways to use Aleph Alpha's semantic embeddings.... |
Anyscale | Let's load the Anyscale Embedding class. |
ascend | [[-0.00348254 0.03098977 -0.00203087 ... 0.08492374 0.03970494 |
AwaDB | AwaDB is an AI Native database for the search and storage of embeddin... |
AzureOpenAI | This will help you get started with AzureOpenAI embedding models usin... |
Baichuan Text Embeddings | As of today (Jan 25th, 2024) BaichuanTextEmbeddings ranks #1 in C-MTE... |
Baidu Qianfan | Baidu AI Cloud Qianfan Platform is a one-stop large model development... |
Bedrock | Amazon Bedrock is a fully managed service that offers a choice of |
BGE on Hugging Face | BGE models on the HuggingFace are one of the best open-source embeddi... |
Bookend AI | Let's load the Bookend AI Embeddings class. |
Clarifai | Clarifai is an AI Platform that provides the full AI lifecycle rangin... |
Cloudflare Workers AI | Cloudflare, Inc. (Wikipedia) is an American company that provides con... |
Clova Embeddings | Clova offers an embeddings service |
Cohere | This will help you get started with Cohere embedding models using Lan... |
DashScope | Let's load the DashScope Embedding class. |
Databricks | Databricks Lakehouse Platform unifies data, analytics, and AI on one ... |
DeepInfra | DeepInfra is a serverless inference as a service that provides access... |
EDEN AI | Eden AI is revolutionizing the AI landscape by uniting the best AI pr... |
Elasticsearch | Walkthrough of how to generate embeddings using a hosted embedding mo... |
Embaas | embaas is a fully managed NLP API service that offers features like e... |
Fake Embeddings | LangChain also provides a fake embedding class. You can use this to t... |
FastEmbed by Qdrant | FastEmbed from Qdrant is a lightweight, fast, Python library built fo... |
Fireworks | This will help you get started with Fireworks embedding models using ... |
GigaChat | This notebook shows how to use LangChain with GigaChat embeddings. |
Google Generative AI Embeddings | Connect to Google's generative AI embeddings service using the Google... |
Google Vertex AI | This will help you get started with Google Vertex AI Embeddings model... |
GPT4All | GPT4All is a free-to-use, locally running, privacy-aware chatbot. The... |
Gradient | Gradient allows to create Embeddings as well fine tune and get comple... |
Hugging Face | Let's load the Hugging Face Embedding class. |
IBM watsonx.ai | WatsonxEmbeddings is a wrapper for IBM watsonx.ai foundation models. |
Infinity | Infinity allows to create Embeddings using a MIT-licensed Embedding S... |
Instruct Embeddings on Hugging Face | Hugging Face sentence-transformers is a Python framework for state-of... |
IPEX-LLM: Local BGE Embeddings on Intel CPU | IPEX-LLM is a PyTorch library for running LLM on Intel CPU and GPU (e... |
IPEX-LLM: Local BGE Embeddings on Intel GPU | IPEX-LLM is a PyTorch library for running LLM on Intel CPU and GPU (e... |
Intel® Extension for Transformers Quantized Text Embeddings | Load quantized BGE embedding models generated by Intel® Extension for... |
Jina | You can check the list of available models from here. |
John Snow Labs | John Snow Labs NLP & LLM ecosystem includes software libraries for st... |
LASER Language-Agnostic SEntence Representations Embeddings by Meta AI | LASER is a Python library developed by the Meta AI Research team and ... |
lindorm_ai | Lindorm Embedding |
Llama.cpp | llama.cpp python library is a simple Python bindings for @ggerganov |
llamafile | Let's load the llamafile Embeddings class. |
LLMRails | Let's load the LLMRails Embeddings class. |
LocalAI | Let's load the LocalAI Embedding class. In order to use the LocalAI E... |
MiniMax | MiniMax offers an embeddings service. |
MistralAI | This will help you get started with MistralAI embedding models using ... |
ModelScope | ModelScope is big repository of the models and datasets. |
MosaicML | MosaicML offers a managed inference service. You can either use a var... |
Naver | This notebook covers how to get started with embedding models provide... |
NLP Cloud | NLP Cloud is an artificial intelligence platform that allows you to u... |
Nomic | This will help you get started with Nomic embedding models using Lang... |
NVIDIA NIMs | The langchain-nvidia-ai-endpoints package contains LangChain integrat... |
Oracle Cloud Infrastructure Generative AI | Oracle Cloud Infrastructure (OCI) Generative AI is a fully managed se... |
Ollama | This will help you get started with Ollama embedding models using Lan... |
OpenClip | OpenClip is an source implementation of OpenAI's CLIP. |
OpenAI | This will help you get started with OpenAI embedding models using Lan... |
OpenVINO | OpenVINO™ is an open-source toolkit for optimizing and deploying AI i... |
Embedding Documents using Optimized and Quantized Embedders | Embedding all documents using Quantized Embedders. |
Oracle AI Vector Search: Generate Embeddings | Oracle AI Vector Search is designed for Artificial Intelligence (AI) ... |
OVHcloud | In order to use this model you need to create a new token on the AI E... |
Pinecone Embeddings | Pinecone's inference API can be accessed via PineconeEmbeddings. Prov... |
PremAI | PremAI is an all-in-one platform that simplifies the creation of robu... |
SageMaker | Let's load the SageMaker Endpoints Embeddings class. The class can be... |
SambaNova | SambaNova's Sambastudio is a platform for running your own open-sourc... |
Self Hosted | Let's load the SelfHostedEmbeddings, SelfHostedHuggingFaceEmbeddings,... |
Sentence Transformers on Hugging Face | Hugging Face sentence-transformers is a Python framework for state-of... |
Solar | Solar offers an embeddings service. |
SpaCy | spaCy is an open-source software library for advanced natural languag... |
SparkLLM Text Embeddings | Official Website//www.xfyun.cn/doc/spark/Embeddingnewapi.html |
TensorFlow Hub | TensorFlow Hub is a repository of trained machine learning models rea... |
Text Embeddings Inference | Hugging Face Text Embeddings Inference (TEI) is a toolkit for deployi... |
TextEmbed - Embedding Inference Server | TextEmbed is a high-throughput, low-latency REST API designed for ser... |
Titan Takeoff | TitanML helps businesses build and deploy better, smaller, cheaper, a... |
Together AI | This will help you get started with Together embedding models using L... |
Upstage | This notebook covers how to get started with Upstage embedding models. |
Volc Engine | This notebook provides you with a guide on how to load the Volcano Em... |
Voyage AI | Voyage AI provides cutting-edge embedding/vectorizations models. |
Xorbits inference (Xinference) | This notebook goes over how to use Xinference embeddings within LangC... |
YandexGPT | This notebook goes over how to use Langchain with YandexGPT embedding... |
ZhipuAI | This will help you get started with ZhipuAI embedding models using La... |