本页还没有译文
本页 28 段还没译成한국어,下面显示的是英文原文。Hugging Face integrations
还没翻译译自英文(docs.langchain.com)本页 28 段都还没译
This page covers all LangChain integrations with Hugging Face Hub and libraries like transformers, sentence transformers, and datasets.
Chat models
ChatHuggingFace
We can use the Hugging Face LLM classes or directly use the ChatHuggingFace class.
See a usage example.
from langchain_huggingface import ChatHuggingFaceLLMs
HuggingFaceEndpoint
We can use the HuggingFaceEndpoint class to run open source models via serverless Inference Providers or via dedicated Inference Endpoints.
See a usage example.
from langchain_huggingface import HuggingFaceEndpointHuggingFacePipeline
We can use the HuggingFacePipeline class to run open source models locally.
See a usage example.
from langchain_huggingface import HuggingFacePipelineEmbedding models
HuggingFaceEmbeddings
We can use the HuggingFaceEmbeddings class to run open source embedding models locally.
See a usage example.
from langchain_huggingface import HuggingFaceEmbeddingsHuggingFaceEndpointEmbeddings
We can use the HuggingFaceEndpointEmbeddings class to run open source embedding models via a dedicated Inference Endpoint.
See a usage example.
from langchain_huggingface import HuggingFaceEndpointEmbeddingsText Embeddings Inference (TEI)
For self-hosted production serving of Sentence Transformers models, Hugging Face publishes Text Embeddings Inference, a dedicated inference server with batching and GPU support. TEI exposes an OpenAI-compatible API, so point LangChain at a TEI deployment via OpenAIEmbeddings. See the dedicated TEI integration guide.
BGE embedding models
BGE models on Hugging Face are a strong open-source embedding family from the Beijing Academy of Artificial Intelligence (BAAI).
BGE models are Sentence Transformers models, so use HuggingFaceEmbeddings with encode_kwargs={"normalize_embeddings": True}. See a usage example.