langchain-huggingface
An integration package connecting Hugging Face and LangChain.
What it is and what it does
langchain-huggingface is a LangChain integration package that bridges Hugging Face models and embeddings into LangChain workflows. It provides classes to work with Hugging Face resources either through local inference or remote API endpoints, letting you embed text and run language models within LangChain applications.
The package has three core runtime dependencies: huggingface-hub (for API access), langchain-core (the LangChain framework), and tokenizers (for text processing). Local inference requires additional optional dependencies (sentence-transformers and transformers), which must be explicitly installed via the [full] extra. The package is actively maintained, supports Python 3.10 through 3.14, and carries no known vulnerabilities.
Use it for:
- Build RAG pipelines that use Hugging Face embeddings to encode documents and queries for semantic search.
- Deploy LangChain agents that call Hugging Face models via API endpoints for inference without local GPU.
- Run local language models through LangChain using Hugging Face transformers for privacy-sensitive applications.
- Combine Hugging Face embeddings with LangChain memory and retrieval for context-aware chatbots.
- Integrate open-source Hugging Face models into existing LangChain workflows without rewriting integration code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Connects Hugging Face models and embeddings to LangChain applications, providing integration classes for local inference and API-based access to Hugging Face resources.
Yes. This is an active, well-maintained integration for a widely-used ecosystem (Hugging Face). Low install friction, permissive license, no known vulnerabilities, and broad Python version support (3.10–3.14) make it a straightforward choice if you need Hugging Face models or embeddings in LangChain. Be aware that local inference requires the [full] extra with newer dependency versions than langchain-community previously accepted.
Install
langchain-huggingface on PyPI
pip
pip install langchain-huggingfaceuv
uv add langchain-huggingfacepoetry
poetry add langchain-huggingfaceInstalling langchain-huggingface
Before you install
Low friction install with a pure-Python wheel. Active maintenance with a recent release 120 days ago. Requires Python 3.10 or later. Optional extras (sentence-transformers>=5.2.0, transformers>=5.0.0) needed only for local inference; note that the [full] extra requires newer versions than langchain-community previously accepted.
License in practice
MIT license is permissive and poses no restrictions on commercial or private use.
Quickstart
pip install langchain-huggingface
from langchain_huggingface import HuggingFaceEmbeddings
# or
from langchain_huggingface import HuggingFaceEndpoint
For local inference (HuggingFaceEmbeddings, HuggingFacePipeline), install the [full] extra which adds sentence-transformers>=5.2.0 and transformers>=5.0.0. Requires Python 3.10 or later.
Verify before relying
- Whether the package supports all Hugging Face model types or only a subset
- Performance characteristics when using remote Hugging Face endpoints vs. local inference
- Whether authentication credentials are required for all use cases or only certain endpoints
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0.0,>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — huggingface-hub, langchain-core, tokenizers |
| Maintenance | actively maintained — 120 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,793,338/month — #3,551 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: langchain_huggingface-1.2.2-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
langchain-ollamaConnects LangChain applications to Ollama,…
permissive · top 5,000 on PyPI
langchain-groqConnects Groq's inference API to LangChain,…
permissive · top 5,000 on PyPI
langchain-openaiProvides LangChain integrations for OpenAI's…
permissive · top 1,000 on PyPI
langchain-perplexityIntegrates Perplexity AI models into LangChain…
permissive · top 15,000 on PyPI
langchain-google-vertexaiConnects LangChain applications to Google…
permissive · top 1,000 on PyPI
langchain-deepseekIntegrates DeepSeek language models into…
permissive · top 5,000 on PyPI
langchain-xaiConnects xAI's language models to LangChain…
permissive · top 5,000 on PyPI
text-generationProvides a Python client to query text…
permissive · top 15,000 on PyPI
abstract-hugpy-devA self-hosted LLM console and OpenAI-compatible…
unclear · top 15,000 on PyPI
hf-doc-builderBuilds and previews documentation for Hugging…
permissive · top 15,000 on PyPI