langchain-perplexity
An integration package connecting Perplexity and LangChain
What it is and what it does
langchain-perplexity is a bridge package that connects Perplexity AI models to the LangChain framework. It wraps Perplexity's API behind LangChain's standard model interface, allowing you to use Perplexity as a language model provider in chains, agents, and other LangChain constructs without writing custom API integration code.
The package depends on langchain-core (LangChain's base abstractions) and perplexityai (the Perplexity client library). It's designed for developers building AI applications with LangChain who want to leverage Perplexity's models as one option among many supported providers. The package is actively maintained, supports Python 3.10 through 3.14, and carries a permissive MIT license.
Use it for:
- Use it to swap Perplexity models into an existing LangChain application without rewriting integration code.
- Use it to build multi-model LangChain agents that can route queries to Perplexity or other providers.
- Use it to prototype AI workflows with Perplexity models before committing to a specific provider.
- Use it to add Perplexity's search-augmented capabilities to LangChain RAG or question-answering pipelines.
- Use it in LangChain-based chatbots or assistants that need to call Perplexity as a reasoning or generation step.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates Perplexity AI models into LangChain applications, enabling you to use Perplexity's language models as a component in LangChain workflows.
Yes. The package is actively maintained, carries no known vulnerabilities, has low install friction, and integrates cleanly into LangChain workflows. Install it if you're already using LangChain and want to add Perplexity as a model provider—it's the standard way to do so. No concerns about maintenance or licensing.
Install
langchain-perplexity on PyPI
pip
pip install langchain-perplexityuv
uv add langchain-perplexitypoetry
poetry add langchain-perplexityInstalling langchain-perplexity
Before you install
Low friction install with just two runtime dependencies. Actively maintained with a recent release 66 days ago and an active repository.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install langchain-perplexity
from langchain_perplexity import ChatPerplexity
model = ChatPerplexity()
response = model.invoke("What is the capital of France?")
Requires Python 3.10 or later and a Perplexity API key or account to authenticate requests.
Verify before relying
- Whether Perplexity API credentials or account setup is required before the package can be used
- What specific Perplexity models are supported and whether model selection is configurable
- Whether the package handles rate limiting or quota management for Perplexity API calls
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 | 2 — langchain-core, perplexityai |
| Maintenance | actively maintained — 66 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 363,655/month — #7,218 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: langchain_perplexity-1.4.0-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-deepseekIntegrates DeepSeek language models into…
permissive · top 5,000 on PyPI
langchain-ollamaConnects LangChain applications to Ollama,…
permissive · top 5,000 on PyPI
langchain-openaiProvides LangChain integrations for OpenAI's…
permissive · top 1,000 on PyPI
langchain-text-splittersSplits text documents into chunks using a…
permissive · top 1,000 on PyPI
langchain-mistralaiConnects Mistral AI language models to…
permissive · top 5,000 on PyPI
langchain-groqConnects Groq's inference API to LangChain,…
permissive · top 5,000 on PyPI
langchain-communityProvides third-party integrations for LangChain…
permissive · top 1,000 on PyPI
langchain-anthropicProvides LangChain integration for Anthropic's…
permissive · top 1,000 on PyPI
langchain-xaiConnects xAI's language models to LangChain…
permissive · top 5,000 on PyPI
langchain-testsProvides standard test base classes and…
permissive · top 5,000 on PyPI