---
title: "Hugging Face x LangChain : A new partner package"
description: "langchain-huggingface is a new Python partner package jointly maintained by Hugging Face and LangChain, replacing community-written integrations that had drifted out of date."
url: "https://swe.quest/articles/hugging-face-x-langchain-a-new-partner-package-4a05b92542fbd2d8"
canonical: "https://huggingface.co/blog/langchain"
source: "Hugging Face"
published: "2024-05-14"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 4
tags: ["llms","python","inference","rag"]
---

# Hugging Face x LangChain : A new partner package

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-05-14, 4 min read, Announcement. Original: [https://huggingface.co/blog/langchain](https://huggingface.co/blog/langchain)

## Summary

langchain-huggingface is a new Python partner package jointly maintained by Hugging Face and LangChain, replacing community-written integrations that had drifted out of date. It provides HuggingFacePipeline for running transformers models locally, HuggingFaceEndpoint for the serverless Inference API or deployed TGI endpoints via InferenceClient, and ChatHuggingFace, which turns message lists into model-specific prompts with tokenizer.apply\_chat\_template. For embeddings it offers HuggingFaceEmbeddings (local sentence-transformers) and HuggingFaceEndpointEmbeddings (Hub or TEI instances), each shown with short code examples.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Python](https://swe.quest/tags/python.md) (Languages)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [RAG & retrieval](https://swe.quest/tags/rag.md) (AI & ML)

## Prerequisites

- LangChain basics
- Hugging Face transformers

## Keywords

LangChain, langchain-huggingface, Hugging Face, transformers, sentence-transformers, Text Generation Inference, InferenceClient, Text Embeddings Inference

## Related posts

- [From OpenAI to Open LLMs with Messages API on Hugging Face](https://swe.quest/articles/from-openai-to-open-llms-with-messages-api-on-hugging-face-98058f09a7d2acc1.md): Hugging Face · 2024-02-08 · Medium · 7 min read · Inference & serving, LLMs, API design, RAG & retrieval
  Text Generation Inference 1.4.0 adds a Messages API compatible with OpenAI's Chat Completion API, so open LLMs on Inference Endpoints can be called from existing OpenAI client code by changing the base URL and token.
- [Generate embeddings with Neon AI Gateway](https://swe.quest/articles/generate-embeddings-with-neon-ai-gateway-8da1f214a3b9e4fc.md): Neon · 2026-10-02 · Medium · 7 min read · RAG & retrieval, Vector search, PostgreSQL, LLMs
  Neon AI Gateway now serves embedding models on its OpenAI-compatible /v1/embeddings endpoint using the same branch-scoped credential as chat, accepting up to 150 inputs per request.
- [Tool Use, Unified](https://swe.quest/articles/tool-use-unified-117f148d6f2c2374.md): Hugging Face · 2024-08-12 · Medium · 11 min read · LLMs, AI agents, Python, API design
  Hugging Face Transformers extends Jinja chat templates to cover tool use, giving a single portable API for passing tools to Mistral, Cohere, NousResearch and Llama models.
- [Deploy Mistral Large to Azure and create a conversation with Python and LangChain](https://swe.quest/articles/deploy-mistral-large-to-azure-and-create-a-conversation-with-python-and-9f252b9b3fd4d808.md): Neon · 2024-02-27 · Medium · 4 min read · LLMs, Python, Cloud platforms
  Mistral Large, Mistral AI's flagship model with a 32k-token context window and leading MBPP and GSM8K scores, can be deployed through Azure AI Studio as a Pay-As-You-Go project in the France Central region.
- [Total noob’s intro to Hugging Face Transformers](https://swe.quest/articles/total-noob-s-intro-to-hugging-face-transformers-c330cf4466509559.md): Hugging Face · 2024-03-22 · Easy · 11 min read · LLMs, Inference & serving, Python, Machine learning
  A beginner-oriented walkthrough of running Microsoft's Phi-2 language model with the Hugging Face Transformers library inside a JupyterLab notebook hosted on a Hugging Face Space with an NVIDIA A10G GPU.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
