langchain_huggingface
chat models. For detailed documentation of all ChatHuggingFace
features and configurations head to the API reference. For a list of models supported by Hugging Face check out this page.
Class | Package | Local | Serializable | JS support | Package downloads | Package latest |
---|---|---|---|---|---|---|
ChatHuggingFace | langchain-huggingface | ✅ | beta | ❌ |
Tool calling | Structured output | JSON mode | Image input | Audio input | Video input | Token-level streaming | Native async | Token usage | Logprobs |
---|---|---|---|---|---|---|---|---|---|
✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ |
langchain-huggingface
integration package.
HUGGINGFACEHUB_API_TOKEN
.
Class | Package | Local | Serializable | JS support | Package downloads | Package latest |
---|---|---|---|---|---|---|
ChatHuggingFace | langchain-huggingface | ✅ | ❌ | ❌ |
Tool calling | Structured output | JSON mode | Image input | Audio input | Video input | Token-level streaming | Native async | Token usage | Logprobs |
---|---|---|---|---|---|---|---|---|---|
✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
langchain_huggingface
models you’ll need to create a Hugging Face
account, get an API key, and install the langchain-huggingface
integration package.
HUGGINGFACEHUB_API_TOKEN
.
ChatHuggingFace
model in two different ways, either from a HuggingFaceEndpoint
or from a HuggingFacePipeline
.
HuggingFaceEndpoint
HuggingFacePipeline
bitsandbytes
quantization config as follows:
HuggingFacePipeline
as a part of its model_kwargs
:
ChatHuggingFace
features and configurations head to the API reference: https://python.langchain.com/api_reference/huggingface/chat_models/langchain_huggingface.chat_models.huggingface.ChatHuggingFace.html